/* public/assets/css/admin.css — Clain Digital */
/* Les polices et la palette viennent de tokens.css (chargé avant cette feuille). */
:root {
    --font-heading: var(--cd-font-serif);
    --font-body: var(--cd-font-sans);

    --bg-main: var(--cd-surface);
    --bg-card: var(--cd-surface-card);
    --bg-card-hover: color-mix(in srgb, var(--cd-surface-card) 92%, var(--cd-brand));
    --bg-card-inner: var(--cd-surface-alt);
    --border: var(--cd-border);

    --text-main: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-subtle: #94a3b8;
    --text-strong: #ffffff;

    --primary: var(--gold, #c9a84c);
    --primary-light: var(--gold, #c9a84c);   /* or en texte : liens, chiffres mis en avant */
    --primary-glow: rgba(201, 168, 76, 0.25);
    --on-primary: #0a0d1a;

    --success: var(--cd-success);
    --success-glow: rgba(60, 118, 80, 0.2);
    --warning: var(--cd-warning);
    --danger: var(--cd-danger);

    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --radius-full: 999px;
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);

    --tint: var(--cd-tint);
    --chrome-bg: var(--cd-surface-card);
    --surface-solid: var(--cd-surface-card);
    --surface-sunk: var(--cd-surface-alt);
    --overlay: rgba(10, 15, 22, 0.55);
    --shadow-card: var(--cd-shadow-subtle);
    --tone-ok: var(--cd-success);
    --tone-warn: var(--cd-accent-ink);
    --tone-bad: var(--cd-danger);
    --tone-hot: var(--cd-danger);
    --tone-info: var(--cd-brand-ink);
    --tone-acc: var(--cd-brand-ink);
    --tone-mute: var(--cd-slate);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--text-strong); text-decoration: underline; }

.admin-header {
    background-color: var(--chrome-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.8rem 2rem;
    display: flex;
    gap: 1rem 2rem;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-strong);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-strong);
    background: rgb(var(--tint) / 0.06);
    text-decoration: none;
}

.main-content {
    max-width: 1440px;
    margin: 2.5rem auto;
    padding: 0 2rem;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-strong);
    margin-bottom: 1.75rem;
    letter-spacing: -0.02em;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    padding: 1.75rem;
    margin-bottom: 1.75rem;
    transition: var(--transition);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 1.5rem; }

/* Stat Highlight Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-strong);
    margin: 0.5rem 0;
    line-height: 1.1;
}

.stat-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Funnel Visual Bars */
.funnel-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.funnel-step-box {
    background: var(--bg-card-inner);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.funnel-step-box:hover {
    border-color: rgba(47, 107, 158, 0.4);
    transform: translateY(-2px);
}

.funnel-step-num {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-strong);
    margin: 0.35rem 0;
}

.funnel-step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Lead Scoring Pills */
.score-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.score-pill.hot {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--tone-bad);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.score-pill.warm {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--tone-warn);
}

.score-pill.normal {
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--tone-mute);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-primary { background: rgba(47, 107, 158, 0.15); color: var(--tone-acc); border: 1px solid rgba(47, 107, 158, 0.3); }
.badge-success { background: rgba(60, 118, 80, 0.15); color: var(--tone-ok); border: 1px solid rgba(60, 118, 80, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--tone-warn); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--tone-bad); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(14, 165, 233, 0.15); color: var(--tone-info); border: 1px solid rgba(14, 165, 233, 0.3); }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
}

th {
    color: var(--text-muted);
    font-weight: 600;
    background: rgb(var(--tint) / 0.02);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tr:hover td {
    background-color: var(--bg-card-hover);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-size: 0.85rem;
    text-align: center;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-strong);
    box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(47, 107, 158, 0.4);
    text-decoration: none;
}

.btn-success { background: var(--success); color: var(--text-strong); }
.btn-danger { background: var(--danger); color: var(--text-strong); }
.btn-secondary { background: rgb(var(--tint) / 0.08); color: var(--text-strong); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgb(var(--tint) / 0.15); text-decoration: none; }

/* Alerts */
.alert {
    padding: 1.1rem 1.4rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
}
.alert-danger { background: rgba(239, 68, 68, 0.15); color: var(--tone-bad); border: 1px solid rgba(239, 68, 68, 0.35); }
.alert-warning { background: rgba(245, 158, 11, 0.15); color: var(--tone-warn); border: 1px solid rgba(245, 158, 11, 0.35); }
.alert-success { background: rgba(60, 118, 80, 0.15); color: var(--tone-ok); border: 1px solid rgba(60, 118, 80, 0.35); }

/* ---------- Identité Clain Digital ---------- */
.brand { text-decoration: none; gap: 12px; font-weight: 500; font-size: 1.15rem; }
.brand:hover { text-decoration: none; color: var(--text-strong); }
.brand .logo { display: inline-flex; align-items: center; gap: 12px; }
.brand .mark { width: 36px; height: 36px; color: var(--text-strong); }
.brand .logo-text b { font-weight: 700; color: var(--primary-light); }
.brand-tag { font-family: var(--font-body); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-subtle); padding: 0.2rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-full); }
.nav-links a.active { color: var(--on-primary); background: var(--primary); }
.nav-links a.nav-out { border: 1px solid var(--border); }
.nav-links a.nav-danger { color: var(--danger); }
.nav-count { display: inline-block; min-width: 1.4em; margin-left: 0.35rem; padding: 0 0.4em; border-radius: var(--radius-full); background: var(--warning); color: var(--cd-on-accent); font-size: 0.72rem; font-weight: 800; text-align: center; }
.btn { border-radius: var(--cd-radius-md); font-weight: 500; }
.btn-primary { background: var(--primary); color: var(--on-primary); border: none; box-shadow: var(--cd-shadow-subtle); }
.btn-primary:hover { color: var(--on-primary); background: color-mix(in srgb, var(--primary) 84%, #000); transform: none; }
h1, h2, h3, .page-title, .card-title { font-family: var(--font-heading); letter-spacing: -0.02em; }
.page-intro { color: var(--text-muted); max-width: 70ch; margin: -1rem 0 1.75rem; }
.table-group th.group { background: rgba(47, 107, 158, 0.12); color: var(--text-strong); font-family: var(--font-heading); font-size: 1rem; letter-spacing: -0.01em; text-transform: none; padding-top: 1rem; }
.table-group th.group small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }
.msg-body { white-space: pre-wrap; background: var(--bg-card-inner); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; margin-top: 0.75rem; font-size: 0.9rem; color: var(--text-main); max-height: 320px; overflow: auto; }
details.msg summary { cursor: pointer; color: var(--primary-light); font-weight: 600; font-size: 0.85rem; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.auth-brand .logo { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-heading); font-size: 1.3rem; color: var(--text-strong); }
.auth-brand .mark { width: 44px; height: 44px; }
.auth-brand .logo-text b { font-weight: 700; color: var(--primary-light); }
.auth-brand .mark, .side .brand .mark { color: var(--text-strong); }
@media (max-width: 760px) { .admin-header { padding: 0.8rem 1rem; } .main-content { padding: 0 1rem; margin-top: 1.5rem; } .brand-tag { display: none; } }

/* ---------- Champs de saisie ---------- */
label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin: 0.9rem 0 0.35rem; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="tel"], input[type="url"], input[type="search"], input[type="date"], select, textarea {
    width: 100%; padding: 0.65rem 0.9rem; margin-bottom: 0.25rem;
    font: inherit; color: var(--text-main);
    background: rgb(var(--tint) / 0.05); border: 1px solid rgba(47, 107, 158, 0.28); border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: rgb(var(--tint) / 0.08); box-shadow: 0 0 0 4px rgba(47, 107, 158, 0.22); }
