/* ═══════════════════════════════════════════════════════════
   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;
}
.role-badge.role-commercial {
    background: #fde4ee; color: #e90069;
    border: 1px solid #fbcfe8;
}

.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); }

/* ══════════════════════════════════════════════════════════
   ADDRESS AUTOCOMPLETE
══════════════════════════════════════════════════════════ */
.addr-complete-wrap { position: relative; display: block; width: 100%; }
.addr-suggest-drop {
    display: none; position: absolute; top: calc(100% + 3px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--border); border-radius: var(--r);
    box-shadow: var(--sh-lg); z-index: 300; max-height: 260px; overflow-y: auto;
}
.addr-suggest-drop.open { display: block; }
.addr-suggest-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 12px; cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background .08s;
}
.addr-suggest-item:last-child { border-bottom: none; }
.addr-suggest-item:hover, .addr-suggest-item.highlighted { background: var(--bg-subtle); }
.addr-suggest-label { font-size: .82rem; font-weight: 600; color: var(--text); }
.addr-suggest-sub { font-size: .71rem; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Address input states */
.addr-input.addr-valid   { border-color: #22c55e !important; background: #f0fdf4 !important; }
.addr-input.addr-invalid { border-color: #ef4444 !important; background: #fef2f2 !important; }

/* Address book chips */
.addr-book-chips {
    display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; min-height: 0;
}
.addr-chip {
    background: var(--bg-subtle); border: 1px solid var(--border);
    border-radius: var(--r-full); padding: 2px 10px;
    font: inherit; font-size: .72rem; font-weight: 600; color: var(--text-3);
    cursor: pointer; transition: all .1s; white-space: nowrap;
}
.addr-chip:hover { background: var(--accent-light,#ffe4f0); border-color: var(--accent,#e90069); color: var(--accent,#e90069); }

/* ──────── FEATURE #1 : New document dropdown ──────── */
.new-invoice-menu {
    position: relative;
}
.new-inv-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 360px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    z-index: 50;
    overflow: hidden;
    display: none;
}
.new-inv-dropdown.open { display: block; }
.new-inv-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--c-text);
    border-bottom: 1px solid var(--c-border);
    transition: background .12s;
}
.new-inv-option:last-child { border-bottom: 0; }
.new-inv-option:hover { background: var(--c-bg); }
.new-inv-option-icon {
    flex: 0 0 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--c-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-3);
}
.new-inv-option:first-child .new-inv-option-icon {
    background: #dcfce7;
    color: #15803d;
}
.new-inv-option:last-child .new-inv-option-icon {
    background: #fef3c7;
    color: #92400e;
}
.new-inv-option strong { display: block; font-size: .88rem; margin-bottom: 2px; }
.new-inv-option small  { display: block; font-size: .74rem; color: var(--c-text-3); line-height: 1.4; }

/* ──────── FEATURE #8 : Per-client custom rate input ──────── */
.client-custom-rate {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    margin-right: 4px;
}
.client-custom-rate .client-rate-input {
    border: 0;
    background: transparent;
    width: 56px;
    font-size: .82rem;
    color: var(--c-text);
    padding: 2px 0;
    text-align: right;
    outline: none;
    -moz-appearance: textfield;
}
.client-custom-rate .client-rate-input::-webkit-outer-spin-button,
.client-custom-rate .client-rate-input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
.client-custom-rate .rate-unit {
    font-size: .72rem;
    color: var(--c-text-3);
    font-weight: 500;
    user-select: none;
}

/* ──────── FEATURE #7 : Extras section ──────── */
.extras-section .input-base {
    padding: 8px 11px;
    font-size: .82rem;
}
.extra-row .btn-icon-danger {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ──────── Address suggest badges (villes / carnet) ──────── */
.addr-suggest-badge {
    display: inline-block;
    font-size: .62rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.addr-badge-city { background: #dbeafe; color: #1d4ed8; }
.addr-badge-book { background: #fef3c7; color: #92400e; }

/* ════════════════════════════════════════════════════════
   COMMERCIAL MODULE — Prospects, RDV, Agenda, To-do
   ════════════════════════════════════════════════════════ */

/* ── Filters bar (prospects + appointments) ─────────────── */
.prospects-filters {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin: 18px 0 20px; flex-wrap: wrap;
}
.prospects-tabs {
    display: flex; gap: 4px; background: #f1f5f9; padding: 4px;
    border-radius: 10px;
}
.prospects-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; font-size: .82rem; font-weight: 500;
    color: var(--c-text-2); text-decoration: none;
    border-radius: 7px; transition: all .12s;
}
.prospects-tab:hover { color: var(--c-text); }
.prospects-tab.active {
    background: #fff; color: var(--c-text); font-weight: 600;
    box-shadow: 0 1px 3px rgba(15,23,42,.08);
}
.prospects-tab-count {
    background: rgba(15,23,42,.08); color: var(--c-text-2);
    padding: 1px 7px; border-radius: 10px; font-size: .7rem; font-weight: 600;
}
.prospects-tab.active .prospects-tab-count {
    background: #fde4ee; color: #e90069;
}

.prospects-search {
    position: relative; display: flex; align-items: center;
    background: #fff; border: 1px solid var(--c-border); border-radius: 9px;
    padding: 0 10px; gap: 6px; min-width: 240px;
}
.prospects-search:focus-within { border-color: #e90069; }
.prospects-search svg { color: var(--c-text-3); flex-shrink: 0; }
.prospects-search input {
    border: 0; outline: none; background: transparent;
    padding: 9px 4px; font-size: .85rem; flex: 1; font-family: inherit;
    color: var(--c-text);
}
.prospects-search-clear {
    color: var(--c-text-3); cursor: pointer;
    padding: 4px; display: flex; text-decoration: none;
}
.prospects-search-clear:hover { color: var(--c-text); }

/* ── Prospect cards ──────────────────────────────────────── */
.prospects-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.prospect-card {
    display: block; padding: 16px 18px;
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 12px; text-decoration: none; color: inherit;
    transition: all .15s ease;
    position: relative;
}
.prospect-card:hover {
    border-color: #e90069;
    box-shadow: 0 4px 16px rgba(233,0,105,.08);
    transform: translateY(-1px);
}
.prospect-card-closed, .prospect-card-abandoned {
    background: #f9fafb; opacity: .72;
}
.prospect-card-closed:hover, .prospect-card-abandoned:hover {
    opacity: 1; transform: none;
}
.prospect-card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 8px; margin-bottom: 10px;
}
.prospect-card-name {
    margin: 0; font-size: .98rem; font-weight: 600; color: var(--c-text);
    line-height: 1.3;
}
.prospect-card-line {
    display: flex; align-items: center; gap: 6px;
    font-size: .8rem; color: var(--c-text-2);
    margin: 3px 0;
}
.prospect-card-line svg { color: var(--c-text-3); flex-shrink: 0; }
.prospect-card-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    font-size: .72rem; color: var(--c-text-3);
}
.prospect-card-source {
    background: #f1f5f9; padding: 2px 8px; border-radius: 10px;
    font-weight: 500; color: var(--c-text-2);
}

/* ── Action badge on prospect card ── */
.prospect-card-action-badge {
    position: absolute;
    top: 12px; right: 12px;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.prospect-card-action-badge svg { width: 12px; height: 12px; }
.prospect-card-action-badge.action-overdue  { background: #dc2626; animation: actionPulse 2s ease infinite; }
.prospect-card-action-badge.action-today    { background: #f59e0b; }
.prospect-card-action-badge.action-upcoming { background: #6b7280; }
@keyframes actionPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); }
    50%      { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
.prospect-card:has(.prospect-card-action-badge) .prospect-card-header {
    padding-right: 28px;
}

/* ── Wrapper + duplicate-button overlay on prospect card ── */
.prospect-card-wrap {
    position: relative;
    display: block;
}
.prospect-card-dup-form {
    position: absolute;
    bottom: 10px; right: 10px;
    margin: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity .15s ease;
}
.prospect-card-wrap:hover .prospect-card-dup-form,
.prospect-card-wrap:focus-within .prospect-card-dup-form {
    opacity: 1;
}
.prospect-card-dup-btn {
    background: #fff; border: 1px solid var(--c-border);
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--c-text-2);
    padding: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    transition: all .15s ease;
}
.prospect-card-dup-btn:hover {
    background: var(--accent, #d97706);
    color: #fff;
    border-color: var(--accent, #d97706);
    transform: translateY(-1px);
}

/* ── State pills ─────────────────────────────────────────── */
.prospect-state-pill {
    display: inline-block; font-size: .68rem; font-weight: 600;
    padding: 3px 9px; border-radius: 10px; letter-spacing: .02em;
    text-transform: uppercase; white-space: nowrap;
}
.prospect-state-open      { background: #dcfce7; color: #15803d; }
.prospect-state-closed    { background: #e5e7eb; color: #6b7280; }
.prospect-state-abandoned { background: #fee2e2; color: #991b1b; }

/* ── Prospect form / sections ───────────────────────────── */
.prospect-form { margin: 20px 0 30px; }
.prospect-section {
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 12px; padding: 22px 26px; margin: 16px 0;
}
/* Collapsible section: title is clickable, chevron rotates */
.prospect-section.collapsible > .prospect-section-title {
    cursor: pointer;
    user-select: none;
    margin: 0;
    /* Keep default flex-start so existing content (icon, "optional" span) groups left */
}
.prospect-section.collapsible > .prospect-section-title:hover {
    color: var(--accent, #d97706);
}
.prospect-section.collapsible > .prospect-section-title .section-chevron {
    width: 14px; height: 14px;
    color: var(--c-text-3);
    transition: transform .2s ease;
    flex-shrink: 0;
    margin-left: auto;       /* pushes chevron to the far right regardless of what's before */
}
.prospect-section.collapsible:hover > .prospect-section-title .section-chevron {
    color: var(--accent, #d97706);
}
.prospect-section.collapsible.collapsed > .prospect-section-title .section-chevron {
    transform: rotate(-90deg);
}
.prospect-section.collapsible > .section-body {
    overflow: hidden;
    transition: max-height .25s ease, opacity .2s ease, margin-top .2s ease;
    max-height: 4000px;
    opacity: 1;
    margin-top: 12px;
}
.prospect-section.collapsible.collapsed > .section-body {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}
/* Top blocks: action + comments side by side */
.prospect-top-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}
.prospect-top-blocks .prospect-section.prospect-top-block {
    margin: 0;
}
@media (max-width: 880px) {
    .prospect-top-blocks { grid-template-columns: 1fr; }
}
.prospect-section-title {
    font-size: 1rem; font-weight: 700; color: var(--c-text);
    margin: 0 0 4px; display: flex; align-items: center; gap: 8px;
}
.prospect-section-count {
    background: #f1f5f9; color: var(--c-text-2);
    padding: 1px 8px; border-radius: 10px; font-size: .72rem; font-weight: 600;
}
.prospect-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 14px;
}
@media (max-width: 600px) {
    .prospect-grid { grid-template-columns: 1fr; }
}
.prospect-field { display: flex; flex-direction: column; gap: 5px; }
.prospect-field-wide { grid-column: 1 / -1; }
.prospect-field label {
    font-size: .75rem; font-weight: 600; color: var(--c-text-2);
}
.prospect-field .optional {
    color: var(--c-text-3); font-weight: 400; font-style: italic;
}
.prospect-field input,
.prospect-field select,
.prospect-field textarea {
    padding: 9px 11px; border: 1.5px solid var(--c-border);
    border-radius: 8px; font-size: .88rem; font-family: inherit;
    background: #fff; color: var(--c-text);
    transition: border-color .12s;
}
.prospect-field input:focus,
.prospect-field select:focus,
.prospect-field textarea:focus {
    outline: none; border-color: var(--accent, #d97706);
    box-shadow: var(--accent-glow, 0 0 0 3px rgba(217, 119, 6, 0.18));
}
.prospect-field textarea { resize: vertical; min-height: 70px; }

/* Comments add form: full-width textarea with the same look as form fields */
.comments-add-form textarea {
    width: 100%;
    display: block;
    padding: 9px 11px;
    border: 1.5px solid var(--c-border);
    border-radius: 8px;
    font-size: .88rem;
    font-family: inherit;
    background: #fff;
    color: var(--c-text);
    resize: vertical;
    min-height: 70px;
    box-sizing: border-box;
    transition: border-color .12s, box-shadow .12s;
}
.comments-add-form textarea:focus {
    outline: none;
    border-color: var(--accent, #d97706);
    box-shadow: var(--accent-glow, 0 0 0 3px rgba(217, 119, 6, 0.18));
}

.prospect-form-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin: 18px 0;
}

/* ── Language pills ──────────────────────────────────────── */
.lang-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-pill {
    display: inline-flex; align-items: center;
    padding: 5px 11px; border-radius: 14px;
    background: #f1f5f9; color: var(--c-text-2);
    font-size: .78rem; font-weight: 500;
    cursor: pointer; transition: all .12s;
    border: 1.5px solid transparent;
    user-select: none;
}
.lang-pill input { display: none; }
.lang-pill:hover { background: #e2e8f0; }
.lang-pill.on {
    background: #fde4ee; color: #e90069; border-color: #e90069;
}

/* ── Financing rows ──────────────────────────────────────── */
.financing-row {
    display: grid; grid-template-columns: 1fr 1fr 1fr 40px;
    gap: 10px; align-items: end;
    padding: 10px 0;
    border-bottom: 1px dashed #f1f5f9;
}
.financing-row:last-of-type { border-bottom: 0; }
.financing-row .fin-remove { align-self: end; margin-bottom: 5px; }
@media (max-width: 600px) {
    .financing-row { grid-template-columns: 1fr 1fr; }
    .financing-row .prospect-field:nth-child(3) { grid-column: 1 / -1; }
    .financing-row .fin-remove { grid-column: 1 / -1; justify-self: end; }
}

/* ── Action en cours ─────────────────────────────────────── */
.action-current {
    background: #fff7ed; border: 1px solid #fed7aa;
    border-radius: 10px; padding: 14px 16px;
    margin-bottom: 14px;
}
.action-text { color: var(--c-text); font-size: .9rem; margin-bottom: 4px; }
.action-due { color: #9a3412; font-size: .8rem; font-weight: 500; }

.action-set-form { padding-top: 6px; }

/* ── Comments ────────────────────────────────────────────── */
.comments-block {
    background: #fafbff; border-radius: 8px;
    padding: 14px 16px; margin-bottom: 14px;
    font-family: inherit; font-size: .85rem; color: var(--c-text);
    white-space: pre-wrap; word-wrap: break-word;
    max-height: 400px; overflow-y: auto;
    border: 1px solid #f1f5f9;
}

/* ── Journal ─────────────────────────────────────────────── */
.journal-list { list-style: none; padding: 0; margin: 0; }
.journal-item {
    display: flex; gap: 16px; padding: 10px 0;
    border-bottom: 1px solid #f8fafc;
    font-size: .82rem;
}
.journal-item:last-child { border-bottom: 0; }
.journal-time {
    flex-shrink: 0; width: 110px; color: var(--c-text-3); font-size: .76rem;
    font-variant-numeric: tabular-nums;
}
.journal-content { flex: 1; color: var(--c-text-2); }
.journal-content strong { color: var(--c-text); }
.journal-details { color: var(--c-text-2); }
.journal-user {
    color: var(--c-text-3); font-style: italic; margin-left: 6px;
    font-size: .76rem;
}

/* Color-code event types */
.journal-created      strong { color: #15803d; }
.journal-state_changed strong { color: #d97706; }
.journal-action_set   strong { color: #1d4ed8; }
.journal-action_completed strong { color: #15803d; }
.journal-mail_sent    strong { color: #7c3aed; }
.journal-appointment_booked strong { color: #15803d; }
.journal-appointment_cancelled strong { color: #dc2626; }

/* ── Availability page ───────────────────────────────────── */
.avail-section {
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 12px; padding: 22px 26px; margin: 16px 0;
}
.avail-section-title {
    font-size: 1rem; font-weight: 700; color: var(--c-text);
    margin: 0 0 6px; display: flex; align-items: center; gap: 8px;
}
.avail-section-hint {
    margin: 0 0 16px; color: var(--c-text-2); font-size: .82rem; line-height: 1.5;
}
.avail-section-subtitle {
    margin: 22px 0 10px; font-size: .85rem; font-weight: 600;
    color: var(--c-text-2); text-transform: uppercase; letter-spacing: .03em;
}

.weekday-list {
    border: 1px solid var(--c-border); border-radius: 10px; overflow: hidden;
}
.weekday-row {
    display: grid; grid-template-columns: 140px 1fr;
    gap: 14px; padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9; align-items: start;
}
.weekday-row:last-child { border-bottom: 0; }
.weekday-row[data-on="0"] { background: #fafbff; opacity: .65; }
.weekday-toggle {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    font-size: .9rem; font-weight: 500; color: var(--c-text);
}
.weekday-toggle input { accent-color: #e90069; cursor: pointer; }
.weekday-ranges {
    display: flex; flex-direction: column; gap: 6px;
}
.time-range {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .85rem;
}
.time-range input[type="time"] {
    padding: 7px 9px; border: 1.5px solid var(--c-border);
    border-radius: 7px; font-family: inherit; font-size: .85rem;
    color: var(--c-text);
}
.time-range input[type="time"]:focus { outline: none; border-color: #e90069; }
.btn-add-range {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
    background: transparent; border: 1px dashed var(--c-border);
    color: var(--c-text-2); font-size: .78rem; padding: 6px 12px;
    border-radius: 7px; cursor: pointer; font-family: inherit;
    transition: all .12s;
}
.btn-add-range:hover { border-color: #e90069; color: #e90069; }

.override-form {
    padding: 16px; background: #fafbff;
    border-radius: 10px; margin-bottom: 14px;
}
.overrides-list { list-style: none; padding: 0; margin: 0; }
.override-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px; background: #fff;
    border: 1px solid var(--c-border); border-radius: 8px;
    margin-bottom: 6px;
}
.override-date strong { font-size: .88rem; color: var(--c-text); text-transform: capitalize; }
.override-date small {
    display: block; font-size: .76rem; color: var(--c-text-2); margin-top: 2px;
}

/* ── Appointments list ───────────────────────────────────── */
.appointments-list { display: flex; flex-direction: column; gap: 24px; }
.appointment-group-date {
    display: flex; align-items: baseline; gap: 10px;
    margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 2px solid var(--c-border);
}
.apt-date-main {
    font-size: .9rem; font-weight: 700; color: var(--c-text); text-transform: capitalize;
}
.apt-date-relative {
    font-size: .75rem; color: #e90069; font-weight: 600;
    background: #fde4ee; padding: 2px 8px; border-radius: 10px;
}
.appointment-card {
    display: grid; grid-template-columns: 80px 1fr auto;
    gap: 16px; align-items: center;
    padding: 14px 18px; background: #fff;
    border: 1px solid var(--c-border); border-radius: 10px;
    margin-bottom: 8px;
}
.appointment-card-cancelled { opacity: .55; }
.appointment-card-done { background: #f0fdf4; border-color: #bbf7d0; }
.appointment-time {
    text-align: center; padding: 6px 0;
    border-right: 1px solid #f1f5f9;
}
.appointment-time strong {
    display: block; font-size: 1.05rem; font-weight: 700; color: var(--c-text);
}
.appointment-time span {
    font-size: .75rem; color: var(--c-text-3);
}
.appointment-info {}
.appointment-name {
    font-size: .92rem; font-weight: 600; color: var(--c-text);
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.appointment-company {
    color: var(--c-text-3); font-weight: 400; font-size: .8rem;
}
.appointment-contact {
    display: flex; gap: 14px; flex-wrap: wrap;
    margin-top: 6px; font-size: .78rem; color: var(--c-text-2);
}
.appointment-contact span { display: inline-flex; align-items: center; gap: 4px; }
.appointment-actions { display: flex; gap: 4px; }
.apt-status-pill {
    display: inline-block; font-size: .68rem; padding: 2px 8px;
    border-radius: 8px; margin-top: 6px; font-weight: 600;
}
.apt-status-cancelled { background: #fee2e2; color: #991b1b; }
.apt-status-done { background: #dcfce7; color: #15803d; }

/* ── Back link ───────────────────────────────────────────── */
.back-link {
    display: inline-block; margin-bottom: 12px;
    color: var(--c-text-2); text-decoration: none;
    font-size: .82rem; font-weight: 500;
    transition: color .12s;
}
.back-link:hover { color: #e90069; }


/* ════════════════════════════════════════════════════════
   AGENDA — Month / Week / Day views
   ════════════════════════════════════════════════════════ */

.agenda-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.agenda-nav { display: flex; align-items: center; gap: 10px; }
.agenda-today {
    font-size: .82rem; padding: 7px 14px;
}
.agenda-nav-btn {
    width: 30px; height: 30px; border-radius: 7px;
    background: #fff; border: 1px solid var(--c-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--c-text-2); cursor: pointer; transition: all .12s;
}
.agenda-nav-btn:hover { background: #f8fafc; color: var(--c-text); }
.agenda-current-label {
    font-size: 1.05rem; font-weight: 700; color: var(--c-text);
    margin-left: 8px; text-transform: capitalize;
}
.agenda-view-switch {
    display: flex; gap: 2px; background: #f1f5f9; padding: 3px;
    border-radius: 8px;
}
.agenda-view-btn {
    background: transparent; border: 0; padding: 6px 14px;
    font-size: .8rem; font-weight: 500; color: var(--c-text-2);
    border-radius: 6px; cursor: pointer; transition: all .12s;
    font-family: inherit;
}
.agenda-view-btn:hover { color: var(--c-text); }
.agenda-view-btn.active {
    background: #fff; color: var(--c-text); font-weight: 600;
    box-shadow: 0 1px 2px rgba(15,23,42,.08);
}

.agenda-container { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden; }
.agenda-loading { padding: 40px; text-align: center; color: var(--c-text-3); }

/* Month view */
.agenda-month-header {
    display: grid; grid-template-columns: repeat(7, 1fr);
    background: #fafbff; border-bottom: 1px solid var(--c-border);
}
.agenda-dow {
    text-align: center; padding: 10px 0;
    font-size: .72rem; font-weight: 600; color: var(--c-text-2);
    text-transform: uppercase; letter-spacing: .04em;
}
.agenda-month-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(90px, 1fr);
}
.agenda-day {
    border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9;
    padding: 6px 8px; cursor: pointer; transition: background .1s;
    display: flex; flex-direction: column; gap: 3px; min-height: 90px;
}
.agenda-day:hover { background: #fafbff; }
.agenda-day.off-month { background: #fafbff; }
.agenda-day.off-month .agenda-day-num { color: var(--c-text-3); }
.agenda-day.today .agenda-day-num {
    background: #e90069; color: #fff;
    width: 22px; height: 22px; line-height: 22px;
    border-radius: 50%; text-align: center;
}
.agenda-day-num { font-size: .8rem; font-weight: 600; color: var(--c-text); }
.agenda-day-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.agenda-evt {
    font-size: .7rem; padding: 2px 6px; border-radius: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    cursor: pointer; font-weight: 500;
}
.agenda-evt:hover { filter: brightness(.92); }
.agenda-evt-more {
    font-size: .68rem; color: var(--c-text-3); padding: 0 6px;
    cursor: pointer;
}

/* Week view */
.agenda-week { position: relative; }
.agenda-week-header {
    display: grid; grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid var(--c-border); background: #fafbff;
}
.agenda-week-day { text-align: center; padding: 10px 4px; border-left: 1px solid #f1f5f9; }
.agenda-week-day.today .agenda-week-day-num {
    background: #e90069; color: #fff;
    width: 26px; height: 26px; line-height: 26px;
    border-radius: 50%; display: inline-block;
}
.agenda-week-day-name { font-size: .72rem; color: var(--c-text-2); text-transform: uppercase; letter-spacing: .04em; }
.agenda-week-day-num  { font-size: 1.1rem; font-weight: 700; color: var(--c-text); margin-top: 2px; }
.agenda-week-grid { position: relative; }
.agenda-week-row {
    display: grid; grid-template-columns: 60px repeat(7, 1fr);
    height: 48px; border-bottom: 1px solid #f8fafc;
}
.agenda-week-hours {
    text-align: right; padding: 2px 8px; font-size: .7rem;
    color: var(--c-text-3); border-right: 1px solid #f1f5f9;
}
.agenda-week-cell { border-left: 1px solid #f8fafc; cursor: pointer; }
.agenda-week-cell:hover { background: #fafbff; }
.agenda-week-event {
    position: absolute; padding: 4px 8px; border-radius: 5px;
    font-size: .72rem; line-height: 1.2; overflow: hidden;
    cursor: pointer; box-sizing: border-box;
}
.agenda-week-event strong { display: block; font-weight: 600; }
.agenda-week-event small { display: block; font-size: .66rem; opacity: .8; }

/* Day view */
.agenda-day-view { position: relative; padding: 0; }
.agenda-day-row {
    display: grid; grid-template-columns: 70px 1fr;
    height: 48px; border-bottom: 1px solid #f8fafc;
}
.agenda-day-hour {
    text-align: right; padding: 2px 12px; font-size: .72rem;
    color: var(--c-text-3); border-right: 1px solid #f1f5f9;
}
.agenda-day-slot { cursor: pointer; transition: background .1s; }
.agenda-day-slot:hover { background: #fafbff; }
.agenda-day-event {
    position: absolute; left: 80px; right: 16px;
    padding: 8px 12px; border-radius: 6px;
    cursor: pointer; box-sizing: border-box;
    font-size: .8rem;
}
.agenda-day-event strong { display: block; font-weight: 600; font-size: .88rem; }
.agenda-day-event small { display: block; font-size: .72rem; opacity: .75; margin-top: 2px; }
.agenda-day-event p { margin: 4px 0 0; font-size: .78rem; opacity: .85; }

/* ════════════════════════════════════════════════════════
   EVENT / TODO MODAL
   ════════════════════════════════════════════════════════ */

.event-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.5); z-index: 99970;
    display: none; align-items: center; justify-content: center;
    padding: 20px;
}
.event-modal-overlay.active { display: flex; }
.event-modal {
    background: #fff; border-radius: 14px;
    width: 480px; max-width: 100%;
    box-shadow: 0 24px 64px rgba(15,23,42,.3);
    max-height: 90vh; overflow-y: auto;
}
.event-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px; border-bottom: 1px solid var(--c-border);
}
.event-modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--c-text); }
.event-modal form { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.event-modal-actions {
    display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px;
    flex-wrap: wrap;
}
.event-modal-actions .btn-secondary:first-child { margin-right: auto; color: #dc2626; }

.color-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatch {
    width: 28px; height: 28px; border-radius: 50%;
    cursor: pointer; position: relative; transition: transform .1s;
    border: 2px solid transparent;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.color-swatch:has(input:checked) {
    border-color: var(--c-text); box-shadow: 0 0 0 2px #fff inset;
}

/* ════════════════════════════════════════════════════════
   TODO LIST
   ════════════════════════════════════════════════════════ */

.todo-toggle-done {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .8rem; color: var(--c-text-2); padding: 7px 12px;
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 8px; cursor: pointer;
}
.todo-toggle-done input { accent-color: #e90069; }

.todo-quick-add {
    display: flex; gap: 8px; margin: 14px 0;
    background: #fff; padding: 8px; border-radius: 10px;
    border: 1px solid var(--c-border);
    align-items: center; flex-wrap: wrap;
}
.todo-quick-add input[type="text"] {
    flex: 1; min-width: 200px; border: 0; outline: none;
    padding: 8px 10px; font-size: .9rem; font-family: inherit; color: var(--c-text);
}
.todo-quick-add input[type="date"] {
    border: 1px solid var(--c-border); border-radius: 7px;
    padding: 7px 9px; font-size: .82rem; font-family: inherit; color: var(--c-text);
}

.todo-section { margin-bottom: 24px; }
.todo-section-title {
    font-size: .82rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; margin: 0 0 10px;
    display: flex; align-items: center; gap: 8px;
}
.todo-section-count {
    background: rgba(15,23,42,.08); color: var(--c-text-2);
    padding: 1px 8px; border-radius: 10px;
    font-size: .68rem; font-weight: 600;
}
.todo-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.todo-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 11px 14px; background: #fff;
    border: 1px solid var(--c-border); border-radius: 10px;
    transition: all .12s; border-left-width: 3px;
}
.todo-item:hover { box-shadow: 0 2px 8px rgba(15,23,42,.05); }
.todo-pri-low    { border-left-color: #cbd5e1; }
.todo-pri-normal { border-left-color: #3b82f6; }
.todo-pri-high   { border-left-color: #e90069; }
.todo-done { opacity: .5; }
.todo-done .todo-title { text-decoration: line-through; }

.todo-check {
    margin-top: 3px; width: 17px; height: 17px;
    accent-color: #e90069; cursor: pointer;
    flex-shrink: 0;
}
.todo-content { flex: 1; cursor: pointer; min-width: 0; }
.todo-title {
    font-size: .9rem; font-weight: 500; color: var(--c-text);
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.todo-desc {
    font-size: .78rem; color: var(--c-text-2); margin-top: 3px;
    line-height: 1.4;
}
.todo-due {
    flex-shrink: 0; font-size: .74rem; color: var(--c-text-2);
    font-weight: 600; padding: 3px 9px;
    background: #f1f5f9; border-radius: 12px;
    align-self: center;
}
.todo-badge {
    font-size: .62rem; font-weight: 600; padding: 1px 7px;
    border-radius: 8px; text-transform: uppercase; letter-spacing: .02em;
}
.todo-badge-appt    { background: #fde4ee; color: #e90069; }
.todo-badge-prospect{ background: #dbeafe; color: #1d4ed8; cursor: pointer; }
.todo-badge-prospect:hover { background: #bfdbfe; }


/* Todo: delete icon + bulk delete button */
.todo-section-title {
    display: flex; align-items: center; gap: 8px;
}
.todo-bulk-delete {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 5px;
    background: transparent; border: 1px solid var(--c-border);
    color: var(--c-text-2); font-size: .72rem; font-weight: 500;
    padding: 4px 10px; border-radius: 7px;
    cursor: pointer; transition: all .12s; font-family: inherit;
    text-transform: none; letter-spacing: 0;
}
.todo-bulk-delete:hover {
    border-color: #dc2626; color: #dc2626; background: #fff5f5;
}
.todo-delete-icon {
    flex-shrink: 0; width: 26px; height: 26px;
    background: transparent; border: 0; border-radius: 6px;
    color: #cbd5e1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .12s; opacity: 0;
}
.todo-item:hover .todo-delete-icon { opacity: 1; }
.todo-delete-icon:hover { background: #fef2f2; color: #dc2626; }
.todo-item.todo-done .todo-delete-icon { opacity: .7; }

/* ════════════════════════════════════════════════════════
   PROSPECT MAIL SECTION
   ════════════════════════════════════════════════════════ */
.mail-send-form { display: flex; flex-direction: column; gap: 6px; }
.mail-preview {
    margin: 0; padding: 14px 16px;
    background: #fafbff; border: 1px solid var(--c-border);
    border-radius: 8px; max-height: 320px; overflow-y: auto;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: .78rem; line-height: 1.55; color: var(--c-text);
    white-space: pre-wrap; word-wrap: break-word;
}
.mail-subheading {
    margin: 22px 0 10px; font-size: .82rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--c-text-2);
}
.mail-reminder-zone { padding: 6px 0; }
.reminder-active {
    display: flex; align-items: center; justify-content: space-between;
    background: #f0fdf4; border: 1px solid #bbf7d0;
    padding: 12px 16px; border-radius: 10px; gap: 12px; flex-wrap: wrap;
}
.reminder-active strong { color: #15803d; font-size: .88rem; }
.reminder-active small { color: var(--c-text-2); font-size: .78rem; }
.reminder-form {
    background: #fafbff; border: 1px solid var(--c-border);
    border-radius: 10px; padding: 12px 14px;
}

.mail-history { list-style: none; padding: 0; margin: 0; }
.mail-history-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 0; border-bottom: 1px solid #f8fafc;
    gap: 12px; flex-wrap: wrap;
}
.mail-history-item:last-child { border-bottom: 0; }
.mail-history-item strong { display: block; font-size: .85rem; color: var(--c-text); font-weight: 600; }
.mail-history-item small { display: block; font-size: .74rem; color: var(--c-text-3); margin-top: 2px; }
.mail-status-pill {
    flex-shrink: 0; font-size: .7rem; font-weight: 600;
    padding: 3px 10px; border-radius: 10px;
}
.mail-status-pill-sent      { background: #dcfce7; color: #15803d; }
.mail-status-pill-scheduled { background: #fef3c7; color: #92400e; }
.mail-status-pill-cancelled { background: #e5e7eb; color: #6b7280; }
.mail-status-pill-failed    { background: #fee2e2; color: #991b1b; }

/* Mail preview is now HTML, not plain text */
.mail-preview {
    margin: 0; padding: 16px 18px;
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 8px; max-height: 380px; overflow-y: auto;
    font-family: inherit; font-size: .88rem; line-height: 1.55;
    color: var(--c-text);
}
.mail-preview p { margin: 0 0 10px; }
.mail-preview p:last-child { margin-bottom: 0; }
.mail-preview a { color: var(--accent, #d97706); text-decoration: underline; }
.mail-preview-subject {
    padding-bottom: 10px; margin-bottom: 12px;
    border-bottom: 1px solid var(--c-border);
    font-size: .78rem; color: var(--c-text-2);
}
.mail-preview-body { font-size: .9rem; }

/* ════════════════════════════════════════════════════════
   TODAY'S ACTIONS BANNER (dashboard)
   ════════════════════════════════════════════════════════ */
.today-actions-banner {
    background: linear-gradient(135deg, #fdf2f8 0%, #fff 60%);
    border: 1px solid #fce7f3;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 20px;
    animation: fadeUp .35s ease;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.today-actions-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.today-actions-title {
    margin: 0; font-size: .95rem; font-weight: 700; color: var(--c-text);
    display: flex; align-items: center; gap: 8px;
}
.today-actions-count {
    background: #e90069; color: #fff;
    padding: 1px 8px; border-radius: 10px;
    font-size: .7rem; font-weight: 700;
}
.today-actions-list { display: flex; flex-direction: column; gap: 6px; }
.today-action-item {
    display: flex; align-items: center; gap: 14px;
    padding: 11px 14px; background: #fff;
    border: 1px solid #f1f5f9; border-radius: 10px;
    text-decoration: none; color: inherit;
    transition: all .15s;
    border-left: 3px solid transparent;
}
.today-action-item:hover {
    box-shadow: 0 4px 14px rgba(15,23,42,.06);
    transform: translateX(2px);
    border-left-color: #e90069;
}
.today-action-appointment { border-left-color: #e90069; }
.today-action-event       { border-left-color: #3b82f6; }
.today-action-todo        { border-left-color: #10b981; }
.today-action-item.overdue { border-left-color: #dc2626; background: #fef2f2; }
.today-action-item.done-animate {
    opacity: .4; text-decoration: line-through;
    transform: translateX(10px); transition: all .35s;
}

.today-action-icon {
    font-size: 1.3rem; line-height: 1;
    width: 36px; height: 36px; border-radius: 50%;
    background: #fafbff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.today-action-info { flex: 1; min-width: 0; }
.today-action-title {
    font-size: .9rem; font-weight: 600; color: var(--c-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.today-action-sub {
    font-size: .76rem; color: var(--c-text-3); margin-top: 2px;
}
.today-action-time {
    flex-shrink: 0; font-size: .76rem; color: var(--c-text-2);
    font-weight: 600;
    background: #f1f5f9; padding: 3px 9px; border-radius: 10px;
    white-space: nowrap;
}
.today-action-item.overdue .today-action-time {
    background: #fee2e2; color: #991b1b;
}
.today-action-done {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
    background: transparent; border: 1.5px solid #cbd5e1;
    color: #cbd5e1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.today-action-done:hover {
    background: #10b981; border-color: #10b981; color: #fff;
    transform: scale(1.1);
}

/* ════════════════════════════════════════════════════════
   FILES PAGE (admin) — Card grid
   ════════════════════════════════════════════════════════ */

.files-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px; margin: 16px 0 18px;
}
.files-stat-card {
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 10px; padding: 12px 14px;
}
.files-stat-label { font-size: .72rem; color: var(--c-text-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.files-stat-value { font-size: 1.4rem; font-weight: 700; color: var(--c-text); margin-top: 4px; }

.files-filters {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.files-tabs {
    display: flex; gap: 4px; background: #f1f5f9; padding: 4px; border-radius: 10px;
}
.files-tab {
    background: transparent; border: 0;
    padding: 7px 14px; font-size: .82rem; font-weight: 500;
    color: var(--c-text-2); border-radius: 7px;
    cursor: pointer; transition: all .12s;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
}
.files-tab:hover { color: var(--c-text); }
.files-tab.active {
    background: #fff; color: var(--c-text); font-weight: 600;
    box-shadow: 0 1px 3px rgba(15,23,42,.08);
}
.files-tab-count {
    background: rgba(15,23,42,.08); padding: 1px 7px; border-radius: 10px;
    font-size: .7rem; font-weight: 600;
}
.files-tab.active .files-tab-count { background: #fde4ee; color: #e90069; }

.files-search {
    position: relative; display: flex; align-items: center;
    background: #fff; border: 1px solid var(--c-border); border-radius: 9px;
    padding: 0 10px; gap: 6px; min-width: 240px;
}
.files-search:focus-within { border-color: #e90069; }
.files-search svg { color: var(--c-text-3); flex-shrink: 0; }
.files-search input {
    border: 0; outline: none; background: transparent;
    padding: 9px 4px; font-size: .85rem; flex: 1; font-family: inherit;
    color: var(--c-text);
}

.files-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.file-card {
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 12px; overflow: hidden;
    display: flex; flex-direction: column;
    transition: all .15s;
}
.file-card:hover {
    box-shadow: 0 8px 24px rgba(15,23,42,.08);
    transform: translateY(-2px);
    border-color: #e90069;
}
.file-card-thumb {
    height: 110px;
    display: flex; align-items: center; justify-content: center;
}
.file-card-thumb.file-type-video    { background: linear-gradient(135deg, #fde4ee, #fbcfe8); color: #e90069; }
.file-card-thumb.file-type-image    { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.file-card-thumb.file-type-document { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #15803d; }

.file-card-body {
    padding: 14px 16px;
    flex: 1; display: flex; flex-direction: column; gap: 6px;
}
.file-card-title {
    margin: 0; font-size: .95rem; font-weight: 700; color: var(--c-text);
    line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-card-meta { font-size: .76rem; color: var(--c-text-3); display: flex; gap: 6px; }
.file-card-vis { margin-top: 2px; }
.file-vis-pill {
    display: inline-block; font-size: .7rem; font-weight: 600;
    padding: 2px 8px; border-radius: 10px;
}
.file-vis-public   { background: #fef3c7; color: #92400e; }
.file-vis-internal { background: #f1f5f9; color: #475569; }
.file-card-uploader { font-size: .72rem; color: var(--c-text-3); font-style: italic; }
.file-card-date     { font-size: .72rem; color: var(--c-text-3); }

.file-card-actions {
    display: flex; gap: 4px; padding: 0 12px 12px;
}
.file-action-btn {
    background: transparent; border: 1px solid var(--c-border);
    width: 32px; height: 32px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: var(--c-text-2); cursor: pointer; transition: all .12s;
    text-decoration: none;
    flex: 1;
}
.file-action-btn:hover {
    background: #fafbff; color: var(--c-text);
}
.file-action-view:hover { color: #1d4ed8; border-color: #1d4ed8; }
.file-action-copy:hover { color: #e90069; border-color: #e90069; }
.file-action-delete:hover { color: #dc2626; border-color: #dc2626; }

/* ════════════════════════════════════════════════════════
   SHARED AGENDA — owner picker
   ════════════════════════════════════════════════════════ */
.agenda-owner-picker { position: relative; }
.agenda-owner-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-white); border: 1.5px solid var(--border);
    padding: 8px 14px; border-radius: 10px;
    font-size: .86rem; font-weight: 600; color: var(--text);
    cursor: pointer; font-family: inherit;
    transition: all .15s;
}
.agenda-owner-btn:hover { border-color: var(--accent); }
.agenda-owner-btn svg:first-child { color: var(--accent); }

.agenda-owner-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    width: 290px; max-height: 380px;
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(15,23,42,.14);
    z-index: 200;
    display: none; flex-direction: column;
    overflow: hidden;
}
.agenda-owner-menu.open { display: flex; }
.agenda-owner-search {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-bottom: 1px solid var(--border-light);
}
.agenda-owner-search svg { color: var(--text-3); flex-shrink: 0; }
.agenda-owner-search input {
    border: 0; outline: none; background: transparent;
    font-size: .85rem; flex: 1; font-family: inherit; color: var(--text);
}
.agenda-owner-list { overflow-y: auto; padding: 6px; }
.agenda-owner-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 8px; cursor: pointer;
    font-size: .86rem; color: var(--text);
    transition: background .12s;
}
.agenda-owner-item:hover { background: var(--bg); }
.agenda-owner-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.agenda-owner-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700; flex-shrink: 0;
}
.agenda-owner-item.active .agenda-owner-avatar { background: var(--accent); color: #fff; }
.agenda-owner-role {
    margin-left: auto; font-size: .68rem; color: var(--text-3);
    font-weight: 500; background: var(--bg); padding: 2px 8px; border-radius: 10px;
}

.agenda-viewing-banner {
    display: flex; align-items: center; gap: 10px;
    background: var(--accent-soft); border: 1px solid var(--accent);
    border-radius: 10px; padding: 10px 16px; margin-bottom: 14px;
    font-size: .84rem; color: var(--accent-active);
}
.agenda-viewing-banner svg { color: var(--accent); flex-shrink: 0; }
.agenda-viewing-banner strong { color: var(--accent-active); }
.agenda-viewing-banner button {
    margin-left: auto; background: var(--accent); color: #fff;
    border: 0; padding: 6px 14px; border-radius: 8px;
    font-size: .78rem; font-weight: 600; cursor: pointer; font-family: inherit;
    white-space: nowrap;
}
.agenda-viewing-banner button:hover { background: var(--accent-hover); }

/* ════════════════════════════════════════════════════════
   PROSPECT — collective course + company contact
   ════════════════════════════════════════════════════════ */

/* Collective toggle switch */
.prospect-collective-toggle { margin-top: 16px; }
.prospect-collective-switch {
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px;
    transition: all .15s; background: var(--bg-white);
}
.prospect-collective-switch:hover { border-color: var(--accent); }
.prospect-collective-switch input { display: none; }
.prospect-collective-slider {
    position: relative; width: 42px; height: 24px; flex-shrink: 0;
    background: #cbd5e1; border-radius: 12px; transition: background .2s;
}
.prospect-collective-slider::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; background: #fff; border-radius: 50%;
    transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.prospect-collective-switch input:checked + .prospect-collective-slider { background: var(--accent); }
.prospect-collective-switch input:checked + .prospect-collective-slider::after { transform: translateX(18px); }
.prospect-collective-label { display: flex; flex-direction: column; }
.prospect-collective-label strong { font-size: .9rem; color: var(--text); }
.prospect-collective-label small { font-size: .76rem; color: var(--text-3); margin-top: 1px; }

/* Company contact collapsible */
.prospect-contact-block {
    margin-top: 14px; border: 1.5px solid var(--border); border-radius: 12px;
    padding: 12px 14px; background: var(--bg-subtle);
}
.prospect-contact-block summary {
    cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--text);
    list-style: none; display: flex; align-items: center; gap: 6px;
}
.prospect-contact-block summary::before {
    content: '▸'; color: var(--accent); transition: transform .15s; display: inline-block;
}
.prospect-contact-block[open] summary::before { transform: rotate(90deg); }
.prospect-contact-block summary::-webkit-details-marker { display: none; }

/* Collective card styling (distinct colour) */
.prospect-card-collective {
    border-color: #c084fc !important;
    background: linear-gradient(135deg, #faf5ff 0%, #fff 55%) !important;
}
.prospect-card-collective:hover { border-color: #a855f7 !important; }
.prospect-collective-tag {
    position: absolute; top: 12px; left: 12px;
    display: inline-flex; align-items: center; gap: 4px;
    background: #f3e8ff; color: #7e22ce;
    font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 10px;
    z-index: 2;
}
.prospect-card-collective .prospect-card-header { padding-top: 24px; }

/* Collective linking section */
.prospect-collective-section { border-left: 3px solid #a855f7; }
.collective-linked-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.collective-linked-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: #faf5ff; border: 1px solid #f3e8ff;
    border-radius: 10px;
}
.collective-linked-info { display: flex; flex-direction: column; gap: 1px; }
.collective-linked-name { font-size: .88rem; font-weight: 600; color: #7e22ce; text-decoration: none; }
.collective-linked-name:hover { text-decoration: underline; }
.collective-linked-company { font-size: .74rem; color: var(--text-3); }
.collective-unlink-btn {
    background: transparent; border: 1px solid #e9d5ff; color: #a855f7;
    width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all .12s;
}
.collective-unlink-btn:hover { background: #fee2e2; border-color: #dc2626; color: #dc2626; }
.collective-add-form { display: flex; gap: 8px; align-items: center; }
.collective-add-form select {
    flex: 1; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 9px;
    font-size: .85rem; font-family: inherit; background: var(--bg-white); color: var(--text);
}
.collective-add-form select:focus { outline: none; border-color: var(--accent); }

/* Collective group members on prospect card */
.prospect-collective-members {
    display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
    margin: 2px 0 8px;
}
.prospect-collective-members-label {
    font-size: .72rem; font-weight: 600; color: #7e22ce;
}
.prospect-collective-member-chip {
    display: inline-block; font-size: .72rem; font-weight: 500;
    background: #f3e8ff; color: #6b21a8;
    padding: 2px 8px; border-radius: 8px;
    white-space: nowrap;
}

/* ════════════════════════════════════════════════════════
   ACTIVITY LOG (Journal d'activité)
   ════════════════════════════════════════════════════════ */
.activity-filters { margin-bottom: 18px; }
.activity-cat-tabs {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.activity-cat-tab {
    padding: 6px 14px; border-radius: 20px; font-size: .82rem; font-weight: 600;
    color: var(--text-3); background: var(--bg-white); border: 1.5px solid var(--border);
    text-decoration: none; transition: all .15s;
}
.activity-cat-tab:hover { border-color: var(--accent); color: var(--accent); }
.activity-cat-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.activity-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-white); border: 1.5px solid var(--border);
    border-radius: 10px; padding: 4px 4px 4px 12px; max-width: 560px;
}
.activity-search svg { color: var(--text-3); flex-shrink: 0; }
.activity-search input {
    border: 0; outline: none; background: transparent; flex: 1;
    font-size: .86rem; font-family: inherit; color: var(--text); padding: 6px 0;
}
.activity-search-clear {
    color: var(--text-3); text-decoration: none; font-size: 1.2rem;
    width: 24px; text-align: center; line-height: 1;
}
.activity-search-clear:hover { color: var(--text); }

.activity-table-wrap {
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden; overflow-x: auto;
}
.activity-table { width: 100%; border-collapse: collapse; }
.activity-table thead th {
    text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em; color: var(--text-3);
    padding: 12px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.activity-table tbody td {
    padding: 11px 16px; border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}
.activity-table tbody tr:last-child td { border-bottom: 0; }
.activity-table tbody tr:hover { background: var(--bg-subtle); }
.activity-cat-badge {
    display: inline-block; font-size: .72rem; font-weight: 700;
    padding: 3px 10px; border-radius: 10px; white-space: nowrap;
}
.activity-pagination {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    margin-top: 18px;
}
.activity-page-info { font-size: .85rem; color: var(--text-3); }

/* ── Verification: zero-hours learners row ── */
.zero-hours-row td { padding: 0 16px 8px !important; background: transparent !important; }
.zero-hours-details {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px;
}
.zero-hours-details summary {
    cursor: pointer; display: flex; align-items: center; gap: 7px;
    font-size: .8rem; font-weight: 600; color: #b45309; list-style: none;
}
.zero-hours-details summary::-webkit-details-marker { display: none; }
.zero-hours-details summary svg { color: #d97706; flex-shrink: 0; }
.zero-hours-list { margin: 8px 0 2px; padding-left: 20px; }
.zero-hours-list li { font-size: .82rem; color: #78350f; margin: 3px 0; }
.zero-hours-meta { color: #a16207; font-size: .76rem; margin-left: 8px; }

/* ════════════════════════════════════════════════════════
   RESPONSIVE — sidebar backdrop + global mobile fixes
   ════════════════════════════════════════════════════════ */
.sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(13,17,23,.45);
    z-index: 99; opacity: 0; pointer-events: none;
    transition: opacity .25s;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

@media (max-width: 800px) {
    /* Make sure the sidebar floats above content + backdrop */
    .sidebar { z-index: 100; box-shadow: var(--sh-xl); }
    /* Tables and wide content scroll horizontally instead of breaking layout */
    .activity-table-wrap,
    .invoice-table-wrap,
    .table-scroll,
    .verification-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 0; }
    /* Stat / KPI grids collapse */
    .stats-grid,
    .kpi-grid,
    .prospects-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 640px) {
    .page-content { padding: 14px 12px; }
    .activity-cat-tabs { gap: 5px; }
    .activity-cat-tab { padding: 5px 11px; font-size: .78rem; }
    .activity-search { flex-wrap: wrap; }
    /* Activity table: hide the IP column on small screens to save room */
    .activity-table thead th:nth-child(5),
    .activity-table tbody td:nth-child(5) { display: none; }
    .activity-table thead th,
    .activity-table tbody td { padding: 9px 10px; }
    /* Prospect stats KPI cards full width */
    .prospects-grid { grid-template-columns: 1fr !important; }
    /* Topbar tightens */
    .topbar-title { display: none; }
}

@media (max-width: 480px) {
    .activity-table thead th:nth-child(3),
    .activity-table tbody td:nth-child(3) { display: none; } /* hide category col, keep date+user+action */
    .page-title-big { font-size: 1.05rem; }
}
