@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-solid: #1e293b;
    --bg-glass: rgba(30, 41, 59, 0.5);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-light: rgba(255, 255, 255, 0.15);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    
    --success: #10b981;
    --success-hover: #059669;
    --success-light: rgba(16, 185, 129, 0.15);
    
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: rgba(239, 68, 68, 0.15);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.35);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Layout --- */
.app-header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform: translateY(0);
    margin-top: 0;
    opacity: 1;
}

/* Glissement et masquage complet garanti de TOUT l'en-tête */
.app-header.header-hidden {
    transform: translateY(-100%) !important;
    margin-top: -80px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

/* Zone invisible tout en haut de l'écran pour détecter le pointeur de la souris (25px) */
.top-hover-sensor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 25px;
    z-index: 9999;
    pointer-events: auto;
}

/* Petit onglet d'indication au centre du haut de l'écran */
.top-menu-tab {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.85rem;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 9998;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-header.header-hidden + .top-menu-tab,
body.header-is-hidden .top-menu-tab {
    opacity: 0.9;
    pointer-events: auto;
}

.top-menu-tab:hover {
    opacity: 1;
    transform: translateX(-50%) translateY(2px);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    overflow: visible !important;
}

/* --- Sonary Header & Mega-Menu Style --- */
.sonary-header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.55rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: nowrap;
    overflow: visible !important;
}

.sonary-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    overflow: visible !important;
}

.sonary-dropdown-wrapper {
    position: relative;
    overflow: visible !important;
}

.sonary-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sonary-dropdown-btn:hover,
.sonary-dropdown-wrapper:hover .sonary-dropdown-btn {
    background: rgba(99, 102, 241, 0.28);
    border-color: var(--primary-light);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.sonary-arrow {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.sonary-dropdown-wrapper.open .sonary-arrow,
.sonary-dropdown-wrapper:hover .sonary-arrow {
    transform: rotate(180deg);
}

/* Mega Menu Panel Sonary Style */
.sonary-mega-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 680px;
    background: #0b132b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
    padding: 1.25rem;
    z-index: 999999;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* Ouverture au clic OU au survol sur Desktop */
.sonary-mega-menu.show {
    display: block !important;
    animation: fadeInSonary 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 851px) {
    .sonary-dropdown-wrapper:hover .sonary-mega-menu {
        display: block !important;
        animation: fadeInSonary 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

@keyframes fadeInSonary {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.sonary-mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.sonary-col {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sonary-col-header {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.75px;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.35rem;
}

.sonary-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
    width: 100%;
    box-sizing: border-box;
}

.sonary-item:hover {
    background: rgba(99, 102, 241, 0.15);
    transform: translateX(3px);
    color: #ffffff;
}

.sonary-item.active {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #ffffff;
}

.sonary-item-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.sonary-item-text {
    display: flex;
    flex-direction: column;
}

.sonary-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
}

.sonary-item-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
}

.sonary-item:hover .sonary-item-desc {
    color: rgba(255, 255, 255, 0.8);
}

/* Quick Direct Links Sonary Style */
.sonary-quick-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sonary-link {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sonary-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.sonary-link.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
    font-weight: 700;
}

/* Mobile & POS Responsive Adjustments for Sonary Menu */
@media (max-width: 850px) {
    .sonary-mega-menu {
        width: 310px;
        max-height: 75vh;
        overflow-y: auto;
        left: auto;
        right: -20px;
    }

    .sonary-mega-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sonary-quick-links {
        display: none;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--success));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    font-size: 1.15rem;
}

.logo span {
    background: linear-gradient(135deg, #fff 30%, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    max-height: 300px;
    overflow: hidden;
}

/* Masquage dynamique fluide pour percepteur / staff */
.main-nav.nav-hidden {
    opacity: 0;
    max-height: 0px;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    list-style: none;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.nav-link {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.nav-badge {
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 800;
    margin-left: 2px;
}

/* --- Menus Déroulants Structurés (Dropdowns) --- */
.nav-dropdown {
    position: relative;
}

.dropdown-arrow {
    font-size: 0.72rem;
    margin-left: 3px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 250;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeInDropdown 0.2s ease forwards;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: flex;
}

.nav-dropdown-item {
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
    background: rgba(99, 102, 241, 0.18);
    color: #fff;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-left: 1px solid var(--border-color);
    padding-left: 0.75rem;
}

.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-left: 1px solid var(--border-color);
    padding-left: 0.75rem;
    flex-shrink: 0;
}

.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
    flex: 1;
}

/* --- Page Header & Actions --- */
.page-title-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-hover));
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-light);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }

.stat-info .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

.stat-info .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Tables & Cards --- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.custom-table th {
    background: rgba(15, 23, 42, 0.4);
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: var(--transition);
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* --- Checkbox Grid (Matrice d'Épargne Mensuelle) --- */
.epargne-grid-table td {
    text-align: center;
    padding: 0.75rem 0.5rem;
}

.month-checkbox-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

/* Custom styled checkbox box */
.month-checkbox {
    display: none;
}

.month-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--border-color);
    color: var(--text-muted);
    transition: var(--transition);
    user-select: none;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 2px;
}

.month-badge .check-icon {
    font-size: 1.1rem;
    opacity: 0.4;
    transition: var(--transition);
}

.month-checkbox:checked + .month-badge {
    background: linear-gradient(135deg, var(--success), var(--success-hover));
    border-color: var(--success);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: scale(1.05);
}

.month-checkbox:checked + .month-badge .check-icon {
    opacity: 1;
    transform: scale(1.1);
}

.month-checkbox-wrapper:hover .month-badge {
    border-color: var(--primary);
    color: #fff;
}

/* Pulse animation during loading */
.month-badge.loading {
    opacity: 0.6;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(0.92); }
}

/* Style pour les cases partielles (dépôt fractionné / demi-case BWAKA CARTE) */
.month-badge.partial {
    border: 1.5px dashed #f59e0b !important;
    color: #fbbf24 !important;
    position: relative;
    overflow: hidden;
    background: rgba(245, 158, 11, 0.08);
}

.month-badge.partial .partial-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(16, 185, 129, 0.6));
    z-index: 1;
    transition: width 0.3s ease;
}

.month-badge.partial > span {
    position: relative;
    z-index: 2;
}

.month-badge.partial .check-icon {
    opacity: 0.95;
    color: #fbbf24;
    font-weight: bold;
}

.badge-partial {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

/* --- Badges & Status --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* --- Forms & Inputs --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

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

.search-box {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-box input {
    padding-left: 2.4rem;
}

.search-box .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: var(--transition);
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    color: var(--text-main);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    animation: slideIn 0.3s ease forwards;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- Footer --- */
.app-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.5);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive Header */
@media (max-width: 1024px) {
    .header-container {
        padding: 0.75rem 1rem;
    }
    .main-nav {
        justify-content: center;
        width: 100%;
    }
    .nav-actions, .user-profile-nav {
        border-left: none;
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    .main-nav {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 0.25rem;
    }
    .nav-link {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }
    .nav-actions {
        justify-content: center;
        width: 100%;
    }
}