input::placeholder, textarea::placeholder { color: var(--text-subtle); }
select option { background: var(--surface-solid); color: var(--text-main); }
textarea { min-height: 110px; resize: vertical; }
td input[type="number"], td input[type="text"] { margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.card form > .btn, .login-box .btn, .totp-box .btn { margin-top: 1.1rem; }
.login-box .btn, .totp-box .btn { width: 100%; justify-content: center; padding: 0.8rem 1rem; font-size: 0.95rem; }
code { font-size: 0.85em; padding: 0.1em 0.4em; border-radius: var(--cd-radius-md); background: rgb(var(--tint) / 0.07); }

/* ——— Menu latéral groupé ——— */
.admin-shell {
    --admin-kpi-width: 254px;
    display: grid;
    grid-template-columns: 242px minmax(0, 1fr) var(--admin-kpi-width);
    min-height: 100vh;
}
html.kpi-collapsed,
body.kpi-collapsed,
html.kpi-collapsed-init body.admin-shell {
    --admin-kpi-width: 52px;
}
.side {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--chrome-bg);
    border-right: 1px solid var(--border);
    padding: 1.1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}
.side .brand { padding: 0 0.5rem; font-size: 1.05rem; }
.side .brand .mark { width: 30px; height: 30px; }

/* Sélecteur des 3 univers : Prospection / Gestion / Administration */
.side-sections { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 3px; background: var(--surface-sunk); padding: 3px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.side-sec-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.4rem 0.2rem; border-radius: calc(var(--radius-md) - 2px); color: var(--text-muted); font-size: 0.68rem; font-weight: 600; text-align: center; text-decoration: none; position: relative; transition: var(--transition); }
.side-sec-btn:hover { color: var(--text-strong); text-decoration: none; background: rgb(var(--tint) / 0.05); }
.side-sec-btn.active { background: var(--chrome-bg); color: var(--primary-light); box-shadow: 0 1px 3px rgba(0,0,0,0.06); font-weight: 700; }
.side-sec-icon { font-size: 0.95rem; line-height: 1; margin-bottom: 2px; }
.side-sec-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: 0.7rem; }
.side-sec-btn .side-count { position: absolute; top: -3px; right: -3px; font-size: 0.6rem; padding: 0 0.35rem; }

/* Sections de navigation */
.side-nav { display: flex; flex-direction: column; gap: 0.85rem; flex: 1; }
.side-section-block { display: flex; flex-direction: column; gap: 2px; }
.side-section-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0.6rem 0.35rem; border-radius: var(--cd-radius-md); color: var(--text-subtle); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; transition: var(--transition); }
.side-section-header:hover { color: var(--text-strong); text-decoration: none; background: rgb(var(--tint) / 0.04); }
.is-active-section .side-section-header { color: var(--primary-light); font-weight: 800; }
.side-section-title { display: flex; align-items: center; gap: 0.4rem; }
.side-sec-emoji { font-size: 0.85rem; }
.side-section-links { display: flex; flex-direction: column; gap: 2px; }
.side-sublabel { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle); padding: 0.45rem 0.6rem 0.15rem; opacity: 0.8; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-subtle); padding: 0 0.6rem 0.3rem; }
.side-link { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.42rem 0.6rem; border-radius: var(--cd-radius-md); color: var(--text-muted); font-size: 0.88rem; font-weight: 500; }
.side-link:hover { background: rgb(var(--tint) / 0.05); color: var(--text-strong); text-decoration: none; }
.side-link.active { background: rgba(47, 107, 158, 0.18); color: var(--text-strong); font-weight: 600; }
.side-count { font-size: 0.72rem; font-weight: 700; padding: 0 0.45rem; border-radius: var(--radius-full); background: rgb(var(--tint) / 0.08); color: var(--text-strong); font-variant-numeric: lining-nums tabular-nums; }
.side-count.hot { background: var(--warning); color: var(--cd-on-accent); }
.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 0.9rem; }
.side-foot .side-link { font-size: 0.84rem; }
.side-danger { color: var(--danger); }
.admin-shell .main-content {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding: 2rem 2.25rem 3rem;
    max-width: 1360px;
    width: 100%;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}
@media (max-width: 860px) {
    .admin-shell { grid-template-columns: minmax(0, 1fr); }
    .side { position: static; height: auto; flex-direction: column; overflow-x: visible; padding: 0.75rem 1rem; gap: 0.75rem; border-right: 0; border-bottom: 1px solid var(--border); }
    .side .brand .logo-text { display: inline-flex; }
    .side-sections { width: 100%; }
    .side-nav { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
    .side-section-block { flex-direction: row; flex-wrap: wrap; gap: 2px; }
    .side-section-header, .side-sublabel { display: none; }
    .side-foot { margin: 0; border: 0; padding: 0; flex-direction: row; }
    .side-link { white-space: nowrap; }
    .admin-shell .main-content { padding: 1.25rem 1rem 2rem; }
    .admin-kpi-float-btn { bottom: 66px; }
}

/* ——— Bandeau latéral droit des indicateurs clés (KPIs) ——— */
.admin-kpi-bar {
    grid-column: 3;
    grid-row: 1;
    position: sticky;
    top: 0;
    right: 0;
    height: 100vh;
    width: var(--admin-kpi-width);
    background: var(--chrome-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 90;
    transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-kpi-backdrop {
    display: none !important;
    pointer-events: none !important;
}

.admin-kpi-float-btn {
    display: none !important;
    pointer-events: none !important;
}

.qs,
.mobile-bottom-bar {
    grid-column: 1 / -1;
    grid-row: 1;
}

/* Version réduite : bandeau vertical d'icônes */
.kpi-collapsed-strip {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 0.4rem;
    height: 100%;
    cursor: pointer;
}

html.kpi-collapsed .kpi-collapsed-strip,
body.kpi-collapsed .kpi-collapsed-strip,
html.kpi-collapsed-init body.admin-shell .kpi-collapsed-strip {
    display: flex;
}

html.kpi-collapsed .kpi-expanded-content,
body.kpi-collapsed .kpi-expanded-content,
html.kpi-collapsed-init body.admin-shell .kpi-expanded-content {
    display: none;
}

.kpi-expanded-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.kpi-strip-expand-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: rgb(var(--tint) / 0.06);
    border: 1px solid var(--border);
    border-radius: var(--cd-radius-md, 8px);
    color: var(--text-strong);
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
}
.kpi-strip-expand-btn:hover {
    background: var(--primary);
    color: var(--on-primary);
}
.kpi-arrow-icon,
.kpi-toggle-symbol {
    pointer-events: none;
    line-height: 1;
}

.kpi-strip-item {
    position: relative;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: var(--cd-radius-md, 8px);
    background: rgb(var(--tint) / 0.04);
    border: 1px solid transparent;
    text-decoration: none;
    transition: var(--transition);
}
.kpi-strip-item:hover {
    background: rgb(var(--tint) / 0.1);
    border-color: var(--border);
    text-decoration: none;
}
.kpi-strip-icon {
    font-size: 1rem;
    line-height: 1;
}
.kpi-strip-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    background: var(--warning);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.kpi-strip-badge.is-info {
    background: var(--primary);
    color: var(--on-primary);
}
.kpi-strip-badge.is-muted {
    background: rgb(var(--tint) / 0.2);
    color: var(--text-muted);
}
.kpi-strip-badge.is-danger {
    background: var(--danger);
    color: #fff;
}

/* Entête du bandeau */
.kpi-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0.85rem 0.75rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.kpi-bar-heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.kpi-bar-icon {
    font-size: 1.05rem;
}
.kpi-bar-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
.kpi-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: kpiPulse 2.4s infinite;
}
@keyframes kpiPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.kpi-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.kpi-bar-btn {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--cd-radius-md, 6px);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.kpi-bar-btn:hover {
    background: rgb(var(--tint) / 0.08);
    border-color: var(--border);
    color: var(--text-strong);
}
.kpi-close-btn {
    display: none;
}

/* Zone scrollable des cartes */
.kpi-bar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}
.kpi-bar-scroll::-webkit-scrollbar {
    width: 4px;
}
.kpi-bar-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 4px;
}

