/* =====================================================================
   Depann'Afrik — tableaux de bord (administration & espace artisan)
   Esthétique « analytics » inspirée de BKLIT UI, thèmes sombre et clair.
   ===================================================================== */

:root {
    --bg: #09090B;
    --panel: #111114;
    --panel-2: #17171C;
    --panel-3: #1E1E24;
    --line: rgba(255, 255, 255, 0.07);
    --line-2: rgba(255, 255, 255, 0.12);
    --text: #F4F4F5;
    --text-2: #B4B4BD;
    --muted: #75757F;
    --c1: #FF7A1A;
    --c2: #FFC247;
    --c3: #34D399;
    --c4: #60A5FA;
    --c5: #A78BFA;
    --c6: #F472B6;
    --danger: #F87171;
    --grid: rgba(255, 255, 255, 0.06);
    --shadow: 0 24px 60px -20px rgba(0, 0, 0, .7);
    --glow: radial-gradient(120% 120% at 0% 0%, rgba(255, 122, 26, .10), transparent 45%);
    --radius: 18px;
    --font-d: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
    --font-b: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    color-scheme: dark;
}
:root[data-theme="light"] {
    --bg: #F6F5F2;
    --panel: #FFFFFF;
    --panel-2: #F4F3EF;
    --panel-3: #ECEAE4;
    --line: rgba(15, 15, 20, 0.08);
    --line-2: rgba(15, 15, 20, 0.14);
    --text: #16161A;
    --text-2: #4A4A55;
    --muted: #85858F;
    --c1: #F2620A;
    --c2: #E0A100;
    --c3: #10A974;
    --c4: #2F7AE5;
    --c5: #7C5CE0;
    --c6: #DB4C95;
    --danger: #DC2626;
    --grid: rgba(15, 15, 20, 0.07);
    --shadow: 0 20px 50px -24px rgba(20, 20, 30, .25);
    --glow: radial-gradient(120% 120% at 0% 0%, rgba(242, 98, 10, .07), transparent 45%);
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font-b);
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; border-radius: 6px; }
.i { flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.muted { color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: var(--c1); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; font-size: .86rem; white-space: nowrap; transition: background .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.btn:hover { background: var(--panel-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: linear-gradient(120deg, #FFC247, #FF6A1A 55%, #D9381E); border-color: transparent; color: #0B0D10; box-shadow: 0 8px 22px -10px rgba(255, 106, 26, .8); }
.btn--primary:hover { background: linear-gradient(120deg, #FFCB5F, #FF7A2E 55%, #E4462A); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .35); }
.btn--sm { height: 32px; padding: 0 11px; font-size: .8rem; border-radius: 9px; }
.btn--lg { height: 46px; padding: 0 20px; font-size: .95rem; border-radius: 13px; }
.btn--block { width: 100%; }
.btn--icon { width: 38px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 14px;
    border-right: 1px solid var(--line);
    background: var(--panel);
    z-index: 30;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.side__brand .logo-mark { border-radius: 10px; }
.side__brand strong { font-family: var(--font-d); font-size: 1.15rem; font-weight: 800; letter-spacing: -.03em; display: block; line-height: 1.1; }
.side__brand strong em { font-style: normal; color: var(--c1); }
.side__brand small { font-size: .72rem; color: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.side__label { padding: 14px 10px 6px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 0;
    background: none;
    width: 100%;
    text-align: left;
    font-weight: 500;
    color: var(--text-2);
    transition: background .2s, color .2s;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.is-active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-item.is-active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c1); }
.nav-item.is-active .i { color: var(--c1); }
.nav-item__count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(255, 122, 26, .16); color: var(--c1); font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.side__foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.me__avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: linear-gradient(135deg, #FFC247, #FF6A1A); color: #0B0D10; overflow: hidden; flex-shrink: 0; }
.me__avatar img { width: 100%; height: 100%; object-fit: cover; }
.me strong { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.me small { color: var(--muted); font-size: .75rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 28px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.top__title h1 { font-family: var(--font-d); font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.top__title p { color: var(--muted); font-size: .82rem; }
.top__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search { position: relative; }
.search input { width: 240px; height: 38px; padding: 0 12px 0 36px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel); outline: none; transition: border-color .2s, width .3s var(--ease); }
.search input:focus { border-color: var(--c1); width: 280px; }
.search .i { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.burger { display: none; }
.content { padding: 24px 28px 48px; display: grid; gap: 18px; }
.view { display: grid; gap: 18px; animation: viewIn .5s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Grille bento ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s9 { grid-column: span 9; } .s12 { grid-column: span 12; }

.card {
    position: relative;
    min-width: 0;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--glow), var(--panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
    animation: cardIn .7s var(--ease) both;
}
.grid > .card:nth-child(2) { animation-delay: .04s; } .grid > .card:nth-child(3) { animation-delay: .08s; }
.grid > .card:nth-child(4) { animation-delay: .12s; } .grid > .card:nth-child(n+5) { animation-delay: .16s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__head h2 { font-size: .95rem; font-weight: 600; }
.card__head p { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.card--flush { padding: 0; overflow: hidden; }
.card--flush .card__head { padding: 18px 18px 0; }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 6px; padding-bottom: 0; overflow: hidden; }
.kpi__label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .82rem; font-weight: 500; }
.kpi__label .i { color: var(--muted); }
.kpi__value { font-family: var(--font-d); font-size: 2.1rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.kpi__value small { font-size: .9rem; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi__meta { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
.kpi__spark { margin: 8px -18px 0; height: 46px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.delta--up { background: rgba(52, 211, 153, .14); color: var(--c3); }
.delta--down { background: rgba(248, 113, 113, .14); color: var(--danger); }
.delta--flat { background: var(--panel-3); color: var(--muted); }

/* Contrôle segmenté */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; font-size: .78rem; font-weight: 600; color: var(--muted); transition: all .2s; }
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--line-2); }

/* ---------- Graphiques ---------- */
.chart { position: relative; min-height: 120px; }
.ch-svg { display: block; overflow: visible; }
.ch-grid { stroke: var(--grid); stroke-dasharray: 3 4; }
.ch-axis { fill: var(--muted); font-size: 11px; font-family: var(--font-b); }
.ch-line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ch-line--thin { stroke-width: 1.8; }
.ch-crossline { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-cross { transition: opacity .15s; pointer-events: none; }
.ch-dot { stroke: var(--panel); stroke-width: 2.5; }
.ch-col { transition: opacity .2s; cursor: pointer; opacity: .55; }
.ch-col.is-last, .ch-col:hover { opacity: 1; }
.ch-tip {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    min-width: 160px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--panel-3);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow);
    font-size: .78rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    display: grid;
    gap: 5px;
}
.ch-tip.is-on { opacity: 1; }
.ch-tip strong { font-size: .76rem; color: var(--text-2); font-weight: 600; text-transform: capitalize; }
.ch-tip span { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.ch-tip span b { margin-left: auto; color: var(--text); font-weight: 700; }
.ch-tip i, .ch-legend i, .ch-ring-legend i { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ch-key { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: .76rem; font-weight: 600; color: var(--text-2); }
.ch-key.is-off { opacity: .4; }
.ch-empty { color: var(--muted); font-size: .85rem; padding: 18px 0; text-align: center; }

.ch-ring { position: relative; width: var(--size); height: var(--size); margin: 4px auto 14px; }
.ch-ring svg { display: block; }
.ch-ring-bg { fill: none; stroke: var(--panel-3); }
.ch-arc { fill: none; stroke-linecap: round; }
.ch-ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ch-ring-center strong { font-family: var(--font-d); font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.ch-ring-center span { color: var(--muted); font-size: .76rem; margin-top: 4px; }
.ch-ring-legend { display: grid; gap: 8px; }
.ch-ring-legend li { display: grid; grid-template-columns: auto 1fr auto 44px; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-2); }
.ch-ring-legend b { color: var(--text); }
.ch-ring-legend em { font-style: normal; color: var(--muted); text-align: right; font-size: .76rem; }

.ch-gauge { position: relative; text-align: center; max-width: 280px; margin: 0 auto; }
.ch-gauge svg { width: 100%; overflow: visible; }
.ch-gauge-bg, .ch-gauge-val { fill: none; stroke-width: 14; stroke-linecap: round; }
.ch-gauge-bg { stroke: var(--panel-3); }
.ch-tick { stroke: var(--line-2); stroke-width: 1.5; stroke-linecap: round; }
.ch-gauge-center { position: absolute; left: 0; right: 0; top: 52%; }
.ch-gauge-center strong { display: block; font-family: var(--font-d); font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.ch-gauge-center span { color: var(--muted); font-size: .78rem; }
.ch-gauge-cap { margin-top: 10px; color: var(--text-2); font-size: .82rem; }

.ch-funnel { position: relative; }
.ch-fu-step { position: absolute; top: 0; padding: 0 10px; display: grid; gap: 1px; }
.ch-fu-step span { font-size: .76rem; color: var(--muted); font-weight: 600; }
.ch-fu-step strong { font-family: var(--font-d); font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.ch-fu-step em { font-style: normal; font-size: .7rem; color: var(--c3); font-weight: 600; }
.ch-fu-div { stroke: var(--line); stroke-dasharray: 3 4; }

.ch-heat { display: grid; grid-template-columns: 34px repeat(var(--cols), minmax(0, 1fr)); gap: 4px; font-size: .68rem; color: var(--muted); }
.ch-heat-x { text-align: center; }
.ch-heat-y { display: flex; align-items: center; }
.ch-heat-cell { position: relative; aspect-ratio: 1.35; border-radius: 5px; background: var(--panel-3); overflow: hidden; }
.ch-heat-cell::before { content: ''; position: absolute; inset: 0; background: var(--color); opacity: var(--v); transition: opacity .6s var(--ease); }
.ch-heat-cell:hover { outline: 1.5px solid var(--text-2); }
.ch-heat-scale { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; font-size: .72rem; color: var(--muted); }
.ch-heat-scale i { width: 90px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--panel-3), var(--c1)); }

.ch-bars { display: grid; gap: 12px; }
.ch-bars-top { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; margin-bottom: 6px; color: var(--text-2); }
.ch-bars-top b { color: var(--text); }
.ch-bars-track { height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.ch-bars-track i { display: block; height: 100%; border-radius: inherit; }

/* Tuiles régionales */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(5, 1fr); gap: 5px; aspect-ratio: 6 / 4.4; }
.tile { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; padding: 6px 7px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); font-size: .64rem; color: var(--muted); overflow: hidden; transition: transform .25s var(--ease); }
.tile::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--c1); opacity: var(--heat, 0); }
.tile strong { font-family: var(--font-d); font-size: .95rem; color: var(--text); line-height: 1; }
.tile.is-hot, .tile.is-hot strong { color: #0B0D10; }
.tile:hover { transform: scale(1.06); z-index: 2; }

/* Flux d'activité */
.feed { display: grid; gap: 2px; max-height: 360px; overflow-y: auto; margin: 0 -8px; }
.feed li { display: flex; gap: 11px; padding: 9px 8px; border-radius: 10px; }
.feed li:hover { background: var(--panel-2); }
.feed__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--panel-3); color: var(--text-2); }
.feed__icon--wa { background: rgba(52, 211, 153, .13); color: var(--c3); }
.feed__icon--call { background: rgba(96, 165, 250, .13); color: var(--c4); }
.feed__icon--sos { background: rgba(248, 113, 113, .14); color: var(--danger); }
.feed__icon--pay { background: rgba(255, 194, 71, .14); color: var(--c2); }
.feed__icon--new { background: rgba(167, 139, 250, .14); color: var(--c5); }
.feed p { font-size: .83rem; color: var(--text-2); }
.feed p strong { color: var(--text); font-weight: 600; }
.feed small { color: var(--muted); font-size: .74rem; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; color: var(--c3); }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px transparent; } }

/* ---------- Tableaux ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar__right { margin-left: auto; display: flex; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: .78rem; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { color: var(--text); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip b { font-weight: 700; opacity: .6; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { position: sticky; top: 0; text-align: left; padding: 10px 14px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .85rem; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--panel-2); }
.table tbody tr.is-click { cursor: pointer; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.person { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.person__avatar { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: .78rem; background: var(--panel-3); color: var(--c2); overflow: hidden; }
.person__avatar img { width: 100%; height: 100%; object-fit: cover; }
.person strong { display: block; font-weight: 600; }
.person small { color: var(--muted); font-size: .76rem; }
.actions { display: flex; gap: 4px; justify-content: flex-end; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty .i { color: var(--c1); margin-bottom: 8px; }
.empty h3 { color: var(--text); font-size: 1rem; margin-bottom: 4px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; background: var(--panel-3); color: var(--text-2); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--plain::before { display: none; }
.badge--green { background: rgba(52, 211, 153, .13); color: var(--c3); }
.badge--amber { background: rgba(255, 194, 71, .14); color: var(--c2); }
.badge--orange { background: rgba(255, 122, 26, .14); color: var(--c1); }
.badge--blue { background: rgba(96, 165, 250, .14); color: var(--c4); }
.badge--violet { background: rgba(167, 139, 250, .14); color: var(--c5); }
.badge--red { background: rgba(248, 113, 113, .14); color: var(--danger); }
.stars { display: inline-flex; gap: 1px; color: var(--c2); }
.stars .i { fill: currentColor; }
.stars .off { color: var(--panel-3); }

/* Interrupteur */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; font-size: .85rem; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2); transition: background .25s; flex-shrink: 0; }
.switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .3s var(--ease); }
.switch input:checked + .switch__track { background: var(--c3); border-color: transparent; }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--c2); outline-offset: 2px; }
.avail { padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); }

/* Bandeaux d'information */
.banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; border: 1px solid; font-size: .88rem; }
.banner .i { flex-shrink: 0; }
.banner p { flex: 1; min-width: 200px; }
.banner strong { display: block; }
.banner--warn { background: rgba(255, 194, 71, .08); border-color: rgba(255, 194, 71, .3); }
.banner--warn > .i { color: var(--c2); }
.banner--ok { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .3); }
.banner--ok > .i { color: var(--c3); }
.banner--bad { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .3); }
.banner--bad > .i { color: var(--danger); }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 14px; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.field small { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); outline: none; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--c1); box-shadow: 0 0 0 3px rgba(255, 122, 26, .15); }
.form__error { padding: 10px 12px; border-radius: 11px; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .3); color: var(--danger); font-size: .85rem; }
.check { display: flex; align-items: center; gap: 9px; font-size: .86rem; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--c1); }

