/* ═══════════════════════════════════════════════════════════
   CFL Staff - Design System v2.0
   Dark sidebar · Inter · Premium cards · Micro-interactions
═══════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
    /* Brand - palette logo CFL (bleu marine + orange/or) */
    --accent:        #d97706;
    --accent-hover:  #b45309;
    --accent-active: #92400e;
    --accent-soft:   rgba(217, 119, 6, 0.10);
    --accent-softer: rgba(217, 119, 6, 0.06);
    --accent-glow:   0 0 0 3px rgba(217, 119, 6, 0.22);

    /* Dark Sidebar - bleu marine logo */
    --sb-bg:         #0d1e4a;
    --sb-surface:    #112258;
    --sb-border:     rgba(255, 255, 255, 0.07);
    --sb-text:       rgba(255, 255, 255, 0.48);
    --sb-text-hover: rgba(255, 255, 255, 0.88);
    --sb-text-muted: rgba(255, 255, 255, 0.22);
    --sb-item-hover: rgba(255, 255, 255, 0.05);
    --sb-active-bg:  rgba(245, 166, 35, 0.14);
    --sb-active-text:#f5a623;
    --sb-active-border: rgba(245, 166, 35, 0.38);

    /* Content Area */
    --bg:        #f4f6fb;
    --bg-white:  #ffffff;
    --bg-subtle: #f8f9fc;
    --border:    #e4e8ef;
    --border-light: #eef1f6;

    /* Text */
    --text:      #0d1117;
    --text-2:    #374151;
    --text-3:    #6b7280;
    --text-4:    #9ca3af;
    --text-5:    #c4c9d4;

    /* Topbar */
    --topbar-bg: rgba(255, 255, 255, 0.88);
    --topbar-blur: blur(16px);

    /* Shadows */
    --sh-xs:  0 1px 2px rgba(0, 0, 0, 0.04);
    --sh-sm:  0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
    --sh-md:  0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --sh-lg:  0 16px 48px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.06);
    --sh-xl:  0 24px 64px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.08);
    --sh-accent: 0 4px 16px rgba(217, 119, 6, 0.28);

    /* Radius */
    --r-xs:  4px;
    --r-sm:  8px;
    --r:     12px;
    --r-lg:  16px;
    --r-xl:  20px;
    --r-full: 9999px;

    /* Sizes */
    --sidebar-w: 240px;
    --topbar-h:  56px;

    /* Transitions */
    --ease:       0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out:   0.2s cubic-bezier(0, 0, 0.2, 1);
    --ease-spring:0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea { font: inherit; }

/* ══════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════ */
.alert {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 11px 14px; border-radius: var(--r-sm);
    font-size: .82rem; font-weight: 500; margin-bottom: 14px;
    line-height: 1.5; width: 100%; box-sizing: border-box;
    border: 1px solid transparent;
}
.alert > div, .alert > span { flex: 1; min-width: 0; }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg-white);
}

/* Left panel - dark brand */
.login-panel-left {
    flex: 0 0 420px;
    background: var(--sb-bg);
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 48px 44px;
    position: relative; overflow: hidden;
}
.login-panel-left::before {
    content: '';
    position: absolute; bottom: -120px; right: -80px;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(217,119,6,.18) 0%, transparent 65%);
    pointer-events: none;
}
.login-panel-left::after {
    content: '';
    position: absolute; top: -80px; left: -60px;
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(217,119,6,.08) 0%, transparent 65%);
    pointer-events: none;
}
/* Subtle grid pattern overlay */
.login-panel-left .login-brand { position: relative; z-index: 1; }
.login-panel-left::after {
    background: radial-gradient(circle, rgba(217,119,6,.08) 0%, transparent 65%),
                linear-gradient(135deg, rgba(255,255,255,.015) 0%, transparent 100%);
}

.login-brand-logo {
    margin-bottom: 52px;
    display: inline-block;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 14px 20px;
    border-radius: 12px;
}
.login-logo-img { width: 160px; height: auto; display: block; }

.login-tagline h2 {
    font-size: 1.7rem; font-weight: 700;
    color: #fff; line-height: 1.25;
    margin-bottom: 14px; letter-spacing: -.03em;
}
.login-tagline p {
    font-size: .875rem; color: rgba(255,255,255,.38);
    line-height: 1.75;
}

/* Feature bullets on login left panel */
.login-features {
    margin-top: 36px;
    display: flex; flex-direction: column; gap: 12px;
}
.login-feature {
    display: flex; align-items: center; gap: 10px;
    font-size: .8rem; color: rgba(255,255,255,.48);
}
.login-feature-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); flex-shrink: 0;
}

.login-panel-footer { position: relative; z-index: 1; }
.login-panel-footer small { font-size: .7rem; color: rgba(255,255,255,.18); }

/* Right panel */
.login-panel-right {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 40px; min-height: 100vh; background: var(--bg);
}
.login-form-wrap { width: 100%; max-width: 390px; }

.login-form-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 36px;
    box-shadow: var(--sh-md);
}

.login-form-wrap h1 {
    font-size: 1.5rem; font-weight: 700; color: var(--text);
    letter-spacing: -.03em; margin-bottom: 6px;
}
.login-sub { font-size: .875rem; color: var(--text-3); margin-bottom: 28px; }

/* Form fields */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: .78rem; font-weight: 600;
    color: var(--text-2); margin-bottom: 6px;
}
.required { color: var(--accent); }
.form-hint { display: block; font-size: .74rem; color: var(--text-4); margin-top: 5px; }

/* Login inputs */
.login-form-wrap input[type="text"],
.login-form-wrap input[type="password"] {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-size: .9rem; color: var(--text); background: var(--bg-subtle);
    outline: none;
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
.login-form-wrap input::placeholder { color: var(--text-5); }
.login-form-wrap input:hover:not(:focus) { border-color: #c5cad4; }
.login-form-wrap input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: var(--accent-glow);
}

/* Password toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px !important; }
.toggle-pw {
    position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-4); border-radius: 6px;
    transition: color var(--ease), background var(--ease);
}
.toggle-pw:hover { color: var(--text); background: var(--bg); }

/* Login button */
.btn-login {
    width: 100%; padding: 12px 20px;
    background: var(--text); color: #fff;
    border-radius: var(--r-sm);
    font-size: .9rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background var(--ease), transform 0.1s, box-shadow var(--ease);
    margin-top: 8px; border: none; cursor: pointer;
    position: relative; overflow: hidden;
}
.btn-login::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 60%);
    pointer-events: none;
}
.btn-login:hover { background: #1a1f2e; box-shadow: var(--sh-md); }
.btn-login:active { transform: scale(.99); }

/* ══════════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════════ */

/* ── Sidebar (Dark) ──────────────────────────────────────── */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--sb-bg);
    border-right: 1px solid var(--sb-border);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform var(--ease-out);
}

.sidebar-logo {
    height: 68px;
    display: flex; align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--sb-border);
    flex-shrink: 0;
}
.sidebar-logo-img {
    height: 44px; width: auto; object-fit: contain;
}
.sidebar-logo-icon {
    width: 26px; height: 26px; background: var(--accent); border-radius: 6px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-logo-text {
    font-size: .82rem; font-weight: 700;
    color: rgba(255,255,255,.88); letter-spacing: -.01em;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sb-border); border-radius: 3px; }

.nav-section { margin-bottom: 4px; }
.nav-section-title {
    display: block; padding: 8px 10px 4px;
    font-size: .63rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--sb-text-muted);
}

.nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 10px; border-radius: var(--r-sm);
    color: var(--sb-text); font-size: .8rem; font-weight: 500;
    transition: all var(--ease); margin-bottom: 2px;
    border: 1px solid transparent;
}
.nav-item:hover { background: var(--sb-item-hover); color: var(--sb-text-hover); }
.nav-item.active {
    background: var(--sb-active-bg);
    color: var(--sb-active-text);
    font-weight: 600;
    border-color: var(--sb-active-border);
}
.nav-item svg { flex-shrink: 0; width: 15px; height: 15px; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
    padding: 12px 16px; border-top: 1px solid var(--sb-border);
    font-size: .68rem; color: var(--sb-text-muted);
}
.sidebar-version {
    display: inline-flex; align-items: center;
    background: rgba(255,255,255,.06);
    padding: 2px 8px; border-radius: var(--r-full);
    font-weight: 600; letter-spacing: .04em;
}