/* Cartes KPI */
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    padding: 0.85rem 0.85rem 0.75rem;
    transition: var(--transition);
}
.kpi-card:hover {
    border-color: rgba(201, 168, 76, 0.4);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}
.kpi-card-highlight {
    border-color: rgba(245, 158, 11, 0.35);
    background: color-mix(in srgb, var(--bg-card) 95%, #f59e0b);
}
.kpi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}
.kpi-card-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
.kpi-card-link {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--primary-light);
    text-decoration: none;
    opacity: 0.85;
    transition: var(--transition);
}
.kpi-card-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.kpi-card-main {
    margin-bottom: 0.55rem;
}
.kpi-stat-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-strong);
    font-variant-numeric: lining-nums tabular-nums;
}
.kpi-stat-value.text-amber {
    color: #f59e0b;
}
.kpi-stat-value.text-primary {
    color: var(--primary-light);
}
.kpi-stat-sublabel {
    font-size: 0.66rem;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}
.kpi-stat-money {
    font-family: var(--font-heading);
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: lining-nums tabular-nums;
}
.kpi-stat-money.text-success {
    color: #10b981;
}
.kpi-stat-money.text-danger {
    color: var(--danger);
}
.kpi-stat-caption {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Lignes de décomposition */
.kpi-breakdown {
    border-top: 1px solid rgb(var(--tint) / 0.08);
    padding-top: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.kpi-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.74rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.2rem 0.35rem;
    border-radius: var(--cd-radius-md, 6px);
    transition: var(--transition);
}
a.kpi-row:hover {
    background: rgb(var(--tint) / 0.06);
    color: var(--text-strong);
    text-decoration: none;
}
.kpi-row-name {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kpi-emoji {
    font-size: 0.85rem;
    line-height: 1;
}
.kpi-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    background: rgb(var(--tint) / 0.08);
    color: var(--text-strong);
    font-variant-numeric: lining-nums tabular-nums;
}
.kpi-pill.is-hot {
    background: #f59e0b;
    color: #0a0d1a;
}
.kpi-pill.is-danger {
    background: var(--danger);
    color: #fff;
}
.kpi-money-pill {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-strong);
    font-variant-numeric: lining-nums tabular-nums;
}
.kpi-row-arrow {
    color: var(--text-subtle);
    font-size: 0.75rem;
}
.kpi-alert-row {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger) !important;
}

/* Carte prochain RDV */
.kpi-next-rdv {
    display: block;
    border-top: 1px solid rgb(var(--tint) / 0.08);
    padding-top: 0.45rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
.kpi-next-rdv:hover {
    text-decoration: none;
}
.kpi-rdv-time {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--primary-light);
    margin-bottom: 0.15rem;
}
.kpi-rdv-who {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kpi-rdv-topic {
    font-size: 0.68rem;
    color: var(--text-subtle);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pied de barre */
.kpi-bar-footer {
    padding: 0.65rem 0.85rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-subtle);
    flex-shrink: 0;
}
.kpi-footer-badge {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-muted);
}
.kpi-footer-city {
    font-size: 0.64rem;
    color: var(--text-subtle);
}

/* Bouton flottant mobile & tablette */
.admin-kpi-float-btn {
    display: none;
}

@media (min-width: 1024px) and (max-width: 1240px) {
    .admin-shell {
        --admin-kpi-width: 236px;
    }
}

