/* ═══════════════════════════════════════════════════════════
   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-flex; align-items: center; gap: 18px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 16px 24px;
    border-radius: 14px;
}
.login-logo-img { width: 160px; height: auto; display: block; }
.login-mascot {
    height: 92px; width: auto; display: block;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,.3));
}
.login-brand-name {
    font-size: 2.1rem; font-weight: 800; color: #fff;
    letter-spacing: -.03em; line-height: 1;
}

.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; gap: 10px;
    padding: 0 16px;
    border-bottom: 1px solid var(--sb-border);
    flex-shrink: 0;
}
.sidebar-logo-img {
    height: 44px; width: auto; object-fit: contain;
}
.sidebar-mascot {
    height: 40px; width: auto; object-fit: contain; flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
}
.sidebar-brand-name {
    font-size: 1.18rem; font-weight: 800; letter-spacing: -.02em;
    color: #fff; line-height: 1;
}
.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;
}
/* Programme de relance terminé sans RDV → abandon possible : contour ambré marqué */
.prospect-card-abandon {
    border-color: #d97706;
    border-width: 1.5px;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, .12);
}
.prospect-card-abandon:hover {
    border-color: #b45309;
    box-shadow: 0 6px 18px rgba(217, 119, 6, .20);
}
.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; }
}

/* ═══════════════════════════════════════════════════════════
   AJOUTS RÉCENTS (post-base learn)
   ═══════════════════════════════════════════════════════════ */

/* ── Centre d'aide button in topbar ── */
.topbar-help-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--accent, #d97706); color: #fff;
    padding: 8px 14px; border-radius: 9px;
    font-size: .85rem; font-weight: 600; text-decoration: none;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}