/* ── Main Wrapper ────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 90;
    height: var(--topbar-h);
    background: var(--topbar-bg);
    backdrop-filter: var(--topbar-blur);
    -webkit-backdrop-filter: var(--topbar-blur);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    padding: 0 20px;
}
.sidebar-toggle {
    color: var(--text-4); padding: 7px; border-radius: var(--r-sm);
    display: none; transition: all var(--ease);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text-3); }
.topbar-title { font-size: .8rem; font-weight: 500; color: var(--text-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ── User Menu ───────────────────────────────────────────── */
.user-menu { position: relative; }
.user-trigger {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 8px; border-radius: var(--r-sm); cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-subtle);
    transition: all var(--ease);
}
.user-trigger:hover { background: var(--bg-white); border-color: #c5cad4; box-shadow: var(--sh-xs); }
.user-info { display: flex; flex-direction: column; align-items: flex-end; }
.user-name { font-size: .76rem; font-weight: 700; color: var(--text); line-height: 1.25; }
.user-role { font-size: .66rem; color: var(--text-4); font-weight: 500; }
.user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #d97706, #fbbf24);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(217,119,6,.30);
}
.user-avatar span { color: #fff; font-weight: 700; font-size: .68rem; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--r); box-shadow: var(--sh-lg);
    min-width: 200px; z-index: 200;
    opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
    transition: all var(--ease); pointer-events: none;
    overflow: hidden;
}
.user-dropdown.open {
    opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto;
}
.user-dropdown-header {
    padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
    background: var(--bg-subtle); border-bottom: 1px solid var(--border-light);
}
.user-dropdown-header strong { font-size: .82rem; font-weight: 700; }
.user-dropdown-header small { font-size: .72rem; color: var(--text-3); }
.user-dropdown-divider { height: 1px; background: var(--border-light); }
.user-dropdown-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 14px; font-size: .8rem;
    color: var(--text-2); font-weight: 500;
    transition: background var(--ease);
}
.user-dropdown-item:hover { background: var(--bg-subtle); }
.user-dropdown-item svg { color: var(--text-4); }
.user-dropdown-logout { color: #dc2626; }
.user-dropdown-logout:hover { background: #fef2f2; }
.user-dropdown-logout svg { color: #dc2626; }

/* ── Page Content ────────────────────────────────────────── */
.page-content {
    flex: 1; padding: 24px 28px;
    max-width: 1280px; width: 100%; box-sizing: border-box;
    animation: pageEnter 0.35s cubic-bezier(0, 0, 0.2, 1);
}
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 12px; margin-bottom: 22px;
}
.page-title-big {
    font-size: 1.25rem; font-weight: 800; color: var(--text);
    letter-spacing: -.03em; line-height: 1.2;
}
.page-subtitle { font-size: .78rem; color: var(--text-4); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 15px;
    background: var(--text); color: #fff;
    border-radius: var(--r-sm); font-size: .8rem; font-weight: 600;
    transition: background var(--ease), box-shadow var(--ease), transform 0.1s;
    white-space: nowrap; border: none; cursor: pointer;
    position: relative; overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.1) 0%, transparent 60%);
}
.btn-primary:hover { background: #1a2032; box-shadow: var(--sh-sm); }
.btn-primary:active { transform: scale(.98); }

.btn-accent {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 15px;
    background: var(--accent); color: var(--sb-bg);
    border-radius: var(--r-sm); font-size: .8rem; font-weight: 600;
    transition: background var(--ease), box-shadow var(--ease), transform 0.1s;
    white-space: nowrap; border: none; cursor: pointer;
    box-shadow: var(--sh-accent);
}
.btn-accent:hover { background: var(--accent-hover); color: #fff; box-shadow: 0 6px 20px rgba(217,119,6,.32); }
.btn-accent:active { transform: scale(.98); }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 15px;
    background: var(--bg-white); color: var(--text-2);
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-size: .8rem; font-weight: 600;
    transition: all var(--ease); white-space: nowrap; cursor: pointer;
}
.btn-secondary:hover { background: var(--bg-subtle); border-color: #c5cad4; }
.btn-secondary:active { transform: scale(.98); }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px;
    background: transparent; color: var(--text-3);
    border: none; border-radius: var(--r-sm);
    font-size: .78rem; font-weight: 500;
    transition: all var(--ease); white-space: nowrap; cursor: pointer;
}
.btn-ghost:hover { background: var(--bg); color: var(--text-2); }

/* ══════════════════════════════════════════════════════════
   DASHBOARD CARDS
══════════════════════════════════════════════════════════ */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.dashboard-card {
    background: var(--bg-white);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r);
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--sh-xs);
    transition: box-shadow var(--ease), border-color var(--ease), transform var(--ease-spring);
    cursor: default;
}
.dashboard-card:hover {
    box-shadow: var(--sh-md);
    border-color: var(--border);
    transform: translateY(-2px);
}
.card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--bg-subtle); border: 1.5px solid var(--border-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); flex-shrink: 0;
}
.dashboard-card.card-accent .card-icon {
    background: var(--accent-softer);
    border-color: rgba(217, 119, 6, 0.15);
    color: var(--accent);
}
.card-label {
    font-size: .66rem; font-weight: 700; color: var(--text-4);
    text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px;
}
.card-value { font-size: .95rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }

/* Dashboard welcome */
.dashboard-welcome {
    background: var(--bg-white);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r);
    padding: 20px 22px;
    display: flex; align-items: flex-start; gap: 14px;
    box-shadow: var(--sh-xs); margin-bottom: 20px;
}
.welcome-icon { flex-shrink: 0; margin-top: 1px; }
.welcome-text h3 { font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.welcome-text p { font-size: .78rem; color: var(--text-3); }

/* Card entry animations */
.dashboard-card, .dashboard-welcome, .table-card, .profile-card {
    animation: cardSlide 0.4s cubic-bezier(0, 0, 0.2, 1) backwards;
}
.dashboard-cards .dashboard-card:nth-child(1) { animation-delay: 0.04s; }
.dashboard-cards .dashboard-card:nth-child(2) { animation-delay: 0.08s; }
.dashboard-cards .dashboard-card:nth-child(3) { animation-delay: 0.12s; }
.dashboard-cards .dashboard-card:nth-child(4) { animation-delay: 0.16s; }
.dashboard-welcome { animation-delay: 0.2s; }
@keyframes cardSlide {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   FILTER TABS
══════════════════════════════════════════════════════════ */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-tab {
    padding: 5px 13px; border-radius: var(--r-full);
    font-size: .76rem; font-weight: 600;
    color: var(--text-3); background: var(--bg-white);
    border: 1.5px solid var(--border);
    transition: all var(--ease);
}
.filter-tab:hover { border-color: #c5cad4; color: var(--text-2); }
.filter-tab.active {
    background: var(--text); border-color: var(--text); color: #fff;
}

/* ══════════════════════════════════════════════════════════
   DATA TABLES
══════════════════════════════════════════════════════════ */
.table-card {
    background: var(--bg-white);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r); overflow: hidden;
    box-shadow: var(--sh-xs);
}
.users-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.users-table thead {
    background: var(--bg-subtle);
    border-bottom: 1.5px solid var(--border);
}
.users-table th {
    padding: 10px 14px; text-align: left;
    font-size: .66rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    color: var(--text-4); white-space: nowrap;
}
.users-table td {
    padding: 12px 14px; border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.users-table tr:last-child td { border-bottom: none; }
.users-table tbody tr { transition: background var(--ease); }
.users-table tbody tr:hover { background: var(--bg-subtle); }
.users-table tbody tr {
    animation: rowFade 0.35s cubic-bezier(0, 0, 0.2, 1) backwards;
}
.users-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.users-table tbody tr:nth-child(2) { animation-delay: 0.09s; }
.users-table tbody tr:nth-child(3) { animation-delay: 0.13s; }
.users-table tbody tr:nth-child(4) { animation-delay: 0.17s; }
.users-table tbody tr:nth-child(5) { animation-delay: 0.21s; }
.users-table tbody tr:nth-child(n+6) { animation-delay: 0.24s; }
@keyframes rowFade {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* User cell */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--bg-subtle); border: 1.5px solid var(--border);
    color: var(--text-3);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .72rem; flex-shrink: 0; overflow: hidden;
}
.user-cell-avatar.avatar-accent {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(217,119,6,.22);
}
.user-cell-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-cell-name { font-weight: 600; font-size: .8rem; color: var(--text); }
.user-cell-you {
    display: inline-block; font-size: .62rem; font-weight: 700;
    background: var(--accent-soft); color: var(--accent);
    padding: 1px 6px; border-radius: var(--r-full); margin-top: 2px;
}

.code-inline {
    background: var(--bg-subtle); border: 1px solid var(--border);
    border-radius: var(--r-xs); padding: 2px 7px;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: .72rem; color: var(--text-2);
}

/* Table action buttons */
.table-actions { display: flex; gap: 4px; align-items: center; }
.btn-icon {
    width: 28px; height: 28px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--ease); color: var(--text-4); cursor: pointer;
}
.btn-icon:hover { background: var(--bg); color: var(--text-3); }
.btn-icon-warning:hover { background: #fffbeb; color: #b45309; }
.btn-icon-danger:hover { background: #fef2f2; color: #dc2626; }

/* ══════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════ */
.role-badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: var(--r-full);
    font-size: .7rem; font-weight: 700; letter-spacing: .02em;
}
.role-badge.role-admin_site {
    background: var(--accent-soft); color: var(--accent-active);
    border: 1px solid rgba(217,119,6,.22);
}
.role-badge.role-admin {
    background: #eff6ff; color: #2563eb;
    border: 1px solid #bfdbfe;
}
.role-badge.role-formateur {
    background: #f0fdf4; color: #15803d;
    border: 1px solid #bbf7d0;
}

.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: var(--r-full);
    font-size: .7rem; font-weight: 700;
}
.status-badge::before {
    content: ''; width: 5px; height: 5px;
    border-radius: 50%; flex-shrink: 0;
}
.status-badge.status-ok    { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.status-badge.status-ok::before { background: #22c55e; }
.status-badge.status-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.status-badge.status-warning::before { background: #f59e0b; }
.status-badge.status-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.status-badge.status-error::before { background: #dc2626; }
.status-badge.status-draft { background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }
.status-badge.status-draft::before { background: #9ca3af; }

/* ══════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(13, 17, 23, .45);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; visibility: hidden;
    transition: all 0.2s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-white); border-radius: var(--r-lg);
    border: 1px solid var(--border); box-shadow: var(--sh-xl);
    width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto;
    transform: translateY(12px) scale(.98);
    transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 22px 0;
}
.modal-header h3 { font-size: .95rem; font-weight: 700; letter-spacing: -.02em; }
.modal-close {
    width: 26px; height: 26px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-4); transition: all var(--ease);
}
.modal-close:hover { background: var(--bg); color: var(--text-2); }
.modal-form { padding: 18px 22px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding-top: 14px; border-top: 1px solid var(--border-light); margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════════════════════════ */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
    width: 100%; padding: 8px 11px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-size: .82rem; color: var(--text); background: var(--bg-white);
    outline: none;
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
    appearance: none; -webkit-appearance: none;
}
.form-group input:hover:not(:focus),
.form-group select:hover:not(:focus) { border-color: #c5cad4; }
.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: var(--accent-glow);
}
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    background-size: 12px; padding-right: 30px;
}

/* Unified input base */
.input-base,
input[type="text"].input-base,
input[type="email"].input-base,
input[type="number"].input-base,
input[type="date"].input-base,
input[type="time"].input-base,
input[type="password"].input-base,
input[type="search"].input-base,
input[type="tel"].input-base,
input[type="url"].input-base,
textarea.input-base,
select.input-base {
    appearance: none; -webkit-appearance: none;
    width: 100%; padding: 9px 12px;
    background: var(--bg-white);
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-family: inherit; font-size: .85rem; color: var(--text);
    line-height: 1.4;
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
    box-sizing: border-box;
}
.input-base::placeholder, textarea.input-base::placeholder {
    color: var(--text-5); opacity: 1;
}
.input-base:hover { border-color: #c5cad4; }
.input-base:focus {
    outline: none; border-color: var(--accent);
    box-shadow: var(--accent-glow);
}
.input-base:disabled {
    background: var(--bg-subtle); color: var(--text-3); cursor: not-allowed; opacity: .65;
}
textarea.input-base { resize: vertical; min-height: 80px; }
select.input-base {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center;
    background-size: 12px; padding-right: 32px; cursor: pointer;
}

/* Form labels */
.form-label {
    display: block; font-size: .78rem; font-weight: 600;
    color: var(--text-2); margin-bottom: 5px;
}
.form-label-sm {
    display: block; font-size: .7rem; color: var(--text-3);
    margin-bottom: 4px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em;
}

/* File input */
input[type="file"] {
    width: 100%; padding: 0;
    border: 2px dashed var(--border); border-radius: var(--r-sm);
    background: var(--bg-subtle); font-size: .82rem; color: var(--text-3);
    cursor: pointer; transition: border-color var(--ease), background var(--ease);
}
input[type="file"]:hover { border-color: var(--accent); background: var(--bg-white); }
input[type="file"]::file-selector-button {
    padding: 9px 14px; margin-right: 12px;
    background: var(--text); color: #fff; border: 0;
    border-radius: 6px 0 0 6px;
    font-family: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
    transition: background var(--ease);
}
input[type="file"]::file-selector-button:hover { background: #1a2032; }

/* ══════════════════════════════════════════════════════════
   OVERLAY
══════════════════════════════════════════════════════════ */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.15); z-index: 80; display: none; }
.overlay.show { display: block; }

/* ══════════════════════════════════════════════════════════
   PROFILE
══════════════════════════════════════════════════════════ */
.profile-grid { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.profile-card {
    background: var(--bg-white); border: 1.5px solid var(--border-light);
    border-radius: var(--r); padding: 20px; box-shadow: var(--sh-xs);
}
.profile-card-title {
    font-size: .82rem; font-weight: 700; color: var(--text);
    margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light);
}
.avatar-upload-area {
    display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.avatar-preview {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, #d97706, #fbbf24);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; font-size: 1.5rem; font-weight: 700; color: #0d1e4a;
    border: 3px solid var(--border);
    box-shadow: var(--sh-sm);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-btn { cursor: pointer; }
.profile-info-list { display: flex; flex-direction: column; }
.profile-info-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0; border-bottom: 1px solid var(--border-light); gap: 10px;
}
.profile-info-item:last-child { border-bottom: none; }
.profile-info-label { font-size: .75rem; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.profile-info-value { font-size: .78rem; font-weight: 600; color: var(--text); text-align: right; }

/* ══════════════════════════════════════════════════════════
   SETTINGS TABS
══════════════════════════════════════════════════════════ */
.settings-tabs {
    display: flex; gap: 2px; margin-bottom: 22px;
    border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.settings-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; font-size: .82rem; font-weight: 600;
    color: var(--text-3); border-radius: var(--r-sm) var(--r-sm) 0 0;
    border: 1px solid transparent; border-bottom: none;
    margin-bottom: -1px; transition: all var(--ease); position: relative;
}
.settings-tab:hover { color: var(--text-2); background: var(--bg-subtle); }
.settings-tab.active {
    color: var(--text); background: var(--bg-white);
    border-color: var(--border); border-bottom-color: var(--bg-white);
}
.tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; background: #f59e0b; color: #fff;
    border-radius: 50%; font-size: .6rem; font-weight: 700; flex-shrink: 0;
}

/* Settings grid */
.settings-section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-save-bar { margin-top: 18px; padding-top: 14px; }

/* Settings card */
.settings-card {
    background: var(--bg-white);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r); padding: 20px 22px; margin-bottom: 14px;
}
.settings-card-title {
    font-size: .78rem; font-weight: 700; color: var(--text);
    margin: 0 0 14px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-3);
}

/* Settings card header */
.settings-card-header {
    display: flex; gap: 12px; align-items: flex-start;
    margin-bottom: 18px; padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}
.settings-card-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--bg-subtle); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2); flex-shrink: 0;
}
.settings-card-title-new {
    font-size: 1rem; font-weight: 700; color: var(--text);
    margin: 0 0 3px; letter-spacing: -.02em;
}
.settings-card-subtitle { font-size: .8rem; color: var(--text-3); margin: 0; line-height: 1.55; }