/* Responsive & Drawer (< 1024px : tablettes et mobiles) */
@media (max-width: 1023px) {
    .admin-shell {
        grid-template-columns: 242px minmax(0, 1fr);
    }
    .admin-kpi-bar {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        bottom: 0 !important;
        width: 280px !important;
        max-width: 86vw !important;
        height: 100vh !important;
        z-index: 1050 !important;
        grid-column: auto !important;
        grid-row: auto !important;
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: -8px 0 28px rgba(0, 0, 0, 0.4);
    }
    .admin-kpi-bar.is-drawer-open {
        transform: translateX(0) !important;
    }
    .admin-kpi-bar .kpi-close-btn {
        display: inline-grid;
    }
    .admin-kpi-bar .kpi-toggle-btn {
        display: none;
    }
    .admin-kpi-bar .kpi-collapsed-strip {
        display: none !important;
    }
    .admin-kpi-bar .kpi-expanded-content {
        display: flex !important;
    }
    .admin-kpi-backdrop {
        display: none !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(10, 13, 26, 0.6) !important;
        backdrop-filter: blur(2px) !important;
        z-index: 1040 !important;
        pointer-events: none !important;
    }
    .admin-kpi-backdrop.is-active {
        display: block !important;
        pointer-events: auto !important;
    }
    .admin-kpi-float-btn {
        display: flex !important;
        pointer-events: auto !important;
        align-items: center;
        gap: 0.4rem;
        position: fixed;
        right: 14px;
        bottom: 74px;
        z-index: 900;
        background: var(--bg-card, #1A2533);
        border: 1px solid var(--primary, #c9a84c);
        color: var(--text-strong, #fff);
        padding: 0.45rem 0.75rem;
        border-radius: var(--radius-full);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 12px rgba(201, 168, 76, 0.25);
        font-size: 0.76rem;
        font-weight: 700;
        cursor: pointer;
        transition: var(--transition);
    }
    .admin-kpi-float-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    }
    .kpi-float-badge {
        background: #f59e0b;
        color: #0a0d1a;
        font-size: 0.65rem;
        font-weight: 800;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: var(--radius-full);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ——— En-tête de page ——— */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.75rem; font-weight: 800; color: var(--text-strong); margin: 0; }
.page-head .sub { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }
.page-head .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.section { margin-bottom: 1.75rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.section-head h2 { font-size: 1.1rem; color: var(--text-strong); margin: 0; }
.section-head .hint { color: var(--text-subtle); font-size: 0.8rem; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); }
.panel.pad { padding: 1rem 1.1rem; }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* ——— Blocages ——— */
.blockers { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.blocker { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; padding: 0.6rem 0.9rem; border-radius: var(--radius-md); font-size: 0.88rem; background: rgba(168, 75, 50, 0.1); border: 1px solid rgba(168, 75, 50, 0.35); color: var(--tone-bad); }
.blocker.warn { background: rgba(192, 122, 46, 0.08); border-color: rgba(192, 122, 46, 0.3); color: var(--tone-warn); }
.blocker.ok { background: rgba(60, 118, 80, 0.08); border-color: rgba(60, 118, 80, 0.3); color: var(--tone-ok); }
.blocker span { flex: 1 1 280px; min-width: 0; }
.blocker a { color: inherit; font-weight: 700; text-decoration: underline; white-space: nowrap; }

/* ——— Compteurs à faire ——— */
.todo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1.75rem; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 0.85rem 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); color: inherit; }
.tile:hover { border-color: rgba(47, 107, 158, 0.55); text-decoration: none; color: inherit; }
.tile .n { font-family: var(--font-heading); font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.tile .l { font-weight: 600; font-size: 0.9rem; color: var(--text-strong); }
.tile .d { color: var(--text-subtle); font-size: 0.76rem; }
.tile.zero .n { color: var(--text-subtle); }
@media (max-width: 980px) { .todo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ——— Liste d'actions ——— */
.rows .row { display: grid; grid-template-columns: 175px minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 0.9rem; align-items: center; padding: 0.7rem 1rem; border-top: 1px solid var(--border); }
.rows .row:first-child { border-top: 0; }
.rows .who strong { display: block; color: var(--text-strong); }
.rows small, .muted-sm { color: var(--text-subtle); font-size: 0.76rem; }
.rows .what { font-size: 0.88rem; color: var(--text-muted); }
.rows .empty { padding: 1.2rem 1rem; color: var(--text-muted); }
@media (max-width: 760px) { .rows .row { grid-template-columns: minmax(0, 1fr) auto; } .rows .what { grid-column: 1 / -1; } }

/* ——— Pastilles ——— */
.chip { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); border: 1px solid; white-space: nowrap; }
.chip.ok { color: var(--tone-ok); border-color: rgba(60, 118, 80, 0.35); background: rgba(60, 118, 80, 0.1); }
.chip.warn { color: var(--tone-warn); border-color: rgba(192, 122, 46, 0.35); background: rgba(192, 122, 46, 0.08); }
.chip.bad { color: var(--tone-bad); border-color: rgba(168, 75, 50, 0.35); background: rgba(168, 75, 50, 0.1); }
.chip.info { color: var(--tone-info); border-color: rgba(56, 189, 248, 0.35); background: rgba(56, 189, 248, 0.08); }
.chip.acc { color: var(--tone-acc); border-color: rgba(47, 107, 158, 0.4); background: rgba(47, 107, 158, 0.14); }
.chip.mute { color: var(--text-muted); border-color: var(--border); background: transparent; }

/* ——— Ce qu'on a trouvé ——— */
.found { display: flex; flex-wrap: nowrap; gap: 4px; align-items: flex-start; }
td.found-cell { min-width: 300px; }
td .badge { white-space: nowrap; }
table.compact td { padding-top: 0.7rem; padding-bottom: 0.7rem; vertical-align: middle; }
.f { display: inline-flex; flex-direction: column; line-height: 1.15; font-size: 0.76rem; font-weight: 600; padding: 3px 7px; border-radius: var(--cd-radius-md); border: 1px solid; white-space: nowrap; cursor: default; }
.f small { font-weight: 400; font-size: 0.66rem; opacity: 0.85; }
.f.sure { color: var(--tone-ok); border-color: rgba(60, 118, 80, 0.35); background: rgba(60, 118, 80, 0.1); }
.f.check { color: var(--tone-warn); border: 1px dashed rgba(192, 122, 46, 0.6); background: rgba(192, 122, 46, 0.06); }
.f.none { color: var(--text-subtle); border-color: var(--border); background: transparent; }
.f.todo { color: var(--text-subtle); border: 1px dashed var(--border); background: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; align-items: center; color: var(--text-subtle); font-size: 0.78rem; margin: 0.25rem 0 0.75rem; }
.legend .f { display: inline-block; margin-right: 4px; }
.found-table td:first-child { color: var(--text-muted); white-space: nowrap; }
.found-table .where { color: var(--text-muted); font-size: 0.86rem; }
.found-table .where a { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.78rem; overflow-wrap: anywhere; }
.copy-btn { margin-left: 6px; font-size: 0.7rem; padding: 1px 8px; border-radius: var(--radius-full); border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; }
.copy-btn:hover { color: var(--text-strong); }
.state-sure { color: var(--success); }

/* ——— Score ——— */
.score { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px; border-radius: var(--cd-radius-md); font-weight: 700; font-size: 0.8rem; font-variant-numeric: lining-nums tabular-nums; }
.score.hot { background: rgba(168, 75, 50, 0.16); color: var(--tone-hot); }
.score.warm { background: rgba(192, 122, 46, 0.13); color: var(--tone-warn); }
.score.cold { background: rgb(var(--tint) / 0.06); color: var(--text-muted); }
.reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.86rem; }
.reasons li { display: flex; justify-content: space-between; gap: 0.75rem; color: var(--text-muted); }
.reasons li b { font-variant-numeric: lining-nums tabular-nums; color: var(--text-strong); white-space: nowrap; }
.reasons li b.neg { color: var(--danger); }

/* ——— Trouvé récemment ——— */
.harvest { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.harvest > div { padding: 0.9rem 1rem; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.harvest > div:first-child { border-left: 0; }
.harvest .h { display: flex; align-items: baseline; gap: 0.5rem; }
.harvest .h b { font-family: var(--font-heading); font-size: 1.5rem; font-variant-numeric: lining-nums tabular-nums; }
.harvest .h span { font-weight: 600; color: var(--text-strong); }
.harvest ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 0.8rem; color: var(--text-muted); }
.harvest li { display: flex; justify-content: space-between; gap: 0.5rem; }
.harvest li span:last-child { color: var(--text-strong); font-variant-numeric: lining-nums tabular-nums; }
.harvest a { font-size: 0.8rem; margin-top: auto; }
@media (max-width: 980px) { .harvest { grid-template-columns: repeat(2, minmax(0, 1fr)); } .harvest > div:nth-child(3) { border-left: 0; } .harvest > div:nth-child(n+3) { border-top: 1px solid var(--border); } }

/* ——— Parcours ——— */
.pipe { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; }
.pipe .stage { padding: 0.7rem 0.9rem; border-left: 1px solid var(--border); position: relative; }
.pipe .stage:first-child { border-left: 0; }
.pipe .stage .n { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; color: var(--text-strong); font-variant-numeric: lining-nums tabular-nums; }
.pipe .stage .l { font-size: 0.76rem; color: var(--text-muted); }
.pipe .stage .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--primary); }
@media (max-width: 980px) { .pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); } .pipe .stage:nth-child(5) { border-left: 0; } .pipe .stage:nth-child(n+5) { border-top: 1px solid var(--border); } }
@media (max-width: 560px) { .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pipe .stage { border-left: 0; border-top: 1px solid var(--border); } }

.two-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 980px) { .two-cols { grid-template-columns: minmax(0, 1fr); } }
.status-lines { display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.88rem; }
.status-lines .line { display: flex; justify-content: space-between; gap: 0.75rem; }
.status-lines .line span:first-child { color: var(--text-muted); }
details.fold { border-top: 1px solid var(--border); padding-top: 0.6rem; font-size: 0.85rem; }
details.fold summary { cursor: pointer; color: var(--primary-light); }
.rate { display: inline-block; height: 6px; border-radius: var(--cd-radius-md); background: var(--success); vertical-align: middle; margin-right: 6px; }
td.r, th.r { text-align: right; font-variant-numeric: lining-nums tabular-nums; }

/* ——— Filtres rapides ——— */
.quick-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.6rem; }
.qf { border: 1px solid var(--border); color: var(--text-muted); border-radius: var(--radius-full); padding: 0.35rem 0.8rem; font-size: 0.82rem; font-weight: 500; }
.qf:hover { color: var(--text-strong); text-decoration: none; border-color: rgba(47, 107, 158, 0.5); }
.qf.on { background: rgba(47, 107, 158, 0.18); color: var(--text-strong); border-color: rgba(47, 107, 158, 0.55); }
.search-inline { display: flex; gap: 0.5rem; flex: 1 1 260px; min-width: 0; }
.search-inline input { margin: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgb(var(--tint) / 0.025); }
td .sm { display: block; color: var(--text-subtle); font-size: 0.76rem; }

/* ——— Tableau de bord ——— */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1.75rem; }
.kpi { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.kpi .k { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle); }
.kpi .v { font-family: var(--font-heading); font-size: 1.9rem; font-weight: 800; color: var(--text-strong); line-height: 1.15; font-variant-numeric: lining-nums tabular-nums; }
.kpi .d { font-size: 0.8rem; color: var(--text-muted); }
.kpi.lead .v { color: var(--primary-light); }
@media (max-width: 980px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 980px) { .charts { grid-template-columns: minmax(0, 1fr); } }
.chart { padding: 1rem 1.1rem; min-width: 0; }
.chart h3 { font-size: 1rem; color: var(--text-strong); margin: 0 0 0.2rem; }
.chart .hint { color: var(--text-subtle); font-size: 0.78rem; margin-bottom: 0.8rem; }
.hbars { display: flex; flex-direction: column; gap: 0.45rem; }
.hbar { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 5.5rem; gap: 0.6rem; align-items: center; font-size: 0.82rem; }
.hbar .lab { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 10px; background: rgb(var(--tint) / 0.04); border-radius: 0 4px 4px 0; position: relative; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary-light); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .fill.sub { background: var(--tone-hot); }
.hbar .val { text-align: right; color: var(--text-strong); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.hbar:hover .lab { color: var(--text-strong); }
.vbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; align-items: end; height: 150px; padding-top: 1.2rem; border-bottom: 1px solid var(--border); }
.vbar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.vbar .fill { width: 100%; background: var(--primary-light); border-radius: 4px 4px 0 0; min-height: 2px; }
.vbar .fill.hot { background: var(--tone-hot); }
.vbar .fill.warm { background: var(--tone-warn); }
.vbar .top { position: absolute; left: 0; right: 0; text-align: center; font-size: 0.7rem; color: var(--text-muted); font-variant-numeric: lining-nums tabular-nums; }
.vlabels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; font-size: 0.7rem; color: var(--text-subtle); text-align: center; margin-top: 0.3rem; }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.76rem; color: var(--text-muted); margin-top: 0.6rem; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: var(--cd-radius-md); margin-right: 5px; vertical-align: -1px; }
.forecast-table td, .forecast-table th { white-space: nowrap; }
.forecast-table .bar-cell { min-width: 120px; }
.forecast-table .mini { height: 8px; background: var(--primary-light); border-radius: 0 4px 4px 0; min-width: 2px; }
.note { font-size: 0.82rem; color: var(--text-muted); }