.topbar-help-btn:hover { background: var(--accent-hover, #b45309); }
.topbar-help-btn:active { transform: scale(.97); }
.topbar-help-btn svg { flex-shrink: 0; }
@media (max-width: 640px) {
    .topbar-help-btn span { display: none; }
    .topbar-help-btn { padding: 8px; border-radius: 50%; }
}

/* ── Leanks Solutions credit (sidebar footer) ── */
.sidebar-credit {
    padding: 10px 16px 14px; font-size: .68rem;
    color: var(--sb-text-3, rgba(255,255,255,.4));
    text-align: center;
    border-top: 1px solid var(--sb-border, rgba(255,255,255,.08));
}
.sidebar-credit a { color: inherit; text-decoration: underline; }
.sidebar-credit a:hover { color: var(--accent, #d97706); }

/* ── Activity log : archive box ── */
.activity-archive-box {
    display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
    background: var(--bg-white, #fff); border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px; padding: 12px 14px; max-width: 420px;
}
.activity-archive-box form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.activity-archive-label { font-size: .82rem; font-weight: 600; color: var(--text-2, #475569); }
.activity-archive-select {
    padding: 7px 10px; border: 1.5px solid var(--border, #e2e8f0); border-radius: 8px;
    font-size: .83rem; font-family: inherit; background: var(--bg-white, #fff);
}
.activity-archive-btn { padding: 8px 14px !important; font-size: .82rem !important; }
.activity-archive-del { color: #dc2626 !important; border-color: #fca5a5 !important; }
.activity-archive-del:hover { background: #fee2e2 !important; border-color: #dc2626 !important; }
.activity-archive-hint { font-size: .72rem; color: var(--text-3, #64748b); text-align: right; line-height: 1.4; }
@media (max-width: 768px) {
    .activity-archive-box { max-width: 100%; width: 100%; align-items: stretch; }
    .activity-archive-box form { justify-content: space-between; }
    .activity-archive-hint { text-align: left; }
}

/* ── "Accéder aux programmations" toggle + Blueprint editor ── */
.bp-trigger-row { margin-top: 18px; padding: 14px; border: 1px solid var(--c-border, #e2e8f0); border-radius: 12px; background: var(--c-bg-white, #fff); }
.bp-trigger-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; font-size: .85rem; font-weight: 600;
    background: linear-gradient(135deg, #1e293b, #334155); color: #fff;
    border: 0; border-radius: 9px; cursor: pointer;
    transition: transform .12s, box-shadow .12s;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.bp-trigger-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.bp-trigger-tagline { color: var(--c-text-3, #64748b); font-size: .82rem; margin: 8px 0 0; }

.bp-section { margin-top: 18px; padding: 14px; border: 1px solid var(--c-border, #e2e8f0); border-radius: 12px; background: var(--c-bg-white, #fff); }
.bp-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.bp-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bp-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 11px; font-size: .8rem; font-weight: 600;
    background: #f1f5f9; color: #334155;
    border: 1.5px solid #cbd5e1; border-radius: 8px;
    cursor: pointer; transition: all .12s;
}
.bp-btn:hover { background: #e2e8f0; border-color: #94a3b8; }
.bp-btn-save { background: var(--accent, #d97706); color: #fff; border-color: var(--accent, #d97706); }
.bp-btn-save:hover { background: var(--accent-hover, #b45309); border-color: var(--accent-hover, #b45309); }
.bp-save-status { font-size: .78rem; color: var(--c-text-3, #64748b); margin-left: 6px; }
.bp-flash-ok { color: #16a34a !important; font-weight: 600; }
.bp-flash-warn { color: #dc2626 !important; font-weight: 600; }

.bp-tpl-controls { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.bp-tpl-select { padding: 6px 10px; font-size: .8rem; border: 1.5px solid #cbd5e1; border-radius: 8px; background: #fff; min-width: 160px; }
.bp-tpl-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 11px; font-size: .8rem; font-weight: 600;
    background: #fff; color: #334155;
    border: 1.5px solid #cbd5e1; border-radius: 8px;
    cursor: pointer; transition: all .12s;
}
.bp-tpl-btn:hover { background: #f1f5f9; border-color: #94a3b8; }

.bp-canvas-wrap {
    position: relative; width: 100%; min-height: 360px;
    background: #0f172a;
    background-image:
        linear-gradient(rgba(148,163,184,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148,163,184,.08) 1px, transparent 1px);
    background-size: 24px 24px;
    border-radius: 10px; overflow: auto;
    border: 1px solid #1e293b;
}
.bp-canvas { position: relative; width: 2400px; height: 1200px; }
.bp-wires  { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; }

.bp-node {
    position: absolute; min-width: 180px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155; border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
    color: #e2e8f0; z-index: 2; user-select: none;
}
.bp-node-head {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; cursor: move;
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    border-bottom: 1px solid #475569;
    border-radius: 7px 7px 0 0;
    font-size: .82rem; font-weight: 700;
}
.bp-node-start  .bp-node-head { background: linear-gradient(180deg, #7f1d1d 0%, #450a0a 100%); border-color: #b91c1c; }
.bp-node-delay  .bp-node-head { background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%); border-color: #3b82f6; }
.bp-node-mail   .bp-node-head { background: linear-gradient(180deg, #14532d 0%, #052e16 100%); border-color: #22c55e; }
.bp-node-condition .bp-node-head { background: linear-gradient(180deg, #713f12 0%, #422006 100%); border-color: #d97706; }
.bp-node-icon { font-size: 1rem; }
.bp-node-title { flex: 1; }
.bp-node-del { background: transparent; border: 0; color: #fca5a5; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0 4px; border-radius: 4px; }
.bp-node-del:hover { background: rgba(239,68,68,.25); }
.bp-node-body { padding: 10px; font-size: .82rem; }
.bp-input { background: #0f172a; color: #e2e8f0; border: 1px solid #475569; border-radius: 5px; padding: 4px 7px; font-size: .82rem; width: 60px; font-family: inherit; }
.bp-node-mail .bp-input { width: 100%; }
.bp-cond-info { color: #94a3b8; font-size: .76rem; font-style: italic; }
.bp-port { position: absolute; width: 14px; height: 14px; background: #d97706; border: 2px solid #fbbf24; border-radius: 50%; cursor: pointer; z-index: 3; transition: transform .12s, box-shadow .12s; }
.bp-port:hover { transform: scale(1.3); box-shadow: 0 0 8px currentColor; }
.bp-port-in  { left: -8px; top: 14px; }
.bp-port-out { right: -8px; top: 14px; }
.bp-port-yes { right: -8px; top: 14px; background: #16a34a; border-color: #4ade80; }
.bp-port-no  { right: -8px; top: 44px; background: #dc2626; border-color: #fca5a5; }
.bp-port-pending { transform: scale(1.4); box-shadow: 0 0 12px #fff; animation: bp-pulse 1s ease-in-out infinite; }
@keyframes bp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.bp-hint { font-size: .76rem; color: var(--c-text-3, #64748b); margin: 8px 2px 0; }

/* ═══════════════════════════════════════════════════════════
   CLASSES COMPLÉMENTAIRES (manquantes au scan)
   ═══════════════════════════════════════════════════════════ */

/* body.app-page = marqueur, pas de style critique mais on garantit le reset */
body.app-page { margin: 0; min-height: 100vh; }

/* Alert variants (intranet) */
.alert-danger { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; padding: 12px 14px; border-radius: 8px; }

/* Generic btn-link */
.btn-link {
    background: transparent; border: 0; color: var(--accent, #d97706);
    cursor: pointer; text-decoration: underline; padding: 0; font: inherit;
}
.btn-link:hover { color: var(--accent-hover, #b45309); }

/* Status pills (users.php) */
.status-ok      { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: .72rem; font-weight: 600; background: #d1fae5; color: #065f46; }
.status-warning { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: .72rem; font-weight: 600; background: #fef3c7; color: #92400e; }

/* Prospect-edit specifics */
.prospect-top-block { background: var(--bg-white, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: 12px; padding: 18px; }
.prospect-delete-btn {
    background: transparent; border: 1.5px solid #fca5a5; color: #dc2626;
    padding: 8px 16px; border-radius: 8px; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.prospect-delete-btn:hover { background: #fee2e2; }
.fin-remove { background: transparent; border: 0; color: #dc2626; cursor: pointer; padding: 4px; }
.fin-remove:hover { opacity: .7; }
.mail-editor { display: flex; flex-direction: column; gap: 10px; }

/* Invoice-create specifics */
.btn-attendance-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border: 1.5px solid var(--border, #e2e8f0); border-radius: 8px;
    background: #fff; color: var(--text-2, #475569); font-size: .82rem; font-weight: 600; cursor: pointer;
}
.btn-attendance-toggle:hover { border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.client-paper-upload { margin-top: 10px; padding: 10px; background: #fef3c7; border: 1px dashed #f59e0b; border-radius: 8px; }
.client-paper-upload-head { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: #92400e; margin-bottom: 6px; }
.client-paper-file-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; background: #fff; border: 1.5px solid #fbbf24;
    border-radius: 7px; font-size: .78rem; cursor: pointer; color: #92400e;
}
.client-paper-file-btn:hover { background: #fef3c7; }
.client-paper-filename { font-size: .76rem; color: #475569; margin-left: 6px; font-style: italic; }
.client-paper-view { display: inline-flex; align-items: center; gap: 4px; color: var(--accent, #d97706); text-decoration: none; font-size: .76rem; }
.client-rate-input { width: 80px; padding: 5px 8px; border: 1px solid var(--border, #e2e8f0); border-radius: 6px; font-size: .82rem; }
.rate-unit { font-size: .78rem; color: var(--text-3, #64748b); margin-left: 4px; }
.grand-total-amount { font-size: 1.4rem; font-weight: 800; color: var(--accent, #d97706); }
.is-blocking { opacity: .5; pointer-events: none; }
.highlighted { background: #fef3c7 !important; }

/* Agenda specifics */
.agenda-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border, #e2e8f0); border: 1px solid var(--border, #e2e8f0); border-radius: 10px; overflow: hidden; }
.agenda-day-grid { display: grid; grid-template-columns: 60px 1fr; gap: 0; }

/* Notes panel close button */
.cfl-notes-close { background: transparent; border: 0; cursor: pointer; padding: 6px; color: var(--text-3, #64748b); border-radius: 6px; }
.cfl-notes-close:hover { background: var(--bg-subtle, #f1f5f9); color: var(--text, #0f172a); }

/* todo-done modifier */
.todo-done { opacity: .5; text-decoration: line-through; }

/* Selected state generic */
.selected { background: var(--accent-soft, rgba(217,119,6,.1)) !important; border-color: var(--accent, #d97706) !important; }

/* ═══════════════════════════════════════════════════════════
   Boutons "copier" dans la liste des prospects
   ═══════════════════════════════════════════════════════════ */
.prospect-card-line { position: relative; }
.prospect-copy-val { overflow: hidden; text-overflow: ellipsis; }
.prospect-copy-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; margin-left: auto; flex-shrink: 0;
    background: transparent; border: 1px solid transparent; border-radius: 6px;
    color: var(--c-text-3, #94a3b8); cursor: pointer;
    transition: all .12s; padding: 0;
}
.prospect-card-line:hover .prospect-copy-btn { color: var(--accent, #d97706); border-color: var(--c-border, #e2e8f0); }
.prospect-copy-btn:hover { background: var(--accent-soft, rgba(217,119,6,.1)); border-color: var(--accent, #d97706); }
.prospect-copy-btn.copied { color: #16a34a; border-color: #16a34a; background: #d1fae5; }

/* ═══════════════════════════════════════════════════════════
   Page de configuration des liens Google Sheets (admin_site)
   ═══════════════════════════════════════════════════════════ */
.sheets-config-form { display: flex; flex-direction: column; gap: 18px; }
.sheets-config-card {
    background: var(--c-bg-white, #fff); border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 12px; padding: 18px 20px;
}
.sheets-config-card h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 700; color: var(--c-text, #0f172a); }
.sheets-config-hint { margin: 0 0 12px; font-size: .82rem; color: var(--c-text-3, #64748b); line-height: 1.45; }
.sheets-config-current { margin: 8px 0 0; font-size: .76rem; color: var(--c-text-3, #94a3b8); }
.sheets-config-current code { background: var(--c-bg-subtle, #f1f5f9); padding: 2px 6px; border-radius: 5px; font-size: .76rem; word-break: break-all; }
.sheets-config-warning {
    background: #fef3c7; border: 1px solid #f59e0b; color: #92400e;
    border-radius: 10px; padding: 12px 16px; font-size: .82rem; line-height: 1.5;
}
.sheets-config-warning code { background: rgba(255,255,255,.6); padding: 2px 6px; border-radius: 5px; font-size: .78rem; word-break: break-all; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE COMPLET — passe défensive (tablette/carré → mobile)
   Objectif : conserver l'expérience "PC portable" jusqu'au plus
   petit écran possible, puis dégrader proprement.
   ═══════════════════════════════════════════════════════════ */

/* ── ≤1100px : écran carré / petite tablette paysage ──
   La sidebar reste visible mais se rétrécit, le contenu respire,
   les éléments larges deviennent défilables/souples. */
@media (max-width: 1100px) {
    :root { --sidebar-w: 210px; }
    .page-content { padding: 22px 20px; }

    /* Toolbars / barres d'action : passer à la ligne au lieu de déborder */
    .page-header,
    .bp-toolbar, .bp-section-head,
    .table-actions, .filter-tabs, .filter-tabs-row,
    .toolbar, .actions-row, .btn-row { flex-wrap: wrap; }

    /* Tableaux : défilement horizontal contenu dans leur carte */
    .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-card table { min-width: 640px; }

    /* Grilles 2-3 colonnes → 2 colonnes */
    .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
    .settings-section-grid { grid-template-columns: 1fr 1fr; }
}

/* ── ≤900px : la sidebar passe en mode "tiroir" (toggle) ──
   (auparavant 800px — relevé pour les écrans carrés ~1024) */
@media (max-width: 900px) {
    :root { --sidebar-w: 240px; }
    .sidebar { transform: translateX(-100%); width: 260px; }
    .sidebar.open { transform: translateX(0); box-shadow: var(--sh-xl); }
    .main-wrapper { margin-left: 0; }
    .sidebar-toggle { display: flex; }

    /* Overlay sombre quand le tiroir est ouvert */
    .sidebar-backdrop {
        position: fixed; inset: 0; background: rgba(0,0,0,.4);
        z-index: 99; opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    .sidebar.open ~ .sidebar-backdrop,
    .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

    /* Tous les formulaires multi-colonnes → 1 colonne */
    .form-row, .form-grid, .profile-grid,
    .entry-row-grid, .entry-row-grid-act, .entry-row-grid-act-2,
    .prospect-grid, .settings-section-grid,
    .invoice-grid, .two-col, .three-col { grid-template-columns: 1fr !important; display: grid; }

    .page-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .dashboard-cards { grid-template-columns: repeat(2, 1fr); }

    /* Modales : prendre presque tout l'écran */
    .modal { max-width: calc(100vw - 32px); }
}

/* ── ≤680px : téléphone large / petite tablette portrait ── */
@media (max-width: 680px) {
    .page-content { padding: 16px 14px; }
    .topbar { padding: 0 14px; }
    .dashboard-cards { grid-template-columns: 1fr; }
    .page-title-big { font-size: 1.15rem; }
    .page-subtitle { font-size: .82rem; }

    /* Onglets de filtre : scroll horizontal plutôt que wrap chaotique */
    .filter-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .filter-tab { white-space: nowrap; flex-shrink: 0; }

    /* Boutons pleine largeur dans les en-têtes/modales */
    .page-header > .btn-primary,
    .page-header > .btn-secondary { width: 100%; justify-content: center; }
    .modal-form .btn-primary,
    .modal-form .btn-secondary,
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary { width: 100%; justify-content: center; }
    .modal-footer { flex-direction: column-reverse; gap: 8px; }

    /* Blueprint : canvas plus court sur mobile */
    .bp-canvas-wrap { min-height: 300px; }

    /* User info caché dans la topbar */
    .user-info .user-info-meta { display: none; }
}

/* ── ≤430px : très petits téléphones ── */
@media (max-width: 430px) {
    .page-content { padding: 12px 10px; }
    .topbar { padding: 0 10px; }
    .modal { max-width: calc(100vw - 16px); border-radius: 12px; }
    .modal-header { padding: 14px 16px; }
    .modal-form { padding: 16px; }
    .page-title-big { font-size: 1.05rem; }
    .btn-primary, .btn-secondary { font-size: .82rem; }

    /* Réduire encore les cartes/paddings denses */
    .table-card table { min-width: 520px; }
    .user-cell-avatar { width: 30px; height: 30px; }
}

/* ═══════════════════════════════════════════════════════════
   BLUEPRINT — REDESIGN palette CFL, canvas CLAIR (surcharge)
   ═══════════════════════════════════════════════════════════ */
.bp-trigger-row {
    margin-top: 18px; padding: 16px 18px;
    border: 1px solid var(--border, #e4e8ef); border-radius: var(--r, 12px);
    background: var(--bg-white, #fff);
}
.bp-trigger-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; font-size: .86rem; font-weight: 700;
    background: var(--sb-bg, #0d1e4a); color: #fff;
    border: 0; border-radius: var(--r-sm, 8px); cursor: pointer;
    transition: transform .12s, box-shadow .12s, background .15s;
    box-shadow: var(--sh-sm);
}
.bp-trigger-btn:hover { background: #112258; transform: translateY(-1px); box-shadow: var(--sh-md); }
.bp-trigger-tagline { color: var(--text-3, #6b7280); font-size: .82rem; margin: 10px 0 0; line-height: 1.5; }

.bp-section {
    margin-top: 16px; padding: 18px;
    border: 1px solid var(--border, #e4e8ef); border-radius: var(--r, 12px);
    background: var(--bg-white, #fff);
}
.bp-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bp-section-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text, #0d1117); }
.bp-toolbar { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.bp-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; font-size: .8rem; font-weight: 600;
    background: var(--bg-subtle, #f8f9fc); color: var(--text-2, #374151);
    border: 1.5px solid var(--border, #e4e8ef); border-radius: var(--r-sm, 8px);
    cursor: pointer; transition: all .12s;
}
.bp-btn:hover { background: #fff; border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.bp-btn-save { background: var(--accent, #d97706); color: #fff; border-color: var(--accent, #d97706); }
.bp-btn-save:hover { background: var(--accent-hover, #b45309); border-color: var(--accent-hover, #b45309); color: #fff; }
.bp-save-status { font-size: .78rem; color: var(--text-3, #6b7280); margin-left: 4px; }
.bp-flash-ok { color: #16a34a !important; font-weight: 700; }
.bp-flash-warn { color: #dc2626 !important; font-weight: 700; }

.bp-tpl-controls { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.bp-tpl-select {
    padding: 7px 11px; font-size: .8rem; border: 1.5px solid var(--border, #e4e8ef);
    border-radius: var(--r-sm, 8px); background: #fff; color: var(--text-2, #374151); min-width: 160px;
}
.bp-tpl-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 12px; font-size: .8rem; font-weight: 600;
    background: #fff; color: var(--text-2, #374151);
    border: 1.5px solid var(--border, #e4e8ef); border-radius: var(--r-sm, 8px);
    cursor: pointer; transition: all .12s;
}
.bp-tpl-btn:hover { background: var(--bg-subtle, #f8f9fc); border-color: var(--accent, #d97706); color: var(--accent, #d97706); }

/* Canvas CLAIR avec grille discrète */
.bp-canvas-wrap {
    position: relative; width: 100%; min-height: 360px;
    background: #fbfcfe;
    background-image:
        linear-gradient(rgba(13,30,74,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13,30,74,.05) 1px, transparent 1px);
    background-size: 22px 22px;
    border-radius: var(--r-sm, 8px); overflow: auto;
    border: 1px solid var(--border, #e4e8ef);
}
.bp-canvas { position: relative; width: 2400px; height: 1200px; }
.bp-wires  { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; }

/* Nœuds clairs, en-tête coloré dans la palette */
.bp-node {
    position: absolute; min-width: 184px;
    background: #fff;
    border: 1.5px solid var(--border, #e4e8ef); border-radius: 10px;
    box-shadow: var(--sh-md);
    color: var(--text, #0d1117); z-index: 2; user-select: none;
}
.bp-node-head {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; cursor: move;
    border-radius: 9px 9px 0 0;
    font-size: .82rem; font-weight: 700; color: #fff;
}
.bp-node-start .bp-node-head { background: var(--sb-bg, #0d1e4a); }
.bp-node-delay .bp-node-head { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.bp-node-mail  .bp-node-head { background: linear-gradient(135deg, var(--accent, #d97706), #f5a623); }
.bp-node-condition .bp-node-head { background: #6b7280; }
.bp-node-icon { font-size: 1rem; }
.bp-node-title { flex: 1; }
.bp-node-del { background: rgba(255,255,255,.18); border: 0; color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 7px; border-radius: 5px; }
.bp-node-del:hover { background: rgba(255,255,255,.34); }
.bp-node-body { padding: 12px; font-size: .82rem; color: var(--text-2, #374151); }
.bp-input {
    background: #fff; color: var(--text, #0d1117);
    border: 1.5px solid var(--border, #e4e8ef); border-radius: 6px;
    padding: 5px 8px; font-size: .82rem; width: 64px; font-family: inherit;
}
.bp-input:focus { outline: none; border-color: var(--accent, #d97706); box-shadow: var(--accent-glow); }
.bp-node-mail .bp-input { width: 100%; }
.bp-cond-info { color: var(--text-4, #9ca3af); font-size: .73rem; font-style: italic; margin-top: 6px; }

/* Ports orange (accent) */
.bp-port {
    position: absolute; width: 14px; height: 14px;
    background: var(--accent, #d97706); border: 2.5px solid #fff;
    border-radius: 50%; cursor: pointer; z-index: 3;
    box-shadow: 0 0 0 1.5px var(--accent, #d97706);
    transition: transform .12s, box-shadow .12s;
}
.bp-port:hover { transform: scale(1.3); }
.bp-port-in  { left: -8px; top: 14px; }
.bp-port-out { right: -8px; top: 14px; }
.bp-port-yes, .bp-port-no { right: -8px; }
.bp-port-pending { transform: scale(1.45); box-shadow: 0 0 0 4px var(--accent-soft, rgba(217,119,6,.25)); animation: bp-pulse 1s ease-in-out infinite; }
@keyframes bp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.bp-hint { font-size: .76rem; color: var(--text-3, #6b7280); margin: 10px 2px 0; }

/* ═══════════════════════════════════════════════════════════
   INPUTS — homogénéisation (alias .form-input / .form-label +
   filet de sécurité pour les inputs orphelins dans le contenu)
   ═══════════════════════════════════════════════════════════ */
.form-input,
input[type="text"].form-input,
input[type="email"].form-input,
input[type="number"].form-input,
input[type="date"].form-input,
input[type="time"].form-input,
input[type="password"].form-input,
input[type="search"].form-input,
input[type="tel"].form-input,
input[type="url"].form-input,
textarea.form-input,
select.form-input {
    appearance: none; -webkit-appearance: none;
    width: 100%; padding: 9px 12px;
    background: var(--bg-white); color: var(--text);
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-family: inherit; font-size: .85rem; line-height: 1.4;
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
    box-sizing: border-box;
}
.form-input::placeholder, textarea.form-input::placeholder { color: var(--text-5); opacity: 1; }
.form-input:hover { border-color: #c5cad4; }
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--accent-glow); }
.form-label {
    display: block; font-size: .8rem; font-weight: 600;
    color: var(--text-2); margin-bottom: 6px;
}

/* Filet de sécurité : tout input/select/textarea dans la zone de contenu
   qui n'aurait AUCUNE classe de style hérite d'un rendu propre, jamais le
   style natif du navigateur. (N'affecte pas ceux déjà classés.) */
.page-content input[type="text"]:not([class]),
.page-content input[type="email"]:not([class]),
.page-content input[type="number"]:not([class]),
.page-content input[type="date"]:not([class]),
.page-content input[type="time"]:not([class]),
.page-content input[type="password"]:not([class]),
.page-content input[type="search"]:not([class]),
.page-content input[type="tel"]:not([class]),
.page-content input[type="url"]:not([class]),
.page-content textarea:not([class]),
.page-content select:not([class]) {
    appearance: none; -webkit-appearance: none;
    width: 100%; padding: 9px 12px; box-sizing: border-box;
    background: var(--bg-white); color: var(--text);
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-family: inherit; font-size: .85rem; line-height: 1.4;
    transition: border-color var(--ease), box-shadow var(--ease);
}
.page-content input:not([class]):focus,
.page-content textarea:not([class]):focus,
.page-content select:not([class]):focus {
    outline: none; border-color: var(--accent); box-shadow: var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD WIDGETS personnalisables
   ═══════════════════════════════════════════════════════════ */
.dash-widgets-section { margin-top: 28px; }
.dash-widgets-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.dash-widgets-heading { font-size: 1.05rem; font-weight: 700; color: var(--text, #0d1117); margin: 0; }
.dash-edit-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 15px; font-size: .83rem; font-weight: 600;
    background: var(--bg-white, #fff); color: var(--text-2, #374151);
    border: 1.5px solid var(--border, #e4e8ef); border-radius: var(--r-sm, 8px);
    cursor: pointer; transition: all .12s;
}
.dash-edit-btn:hover { border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.dash-widgets-section.editing .dash-edit-btn { background: var(--accent, #d97706); color: #fff; border-color: var(--accent, #d97706); }

/* Grille de widgets */
.dash-widgets-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    align-items: start;
}
.dash-widget {
    background: var(--bg-white, #fff); border: 1px solid var(--border, #e4e8ef);
    border-radius: var(--r, 12px); box-shadow: var(--sh-sm);
    overflow: hidden; display: flex; flex-direction: column;
    transition: box-shadow .15s, transform .1s;
}
.dash-widget-sm { grid-column: span 1; }
.dash-widget-md { grid-column: span 2; }
.dash-widget-lg { grid-column: span 4; }
.dash-widget-head {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 14px; border-bottom: 1px solid var(--border-light, #eef1f6);
    background: var(--bg-subtle, #f8f9fc);
}
.dash-widget-icon { display: inline-flex; color: var(--accent, #d97706); }
.dash-widget-title { flex: 1; font-size: .83rem; font-weight: 700; color: var(--text, #0d1117); }
.dash-widget-remove, .dash-widget-grip { display: none; background: transparent; border: 0; cursor: pointer; color: var(--text-4, #9ca3af); padding: 2px 4px; border-radius: 5px; }
.dash-widget-remove:hover { color: #dc2626; background: #fee2e2; }
.dash-widgets-section.editing .dash-widget-remove,
.dash-widgets-section.editing .dash-widget-grip { display: inline-flex; align-items: center; }
.dash-widgets-section.editing .dash-widget { border-style: dashed; border-color: var(--accent, #d97706); cursor: grab; }
.dash-widget.dragging { opacity: .5; box-shadow: var(--sh-lg); }
.dash-widget-body { padding: 14px; flex: 1; }

/* Contenu interne des widgets */
.w-stat-big { font-size: 2.1rem; font-weight: 800; color: var(--text, #0d1117); line-height: 1; }
.w-stat-mid { font-size: 1.1rem; font-weight: 700; color: var(--text, #0d1117); margin-bottom: 6px; }
.w-stat-sub { font-size: .78rem; color: var(--text-3, #6b7280); margin-top: 5px; }
.w-link { display: inline-block; margin-top: 12px; font-size: .8rem; font-weight: 600; color: var(--accent, #d97706); text-decoration: none; }
.w-link:hover { text-decoration: underline; }
.w-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-light, #eef1f6); text-decoration: none; color: var(--text-2, #374151); font-size: .82rem; }
.w-row:last-of-type { border-bottom: 0; }
.w-row-main { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-row-sub { color: var(--text-4, #9ca3af); font-size: .76rem; flex-shrink: 0; }
.w-empty { color: var(--text-4, #9ca3af); font-size: .82rem; padding: 8px 0; text-align: center; }
.w-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--bg-subtle, #f8f9fc); }
.w-bar-seg { height: 100%; }
.w-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: .74rem; color: var(--text-3, #6b7280); }
.w-legend span { display: inline-flex; align-items: center; gap: 5px; }
.w-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.w-badge { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: .72rem; font-weight: 600; }
.w-badge-ok { background: #d1fae5; color: #065f46; }
.w-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.w-action-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 11px; background: var(--bg-subtle, #f8f9fc); border: 1px solid var(--border, #e4e8ef); border-radius: var(--r-sm, 8px); font-size: .8rem; font-weight: 600; color: var(--text-2, #374151); text-decoration: none; transition: all .12s; }
.w-action-btn:hover { background: #fff; border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.w-note { width: 100%; min-height: 90px; border: 1px solid var(--border, #e4e8ef); border-radius: var(--r-sm, 8px); padding: 9px 11px; font-family: inherit; font-size: .82rem; resize: vertical; color: var(--text); box-sizing: border-box; }
.w-note:focus { outline: none; border-color: var(--accent, #d97706); box-shadow: var(--accent-glow); }
.w-clock { text-align: center; padding: 6px 0; }
.w-clock-time { font-size: 2rem; font-weight: 800; color: var(--text, #0d1117); letter-spacing: 1px; }
.w-clock-date { font-size: .8rem; color: var(--text-3, #6b7280); margin-top: 4px; text-transform: capitalize; }

/* Palette d'ajout */
.dash-palette { margin-top: 18px; padding: 16px; background: var(--bg-subtle, #f8f9fc); border: 1.5px dashed var(--border, #e4e8ef); border-radius: var(--r, 12px); }
.dash-palette-title { font-size: .85rem; font-weight: 700; color: var(--text, #0d1117); margin-bottom: 12px; }
.dash-palette-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.dash-palette-item { display: inline-flex; align-items: center; gap: 9px; padding: 10px 12px; background: var(--bg-white, #fff); border: 1.5px solid var(--border, #e4e8ef); border-radius: var(--r-sm, 8px); cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--text-2, #374151); transition: all .12s; text-align: left; }
.dash-palette-item:hover { border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.dash-palette-item .dash-palette-icon { display: inline-flex; color: var(--accent, #d97706); }
.dash-palette-item span:not(.dash-palette-icon) { flex: 1; }
.dash-palette-plus { flex-shrink: 0; color: var(--accent, #d97706); }
.dash-palette-item.added { opacity: .4; pointer-events: none; }
.dash-palette-item.added .dash-palette-plus { display: none; }
.dash-palette-foot { margin-top: 14px; }

@media (max-width: 1100px) {
    .dash-widgets-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-widget-lg { grid-column: span 2; }
    .dash-widget-md { grid-column: span 2; }
}
@media (max-width: 680px) {
    .dash-widgets-grid { grid-template-columns: 1fr; }
    .dash-widget-sm, .dash-widget-md, .dash-widget-lg { grid-column: span 1; }
    .w-actions { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   DOCUMENTS du prospect
   ═══════════════════════════════════════════════════════════ */
.pdoc-section { margin-top: 18px; padding: 18px; border: 1px solid var(--border, #e4e8ef); border-radius: var(--r, 12px); background: var(--bg-white, #fff); }
.pdoc-head { display: flex; align-items: center; gap: 10px; }
.pdoc-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent-soft, rgba(217,119,6,.1)); color: var(--accent, #d97706); font-size: .75rem; font-weight: 700; }
.pdoc-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.pdoc-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--border-light, #eef1f6); border-radius: var(--r-sm, 8px); background: var(--bg-subtle, #f8f9fc); transition: border-color .12s, background .12s; }
.pdoc-item:hover { border-color: var(--accent, #d97706); background: #fff; }
.pdoc-icon { display: inline-flex; flex-shrink: 0; color: var(--accent, #d97706); }
.pdoc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.pdoc-title { font-size: .86rem; font-weight: 600; color: var(--text, #0d1117); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdoc-info:hover .pdoc-title { color: var(--accent, #d97706); text-decoration: underline; }
.pdoc-meta { font-size: .74rem; color: var(--text-3, #6b7280); }
.pdoc-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pdoc-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--border, #e4e8ef); border-radius: 7px; background: #fff; color: var(--text-3, #6b7280); cursor: pointer; transition: all .12s; text-decoration: none; }
.pdoc-btn:hover { border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.pdoc-btn-del:hover { border-color: #dc2626; color: #dc2626; background: #fee2e2; }
.pdoc-empty { color: var(--text-4, #9ca3af); font-size: .85rem; padding: 14px 0; text-align: center; }
.pdoc-upload { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light, #eef1f6); flex-wrap: wrap; }
.pdoc-upload-title { flex: 1; min-width: 180px; }
.pdoc-file-label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1.5px dashed var(--border, #e4e8ef); border-radius: var(--r-sm, 8px); cursor: pointer; font-size: .82rem; color: var(--text-2, #374151); background: var(--bg-subtle, #f8f9fc); transition: all .12s; }
.pdoc-file-label:hover { border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.pdoc-file-label svg { flex-shrink: 0; }
.pdoc-upload-btn { flex-shrink: 0; }
@media (max-width: 680px) {
    .pdoc-upload { flex-direction: column; align-items: stretch; }
    .pdoc-upload-title, .pdoc-file-label, .pdoc-upload-btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════
   Dépôt de facture personnelle (invoice-upload)
   ═══════════════════════════════════════════════════════════ */
.own-inv-card { max-width: 680px; background: var(--bg-white, #fff); border: 1px solid var(--border, #e4e8ef); border-radius: var(--r, 12px); padding: 24px; box-shadow: var(--sh-sm); }
.own-inv-warn-card { border-color: #f59e0b; background: #fffbeb; }
.own-inv-warn-icon { display: inline-flex; color: #d97706; margin-bottom: 8px; }
.own-inv-step-title { margin: 0 0 10px; font-size: 1.05rem; font-weight: 700; color: var(--text, #0d1117); }
.own-inv-help { font-size: .88rem; color: var(--text-2, #374151); line-height: 1.55; margin: 0 0 12px; }
.own-inv-form { display: flex; flex-direction: column; }
.own-inv-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.own-inv-empty { color: var(--text-4, #9ca3af); text-align: center; padding: 18px 0; font-size: .88rem; }
.own-inv-file { display: inline-flex; align-items: center; gap: 9px; padding: 12px 16px; border: 1.5px dashed var(--border, #e4e8ef); border-radius: var(--r-sm, 8px); cursor: pointer; color: var(--text-2, #374151); background: var(--bg-subtle, #f8f9fc); transition: all .12s; margin-top: 4px; }
.own-inv-file:hover { border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
@media (max-width: 680px) {
    .own-inv-actions { flex-direction: column-reverse; align-items: stretch; }
    .own-inv-actions .btn-primary, .own-inv-actions .btn-secondary { width: 100%; justify-content: center; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════
   Modale "déposer ma propre facture" (invoice-create)
   ═══════════════════════════════════════════════════════════ */
.own-modal-overlay { position: fixed; inset: 0; background: rgba(13,30,74,.45); backdrop-filter: blur(2px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.own-modal { position: relative; width: 100%; max-width: 520px; background: var(--bg-white, #fff); border-radius: var(--r-lg, 16px); box-shadow: var(--sh-xl); padding: 28px; max-height: 90vh; overflow-y: auto; }
.own-modal-x { position: absolute; top: 14px; right: 14px; background: transparent; border: 0; cursor: pointer; color: var(--text-3, #6b7280); padding: 6px; border-radius: 7px; }
.own-modal-x:hover { background: var(--bg-subtle, #f8f9fc); color: var(--text, #0d1117); }
.own-warn-icon { display: inline-flex; color: #d97706; margin-bottom: 6px; }
.own-title { margin: 0 0 12px; font-size: 1.15rem; font-weight: 700; color: var(--text, #0d1117); }
.own-text { font-size: .88rem; color: var(--text-2, #374151); line-height: 1.55; margin: 0 0 12px; }
.own-hours { margin: 14px 0; border: 1px solid var(--border, #e4e8ef); border-radius: var(--r-sm, 8px); overflow: hidden; }
.own-hrow { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-size: .85rem; color: var(--text-2, #374151); border-bottom: 1px solid var(--border-light, #eef1f6); }
.own-hrow:last-child { border-bottom: 0; }
.own-hrow-total { background: var(--bg-subtle, #f8f9fc); font-weight: 700; color: var(--text, #0d1117); }
.own-empty { padding: 16px; text-align: center; color: var(--text-4, #9ca3af); font-size: .85rem; }
.own-file { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1.5px dashed var(--border, #e4e8ef); border-radius: var(--r-sm, 8px); cursor: pointer; color: var(--text-2, #374151); background: var(--bg-subtle, #f8f9fc); transition: all .12s; margin: 6px 0 4px; }
.own-file:hover { border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.own-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@media (max-width: 560px) {
    .own-modal { padding: 20px; }
    .own-actions { flex-direction: column-reverse; align-items: stretch; }
    .own-actions .btn-primary, .own-actions .btn-secondary { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════
   FIX : champs .input-inline (dates/heures dans les tableaux de facture)
   Le texte héritait parfois d'une couleur claire → date invisible.
   ═══════════════════════════════════════════════════════════ */
.input-inline {
    color: var(--text, #0d1117) !important;
    background: #fff;
    font-family: inherit;
    -webkit-text-fill-color: var(--text, #0d1117); /* Safari : force la couleur du texte de date */
}
.input-inline::-webkit-datetime-edit,
.input-inline::-webkit-datetime-edit-fields-wrapper,
.input-inline::-webkit-datetime-edit-text,
.input-inline::-webkit-datetime-edit-month-field,
.input-inline::-webkit-datetime-edit-day-field,
.input-inline::-webkit-datetime-edit-year-field {
    color: var(--text, #0d1117) !important;
    -webkit-text-fill-color: var(--text, #0d1117);
}
.input-inline::-webkit-calendar-picker-indicator { opacity: 1; cursor: pointer; }
.input-inline:focus { outline: none; border-color: var(--accent, #d97706) !important; box-shadow: var(--accent-glow); }

/* ═══════════════════════════════════════════════════════════
   Messagerie SMS (fiche prospect)
   ═══════════════════════════════════════════════════════════ */
.sms-section { margin-top: 18px; padding: 18px; border: 1px solid var(--border, #e4e8ef); border-radius: var(--r, 12px); background: var(--bg-white, #fff); }
.sms-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sms-unread-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #dc2626; color: #fff; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.sms-toggle-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; font-size: .82rem; font-weight: 600; background: var(--bg-subtle, #f8f9fc); color: var(--text-2, #374151); border: 1.5px solid var(--border, #e4e8ef); border-radius: var(--r-sm, 8px); cursor: pointer; transition: all .12s; }
.sms-toggle-btn:hover { border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.sms-panel { margin-top: 14px; }
.sms-thread { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; padding: 14px; background: var(--bg-subtle, #f8f9fc); border: 1px solid var(--border-light, #eef1f6); border-radius: var(--r-sm, 8px); }
.sms-msg { display: flex; flex-direction: column; max-width: 78%; }
.sms-in  { align-self: flex-start; align-items: flex-start; }
.sms-out { align-self: flex-end; align-items: flex-end; }
.sms-bubble { padding: 9px 13px; border-radius: 14px; font-size: .86rem; line-height: 1.45; word-wrap: break-word; white-space: pre-wrap; }
.sms-in .sms-bubble  { background: #fff; border: 1px solid var(--border, #e4e8ef); color: var(--text, #0d1117); border-bottom-left-radius: 4px; }
.sms-out .sms-bubble { background: var(--sb-bg, #0d1e4a); color: #fff; border-bottom-right-radius: 4px; }
.sms-failed .sms-bubble { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.sms-meta { font-size: .68rem; color: var(--text-4, #9ca3af); margin-top: 3px; padding: 0 4px; }
.sms-empty, .sms-loading { text-align: center; color: var(--text-4, #9ca3af); font-size: .85rem; padding: 24px 0; }
.sms-composer { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.sms-input { flex: 1; resize: vertical; min-height: 42px; padding: 10px 12px; border: 1.5px solid var(--border, #e4e8ef); border-radius: var(--r-sm, 8px); font-family: inherit; font-size: .86rem; color: var(--text); box-sizing: border-box; }
.sms-input:focus { outline: none; border-color: var(--accent, #d97706); box-shadow: var(--accent-glow); }
.sms-send-btn { flex-shrink: 0; height: 42px; width: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
@media (max-width: 680px) {
    .sms-msg { max-width: 90%; }
    .sms-head { flex-direction: column; align-items: stretch; }
    .sms-toggle-btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════
   Drawer messagerie (fiche prospect) — WhatsApp-like
   ═══════════════════════════════════════════════════════════ */
.prospect-msg-btn { display: inline-flex; align-items: center; gap: 6px; }
.prospect-msg-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 700; }
.msg-drawer-backdrop { position: fixed; inset: 0; background: rgba(13,30,74,.4); z-index: 1200; opacity: 0; pointer-events: none; transition: opacity .25s; }
.msg-drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.msg-drawer { position: fixed; top: 0; right: 0; width: 400px; max-width: 92vw; height: 100vh; background: var(--bg-white, #fff); box-shadow: -8px 0 32px rgba(13,30,74,.18); z-index: 1201; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1); }
.msg-drawer.open { transform: translateX(0); }
.msg-drawer-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--sb-bg, #0d1e4a); color: #fff; }
.msg-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--accent, #d97706), #f5a623); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; flex-shrink: 0; }
.msg-drawer-id { flex: 1; min-width: 0; }
.msg-drawer-name { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-drawer-number { font-size: .76rem; opacity: .75; }
.msg-call-btn, .msg-drawer-close { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.msg-call-btn { background: #16a34a; color: #fff; }
.msg-call-btn:hover { background: #15803d; }
.msg-drawer-close { background: rgba(255,255,255,.15); color: #fff; }
.msg-drawer-close:hover { background: rgba(255,255,255,.28); }
.msg-drawer-thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #f4f6fb; }
.msg-bubble-row { display: flex; flex-direction: column; max-width: 80%; }
.msg-bubble-row.in { align-self: flex-start; align-items: flex-start; }
.msg-bubble-row.out { align-self: flex-end; align-items: flex-end; }
.msg-bubble { padding: 9px 13px; border-radius: 14px; font-size: .86rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg-bubble-row.in .msg-bubble { background: #fff; border: 1px solid var(--border, #e4e8ef); color: var(--text, #0d1117); border-bottom-left-radius: 4px; }
.msg-bubble-row.out .msg-bubble { background: var(--sb-bg, #0d1e4a); color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble-row.failed .msg-bubble { background: #fee2e2; color: #991b1b; }
.msg-time { font-size: .67rem; color: var(--text-4, #9ca3af); margin-top: 3px; padding: 0 4px; }
.msg-empty { text-align: center; color: var(--text-4, #9ca3af); font-size: .85rem; padding: 30px 0; margin: auto; }
.msg-drawer-warn { padding: 14px 16px; font-size: .82rem; color: var(--text-3, #6b7280); border-top: 1px solid var(--border-light, #eef1f6); }
.msg-drawer-composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-light, #eef1f6); align-items: flex-end; }
.msg-input { flex: 1; resize: none; max-height: 120px; min-height: 40px; padding: 10px 12px; border: 1.5px solid var(--border, #e4e8ef); border-radius: 20px; font-family: inherit; font-size: .86rem; color: var(--text); box-sizing: border-box; }
.msg-input:focus { outline: none; border-color: var(--accent, #d97706); }
.msg-send { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 680px) { .msg-drawer { width: 100vw; max-width: 100vw; } }

/* ═══════════════════════════════════════════════════════════
   Overlay d'appel (style Discord)
   ═══════════════════════════════════════════════════════════ */
.call-overlay { position: fixed; inset: 0; z-index: 1300; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; background: radial-gradient(circle at 50% 40%, #1a2d5e 0%, #0a1430 70%, #060d22 100%); }
.call-stage { display: flex; gap: 56px; align-items: center; }
.call-party { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.call-pdp { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2563eb, #1e3a8a); color: #fff; font-size: 2.4rem; font-weight: 700; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.call-pdp img { width: 100%; height: 100%; object-fit: cover; }
.call-pdp-them { animation: callHalo 1.6s ease-in-out infinite; }
@keyframes callHalo {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.55), 0 0 0 4px rgba(255,255,255,.08); }
    50% { box-shadow: 0 0 0 14px rgba(34,197,94,0), 0 0 0 4px rgba(255,255,255,.08); }
}
.call-pdp-me { background: linear-gradient(135deg, var(--accent, #d97706), #f5a623); }
.call-party-name { color: #fff; font-weight: 600; font-size: 1rem; }
.call-status { color: rgba(255,255,255,.7); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.call-controls { display: flex; gap: 20px; }
.call-hangup { width: 64px; height: 64px; border-radius: 50%; background: #dc2626; color: #fff; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s, background .15s; }
.call-hangup:hover { background: #b91c1c; transform: scale(1.06); }
@media (max-width: 560px) {
    .call-stage { gap: 28px; }
    .call-pdp { width: 90px; height: 90px; font-size: 1.8rem; }
}

/* ═══════════════════════════════════════════════════════════
   Page Communications (inbox + dialer + history)
   ═══════════════════════════════════════════════════════════ */
.comm-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--border, #e4e8ef); }
.comm-tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; background: transparent; border: 0; border-bottom: 2.5px solid transparent; cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--text-3, #6b7280); transition: all .12s; }
.comm-tab:hover { color: var(--text, #0d1117); }
.comm-tab.active { color: var(--accent, #d97706); border-bottom-color: var(--accent, #d97706); }
.comm-messenger { display: flex; gap: 0; height: 560px; max-height: 70vh; border: 1px solid var(--border, #e4e8ef); border-radius: var(--r, 12px); overflow: hidden; background: var(--bg-white, #fff); }
.comm-inbox { width: 300px; border-right: 1px solid var(--border, #e4e8ef); display: flex; flex-direction: column; }
.comm-inbox-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-weight: 700; font-size: .9rem; border-bottom: 1px solid var(--border-light, #eef1f6); }
.comm-new-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--accent, #d97706); color: #fff; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.comm-new-btn:hover { background: var(--accent-hover, #b45309); }
.comm-inbox-list { flex: 1; overflow-y: auto; }
.comm-inbox-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 16px; background: transparent; border: 0; border-bottom: 1px solid var(--border-light, #eef1f6); cursor: pointer; text-align: left; transition: background .12s; }
.comm-inbox-item:hover { background: var(--bg-subtle, #f8f9fc); }
.comm-inbox-item.unread { background: #fffbeb; }
.comm-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--accent, #d97706), #f5a623); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.comm-avatar-sm { width: 38px; height: 38px; font-size: .85rem; }
.comm-inbox-meta { flex: 1; min-width: 0; }
.comm-inbox-name { font-weight: 600; font-size: .86rem; color: var(--text, #0d1117); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comm-inbox-last { font-size: .77rem; color: var(--text-3, #6b7280); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comm-unread { background: #dc2626; color: #fff; font-size: .68rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.comm-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.comm-chat-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--text-4, #9ca3af); text-align: center; padding: 30px; }
.comm-chat-inner { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.comm-chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border-light, #eef1f6); }
.comm-chat-id { flex: 1; min-width: 0; }
.comm-chat-name { font-weight: 700; font-size: .9rem; }
.comm-chat-number { font-size: .76rem; color: var(--text-3, #6b7280); }
.comm-call-btn { width: 38px; height: 38px; border-radius: 50%; background: #16a34a; color: #fff; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.comm-call-btn:hover { background: #15803d; }
.comm-thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #f4f6fb; }
.comm-msg { display: flex; flex-direction: column; max-width: 78%; }
.comm-msg.in { align-self: flex-start; align-items: flex-start; }
.comm-msg.out { align-self: flex-end; align-items: flex-end; }
.comm-bubble { padding: 9px 13px; border-radius: 14px; font-size: .86rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.comm-msg.in .comm-bubble { background: #fff; border: 1px solid var(--border, #e4e8ef); color: var(--text, #0d1117); border-bottom-left-radius: 4px; }
.comm-msg.out .comm-bubble { background: var(--sb-bg, #0d1e4a); color: #fff; border-bottom-right-radius: 4px; }
.comm-msg.failed .comm-bubble { background: #fee2e2; color: #991b1b; }
.comm-msg-time { font-size: .67rem; color: var(--text-4, #9ca3af); margin-top: 3px; padding: 0 4px; }
.comm-composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-light, #eef1f6); align-items: flex-end; }
.comm-input { flex: 1; resize: none; min-height: 40px; max-height: 120px; padding: 10px 12px; border: 1.5px solid var(--border, #e4e8ef); border-radius: 20px; font-family: inherit; font-size: .86rem; box-sizing: border-box; color: var(--text); }
.comm-input:focus { outline: none; border-color: var(--accent, #d97706); }
.comm-send { width: 42px; height: 42px; border-radius: 50%; padding: 0; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.comm-empty { text-align: center; color: var(--text-4, #9ca3af); font-size: .85rem; padding: 30px 16px; }
/* Dialer */
.comm-dialer { max-width: 320px; margin: 10px auto; background: var(--bg-white, #fff); border: 1px solid var(--border, #e4e8ef); border-radius: var(--r-lg, 16px); padding: 24px; box-shadow: var(--sh-sm); }
.dialer-display { width: 100%; text-align: center; font-size: 1.5rem; font-weight: 600; border: 0; border-bottom: 2px solid var(--border, #e4e8ef); padding: 12px 0; margin-bottom: 20px; color: var(--text, #0d1117); letter-spacing: 1px; }
.dialer-display:focus { outline: none; border-bottom-color: var(--accent, #d97706); }
.dialer-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.dialer-key { aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--border, #e4e8ef); background: var(--bg-subtle, #f8f9fc); font-size: 1.4rem; font-weight: 600; color: var(--text, #0d1117); cursor: pointer; transition: all .12s; }
.dialer-key:hover { background: #fff; border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.dialer-actions { display: flex; align-items: center; justify-content: center; gap: 20px; }
.dialer-call { width: 64px; height: 64px; border-radius: 50%; background: #16a34a; color: #fff; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s; }
.dialer-call:hover { background: #15803d; transform: scale(1.05); }
.dialer-back, .dialer-sms { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--border, #e4e8ef); background: var(--bg-subtle, #f8f9fc); color: var(--text-2, #374151); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.dialer-back:hover, .dialer-sms:hover { border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
/* History */
.comm-history { background: var(--bg-white, #fff); border: 1px solid var(--border, #e4e8ef); border-radius: var(--r, 12px); overflow: hidden; }
.comm-hist-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border-light, #eef1f6); }
.comm-hist-row:last-child { border-bottom: 0; }
.comm-hist-icon { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.comm-hist-icon.out { background: #dbeafe; color: #2563eb; }
.comm-hist-icon.in { background: #dcfce7; color: #16a34a; }
.comm-hist-icon.fail { background: #fee2e2; color: #dc2626; }
.comm-hist-num { flex: 1; font-weight: 600; font-size: .86rem; color: var(--text, #0d1117); }
.comm-hist-time { font-size: .77rem; color: var(--text-3, #6b7280); }
.comm-hist-call { width: 34px; height: 34px; border-radius: 50%; background: #16a34a; color: #fff; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.comm-hist-call:hover { background: #15803d; }
@media (max-width: 768px) {
    .comm-messenger { flex-direction: column; height: auto; }
    .comm-inbox { width: 100%; border-right: 0; border-bottom: 1px solid var(--border, #e4e8ef); max-height: 220px; }
    .comm-chat { min-height: 400px; }
}

/* ═══════════════════════════════════════════════════════════
   Overlay d'appel DISCRET (bas droite) + notif distincte des messages
   ═══════════════════════════════════════════════════════════ */
.voice-overlay {
    position: fixed; bottom: 22px; right: 22px; z-index: 1300;
    display: flex; align-items: center; gap: 12px;
    background: #0d1e4a; color: #fff;
    padding: 12px 14px; border-radius: 14px;
    box-shadow: 0 12px 40px rgba(13,30,74,.4);
    min-width: 280px; max-width: 340px;
    animation: voiceSlideIn .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes voiceSlideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.voice-ov-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--accent,#d97706), #f5a623); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
/* Deux avatars superposés (interlocuteur + consultant) avec halo réactif */
.voice-ov-avatars { display: flex; align-items: center; gap: 14px; flex-shrink: 0; padding: 4px 2px; }
.voice-ov-pdp { position: relative; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; color: #fff; transition: box-shadow .08s linear, transform .08s linear; will-change: box-shadow, transform; }
.voice-ov-them { background: linear-gradient(135deg, var(--accent,#d97706), #f5a623); }
.voice-ov-me { background: linear-gradient(135deg, #3b5bdb, #5c7cfa); }
.voice-ov-info { flex: 1; min-width: 0; }
.voice-ov-name { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-ov-status { font-size: .76rem; opacity: .75; font-variant-numeric: tabular-nums; }
.voice-ov-mute, .voice-ov-hangup { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.voice-ov-mute { background: rgba(255,255,255,.15); color: #fff; }
.voice-ov-mute:hover { background: rgba(255,255,255,.28); }
.voice-ov-mute.active { background: #f5a623; color: #0d1e4a; }
.voice-ov-hangup { background: #dc2626; color: #fff; }
.voice-ov-hangup:hover { background: #b91c1c; }

/* Notifier appels entrants (bas droite, distinct d'un message) */
.vphone-notifier { position: fixed; bottom: 22px; right: 22px; z-index: 1250; width: 320px; max-width: calc(100vw - 32px); }
.vphone-primary {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 2px solid #16a34a; border-left: 5px solid #16a34a;
    border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
    animation: vphoneRing 1s ease-in-out infinite;
}
.vphone-primary.known { border-color: var(--accent,#d97706); border-left-color: var(--accent,#d97706); background: #fffbeb; }
@keyframes vphoneRing { 0%,100% { box-shadow: 0 12px 40px rgba(0,0,0,.18); } 50% { box-shadow: 0 12px 40px rgba(22,163,74,.4); } }
.vphone-ringing-icon { width: 40px; height: 40px; border-radius: 50%; background: #dcfce7; color: #16a34a; display: flex; align-items: center; justify-content: center; flex-shrink: 0; animation: vphoneShake .9s ease-in-out infinite; }
.vphone-primary.known .vphone-ringing-icon { background: #fef3c7; color: var(--accent,#d97706); }
@keyframes vphoneShake { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(8deg); } }
.vphone-primary-info { flex: 1; min-width: 0; }
.vphone-primary-name { font-weight: 700; font-size: .9rem; color: var(--text,#0d1117); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vphone-primary-meta { font-size: .76rem; color: var(--text-3,#6b7280); }
.vphone-timer { font-variant-numeric: tabular-nums; font-weight: 600; }
.vphone-answer { display: inline-flex; align-items: center; gap: 5px; padding: 9px 13px; background: #16a34a; color: #fff; border: 0; border-radius: 9px; cursor: pointer; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.vphone-answer:hover { background: #15803d; }
.vphone-others { margin-top: 8px; background: #fff; border: 1px solid var(--border,#e4e8ef); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; }
.vphone-others-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: transparent; border: 0; cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--text-2,#374151); }
.vphone-others-list { border-top: 1px solid var(--border-light,#eef1f6); }
.vphone-other-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-light,#eef1f6); }
.vphone-other-row:last-child { border-bottom: 0; }
.vphone-other-row.known { background: #fffbeb; }
.vphone-other-info { flex: 1; min-width: 0; }
.vphone-other-name { font-weight: 600; font-size: .82rem; color: var(--text,#0d1117); }
.vphone-other-sub { font-size: .73rem; color: var(--text-3,#6b7280); }
.vphone-other-answer { padding: 6px 11px; background: #16a34a; color: #fff; border: 0; border-radius: 7px; cursor: pointer; font-size: .76rem; font-weight: 600; }
.vphone-other-answer:hover { background: #15803d; }

/* Compteur notif sidebar Communications */
.comm-nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto; border-radius: 9px; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 700; }

/* Expéditeur dans les bulles */
.comm-msg-sender, .msg-sender { font-size: .68rem; font-weight: 700; color: var(--accent,#d97706); margin-bottom: 2px; padding: 0 4px; opacity: .85; }

/* Drawer : barre d'outils relance/modèles */
.msg-drawer-tools { display: flex; gap: 8px; padding: 8px 16px 0; align-items: center; }
.msg-tool-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; background: var(--bg-subtle,#f8f9fc); border: 1.5px solid var(--border,#e4e8ef); border-radius: 8px; cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--text-2,#374151); }
.msg-tool-btn:hover { border-color: var(--accent,#d97706); color: var(--accent,#d97706); }
.msg-tpl-select { flex: 1; padding: 6px 10px; border: 1.5px solid var(--border,#e4e8ef); border-radius: 8px; font-size: .78rem; background: #fff; color: var(--text-2,#374151); }

/* Modèles SMS (page communications) */
.comm-templates { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.comm-tpl-form { background: var(--bg-white,#fff); border: 1px solid var(--border,#e4e8ef); border-radius: var(--r,12px); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.comm-tpl-vars { font-size: .73rem; color: var(--text-3,#6b7280); }
.comm-tpl-vars code { background: var(--bg-subtle,#f8f9fc); padding: 1px 5px; border-radius: 4px; font-size: .72rem; }
.comm-tpl-list { display: flex; flex-direction: column; gap: 10px; }
.comm-tpl-item { background: var(--bg-white,#fff); border: 1px solid var(--border,#e4e8ef); border-radius: var(--r,12px); padding: 14px; }
.comm-tpl-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.comm-tpl-body { font-size: .82rem; color: var(--text-2,#374151); white-space: pre-wrap; line-height: 1.5; }
.comm-tpl-edit, .comm-tpl-del { background: transparent; border: 0; cursor: pointer; font-size: .76rem; font-weight: 600; padding: 3px 7px; border-radius: 6px; }
.comm-tpl-edit { color: var(--accent,#d97706); }
.comm-tpl-del { color: #dc2626; }
.comm-tpl-edit:hover { background: #fff7ed; }
.comm-tpl-del:hover { background: #fee2e2; }
.comm-hist-row.unread { background: #fffbeb; }
@media (max-width: 768px) { .comm-templates { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════
   Toasts + modal maison (remplacent alert/confirm/prompt natifs)
   ═══════════════════════════════════════════════════════════ */
.cfl-toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.cfl-toast { pointer-events: auto; min-width: 240px; max-width: 90vw; padding: 12px 18px; border-radius: 10px; font-size: .86rem; font-weight: 500; color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.22); opacity: 0; transform: translateY(12px); transition: opacity .22s, transform .22s; }
.cfl-toast.show { opacity: 1; transform: translateY(0); }
.cfl-toast.info { background: #0d1e4a; }
.cfl-toast.success { background: #16a34a; }
.cfl-toast.error { background: #dc2626; }
.cfl-modal-backdrop { position: fixed; inset: 0; z-index: 1450; display: none; align-items: center; justify-content: center; background: rgba(13,30,74,.45); padding: 20px; }
.cfl-modal-backdrop.show { display: flex; animation: cflFade .15s ease; }
@keyframes cflFade { from { opacity: 0; } to { opacity: 1; } }
.cfl-modal { background: var(--bg-white,#fff); border-radius: 16px; padding: 24px; max-width: 440px; width: 100%; box-shadow: 0 24px 70px rgba(0,0,0,.3); animation: cflPop .18s cubic-bezier(.2,.8,.2,1); }
@keyframes cflPop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cfl-modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text,#0d1117); margin-bottom: 10px; }
.cfl-modal-body { font-size: .9rem; color: var(--text-2,#374151); line-height: 1.5; }
.cfl-modal-input { width: 100%; margin-top: 14px; padding: 10px 12px; border: 1.5px solid var(--border,#e4e8ef); border-radius: 8px; font-size: .9rem; box-sizing: border-box; font-family: inherit; }
.cfl-modal-input:focus { outline: none; border-color: var(--accent,#d97706); }
.cfl-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Bannière d'événement dans une conversation (appel entrant/sortant) */
.conv-event { align-self: center; display: inline-flex; align-items: center; gap: 7px; margin: 6px auto; padding: 5px 13px; background: rgba(13,30,74,.06); border-radius: 14px; font-size: .73rem; font-weight: 600; color: var(--text-3,#6b7280); }
.conv-event-icon { display: inline-flex; color: var(--accent,#d97706); }

/* Badges sur les onglets de Communications */
.comm-tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #dc2626; color: #fff; font-size: .66rem; font-weight: 700; vertical-align: middle; }

/* ═══════════════════════════════════════════════════════════
   Lecteur de messages vocaux personnalisé (waveform type Instagram)
   Deux couches de barres superposées : base (gris) + remplie (accent), la
   couche remplie est clippée en continu pour une progression fluide.
   ═══════════════════════════════════════════════════════════ */
.vm-player { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 8px 12px; background: var(--bg-subtle,#f8f9fc); border: 1px solid var(--border-light,#eef1f6); border-radius: 22px; max-width: 520px; flex-wrap: wrap; }
.vm-play { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; background: var(--accent,#d97706); color: #fff; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, transform .1s; }
.vm-play:hover { background: var(--accent-hover,#b45309); }
.vm-play:active { transform: scale(.92); }
.vm-wave { position: relative; flex: 1; height: 40px; cursor: pointer; min-width: 120px; }
.vm-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; pointer-events: none; }
.vm-bars .vm-bar { flex: 1; min-width: 2px; max-width: 5px; border-radius: 2px; }
.vm-bars-base .vm-bar { background: var(--border,#cbd2de); }
.vm-bars-fill { will-change: clip-path; }
.vm-bars-fill .vm-bar { background: var(--accent,#d97706); }
.vm-time { flex-shrink: 0; font-size: .72rem; color: var(--text-3,#6b7280); font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; }
.vm-transcript-btn { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border,#e4e8ef); background: #fff; color: var(--text-3,#6b7280); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.vm-transcript-btn:hover, .vm-transcript-btn.active { border-color: var(--accent,#d97706); color: var(--accent,#d97706); }
.vm-transcript { flex-basis: 100%; width: 100%; margin-top: 8px; padding: 10px 12px; background: #fff; border: 1px solid var(--border-light,#eef1f6); border-radius: 10px; font-size: .82rem; line-height: 1.5; color: var(--text-2,#374151); white-space: pre-wrap; }
@media (max-width: 600px) { .vm-time { min-width: 0; } .vm-player { gap: 8px; padding: 7px 10px; } }

/* ═══════════════════════════════════════════════════════════
   Menu contextuel (clic droit)
   ═══════════════════════════════════════════════════════════ */
.cfl-ctxmenu { position: fixed; z-index: 1500; min-width: 210px; max-width: 280px; background: var(--bg-white,#fff); border: 1px solid var(--border,#e4e8ef); border-radius: 12px; box-shadow: 0 16px 48px rgba(13,30,74,.22); padding: 6px; animation: cflCtxPop .12s ease; }
@keyframes cflCtxPop { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.cfl-ctx-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-size: .85rem; font-weight: 500; color: var(--text-2,#374151); text-align: left; font-family: inherit; transition: background .1s; }
.cfl-ctx-item:hover { background: var(--bg-subtle,#f8f9fc); }
.cfl-ctx-item.danger { color: #dc2626; }
.cfl-ctx-item.danger:hover { background: #fee2e2; }
.cfl-ctx-item.disabled { opacity: .45; cursor: default; }
.cfl-ctx-item.disabled:hover { background: transparent; }
.cfl-ctx-ico { display: inline-flex; align-items: center; justify-content: center; width: 16px; flex-shrink: 0; color: var(--text-3,#6b7280); }
.cfl-ctx-item.danger .cfl-ctx-ico { color: #dc2626; }
.cfl-ctx-item:hover .cfl-ctx-ico { color: var(--accent,#d97706); }
.cfl-ctx-item.danger:hover .cfl-ctx-ico { color: #dc2626; }
.cfl-ctx-sep { height: 1px; background: var(--border-light,#eef1f6); margin: 5px 8px; }

/* ═══════════════════════════════════════════════════════════
   Indicateur "utilisateurs connectés" (header)
   ═══════════════════════════════════════════════════════════ */
.online-menu { position: relative; }
.online-trigger { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--border,#e4e8ef); border-radius: 10px; background: var(--bg-white,#fff); color: var(--text-2,#374151); cursor: pointer; transition: border-color .15s, background .15s; }
.online-trigger:hover { border-color: var(--accent,#d97706); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: onlinePulse 2s infinite; }
@keyframes onlinePulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.online-count { font-size: .82rem; font-weight: 700; color: var(--text,#0d1117); min-width: 12px; text-align: center; }
.online-dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 280px; max-height: 380px; overflow-y: auto; background: var(--bg-white,#fff); border: 1px solid var(--border,#e4e8ef); border-radius: 14px; box-shadow: 0 16px 48px rgba(13,30,74,.18); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .15s, transform .15s, visibility .15s; z-index: 1200; }
.online-menu.open .online-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.online-dropdown-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 10px; border-bottom: 1px solid var(--border-light,#eef1f6); margin-bottom: 6px; font-size: .9rem; }
.online-dropdown-header span { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #16a34a; color: #fff; font-size: .72rem; font-weight: 700; }
.online-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: inherit; transition: background .1s; }
.online-item:hover { background: var(--bg-subtle,#f8f9fc); }
.online-avatar { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent,#d97706), #f5a623); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; overflow: hidden; }
.online-avatar img { width: 100%; height: 100%; object-fit: cover; }
.online-sep { padding: 10px 10px 5px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3,#9aa3b2); border-top: 1px solid var(--border-light,#eef1f6); margin-top: 6px; }
.online-item.recent { opacity: .55; }
.online-item.recent:hover { opacity: 1; }
.online-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.online-name { font-size: .86rem; font-weight: 600; color: var(--text,#0d1117); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-name em { font-style: normal; color: var(--text-3,#6b7280); font-weight: 500; }
.online-role { font-size: .74rem; color: var(--text-3,#6b7280); }
.online-pulse { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.online-empty { padding: 16px 10px; text-align: center; color: var(--text-3,#6b7280); font-size: .82rem; }

/* ═══════════════════════════════════════════════════════════
   Profil public (lecture seule, accessible à tous)
   ═══════════════════════════════════════════════════════════ */
.profile-card-head { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.profile-avatar-lg { width: 84px; height: 84px; border-radius: 50%; background: linear-gradient(135deg, var(--accent,#d97706), #f5a623); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 1.4rem; font-weight: 800; margin: 0 0 6px; color: var(--text,#0d1117); }
.profile-role-badge { display: inline-block; padding: 3px 12px; border-radius: 20px; background: rgba(217,119,6,.12); color: var(--accent,#b45309); font-size: .78rem; font-weight: 700; }
.profile-presence { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; font-size: .82rem; font-weight: 600; }
.profile-presence-dot { width: 9px; height: 9px; border-radius: 50%; }
.profile-presence.on { color: #16a34a; }
.profile-presence.on .profile-presence-dot { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.profile-presence.off { color: var(--text-3,#6b7280); }
.profile-presence.off .profile-presence-dot { background: #cbd2de; }
.profile-fields { display: flex; flex-direction: column; gap: 2px; }
.profile-field { display: flex; justify-content: space-between; gap: 16px; padding: 12px 2px; border-bottom: 1px solid var(--border-light,#eef1f6); }
.profile-field:last-child { border-bottom: 0; }
.profile-field-label { color: var(--text-3,#6b7280); font-size: .85rem; font-weight: 600; }
.profile-field-value { color: var(--text,#0d1117); font-size: .9rem; font-weight: 500; text-align: right; word-break: break-word; }
a.profile-field-value { color: var(--accent,#b45309); text-decoration: none; }
a.profile-field-value:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   Tags sur les cartes prospect (langues + CPF)
   ═══════════════════════════════════════════════════════════ */
.prospect-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.prospect-tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; letter-spacing: .01em; }
.prospect-tag-lang { background: rgba(59,91,219,.12); color: #3b5bdb; }
.prospect-tag-cpf { background: rgba(22,163,74,.14); color: #15803d; }

/* Sous-section Contact entreprise (fiche prospect) */
.prospect-subsection { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border,#e4e8ef); }
.prospect-subsection-title { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 700; color: var(--text-2,#374151); margin: 0 0 12px; }
.prospect-subsection-title svg { color: var(--accent,#d97706); }