/* Avatar badge dot */
.avatar-badge {
    position: absolute; bottom: 0; right: 0;
    width: 9px; height: 9px; background: #f59e0b;
    border: 2px solid #fff; border-radius: 50%;
}

/* Dropdown badge */
.dropdown-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; background: #f59e0b; color: #fff;
    border-radius: 50%; font-size: .6rem; font-weight: 700;
    margin-left: auto; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR NAV GROUPS (COLLAPSIBLE)
══════════════════════════════════════════════════════════ */
.nav-group { display: flex; flex-direction: column; margin-bottom: 2px; }

.nav-group-trigger {
    margin: 0; appearance: none; -webkit-appearance: none;
    background: transparent; border: 0; outline: 0; cursor: pointer;
    text-decoration: none; box-shadow: none;
    display: flex; align-items: center; gap: 9px;
    width: 100%; text-align: left; font-family: inherit;
    font-size: .8rem; font-weight: 500; line-height: 1.4;
    color: var(--sb-text); padding: 7px 10px;
    border-radius: var(--r-sm);
    transition: all var(--ease); margin-bottom: 2px;
    border: 1px solid transparent;
}
.nav-group-trigger:hover { background: var(--sb-item-hover); color: var(--sb-text-hover); }
.nav-group-trigger:focus, .nav-group-trigger:focus-visible { outline: 0; }
.nav-group-trigger.active {
    background: var(--sb-active-bg); color: var(--sb-active-text); font-weight: 600;
    border-color: var(--sb-active-border);
}
.nav-group-trigger svg:first-of-type { flex-shrink: 0; width: 15px; height: 15px; opacity: .8; }
.nav-group-trigger.active svg:first-of-type { opacity: 1; }
.nav-group-trigger .nav-chevron {
    margin-left: auto; width: 10px; height: 10px;
    color: var(--sb-text-muted); transition: transform var(--ease);
}
.nav-group.open .nav-group-trigger .nav-chevron { transform: rotate(180deg); }