/* ——— Suivi commercial ——— */
.followup-form label:first-child { margin-top: 0; }
.fu-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.75rem; }
.fu-row label { margin-top: 0; }
.fu-dates { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.fu-dates input { width: auto; margin: 0; }
.fu-dates .qf { background: transparent; cursor: pointer; font: inherit; font-size: 0.8rem; }
.followup-form textarea { width: 100%; }
.timeline-fu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.timeline-fu li { display: flex; flex-direction: column; gap: 0.3rem; border-left: 2px solid var(--border); padding-left: 0.8rem; }
.timeline-fu li:first-child { border-left-color: var(--primary-light); }
.fu-head { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.fu-note { font-size: 0.88rem; color: var(--text-main); }

/* ——— Courrier libre ——— */
.free-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.25rem; align-items: start; }
.free-form { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.free-form label:first-of-type { margin-top: 0.4rem; }
.free-form textarea, .free-form input, .free-form select { width: 100%; }
.free-h { font-size: 1rem; color: var(--text-strong); margin: 0; }
.free-preview { position: sticky; top: 1rem; min-width: 0; }
.free-preview iframe { width: 100%; height: 1120px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #e5e7eb; }
@media (max-width: 1100px) { .free-grid { grid-template-columns: minmax(0, 1fr); } .free-preview { position: static; } .free-preview iframe { height: 900px; } }

/* ——— Sélecteur de thème ——— */
.theme-switch { display: flex; gap: 2px; margin: 0 0.6rem 0.5rem; padding: 3px; border-radius: var(--radius-full); border: 1px solid var(--border); background: rgb(var(--tint) / 0.04); }
.theme-switch button { flex: 1; padding: 0.3rem 0.4rem; border: 0; border-radius: var(--radius-full); background: transparent; color: var(--text-muted); font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.theme-switch button:hover { color: var(--text-strong); }
.theme-switch button[aria-pressed="true"] { background: rgba(47, 107, 158, 0.2); color: var(--text-strong); }
.no-js .theme-switch { display: none; }
.auth-theme { position: fixed; top: 1rem; right: 1rem; margin: 0; }
@media (max-width: 860px) { .side .theme-switch { margin: 0; flex: none; } }

/* ——— Clain Digital : Playfair pour les titres, DM Sans pour l'interface (boutons, étiquettes de blocs) ——— */
.btn, .glass h3, .side-label, .kpi .k { font-family: var(--font-body); }
.glass h3 { letter-spacing: var(--cd-tracking-label); font-weight: 500; }

/* ——— Affaires : devis ferme, acceptation, checklist ——— */
a.deal-row { color: inherit; text-decoration: none; }
a.deal-row:hover { background: rgb(var(--tint) / 0.03); text-decoration: none; }
.rows .row .r { text-align: right; white-space: nowrap; }
.deal-form label { margin-top: 0.8rem; }
.deal-lines { margin-top: 0.8rem; }
.deal-lines td { vertical-align: top; }
.deal-lines td input[type="text"] { margin: 0; }
.deal-lines .num-input { width: 92px; text-align: right; }
.deal-lines td:first-child small { display: block; margin-top: 3px; }
.deal-lines .remove { display: inline-flex; gap: 4px; align-items: center; margin: 0.55rem 0 0; font-size: 0.75rem; font-weight: 400; color: var(--text-subtle); white-space: nowrap; }
.deal-lines .remove input { width: auto; margin: 0; }
.deal-total { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; margin-top: 1.2rem; padding: 0.9rem 1rem; border-radius: var(--radius-md); background: var(--bg-card-inner); border: 1px solid var(--border); font-size: 0.92rem; color: var(--text-muted); }
.deal-total strong { color: var(--text-strong); font-size: 1.1rem; }
.btn-row-admin { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.btn-row-admin .btn, .card form > .btn-row-admin .btn { margin-top: 0; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-box { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.6rem; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card-inner); }
.link-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: none; padding: 0; }
.check-section { margin: 1.1rem 0 0.4rem; font-family: var(--font-body); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-subtle); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.4rem 0.3rem; border-radius: var(--radius-sm); }
.checklist li:hover { background: rgb(var(--tint) / 0.03); }
.checklist form { margin: 0; }
.checklist .tick { width: 20px; height: 20px; flex: none; margin-top: 1px; display: grid; place-items: center; padding: 0; border: 1.5px solid var(--border); border-radius: 4px; background: transparent; color: #fff; font-size: 0.75rem; line-height: 1; cursor: pointer; }
.checklist .tick:hover { border-color: var(--primary); }
.checklist li.done .tick { background: var(--success); border-color: var(--success); }
.checklist .lbl { flex: 1; font-size: 0.9rem; color: var(--text-main); }
.checklist li.done .lbl { color: var(--text-subtle); text-decoration: line-through; text-decoration-color: rgb(var(--tint) / 0.25); }
.checklist .lbl .chip { margin-left: 4px; text-decoration: none; }
.checklist .del button { border: 0; background: none; color: var(--text-subtle); font-size: 1rem; cursor: pointer; opacity: 0; padding: 0 4px; }
.checklist li:hover .del button { opacity: 1; }
.checklist .del button:hover { color: var(--danger); }
.add-task { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 0.5rem; margin-top: 1rem; }
.add-task input { margin: 0; }
.advance { display: grid; gap: 0.6rem; margin-top: 1rem; }
.advance form { margin: 0; }
.advance .btn { width: 100%; justify-content: center; }
.deal-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.84rem; color: var(--text-muted); max-height: 360px; overflow: auto; }
.deal-log small { display: block; }
@media (max-width: 760px) { .add-task { grid-template-columns: minmax(0, 1fr); } .deal-lines .num-input { width: 70px; } }
td.r, th.r { white-space: nowrap; }

/* ——— Veille clients ——— */
.naf-chosen { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.25rem; font-size: 0.84rem; color: var(--text-muted); }
.naf-chosen b { color: var(--text-strong); margin-right: 0.35rem; }
.zone-box { margin-top: 1rem; padding: 0.2rem 1rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card-inner); }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.funnel li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; padding: 0.55rem 0.8rem; border-radius: var(--radius-sm); background: var(--bg-card-inner); font-size: 0.9rem; }
.funnel li b { font-family: var(--font-heading); font-size: 1.1rem; color: var(--text-strong); }
.funnel li small { grid-column: 1 / -1; color: var(--danger); font-size: 0.8rem; }
.funnel li.cut { border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }
.feed-map { height: 380px; border-radius: var(--radius-md); border: 1px solid var(--border); overflow: hidden; z-index: 0; }
.feed-map-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--text-muted); }
.feed-map-legend i { display: inline-block; width: 11px; height: 11px; margin-right: 5px; vertical-align: -1px; border-radius: 50%; }
.feed-map-legend .dot { background: #2F6B9E; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #2F6B9E; }
.feed-map-legend .dot.st-contacte { background: #C98A2E; box-shadow: 0 0 0 1px #C98A2E; }
.feed-map-legend .dot.st-interesse { background: #2E8B57; box-shadow: 0 0 0 1px #2E8B57; }
.feed-map-legend .dot.st-ecarte { background: #8A949E; box-shadow: 0 0 0 1px #8A949E; }
.feed-map-legend .ring { border: 2.5px solid #5B2A86; background: rgba(91, 42, 134, 0.15); }
.feed-map-legend .area { border-radius: 2px; background: rgba(47, 107, 158, 0.15); border: 1px solid #2F6B9E; }

/* Pack créateur dans la fiche d'un client de la veille */
.pack-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.5rem; margin-bottom: 0.6rem; }
.pack-mod { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0; padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.pack-mod:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--bg-card)); }
.pack-mod input { margin-top: 0.2rem; }
.pack-mod b { display: block; font-size: 0.9rem; }
.pack-mod small { display: block; color: var(--text-muted); font-size: 0.76rem; line-height: 1.4; }
.pack-part { margin: 0.8rem 0 0; padding: 0.2rem 0.9rem 0.8rem; border: 1px dashed var(--border); border-radius: var(--radius-md); }
.pack-part legend { padding: 0 0.4rem; font-weight: 600; font-size: 0.86rem; }
.pack-part[hidden] { display: none; }
.pack-descr { max-height: 220px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.1rem 0.6rem; margin-top: 0.4rem; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); }
.pack-descr label { display: flex; gap: 0.4rem; align-items: baseline; margin: 0; padding: 0.15rem 0.3rem; border-radius: 4px; font-size: 0.82rem; font-weight: 400; cursor: pointer; }
.pack-descr label.on { background: color-mix(in srgb, var(--primary) 12%, transparent); font-weight: 600; }
.pack-descr label[hidden] { display: none; }
.pack-descr small { margin-left: auto; color: var(--text-muted); font-size: 0.7rem; font-weight: 400; }
.pack-inline { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; align-items: center; }
.pack-inline .check-line { margin: 0; }

/* ——— PWA Mobile Bottom Bar ——— */
.mobile-bottom-bar { display: none; }
@media (max-width: 768px) {
    .mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--bg-card, #111827);
        border-top: 1px solid var(--border, #2d3748);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
    }
    .mob-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        flex: 1;
        height: 100%;
        color: var(--text-muted, #94a3b8);
        text-decoration: none;
        font-size: 0.72rem;
        position: relative;
    }
    .mob-btn.active, .mob-btn:hover {
        color: var(--primary, #38bdf8);
        font-weight: 700;
    }
    .mob-icon { font-size: 1.15rem; line-height: 1; }
    .mob-badge {
        position: absolute;
        top: 6px;
        right: calc(50% - 18px);
        background: var(--danger, #ef4444);
        color: #fff;
        font-size: 0.65rem;
        padding: 1px 5px;
        border-radius: 10px;
        font-weight: 700;
    }
    body.admin-shell { padding-bottom: 70px; }
}

/* ——— CRM Pipeline / Kanban ——— */
.crm-kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    min-height: calc(100vh - 280px);
    scroll-snap-type: x mandatory;
}
.crm-column {
    flex: 0 0 310px;
    background: var(--bg-card-inner, rgba(255,255,255,0.03));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
    scroll-snap-align: start;
}
.crm-col-header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}
.crm-col-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-strong);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.crm-col-count {
    background: var(--chrome-bg, rgba(255,255,255,0.1));
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.crm-col-value {
    padding: 0.4rem 1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border);
}
.crm-col-cards {
    padding: 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}
.crm-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.crm-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.crm-card.dragging {
    opacity: 0.4;
    cursor: grabbing;
}
.crm-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-strong);
    line-height: 1.3;
}
.crm-card-title a { color: inherit; text-decoration: none; }
.crm-card-title a:hover { color: var(--primary); }
.crm-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.crm-card-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.2rem;
}
.crm-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
    font-size: 0.78rem;
}