/* ---------- Fenêtres modales & tiroir ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.modal__panel { position: relative; width: min(520px, 100%); max-height: 90vh; overflow-y: auto; padding: 24px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .3s var(--ease), transform .4s var(--ease); }
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__panel { opacity: 1; transform: none; }
.modal__title { font-family: var(--font-d); font-size: 1.3rem; font-weight: 700; padding-right: 40px; }
.modal__sub { color: var(--muted); margin: 4px 0 18px; font-size: .86rem; }
.modal__close { position: absolute; top: 14px; right: 14px; }
.modal--drawer { place-items: stretch end; padding: 0; }
.modal--drawer .modal__panel { width: min(520px, 100%); max-height: none; height: 100%; border-radius: 0; border-width: 0 0 0 1px; transform: translateX(40px); }
.modal--drawer.is-open .modal__panel { transform: none; }
.secret { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--panel-2); border: 1px dashed var(--line-2); font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .06em; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; font-size: .86rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }

/* Notifications */
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-height: 420px; overflow-y: auto; padding: 8px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); z-index: 40; }
.menu__head { padding: 8px 10px 10px; font-weight: 600; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; justify-content: space-between; }
.bell { position: relative; }
.bell__dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--c1); box-shadow: 0 0 0 2px var(--bg); }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; width: min(380px, calc(100% - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: .86rem; opacity: 0; transform: translateY(10px); transition: all .35s var(--ease); }
.toast.is-in { opacity: 1; transform: none; }
.toast--success .i { color: var(--c3); } .toast--error .i { color: var(--danger); } .toast--info .i { color: var(--c2); }

/* ---------- Écran de connexion ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth__art { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 20% 20%, rgba(255, 122, 26, .35), transparent 50%), radial-gradient(circle at 80% 70%, rgba(255, 194, 71, .22), transparent 55%), #0B0B0E; color: #F4F4F5; }
.auth__art::after { content: ''; position: absolute; inset: 0; opacity: .12; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23FFC247' stroke-width='1.4'%3E%3Cpath d='M0 12 12 0l12 12L36 0l12 12L60 0l12 12L84 0l12 12'/%3E%3Ccircle cx='48' cy='48' r='9'/%3E%3Cpath d='M24 38v20M72 38v20'/%3E%3C/g%3E%3C/svg%3E"); }
.auth__art > * { position: relative; z-index: 1; }
.auth__art h2 { font-family: var(--font-d); font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; max-width: 12ch; }
.auth__art p { color: #B4B4BD; margin-top: 14px; max-width: 40ch; }
.auth__form { display: grid; place-items: center; padding: 32px; }
.auth__box { width: min(400px, 100%); }
.auth__box h1 { font-family: var(--font-d); font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
.auth__box > p { color: var(--muted); margin: 6px 0 24px; }

/* ---------- Divers ---------- */
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tips li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--text-2); }
.tips li:last-child { border-bottom: 0; }
.tips .i { margin-top: 2px; }
.tips .done .i { color: var(--c3); }
.tips .todo .i { color: var(--muted); }
.portfolio { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.shot { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.shot:hover img { transform: scale(1.05); }
.shot__del { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .2s; }
.shot:hover .shot__del, .shot:focus-within .shot__del { opacity: 1; }
.shot__cap { position: absolute; inset: auto 0 0; padding: 8px 10px; font-size: .75rem; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; }
.shot--add { display: grid; place-items: center; align-content: center; gap: 8px; border: 1.5px dashed var(--line-2); color: var(--muted); font-weight: 600; cursor: pointer; background: transparent; }
.shot--add:hover { border-color: var(--c1); color: var(--c1); }
.plan-card { padding: 22px; border-radius: 18px; border: 1px solid var(--line-2); background: radial-gradient(circle at 100% 0%, rgba(255, 122, 26, .16), transparent 55%), var(--panel-2); }
.plan-card h3 { font-family: var(--font-d); font-size: 1.6rem; font-weight: 700; margin: 6px 0 2px; }
.qr { display: grid; place-items: center; padding: 18px; border-radius: 16px; background: #fff; width: fit-content; margin: 0 auto; }
.qr img, .qr canvas { display: block; }
.recorder { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.recorder audio { flex: 1; min-width: 220px; height: 38px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: live 1.2s infinite; color: var(--danger); }

/* ---------- Espace patron : profils de l'équipe ---------- */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.member { display: grid; gap: 12px; align-content: start; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel-2); transition: border-color .3s var(--ease); }
.member:hover { border-color: var(--line-2); }
.member.is-off { opacity: .72; }
.member__head { display: flex; gap: 12px; align-items: center; }
.member__head .me__avatar { width: 52px; height: 52px; border-radius: 16px; font-size: 1rem; flex-shrink: 0; }
.member__head strong { display: block; font-weight: 700; }
.member__head small { color: var(--muted); font-size: .78rem; }
.member__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.member__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.member__foot .switch { font-size: .8rem; color: var(--text-2); }
.member--add { place-items: center; align-content: center; min-height: 170px; border-style: dashed; border-width: 1.5px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.member--add:hover { border-color: var(--c1); color: var(--c1); }
.seats { display: block; height: 6px; border-radius: 6px; background: var(--panel-3); overflow: hidden; margin-top: 10px; }
.seats span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c2), var(--c1)); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .s3 { grid-column: span 6; }
    .s4, .s5 { grid-column: span 6; }
    .s7, .s8, .s9 { grid-column: span 12; }
}
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: var(--shadow); }
    .side.is-open { transform: none; }
    .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .5); }
    .burger { display: inline-flex; }
    .top { padding: 12px 16px; }
    .content { padding: 16px 16px 40px; }
    .search { display: none; }
    .s3, .s4, .s5, .s6 { grid-column: span 12; }
    .auth { grid-template-columns: 1fr; }
    .auth__art { display: none; }
}
@media (max-width: 560px) {
    .top { flex-wrap: wrap; row-gap: 10px; }
    .top__title { flex: 1; min-width: 0; }
    .top__title h1 { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .top__actions { margin-left: 0; width: 100%; justify-content: space-between; }
    .top__title p { display: none; }
    .form__grid { grid-template-columns: 1fr; }
    .kpi__value { font-size: 1.8rem; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
    .side, .top, .btn { display: none !important; }
    .app { display: block; }
}