.nav-submenu {
    max-height: 0; overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0, 0, 0.2, 1);
    margin-left: 14px; padding-left: 12px;
    border-left: 1.5px solid var(--sb-border);
}
.nav-group.open .nav-submenu { max-height: 200px; padding-top: 3px; padding-bottom: 5px; }
.nav-subitem {
    display: block; padding: 6px 10px;
    color: var(--sb-text); font-size: .78rem; font-weight: 500;
    border-radius: 6px; text-decoration: none;
    transition: background var(--ease), color var(--ease); line-height: 1.4;
}
.nav-subitem:hover { color: var(--sb-text-hover); background: var(--sb-item-hover); }
.nav-subitem.active { color: var(--sb-active-text); background: var(--sb-active-bg); font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   BANNERS
══════════════════════════════════════════════════════════ */
.banner {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 16px 20px; border-radius: var(--r); margin-bottom: 14px;
    border: 1px solid; animation: bannerSlide .35s cubic-bezier(0, 0, 0.2, 1);
    width: 100%; box-sizing: border-box; position: relative;
}
@keyframes bannerSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.banner-success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac; color: #14532d;
}
.banner-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fcd34d; color: #78350f;
}
.banner-error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fca5a5; color: #7f1d1d;
}
.banner-icon {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.65); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.banner-success .banner-icon { color: #15803d; }
.banner-warning .banner-icon { color: #b45309; }
.banner-content { flex: 1; min-width: 0; line-height: 1.55; }
.banner-content > strong:first-child {
    display: block; font-size: .92rem; font-weight: 700;
    margin-bottom: 3px; letter-spacing: -.01em;
}
.banner-content p { margin: 0; font-size: .82rem; opacity: .88; }
.banner-content p strong { display: inline; font-weight: 700; }
.banner-content code {
    background: rgba(0,0,0,.07); padding: 1px 6px;
    border-radius: 4px; font-size: .8em;
    font-family: 'SF Mono', Menlo, monospace;
}
.banner-link {
    align-self: center; flex-shrink: 0; color: inherit;
    text-decoration: none; font-weight: 700; font-size: .82rem;
    padding: 7px 14px; border-radius: var(--r-sm);
    background: rgba(255,255,255,.7); transition: background var(--ease);
    white-space: nowrap;
}
.banner-link:hover { background: #fff; }
.banner-dismiss {
    background: transparent; border: none; color: inherit; opacity: .4;
    cursor: pointer; padding: 6px; margin-left: 4px;
    border-radius: 4px; display: flex; align-items: center; justify-content: center;
    transition: opacity var(--ease), background var(--ease); align-self: flex-start;
}
.banner-dismiss:hover { opacity: 1; background: rgba(0,0,0,.07); }

/* ══════════════════════════════════════════════════════════
   PENDING DATES
══════════════════════════════════════════════════════════ */
.pending-list {
    margin-bottom: 16px; border-radius: var(--r);
    border: 1.5px solid #fde68a; background: #fffbeb; overflow: hidden;
    box-shadow: var(--sh-xs);
}
.pending-item {
    display: flex; align-items: center; gap: 16px;
    padding: 13px 18px; border-bottom: 1px solid #fde68a;
    transition: background var(--ease);
}
.pending-item:last-child { border-bottom: none; }
.pending-item:hover { background: #fef3c7; }
.pending-date { font-weight: 700; color: #78350f; width: 100px; flex-shrink: 0; font-size: .85rem; }
.pending-info { flex: 1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pending-info strong { font-size: .85rem; color: var(--text); }
.pending-duration {
    background: #fef3c7; color: #92400e;
    padding: 2px 9px; border-radius: var(--r-full);
    font-size: .72rem; font-weight: 700;
    border: 1px solid rgba(202,138,4,.2);
}
.pending-reason { color: #78350f; font-size: .72rem; opacity: .8; }
.btn-mark-signed { background: #15803d !important; color: #fff !important; border-color: #15803d !important; }
.btn-mark-signed:hover { background: #166534 !important; }

.pending-section { margin: 24px 0 20px; }
.pending-section-hint {
    font-size: .8rem; color: var(--text-3); margin: 5px 0 12px; line-height: 1.6;
}
.pending-section-footnote {
    font-size: .78rem; color: var(--text-3); margin-top: 10px; line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   NOTIFICATION BELL
══════════════════════════════════════════════════════════ */
.notif-menu { position: relative; margin-right: 4px; }
.notif-trigger {
    width: 36px; height: 36px; border-radius: var(--r-sm);
    background: transparent; border: 1.5px solid transparent;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-3);
    transition: all var(--ease); position: relative;
}
.notif-trigger:hover {
    background: var(--bg); border-color: var(--border); color: var(--text);
}
.notif-badge {
    position: absolute; top: -3px; right: -3px;
    min-width: 17px; height: 17px; background: var(--accent); color: var(--sb-bg);
    border-radius: var(--r-full); font-size: .62rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; border: 2px solid #fff; line-height: 1;
}
.notif-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 370px; max-height: 480px;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--r-lg); box-shadow: var(--sh-xl);
    overflow: hidden;
    opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
    transition: opacity .18s, transform .18s, visibility .18s;
    z-index: 600; display: flex; flex-direction: column;
}
.notif-menu.open .notif-dropdown {
    opacity: 1; visibility: visible; transform: translateY(0) scale(1);
}
.notif-dropdown-header {
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-subtle);
}
.notif-dropdown-header strong { font-size: .84rem; color: var(--text); letter-spacing: -.01em; }
.notif-mark-all {
    background: none; border: none; color: var(--accent);
    font-size: .74rem; font-weight: 700; cursor: pointer; padding: 0;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-empty {
    padding: 36px 20px; text-align: center; color: var(--text-4);
}
.notif-empty p { margin: 8px 0 0; font-size: .82rem; }
.notif-list { overflow-y: auto; max-height: 400px; }
.notif-item {
    display: flex; gap: 11px; padding: 13px 16px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none; color: inherit;
    transition: background .12s; position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-subtle); }
.notif-item.unread { background: rgba(217, 119, 6, 0.04); }
.notif-item.unread::before {
    content: ''; position: absolute; left: 6px; top: 50%;
    transform: translateY(-50%); width: 5px; height: 5px;
    border-radius: 50%; background: var(--accent);
}
.notif-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notif-content { flex: 1; min-width: 0; }
.notif-content strong {
    display: block; font-size: .82rem; font-weight: 700;
    color: var(--text); line-height: 1.3;
}
.notif-content p { font-size: .76rem; color: var(--text-3); margin: 3px 0 5px; line-height: 1.45; }
.notif-content small { font-size: .68rem; color: var(--text-4); }

/* ══════════════════════════════════════════════════════════
   CUSTOM DIALOGS
══════════════════════════════════════════════════════════ */
.cfl-dialog-overlay {
    position: fixed; inset: 0;
    background: rgba(13, 17, 23, .55);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; opacity: 0; pointer-events: none;
    transition: opacity .2s ease; padding: 16px;
}
.cfl-dialog-overlay.open { opacity: 1; pointer-events: auto; }
.cfl-dialog {
    background: #fff; border-radius: var(--r-lg);
    box-shadow: var(--sh-xl); width: 100%; max-width: 430px;
    padding: 28px 28px 22px; text-align: center;
    transform: scale(.95); opacity: 0;
    animation: cflDlgIn .25s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}
@keyframes cflDlgIn { to { transform: scale(1); opacity: 1; } }
.cfl-dialog-icon {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.cfl-dialog-title {
    font-size: 1.08rem; font-weight: 800; color: var(--text);
    margin: 0 0 7px; letter-spacing: -.02em;
}
.cfl-dialog-message { font-size: .875rem; color: var(--text-3); line-height: 1.6; margin: 0; }
.cfl-dialog-input {
    width: 100%; margin-top: 14px; padding: 10px 12px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font: inherit; font-size: .9rem; color: var(--text);
    outline: none; transition: border-color var(--ease), box-shadow var(--ease);
}
.cfl-dialog-input:focus { border-color: var(--accent); box-shadow: var(--accent-glow); }
.cfl-dialog-actions {
    display: flex; gap: 9px; margin-top: 22px; justify-content: center;
}
.cfl-dialog-btn {
    flex: 1; padding: 10px 16px; font: inherit; font-size: .87rem;
    font-weight: 700; border-radius: var(--r-sm); cursor: pointer;
    transition: opacity .15s, transform .1s, background .15s; border: none;
}
.cfl-dialog-btn-cancel { background: var(--bg-subtle); color: var(--text-3); }
.cfl-dialog-btn-cancel:hover { background: var(--bg); }
.cfl-dialog-btn-confirm { background: var(--text); color: #fff; }
.cfl-dialog-btn-confirm:hover { opacity: .9; }
.cfl-dialog-btn:active { transform: scale(.98); }
.cfl-dialog-actions .cfl-dialog-btn-cancel:empty { display: none; }

/* ══════════════════════════════════════════════════════════
   REMEMBER ME CHECKBOX
══════════════════════════════════════════════════════════ */
.remember-row { margin: 4px 0 14px; }
.remember-check {
    display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
    user-select: none; font-size: .84rem; color: var(--text-2); margin: 0; line-height: 1.4;
}
.remember-check input[type="checkbox"] {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.remember-box {
    flex: 0 0 17px; width: 17px; height: 17px; min-width: 17px;
    box-sizing: border-box; border: 1.5px solid var(--border);
    border-radius: 5px; background: #fff; position: relative;
    transition: all var(--ease); display: inline-block;
}
.remember-check:hover .remember-box { border-color: var(--accent); }
.remember-check input:checked ~ .remember-box { background: var(--accent); border-color: var(--accent); }
.remember-check input:checked ~ .remember-box::after {
    content: ''; position: absolute; left: 4px; top: 1px;
    width: 6px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.remember-label { font-weight: 500; }

/* ══════════════════════════════════════════════════════════
   CFL CHECKBOX
══════════════════════════════════════════════════════════ */
.cfl-checkbox {
    display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
    user-select: none; padding: 13px 15px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    background: var(--bg-subtle); transition: all var(--ease);
}
.cfl-checkbox:hover { border-color: var(--accent); background: var(--bg-white); }
.cfl-checkbox input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.cfl-checkbox-box {
    flex: 0 0 18px; width: 18px; height: 18px; min-width: 18px;
    box-sizing: border-box; border: 1.5px solid var(--border);
    border-radius: 5px; background: #fff; position: relative;
    transition: all var(--ease); margin-top: 2px; display: inline-block;
}
.cfl-checkbox input:checked ~ .cfl-checkbox-box { background: var(--accent); border-color: var(--accent); }
.cfl-checkbox input:checked ~ .cfl-checkbox-box::after {
    content: ''; position: absolute; left: 5px; top: 1px;
    width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.cfl-checkbox-label { flex: 1; line-height: 1.5; }
.cfl-checkbox-label strong { display: block; font-size: .86rem; font-weight: 700; color: var(--text); }
.cfl-checkbox-label small { display: block; font-size: .76rem; color: var(--text-3); margin-top: 2px; font-weight: normal; }

/* ══════════════════════════════════════════════════════════
   LEARNER TILES (FORMATEUR DASHBOARD)
══════════════════════════════════════════════════════════ */
.section-title-small {
    font-size: .92rem; font-weight: 700; color: var(--text);
    margin: 24px 0 12px; letter-spacing: -.02em;
}
.my-learners-section { margin-bottom: 20px; }
.my-learners-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 10px;
}
.learner-tile {
    border: 1.5px solid; border-radius: var(--r); padding: 14px 16px;
    transition: transform var(--ease-spring), box-shadow var(--ease);
    background: var(--bg-white);
}
.learner-tile:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.learner-tile-name {
    font-size: .82rem; font-weight: 700; color: var(--text);
    margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.learner-tile-hours { display: flex; align-items: baseline; gap: 5px; }
.learner-tile-hours strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.learner-tile-hours span { font-size: .72rem; color: var(--text-3); }

/* Critical learners */
.critical-learners-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px; margin-bottom: 20px;
}
.critical-learner-card {
    background: #fff7ed; border: 1.5px solid #fed7aa;
    border-radius: var(--r); padding: 14px 16px;
    display: flex; flex-direction: column; gap: 3px;
}
.critical-learner-name {
    font-size: 1rem; font-weight: 700; color: var(--text);
    letter-spacing: -.02em; line-height: 1.2;
}
.critical-learner-hours {
    font-size: .82rem; font-weight: 700; color: #c2410c; margin-top: 1px;
}
.critical-learner-trainer {
    font-size: .75rem; color: var(--text-3); margin-top: 6px;
}
.critical-learner-links { margin-top: 8px; }
.critical-link {
    display: inline-block; color: #1d4ed8;
    text-decoration: none; font-size: .75rem; font-weight: 600;
}
.critical-link:hover { text-decoration: underline; }

/* Archived learners */
.archived-learners {
    margin-top: 16px; background: var(--bg-subtle);
    border: 1.5px solid var(--border); border-radius: var(--r);
    padding: 0; overflow: hidden;
}
.archived-learners summary {
    list-style: none; cursor: pointer; padding: 12px 16px;
    display: flex; align-items: center; gap: 8px;
    font-size: .82rem; font-weight: 600; color: var(--text-3);
    user-select: none; transition: background var(--ease);
}
.archived-learners summary::-webkit-details-marker { display: none; }
.archived-learners summary:hover { background: var(--bg); color: var(--text); }
.archived-chevron {
    color: var(--text-4); transition: transform .22s ease;
    flex-shrink: 0; transform: rotate(-90deg);
}
.archived-learners[open] .archived-chevron { transform: rotate(0deg); }
.archived-count {
    margin-left: auto; background: var(--border);
    color: var(--text-3); padding: 1px 8px;
    border-radius: var(--r-full); font-size: .7rem; font-weight: 700;
}
.archived-learners[open] { padding-bottom: 14px; }
.archived-learners[open] > .my-learners-grid { padding: 0 14px; }

/* ══════════════════════════════════════════════════════════
   TRAINER PICKER
══════════════════════════════════════════════════════════ */
.trainer-picker {
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    background: #fff; overflow: hidden;
    transition: border-color var(--ease), box-shadow var(--ease);
}
.trainer-picker:focus-within { border-color: var(--accent); box-shadow: var(--accent-glow); }
.trainer-search-wrap {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 11px; border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}
.trainer-search-wrap svg { color: var(--text-4); flex-shrink: 0; }
.trainer-search-wrap input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: .83rem; color: var(--text); font-family: inherit;
}
.trainer-search-wrap input::placeholder { color: var(--text-4); }
.trainer-list { max-height: 210px; overflow-y: auto; }
.trainer-loading {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 14px; font-size: .8rem; color: var(--text-3);
}
.trainer-spinner {
    width: 16px; height: 16px; border: 2px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin .7s linear infinite; flex-shrink: 0;
}
.trainer-empty { padding: 16px 14px; font-size: .8rem; color: var(--text-4); text-align: center; }
.trainer-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 13px; cursor: pointer;
    transition: background var(--ease); border-bottom: 1px solid var(--border-light);
}
.trainer-item:last-child { border-bottom: none; }
.trainer-item:hover { background: var(--bg-subtle); }
.trainer-item.selected { background: var(--accent-softer); }
.trainer-item-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--bg-subtle); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700; color: var(--text-3); flex-shrink: 0;
}
.trainer-item.selected .trainer-item-avatar {
    background: var(--accent-soft); color: var(--accent); border-color: rgba(217,119,6,.22);
}
.trainer-item-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.trainer-item-name {
    font-size: .83rem; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trainer-item.selected .trainer-item-name { color: var(--accent); }
.trainer-item-email {
    font-size: .72rem; color: var(--text-4);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-refresh-trainers {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border: 1.5px solid var(--border); border-radius: var(--r-full);
    font-size: .7rem; font-weight: 700; color: var(--text-3);
    background: #fff; cursor: pointer; transition: all var(--ease);
}
.btn-refresh-trainers:hover { border-color: #c5cad4; color: var(--text-2); background: var(--bg-subtle); }
.btn-refresh-trainers.spinning svg { animation: spin .7s linear infinite; }

/* ══════════════════════════════════════════════════════════
   TRAINER GRID CARDS
══════════════════════════════════════════════════════════ */
.trainer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.trainer-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px; background: var(--bg-white);
    border: 1.5px solid var(--border-light); border-radius: var(--r);
    text-decoration: none; color: var(--text);
    transition: all var(--ease-spring), box-shadow var(--ease);
    box-shadow: var(--sh-xs);
}
.trainer-card:hover {
    border-color: var(--border); transform: translateY(-2px);
    box-shadow: var(--sh-md);
}
.trainer-avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--bg-subtle); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.05rem; color: var(--text-3);
    flex-shrink: 0; overflow: hidden;
}
.trainer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.trainer-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.trainer-info strong { font-size: .9rem; font-weight: 700; line-height: 1.2; }
.trainer-info small { font-size: .76rem; color: var(--text-3); }

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════ */
.empty-state-card {
    text-align: center; padding: 64px 24px;
    background: var(--bg-white); border: 1.5px solid var(--border-light);
    border-radius: var(--r-lg); box-shadow: var(--sh-xs);
}
.empty-state-card svg { margin-bottom: 16px; opacity: .5; }
.empty-state-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 7px; letter-spacing: -.02em; }
.empty-state-card p {
    font-size: .86rem; color: var(--text-3); margin: 0;
    max-width: 380px; margin-left: auto; margin-right: auto; line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════
   ENTRY ROWS (DECLARATIONS / ACTIVITIES)
══════════════════════════════════════════════════════════ */
.entry-row {
    background: var(--bg-subtle); border: 1.5px solid var(--border);
    border-radius: var(--r); padding: 16px; margin-bottom: 10px;
    transition: border-color var(--ease);
}
.entry-row:hover { border-color: var(--border); }
.entry-row:last-child { margin-bottom: 0; }
.entry-row-grid { display: grid; grid-template-columns: 145px 1fr 1fr; gap: 11px; align-items: end; }
.entry-row-grid-act { display: grid; grid-template-columns: 145px 115px 115px 1fr; gap: 11px; align-items: end; }
.entry-row-grid-act-2 { display: flex; gap: 11px; align-items: end; }

/* ══════════════════════════════════════════════════════════
   INVOICE COMPONENTS
══════════════════════════════════════════════════════════ */
.invoice-settings-bar {
    display: flex; align-items: flex-end; gap: 14px;
    background: var(--bg-white); border: 1.5px solid var(--border-light);
    border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px;
    box-shadow: var(--sh-xs);
}
.invoice-empty {
    text-align: center; padding: 28px;
    color: var(--text-4); font-size: .875rem;
    background: var(--bg-white); border: 2px dashed var(--border);
    border-radius: var(--r); margin-bottom: 16px;
}
.client-card {
    background: var(--bg-white); border: 1.5px solid var(--border-light);
    border-radius: var(--r); margin-bottom: 12px;
    box-shadow: var(--sh-xs);
    transition: box-shadow var(--ease), border-color var(--ease); cursor: default;
}
.client-card:hover { box-shadow: var(--sh-sm); border-color: var(--border); }
.client-card[draggable="true"] { cursor: grab; }
.client-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; border-bottom: 1px solid var(--border-light);
}
.client-drag-handle { color: var(--text-4); cursor: grab; padding: 2px; flex-shrink: 0; }
.client-drag-handle:active { cursor: grabbing; }
.client-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg-subtle); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700; color: var(--text-3); flex-shrink: 0;
}
.client-name-input {
    flex: 1; border: none; outline: none;
    font-size: .9rem; font-weight: 700; color: var(--text);
    font-family: inherit; background: transparent;
    padding: 3px 7px; border-radius: 5px; transition: background var(--ease);
}
.client-name-input:hover { background: var(--bg-subtle); }
.client-name-input:focus { background: var(--bg-subtle); }
.client-subtotal {
    font-size: .9rem; font-weight: 700; color: var(--text);
    white-space: nowrap; margin-left: auto; padding-right: 8px;
}
.client-sessions { padding: 13px 16px; }
.sessions-table { width: 100%; border-collapse: collapse; font-size: .8rem; margin-bottom: 10px; }
.sessions-table th {
    padding: 7px 9px; text-align: left;
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-4);
}

/* Hours summary */
.client-hours-summary {
    margin-top: 9px; padding: 11px 14px;
    background: var(--bg-subtle); border: 1.5px solid var(--border);
    border-radius: var(--r-sm); font-size: .82rem;
}
.client-hours-summary.over-limit { background: #fef2f2; border-color: #fecaca; }
.hours-summary-row { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; }
.hours-summary-row-final {
    margin-top: 6px; padding-top: 9px;
    border-top: 1.5px solid var(--border); font-weight: 700;
}
.hours-summary-label { color: var(--text-3); }
.hours-summary-label small { color: var(--text-4); font-size: .9em; margin-left: 5px; }
.hours-summary-value { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.hours-summary-value.over-limit { color: #dc2626; }

/* Grand total bar */
.invoice-grand-total {
    margin-top: 18px; padding: 16px 20px;
    background: var(--text); color: #fff;
    border-radius: var(--r);
    display: flex; justify-content: space-between; align-items: center;
    font-size: .9rem; box-shadow: var(--sh-md);
}
.invoice-grand-total strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.invoice-grand-total .grand-total-amount { font-size: 1.15rem; }

/* Client status pills */
.client-status-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; font-size: .72rem; font-weight: 700;
    border-radius: var(--r-full); line-height: 1.4; white-space: nowrap;
}
.client-status-pill.success { background: #dcfce7; color: #166534; }
.client-status-pill.error   { background: #fee2e2; color: #991b1b; }
.client-status-pill.loading { background: var(--bg-subtle); color: var(--text-3); }
.client-status-pill.paper   { background: #fef3c7; color: #92400e; }
.client-status-pill.collective { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* Address items */
.address-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 11px 14px;
    background: var(--bg-subtle); border: 1.5px solid var(--border); border-radius: var(--r-sm);
    transition: border-color var(--ease);
}
.address-item:hover { border-color: var(--border); }
.address-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.address-item-info strong { font-size: .85rem; font-weight: 700; }
.address-item-info span { font-size: .75rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════
   FORM GRID
══════════════════════════════════════════════════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }
.form-field { display: flex; flex-direction: column; }
.form-field .input-base { width: 100%; }

/* ══════════════════════════════════════════════════════════
   SPINNERS & LOADING
══════════════════════════════════════════════════════════ */
.spinner-inline {
    display: inline-block; width: 13px; height: 13px;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: spin .7s linear infinite;
    vertical-align: -2px; margin-right: 5px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   UTILS
══════════════════════════════════════════════════════════ */
.mb-20 { margin-bottom: 20px; }
.text-muted { color: var(--text-4); }

/* ══════════════════════════════════════════════════════════
   WELCOME / LOADING PAGE
══════════════════════════════════════════════════════════ */
.welcome-page {
    min-height: 100vh; background: var(--sb-bg);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; overflow: hidden;
}
.welcome-container {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; max-width: 420px; width: 100%;
}
.welcome-logo-wrap {
    margin-bottom: 40px; opacity: 0; transform: translateY(-14px);
    animation: fadeDown 0.6s 0.1s ease-out forwards;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 16px;
    padding: 20px 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}
.welcome-logo {
    width: 200px; height: auto; display: block;
}
.welcome-content { position: relative; width: 100%; min-height: 100px; }
.welcome-step {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; flex-direction: column; align-items: center; gap: 18px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
#step-loading { opacity: 0; animation: fadeIn 0.5s 0.4s ease-out forwards; }
#step-loading.fade-out { opacity: 0; transform: translateY(-8px); }
#step-greeting { opacity: 0; transform: translateY(14px); }
#step-greeting.show { opacity: 1; transform: translateY(0); }
.welcome-spinner {
    width: 38px; height: 38px;
    border: 2.5px solid rgba(255,255,255,.12);
    border-top-color: #f5a623; border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.welcome-text { color: rgba(255,255,255,.50); font-size: 0.95rem; font-weight: 500; letter-spacing: 0.01em; }
.welcome-check { animation: checkPop 0.5s ease-out; }
.welcome-greeting { font-size: 1.5rem; font-weight: 800; color: #fff; letter-spacing: -0.03em; }
.welcome-greeting strong { color: #f5a623; font-weight: 800; }
.welcome-redirect { color: rgba(255,255,255,.38); font-size: 0.85rem; font-weight: 500; }

@keyframes fadeIn  { from { opacity: 0; transform: translateY(8px);  } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUpOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-52px); } }
.welcome-container.slide-out { animation: slideUpOut 0.38s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes checkPop {
    0%   { opacity: 0; transform: scale(0.5); }
    50%  { transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .login-panel-left { display: none; }
}
@media (max-width: 800px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--sh-xl); }
    .main-wrapper { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .form-row { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; }
    .settings-section-grid { grid-template-columns: 1fr; }
    .entry-row-grid, .entry-row-grid-act, .entry-row-grid-act-2 { grid-template-columns: 1fr; display: grid; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .page-content { padding: 16px 14px; }
    .topbar { padding: 0 14px; }
    .dashboard-cards { grid-template-columns: 1fr; }
    .user-info { display: none; }
    .login-panel-right { padding: 24px 20px; }
    .page-title-big { font-size: 1.1rem; }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ══════════════════════════════════════════════════════════
   BACKWARD COMPATIBILITY ALIASES (invoice.css + legacy pages)
══════════════════════════════════════════════════════════ */
:root {
    --c-white:        var(--bg-white);
    --c-bg:           var(--bg-subtle);
    --c-border:       var(--border);
    --c-border-light: var(--border-light);
    --c-text:         var(--text);
    --c-text-2:       var(--text-2);
    --c-text-3:       var(--text-3);
    --c-text-4:       var(--text-4);
    --accent-bg:      var(--accent-soft);
    --sh-lg:          0 16px 48px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.06);
}

/* ══════════════════════════════════════════════════════════
   INVOICE.CSS OVERRIDES - align with new design tokens
══════════════════════════════════════════════════════════ */

/* Settings grid (used on settings/invoice pages) */
.settings-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start;
}
@media (max-width: 768px) {
    .settings-grid { grid-template-columns: 1fr; }
    .invoice-settings-bar { flex-direction: column; align-items: stretch; }
}

/* Nav badge */
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 17px; height: 17px; background: #f59e0b; color: #fff;
    border-radius: 50%; font-size: .6rem; font-weight: 700;
    margin-left: auto; flex-shrink: 0;
}

/* Empty state (invoice variant) */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-state-icon {
    width: 66px; height: 66px; border-radius: 50%;
    background: var(--bg-subtle); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; color: var(--text-4);
}
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.empty-state p  { font-size: .82rem; }

/* Optional label */
.optional { color: var(--text-4); font-weight: 400; font-size: .72rem; }

/* Form divider */
.form-divider {
    display: flex; align-items: center; gap: 10px; margin: 18px 0 14px;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
    font-weight: 700; color: var(--text-4);
}
.form-divider::before, .form-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Sess inputs */
.sess-input {
    width: 100%; padding: 5px 8px;
    border: 1.5px solid transparent; border-radius: 5px;
    font: inherit; font-size: .8rem; color: var(--text);
    background: transparent; outline: none; transition: all var(--ease);
    appearance: none; -webkit-appearance: none;
}
.sess-input:hover { border-color: var(--border); background: var(--bg-subtle); }
.sess-input:focus { border-color: var(--accent); background: #fff; box-shadow: var(--accent-glow); }
select.sess-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7280' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 6px center; padding-right: 22px; cursor: pointer;
}
.sess-readonly { padding: 7px 10px; font-size: .82rem; color: var(--text); }

/* Btn add session */
.btn-add-session {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 11px; font-size: .76rem; font-weight: 700;
    color: var(--text-3); border: 1.5px dashed var(--border);
    border-radius: var(--r-sm); background: transparent; cursor: pointer;
    transition: all var(--ease);
}
.btn-add-session:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-softer); }

/* Add client bar */
.add-client-bar {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-white); border: 1.5px solid var(--border-light);
    border-radius: var(--r); padding: 13px 16px;
    box-shadow: var(--sh-xs); position: relative;
}
.learner-search-wrap { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--text-4); }
.learner-search-wrap input {
    flex: 1; border: none; outline: none; font: inherit;
    font-size: .875rem; color: var(--text); background: transparent;
}
.learner-search-wrap input::placeholder { color: var(--text-4); }

/* Learner picker */
.learner-picker { flex: 1; position: relative; }
.learner-picker-trigger {
    width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-sm);
    background: #fff; padding: 9px 12px; font: inherit; font-size: .85rem;
    color: var(--text); outline: none; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: all var(--ease); text-align: left;
}
.learner-picker-trigger:hover:not(:disabled) { border-color: var(--accent); }
.learner-picker-trigger:disabled { opacity: .55; cursor: not-allowed; background: var(--bg-subtle); }
.learner-picker-trigger > svg:first-child { color: var(--text-3); flex-shrink: 0; }
.learner-picker-trigger #learner-picker-label {
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2);
}
.learner-picker-trigger > svg:last-child { color: var(--text-4); flex-shrink: 0; transition: transform var(--ease); }
.learner-picker.open .learner-picker-trigger > svg:last-child,
.learner-picker:has(.learner-picker-dropdown.open) .learner-picker-trigger > svg:last-child { transform: rotate(180deg); }

.learner-picker-dropdown {
    position: absolute; top: calc(100% + 5px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--border); border-radius: var(--r);
    box-shadow: var(--sh-lg); z-index: 50; overflow: hidden;
    opacity: 0; transform: translateY(-6px); pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}
.learner-picker-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.learner-picker-search {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid var(--border-light); color: var(--text-4);
}
.learner-picker-search input {
    flex: 1; border: none; outline: none; background: transparent;
    font: inherit; font-size: .85rem; color: var(--text);
}
.learner-picker-search input::placeholder { color: var(--text-4); }
.learner-picker-list { max-height: 260px; overflow-y: auto; padding: 4px; }
.learner-picker-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 8px 10px; border: none; background: transparent;
    border-radius: var(--r-sm); cursor: pointer; font: inherit; font-size: .85rem;
    color: var(--text); text-align: left; transition: background var(--ease);
}
.learner-picker-item:hover, .learner-picker-item.highlighted { background: var(--bg-subtle); }
.learner-picker-avatar {
    width: 27px; height: 27px; border-radius: 50%;
    background: var(--accent-softer); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700; flex-shrink: 0;
}
.learner-picker-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.learner-picker-empty { padding: 18px 14px; text-align: center; color: var(--text-4); font-size: .82rem; }

/* Learner dropdown */
.learner-dropdown {
    position: absolute; left: 14px; right: 14px; top: calc(100% + 5px);
    background: #fff; border: 1px solid var(--border); border-radius: var(--r);
    box-shadow: var(--sh-lg); z-index: 200; max-height: 230px; overflow-y: auto;
}
.learner-dd-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    font-size: .82rem; font-weight: 600; color: var(--text-2);
    cursor: pointer; transition: background var(--ease);
    border-bottom: 1px solid var(--border-light);
}
.learner-dd-item:last-child { border-bottom: none; }
.learner-dd-item:hover { background: var(--bg-subtle); }
.learner-dd-avatar {
    width: 27px; height: 27px; border-radius: 50%;
    background: var(--bg-subtle); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700; color: var(--text-3); flex-shrink: 0;
}

/* Mini spinner */
.mini-spinner {
    display: inline-block; width: 10px; height: 10px;
    border: 1.5px solid var(--border); border-top-color: var(--text-3);
    border-radius: 50%; animation: spin .7s linear infinite;
}

/* Client refresh btn */
.btn-refresh-client { margin-left: 4px; color: var(--text-3); }
.btn-refresh-client:hover { color: var(--text); background: var(--bg-subtle); }

/* Warning rows */
.session-row-warning td { background: #fffbeb; }
.session-warning-row td { background: #fffbeb; padding: 6px 10px; border-bottom: 1px solid #fde68a; }
.session-warning { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: #92400e; }
.session-warning svg { flex-shrink: 0; color: #d97706; }
.btn-defer-link {
    margin-left: auto; background: transparent; border: 1.5px solid #fcd34d;
    color: #92400e; padding: 3px 10px; border-radius: 5px; cursor: pointer;
    font-size: .72rem; font-weight: 700; transition: all .12s;
}
.btn-defer-link:hover { background: #fef3c7; border-color: #f59e0b; }
.btn-defer-inline {
    margin-left: auto; background: transparent; border: 1.5px solid #fcd34d;
    color: #92400e; padding: 3px 10px; border-radius: 5px; cursor: pointer;
    font-size: .72rem; font-weight: 600; transition: all .12s; white-space: nowrap;
}
.btn-defer-inline:hover { background: #fef3c7; border-color: #f59e0b; }
.btn-delete-inline {
    background: transparent; border: 1.5px solid #fca5a5;
    color: #dc2626; padding: 3px 10px; border-radius: 5px; cursor: pointer;
    font-size: .72rem; font-weight: 600; transition: all .12s; white-space: nowrap;
}
.btn-delete-inline:hover { background: #fee2e2; border-color: #f87171; }
.session-row-blocking td { background: #fef2f2; }
.session-blocking-row td { background: #fef2f2; padding: 6px 10px; border-bottom: 1px solid #fecaca; }
.session-warning.is-blocking { color: #991b1b; }
.session-warning.is-blocking svg { color: #dc2626; }
.learner-picker-hours { font-size: .72rem; color: var(--text-4); white-space: nowrap; margin-left: auto; padding-left: 8px; }

/* Attendance toggle */
.attendance-toggle {
    background: var(--bg-white); border: 1.5px solid var(--border);
    border-radius: var(--r); padding: 16px 18px; margin-bottom: 14px;
    box-shadow: var(--sh-xs);
}
.attendance-toggle-state { display: none !important; align-items: flex-start; gap: 12px; }
.attendance-toggle[data-mode="digital"] > .attendance-state-digital,
.attendance-toggle[data-mode="paper"]   > .attendance-state-paper { display: flex !important; }
.attendance-toggle-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: #eff6ff; color: #1d4ed8;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.attendance-toggle-content { flex: 1; min-width: 0; }
.attendance-toggle-content strong {
    display: block; font-size: .9rem; font-weight: 700;
    color: var(--text); letter-spacing: -.01em; margin-bottom: 4px;
}
.attendance-toggle-content p { margin: 0; font-size: .8rem; color: var(--text-3); line-height: 1.55; }
.attendance-toggle-content a {
    color: var(--accent); font-weight: 700; text-decoration: none;
    border-bottom: 1px dashed currentColor; padding-bottom: 1px;
    transition: opacity var(--ease);
}
.attendance-toggle-content a:hover { opacity: .7; }
.attendance-toggle[data-mode="paper"] { background: #fffbf2; border-color: #fde68a; }

/* Paper mode add-date btn */
.btn-add-paper-row {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1.5px dashed var(--border);
    color: var(--text-3); padding: 7px 14px; border-radius: var(--r-sm);
    font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
    margin-top: 8px; transition: all var(--ease);
}
.btn-add-paper-row:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-softer); }

/* Collective btn */
.btn-collective { color: var(--text-4); margin-right: 4px; }
.btn-collective:hover { color: var(--accent); background: var(--accent-softer); }

/* Collective modal */
.collective-modal {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.collective-modal-backdrop { position: absolute; inset: 0; background: rgba(13,17,23,.55); backdrop-filter: blur(4px); }
.collective-modal-box {
    position: relative; background: #fff; border-radius: var(--r-lg);
    width: 100%; max-width: 490px; max-height: 90vh; overflow: auto;
    box-shadow: var(--sh-xl); display: flex; flex-direction: column;
}
.collective-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px; border-bottom: 1px solid var(--border);
}
.collective-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }
.collective-modal-close {
    background: none; border: 0; font-size: 1.4rem; line-height: 1;
    cursor: pointer; color: var(--text-4); padding: 0 6px; transition: color var(--ease);
}
.collective-modal-close:hover { color: var(--text); }
.collective-modal-body { padding: 20px 22px; }
.collective-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 22px; border-top: 1px solid var(--border);
}
.collective-modal-body .input-base {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font: inherit; font-size: .85rem; color: var(--text); outline: none;
    transition: border-color var(--ease), box-shadow var(--ease);
}
.collective-modal-body .input-base:focus { border-color: var(--accent); box-shadow: var(--accent-glow); }