/* ——— Mode Switcher (Tableau / Kanban / Carte) ——— */
.view-switcher {
    display: inline-flex;
    background: var(--bg-card-inner, rgba(255,255,255,0.06));
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    gap: 2px;
}
.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.view-btn.active {
    background: var(--primary);
    color: #fff;
}
.view-btn:hover:not(.active) {
    background: rgba(255,255,255,0.08);
    color: var(--text-strong);
}

/* ─────────────────────────────────────────────
   SYSTÈME DE DESIGN UNIFIÉ — ADMINISTRATION
   Harmonisation complète avec la charte Clain Digital
   ───────────────────────────────────────────── */

:root {
  --gold:       #c9a84c;
  --gold-light: #e2c97a;
  --copper:     #b87333;
  --bg-deep:    #0a0d1a;
  --bg-mid:     #0f1428;
  --primary:    var(--gold);
  --primary-light: var(--gold);
  --primary-glow: rgba(201, 168, 76, 0.25);
  --on-primary: #0a0d1a;
}

[data-theme="light"] {
  --gold:       #b38928;
  --gold-light: #c9a84c;
  --copper:     #9e5b20;
  --bg-deep:    #F7F3ED;
  --bg-mid:     #FFFFFF;
  --primary:    var(--gold);
  --primary-light: var(--gold);
  --primary-glow: rgba(179, 137, 40, 0.25);
  --on-primary: #0a0d1a;
  --text-main: #1A2533;
  --text-muted: #4A5868;
  --text-subtle: #7D8DA0;
  --text-strong: #0a0d1a;
}

/* ── Typographie et accents dorés ── */
em, i:not(.ico):not([class*="emoji"]):not(.threat),
h1 em, h2 em, h3 em,
.page-title em,
.card-title em,
[class*="italic"],
[class*="accent"],
.grad-text,
.brand .logo-text b,
.auth-brand .logo-text b {
  color: var(--gold) !important;
  font-style: italic !important;
}

.brand .mark,
.auth-brand .mark,
.side .brand .mark {
  color: var(--gold) !important;
}

/* ── Fond global et structure shell ── */
body.admin-shell,
body {
  background-color: #0a0d1a !important;
  color: #F7F3ED !important;
}

.side {
  background: #0f1428 !important;
  border-right: 1px solid rgba(201, 168, 76, 0.15) !important;
}

/* ── Boutons en pilule ── */
.btn,
button.btn,
a.btn {
  border-radius: 999px !important;
}

