:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --bg-dark: #0f172a;
    --bg-medium: #1e293b;
    --bg-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Remove focus ring on mouse/touch clicks, keep for keyboard */
*:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Visible focus ring for keyboard navigation only */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Firefox: remove inner dotted border on buttons */
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

/* Mobile: remove tap highlight */
button, a, input, select, textarea, label, summary,
[tabindex], [role="button"] {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: var(--bg-medium);
    border-bottom: 2px solid var(--primary-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header .container {
    padding: 0 16px;
}

.container.header-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.header-left,
.header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}

.nav {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--primary-color);
}

.current-date-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.4px;
}

.notification-toggle,
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    min-width: 44px;
}

.notification-toggle {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.theme-toggle {
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.notification-toggle span,
.theme-toggle span {
    font-size: 0.9rem;
}

.notification-icon,
.theme-icon,
.notification-switch,
.theme-switch {
    font-size: 1.2rem;
}

.main-content {
    padding: 2rem 0 1rem;
    margin-top: 0.5rem;
}

.controls {
    background: var(--bg-medium);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.view-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

.search-filter {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.filter-group {
    display: flex;
    gap: 1rem;
}

.filter-select {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.notification-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.vapid-status {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.vapid-status.valid {
    border-color: rgba(16, 185, 129, 0.7);
    background: rgba(16, 185, 129, 0.15);
}

.vapid-status.expiring {
    border-color: rgba(245, 158, 11, 0.7);
    background: rgba(245, 158, 11, 0.15);
}

.vapid-status.expired,
.vapid-status.missing {
    border-color: rgba(239, 68, 68, 0.8);
    background: rgba(239, 68, 68, 0.15);
}

.vapid-status.hidden {
    display: none;
}

.vapid-status-icon {
    font-size: 1.25rem;
}

.vapid-status-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.vapid-status-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.vapid-status-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.vapid-status-link {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.schedule-container {
    transition: all 0.3s ease;
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.timeline-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.session-card {
    background: var(--bg-medium);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.session-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--accent-color);
}

.session-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.session-time {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.session-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.session-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.session-room,
.session-speakers {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-subject {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--bg-light);
    color: var(--primary-color);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.session-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-view .session-card {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 1.5rem;
}

.list-view .session-description {
    display: none;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-medium);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: sticky;
    top: 0.75rem;
    float: right;
    margin-right: 0.75rem;
    margin-bottom: -40px;
    background: var(--bg-dark);
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--error-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-time {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.modal-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.info-row {
    display: flex;
    gap: 1rem;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
}

.info-value {
    color: var(--text-primary);
}

.subject-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-light);
    color: var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.modal-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.modal-actions .hidden {
    display: none;
}

/* Hide .ics download on desktop — Outlook and others fail to import reliably */
@media (min-width: 769px) {
    .modal-actions #downloadICSBtn {
        display: none;
    }
}

.btn-primary,
.btn-secondary {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    flex: 1;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.connection-status {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--bg-medium);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 99;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.connection-status.hidden {
    opacity: 0;
    pointer-events: none;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.connection-status.disconnected .status-indicator {
    background: var(--error-color);
}

.status-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-medium);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-width: 400px;
    width: calc(100% - 40px);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.install-prompt.hidden {
    display: none;
}

.install-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.install-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.install-buttons {
    display: flex;
    gap: 0.75rem;
}

.loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.no-sessions {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-medium);
    border-radius: 12px;
    margin-top: 2rem;
}

.no-sessions.hidden {
    display: none;
}

.no-sessions-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-sessions h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-sessions p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Past sessions toggle */
.past-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
    margin-top: 0.25rem;
}

.past-toggle input {
    display: none;
}

.past-toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.past-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.past-toggle input:checked + .past-toggle-slider {
    background: var(--primary-color);
    border-color: var(--primary-dark);
}

.past-toggle input:checked + .past-toggle-slider::after {
    left: 18px;
    background: white;
}

.past-toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Ended session card styling */
.session-card.session-ended {
    opacity: 0.55;
    border-left-color: var(--border-color);
}

.session-card.session-ended:hover {
    opacity: 0.75;
    border-left-color: var(--border-color);
}

.session-ended-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-light);
    color: var(--text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 0.375rem;
}

body.light-mode {
    background: #f8fafc;
    color: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #0f172a;
    --bg-dark: #f8fafc;
    --bg-medium: #ffffff;
    --bg-light: #e2e8f0;
    --border-color: #cbd5f5;
    --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

body.light-mode .header {
    background: #ffffff;
    color: #0f172a;
    border-bottom-color: #dbeafe;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.07);
}

body.light-mode .nav-link {
    color: #475569;
}

body.light-mode .nav-link.active {
    background: #c7d2fe;
    color: #0f172a;
}

body.light-mode .controls {
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

body.light-mode .search-input,
body.light-mode .filter-select {
    background: #f1f5f9;
    border-color: #cbd5f5;
    color: #0f172a;
}

body.light-mode .install-prompt {
    background: #ffffff;
    border-color: #cbd5f5;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

body.light-mode .connection-status {
    background: #ffffff;
    border: 1px solid #cbd5f5;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

body.light-mode .connection-status .status-indicator {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0 0.5rem;
        margin-top: 0.25rem;
    }

    .controls {
        padding: 0.75rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    .search-filter {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .search-input {
        padding: 0.625rem 0.75rem;
        font-size: 0.9rem;
    }

    .filter-select {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .timeline-view {
        gap: 0.5rem;
    }

    .session-card {
        padding: 0.875rem;
        border-radius: 8px;
    }

    .session-title {
        font-size: 1.05rem;
        margin-bottom: 0.375rem;
    }

    .session-time {
        margin-bottom: 0.25rem;
        font-size: 0.85rem;
    }

    .session-meta {
        gap: 0.25rem;
        margin-bottom: 0.375rem;
    }

    .session-room,
    .session-speakers {
        font-size: 0.8rem;
    }

    .session-subject {
        padding: 0.25rem 0.625rem;
        font-size: 0.78rem;
    }

    .session-description {
        margin-top: 0.375rem;
        font-size: 0.82rem;
    }

    .modal {
        padding: 0;
        align-items: stretch;
    }

    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        margin: 0;
    }

    .modal-body {
        padding: 1rem 0.875rem;
    }

    .modal-close {
        top: 0.5rem;
        margin-right: 0.5rem;
        margin-bottom: -36px;
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }

    .modal-header {
        margin-bottom: 0.5rem;
        padding-bottom: 0.375rem;
        padding-right: 2.5rem;
    }

    .modal-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .modal-time {
        font-size: 0.85rem;
    }

    .modal-info {
        gap: 0.375rem;
        margin-bottom: 0.5rem;
    }

    .info-row {
        gap: 0.5rem;
        font-size: 0.85rem;
    }

    .info-label {
        min-width: 60px;
        font-size: 0.8rem;
    }

    .info-value {
        font-size: 0.85rem;
    }

    .subject-tag {
        padding: 0.15rem 0.5rem;
        font-size: 0.78rem;
    }

    .modal-section {
        margin-bottom: 0.5rem;
    }

    .modal-section h3 {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .modal-section p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .modal-actions {
        gap: 0.5rem;
        padding-top: 0.5rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }

    .no-sessions {
        padding: 2rem 1rem;
        margin-top: 1rem;
    }

    .no-sessions-icon {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }

    .no-sessions h3 {
        font-size: 1.15rem;
        margin-bottom: 0.25rem;
    }

    .no-sessions p {
        margin-bottom: 0.75rem;
        font-size: 0.85rem;
    }

    .loading {
        padding: 1.5rem 1rem;
        font-size: 0.95rem;
    }

    .vapid-status {
        margin-top: 0.5rem;
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .install-prompt {
        padding: 1rem;
    }

    .install-content p {
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
    }
}

body.light-mode .notification-toggle {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

body.light-mode .theme-toggle {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}

body.light-mode .schedule-container {
    background: transparent;
}

body.light-mode .session-card {
    background: #ffffff;
    border-left-color: #2563eb;
    color: #0f172a;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.1);
}

@media (max-width: 768px) {
    .controls {
        padding: 1rem;
    }
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    .grid-view {
        grid-template-columns: 1fr;
    }
    .filter-group {
        flex-direction: column;
    }
    .list-view .session-card {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .modal-actions {
        flex-direction: column;
    }
    .connection-status {
        top: auto;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .container.header-layout {
        flex-wrap: wrap;
        justify-content: space-between !important;
        gap: 0.6rem 1.2rem;
        padding: 0.8rem 1rem;
    }
    .header-left {
        justify-content: flex-start !important;
        order: 1;
        margin-right: auto;
    }
    .header-center {
        order: 2;
        flex: 1 1 100%;
        margin: 0.4rem 0;
        justify-content: center;
    }
    .header-right {
        justify-content: flex-end !important;
        order: 3;
        margin-left: auto;
    }
    .nav {
        gap: 1rem;
        width: 100%;
        justify-content: center;
    }
    .nav-link {
        padding: 0.5rem 0.9rem;
        font-size: 0.95rem;
    }
    .notification-toggle,
    .theme-toggle {
        padding: 0.6rem 1rem;
        min-width: 48px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .container.header-layout {
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.5rem;
        padding: 0.6rem 1rem;
    }

    .header-left {
        order: 1;
        flex: 0 0 auto !important;
    }

    .header-center {
        order: 2;
        flex: 1 1 auto !important;  /* REMOVE the 100% width */
        margin: 0 !important;
    }

    .header-right {
        order: 3;
        flex: 0 0 auto !important;
    }

    .nav {
        gap: 0.4rem;
        flex-wrap: nowrap;
    }

    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .notification-toggle,
    .theme-toggle {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        min-width: unset;
    }

    .notification-toggle span,
    .notification-toggle .notification-switch,
    .theme-toggle .theme-text,
    .theme-toggle .theme-switch {
        display: none;
    }
}

@media (max-width: 480px) {
    .container.header-layout {
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        padding: 0.5rem 0.75rem;
        gap: 0.35rem;
    }

    .header-center {
        flex: 1 1 auto !important;
    }

    .nav-link {
        padding: 0.35rem 0.5rem;
        font-size: 0.78rem;
    }

    .notification-toggle,
    .theme-toggle {
        width: 38px;
        height: 38px;
    }

    .modal-body {
        padding: 0.75rem;
    }

    .modal-title {
        font-size: 1rem;
    }

    .modal-section p {
        font-size: 0.8rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}