/* Bouton primaire : Dégradé signature Or & Cuivre */
.btn-primary,
button.btn-primary,
a.btn-primary,
.btn-cta,
button[type="submit"]:not(.btn-secondary):not(.btn-danger):not(.side-sec-btn):not(.theme-switch button) {
  background: linear-gradient(135deg, var(--gold, #c9a84c) 0%, var(--copper, #b87333) 100%) !important;
  color: #0a0d1a !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.25) !important;
  border-radius: 999px !important;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s !important;
}

.btn-primary:hover,
button.btn-primary:hover,
a.btn-primary:hover,
.btn-cta:hover,
button[type="submit"]:not(.btn-secondary):not(.btn-danger):not(.side-sec-btn):not(.theme-switch button):hover {
  background: linear-gradient(135deg, var(--gold-light, #e2c97a) 0%, var(--gold, #c9a84c) 100%) !important;
  color: #0a0d1a !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.4) !important;
}

/* Boutons secondaires / ghost */
.btn-secondary,
a.btn-secondary,
.btn-ghost,
a.btn-ghost,
.btn-outline,
a.btn-outline {
  background: transparent !important;
  border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  transition: transform 0.2s, border-color 0.2s, color 0.2s !important;
}

.btn-secondary:hover,
a.btn-secondary:hover,
.btn-ghost:hover,
a.btn-ghost:hover,
.btn-outline:hover,
a.btn-outline:hover {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
  transform: translateY(-2px) !important;
}

/* ── Cartes, panneaux et conteneurs avec profondeur ── */
.card,
.panel,
.glass,
.tile,
.login-box .card,
.totp-box .card {
  border-radius: 20px !important;
  background-color: #141b35 !important;
  border: 1px solid rgba(201, 168, 76, 0.18) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 -1px 0 rgba(201, 168, 76, 0.1) !important;
}

.tile:hover,
.card:hover {
  border-color: rgba(201, 168, 76, 0.35) !important;
}

/* ── Formulaires et champs de saisie ── */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="search"],
select,
textarea {
  border-radius: 12px !important;
  border: 1px solid rgba(201, 168, 76, 0.25) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: inherit !important;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.25) !important;
  outline: none !important;
}

/* ── Badges, tags, pastilles et filtres ── */
.chip,
.badge,
.brand-tag,
.score,
.f,
.nav-count,
.view-switcher,
.view-btn,
.qf,
.filter-pill {
  border-radius: 999px !important;
}

.view-switcher {
  border: 1px solid rgba(201, 168, 76, 0.25) !important;
  background: rgba(0, 0, 0, 0.25) !important;
  padding: 3px !important;
}

.view-btn.active,
.qf.on {
  background: linear-gradient(135deg, var(--gold) 0%, var(--copper) 100%) !important;
  color: #0a0d1a !important;
  font-weight: 700 !important;
  border-color: transparent !important;
}

.side-count.hot,
.nav-count {
  background: linear-gradient(135deg, var(--gold) 0%, var(--copper) 100%) !important;
  color: #0a0d1a !important;
  font-weight: 800 !important;
}

/* ── Navigation latérale (Sidebar) ── */
.side-sections {
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(201, 168, 76, 0.2) !important;
  border-radius: 999px !important;
  padding: 3px !important;
}

.side-sec-btn {
  border-radius: 999px !important;
  transition: all 0.2s ease !important;
}

.side-sec-btn.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--copper) 100%) !important;
  color: #0a0d1a !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.35) !important;
}
.side-sec-btn.active .side-sec-icon,
.side-sec-btn.active .side-sec-text {
  color: #0a0d1a !important;
}

.side-link {
  border-radius: 999px !important;
  transition: all 0.2s ease !important;
}

.side-link:hover {
  color: var(--gold) !important;
  background: rgba(201, 168, 76, 0.08) !important;
}

.side-link.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--copper) 100%) !important;
  color: #0a0d1a !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 10px rgba(201, 168, 76, 0.3) !important;
}
.side-link.active span,
.side-link.active .side-count {
  color: #0a0d1a !important;
}

.side-section-header {
  border-radius: 999px !important;
  transition: all 0.2s ease !important;
}
.side-section-header:hover {
  color: var(--gold) !important;
  background: rgba(201, 168, 76, 0.08) !important;
}

/* ── Sélecteur de thème en pilule ── */
.theme-switch {
  border-radius: 999px !important;
  border: 1px solid rgba(201, 168, 76, 0.3) !important;
  padding: 3px !important;
}
.theme-switch button {
  border-radius: 999px !important;
}
.theme-switch button[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--gold) 0%, var(--copper) 100%) !important;
  color: #0a0d1a !important;
  font-weight: 700 !important;
}

/* ── Recherche rapide (Ctrl+K) ── */
.qs form {
  border-radius: 20px !important;
  border: 1px solid rgba(201, 168, 76, 0.35) !important;
  background: #0f1428 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
}
.qs input[type="search"] {
  border-radius: 999px !important;
}
.kbd {
  border-radius: 6px !important;
  border: 1px solid rgba(201, 168, 76, 0.35) !important;
  color: var(--gold) !important;
}

/* ── Tableaux de données ── */
table th {
  background-color: #0f1428 !important;
  color: var(--gold) !important;
  font-weight: 700 !important;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2) !important;
}
tr:hover td {
  background-color: rgba(201, 168, 76, 0.05) !important;
}

/* ── Indicateur de défilement vers le bas (souris animée moderne) ── */
.scroll-hint,
.admin-scroll-hint {
  display: block !important;
  position: fixed !important;
  left: calc(242px + (100vw - 242px) / 2) !important;
  bottom: 24px !important;
  transform: translateX(-50%) !important;
  width: 22px !important;
  height: 38px !important;
  border: 1.5px solid rgba(201, 168, 76, 0.55) !important;
  border-radius: 999px !important;
  background: rgba(10, 13, 26, 0.75) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(201, 168, 76, 0.1) !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 40 !important;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s, box-shadow 0.3s, background 0.3s !important;
}

@media (max-width: 860px) {
  .scroll-hint,
  .admin-scroll-hint {
    left: 50% !important;
    bottom: 74px !important;
  }
}

.scroll-hint::before,
.admin-scroll-hint::before {
  content: '' !important;
  position: absolute !important;
  left: 50% !important;
  bottom: -15px !important;
  width: 7px !important;
  height: 7px !important;
  margin-left: -3.5px !important;
  border-right: 1.5px solid var(--gold, #c9a84c) !important;
  border-bottom: 1.5px solid var(--gold, #c9a84c) !important;
  transform: rotate(45deg) !important;
  animation: scroll-chevron 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
  pointer-events: none !important;
  opacity: 0.8 !important;
  transition: border-color 0.3s, opacity 0.3s !important;
}

.scroll-hint::after,
.admin-scroll-hint::after {
  content: '' !important;
  position: absolute !important;
  left: 50% !important;
  top: 7px !important;
  width: 3px !important;
  height: 7px !important;
  margin-left: -1.5px !important;
  border-radius: 999px !important;
  background: var(--gold, #c9a84c) !important;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.85) !important;
  animation: scroll-wheel 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
}

.scroll-hint:hover,
.admin-scroll-hint:hover {
  transform: translateX(-50%) translateY(-3px) scale(1.06) !important;
  border-color: var(--gold, #f3cf7a) !important;
  box-shadow: 0 8px 24px -2px rgba(201, 168, 76, 0.4), inset 0 0 12px rgba(201, 168, 76, 0.2) !important;
}

.scroll-hint:hover::before,
.admin-scroll-hint:hover::before {
  border-color: var(--gold, #f3cf7a) !important;
  opacity: 1 !important;
}

.scroll-hint:hover::after,
.admin-scroll-hint:hover::after {
  background: #f3cf7a !important;
  box-shadow: 0 0 12px #f3cf7a !important;
}

/* ── HARMONISATION THÈME CLAIR DANS L'ADMINISTRATION ── */
[data-theme="light"] body.admin-shell,
[data-theme="light"] body {
  background-color: var(--cd-surface, #F7F3ED) !important;
  color: var(--cd-ink, #1A2533) !important;
}

[data-theme="light"] .side {
  background-color: #EFE9DF !important;
  border-right: 1px solid #D3CABB !important;
}

[data-theme="light"] .admin-header {
  background-color: rgba(247, 243, 237, 0.94) !important;
  border-bottom: 1px solid #D3CABB !important;
}

[data-theme="light"] .side-sections {
  background: #E2DBD0 !important;
  border-color: #D3CABB !important;
}

[data-theme="light"] .card,
[data-theme="light"] .panel,
[data-theme="light"] .glass,
[data-theme="light"] .tile,
[data-theme="light"] .login-box .card,
[data-theme="light"] .totp-box .card {
  background: #FFFFFF !important;
  border: 1px solid #E8E2D8 !important;
  box-shadow: 0 4px 20px rgba(26, 37, 51, 0.06), 0 1px 3px rgba(26, 37, 51, 0.04) !important;
  color: var(--cd-ink, #1A2533) !important;
}

[data-theme="light"] .btn-secondary,
[data-theme="light"] a.btn-secondary,
[data-theme="light"] .btn-ghost,
[data-theme="light"] a.btn-ghost,
[data-theme="light"] .btn-outline,
[data-theme="light"] a.btn-outline {
  background: #FFFFFF !important;
  color: var(--cd-ink, #1A2533) !important;
  border: 1.5px solid var(--cd-border-strong, #D3CABB) !important;
}

[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] a.btn-secondary:hover,
[data-theme="light"] .btn-ghost:hover,
[data-theme="light"] a.btn-ghost:hover {
  border-color: var(--gold, #b38928) !important;
  color: var(--gold, #b38928) !important;
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] input[type="url"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="search"],
[data-theme="light"] select,
[data-theme="light"] textarea {
  border: 1px solid #D3CABB !important;
  background: #F7F3ED !important;
  color: #1A2533 !important;
}

[data-theme="light"] .view-switcher {
  background: #E2DBD0 !important;
  border-color: #D3CABB !important;
}

[data-theme="light"] table th {
  background-color: #F0EAE1 !important;
  color: var(--cd-ink, #1A2533) !important;
  border-bottom: 1px solid #D3CABB !important;
}

[data-theme="light"] tr:hover td {
  background-color: #F9F7F4 !important;
}

[data-theme="light"] .table-group th.group {
  background-color: rgba(201, 168, 76, 0.12) !important;
  color: var(--cd-ink, #1A2533) !important;
}

[data-theme="light"] .qs form {
  background: #FFFFFF !important;
  border: 1px solid #D3CABB !important;
  box-shadow: 0 20px 60px rgba(26, 37, 51, 0.18) !important;
}

[data-theme="light"] .scroll-hint,
[data-theme="light"] .admin-scroll-hint {
  border-color: rgba(179, 137, 40, 0.65) !important;
  background: rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 4px 18px -2px rgba(179, 137, 40, 0.2), inset 0 0 10px rgba(179, 137, 40, 0.08) !important;
}
[data-theme="light"] .scroll-hint:hover,
[data-theme="light"] .admin-scroll-hint:hover {
  border-color: var(--gold, #b38928) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 8px 24px -2px rgba(179, 137, 40, 0.35) !important;
}
[data-theme="light"] .scroll-hint::before,
[data-theme="light"] .admin-scroll-hint::before {
  border-color: var(--gold, #b38928) !important;
}
[data-theme="light"] .scroll-hint::after,
[data-theme="light"] .admin-scroll-hint::after {
  background: var(--gold, #b38928) !important;
  box-shadow: 0 0 8px rgba(179, 137, 40, 0.75) !important;
}

/* Thème clair — Bandeau d'indicateurs (KPIs) */
[data-theme="light"] .admin-kpi-bar {
  background-color: #EFE9DF !important;
  border-left: 1px solid #D3CABB !important;
}
[data-theme="light"] .admin-kpi-bar .kpi-card {
  background: #FFFFFF !important;
  border-color: #E8E2D8 !important;
  box-shadow: 0 2px 8px rgba(26, 37, 51, 0.04) !important;
}
[data-theme="light"] .admin-kpi-bar .kpi-card:hover {
  border-color: #c9a84c !important;
  box-shadow: 0 4px 14px rgba(26, 37, 51, 0.08) !important;
}
[data-theme="light"] .admin-kpi-bar .kpi-card-highlight {
  background: #FFFBF5 !important;
  border-color: #F59E0B !important;
}
[data-theme="light"] .admin-kpi-bar .kpi-bar-header,
[data-theme="light"] .admin-kpi-bar .kpi-bar-footer {
  border-color: #D3CABB !important;
}
[data-theme="light"] .admin-kpi-bar .kpi-strip-item,
[data-theme="light"] .admin-kpi-bar .kpi-strip-expand-btn {
  background: #E2DBD0 !important;
  border-color: #D3CABB !important;
}
[data-theme="light"] .admin-kpi-float-btn {
  background: #FFFFFF !important;
  border-color: #b38928 !important;
  color: #1A2533 !important;
  box-shadow: 0 4px 14px rgba(26, 37, 51, 0.12) !important;
}




/* ===== Ergonomie générale (2026-11-12) : menu unique, recherche Ctrl+K, barre d'actions en lot, page Système ===== */

/* Bloc « Plus » du menu (styles auparavant en ligne) */
.side-more { margin-top: 2px; }
.side-more-summary { display: flex; align-items: center; justify-content: space-between; padding: 0.35rem 0.6rem; border-radius: var(--radius-md); color: var(--text-subtle); font-size: 0.8rem; font-weight: 500; cursor: pointer; user-select: none; list-style: none; }
.side-more-summary::-webkit-details-marker { display: none; }
.side-more-summary:hover { color: var(--text-strong); background: var(--bg-card-hover); }
.side-more-caret { font-size: 0.7rem; opacity: 0.6; transition: transform 0.15s ease; }
.side-more[open] .side-more-caret { transform: rotate(180deg); }
.side-more-links { display: flex; flex-direction: column; gap: 2px; padding-left: 0.4rem; border-left: 1px solid var(--border); margin: 2px 0 2px 0.6rem; }
.side-search-btn { width: 100%; background: transparent; border: 0; font: inherit; text-align: left; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }

/* Recherche rapide : résultats groupés par type */
.qs-results { margin-top: 0.5rem; max-height: min(60vh, 520px); overflow-y: auto; background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 0.35rem; }
.qs-group + .qs-group { border-top: 1px solid var(--border); margin-top: 0.3rem; padding-top: 0.3rem; }
.qs-group-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-subtle); padding: 0.35rem 0.6rem 0.2rem; }
.qs-item { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.45rem 0.6rem; border-radius: var(--radius-md); color: var(--text-strong); text-decoration: none; }
.qs-item:hover, .qs-item.is-cursor { background: var(--tint); outline: none; }
.qs-item-title { font-size: 0.92rem; font-weight: 600; }
.qs-item-sub { font-size: 0.78rem; color: var(--text-muted); }
.qs-empty { padding: 0.75rem; font-size: 0.85rem; color: var(--text-muted); text-align: center; }

/* Barre d'actions en lot des prospects : fixée en bas de l'écran dès qu'une sélection existe */
#batch-bar {
    position: fixed !important;
    top: auto !important;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: min(980px, calc(100vw - 2rem));
    margin: 0 !important;
    z-index: 150 !important;
}
@media (max-width: 768px) {
    #batch-bar { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
}
/* Place pour que la barre ne masque pas la dernière ligne */
#batch-form { padding-bottom: 5rem; }

/* Page Système : onglets */
.system-head { margin-bottom: 1.25rem; }
.system-backup { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--text-muted, #5b6470); }
.system-backup--stale, .system-backup--failed, .system-backup--missing { color: var(--danger, #b42318); font-weight: 600; }
.system-kicker { margin: 0 0 0.5rem; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary-light); }
.system-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; border-bottom: 1px solid var(--border); }
.system-tab { padding: 0.55rem 0.9rem; border-radius: var(--radius-md) var(--radius-md) 0 0; color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.system-tab:hover { color: var(--text-strong); background: var(--bg-card-hover); }
.system-tab.is-active { color: var(--text-strong); background: var(--bg-card); border-color: var(--border); }

/* Carte des prospects : mêmes filtres que la liste */
.map-list-filters { margin-bottom: 0.75rem; }
.map-list-filters .search-inline { margin-bottom: 0.5rem; }

/* Coordonnées saisies à la main (fiche prospect, file « À compléter ») */
.cf-form label { margin: 0.4rem 0 0.25rem; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 0.8rem; }
.cf-grid .cf-value { grid-column: span 2; }
.cf-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.6rem; }
.cf-check { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; font-weight: 500; }
.cf-check input { width: auto; margin: 0; }
.cf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.cf-list > li { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.55rem 0.75rem; background: var(--bg-card-inner); }
.cf-line { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.cf-line .cf-actions { display: inline-flex; gap: 0.4rem; align-items: center; }
.cf-line .cf-actions form { display: inline; margin: 0; }
.cf-list details > summary { cursor: pointer; color: var(--text-muted); font-size: 0.8rem; }
.gp-box { margin-top: 0.6rem; font-size: 0.88rem; }
.gp-box .gp-phone { font-weight: 700; color: var(--text-strong); margin-right: 0.5rem; }
.tc-item { scroll-margin-top: 80px; }
.tc-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.tc-links { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: 0.86rem; margin: 0.5rem 0; }
@media (max-width: 640px) { .cf-grid .cf-value { grid-column: auto; } }
