/* Back-office du site dole-money.ga — refonte 2026-10 (maquette validée).
 * Mêmes couleurs que le site public (nuit #1A0033, or #FFD700, Inter).
 * Feuille autonome : sans Tailwind, sans librairie de graphiques. */

:root {
  --night: #1A0033;
  --side: #140029;
  --surface: #241047;
  --surface-2: #2C1657;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --gold: #FFD700;
  --gold-hover: #FFE24D;
  --gold-soft: rgba(255, 215, 0, 0.13);
  --gold-line: rgba(255, 215, 0, 0.42);
  --on-gold: #1A0033;
  --text: #FFFFFF;
  --muted: rgba(255, 255, 255, 0.70);
  --ok: #69F0AE;
  --ok-soft: rgba(105, 240, 174, 0.14);
  --warn: #FFD666;
  --warn-soft: rgba(255, 214, 102, 0.14);
  --ko: #FF8A80;
  --ko-soft: rgba(255, 82, 82, 0.15);
  --info: #8FD3FE;
  --info-soft: rgba(13, 202, 240, 0.14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* `hidden` doit l'emporter sur les display des composants (panneaux 7/30 j, bouton masqué pendant une confirmation). */
[hidden] { display: none !important; }
body { margin: 0; background: var(--night); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ic { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -0.125em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== Coque ===== */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; text-decoration: none; }
.logo { width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-weight: 800; flex: none; }
.brand b { display: block; font-size: 15px; }
.brand small { color: var(--muted); font-size: 12px; }
.nav-group { display: grid; gap: 2px; }
.nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 10px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; min-height: 40px; transition: background-color .15s ease; }
.nav-link .ic { color: var(--muted); font-size: 16px; }
.nav-link:hover { background: rgba(255, 255, 255, .05); }
.nav-link.active { background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.nav-link.active .ic { color: var(--gold); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 6px 0; display: grid; gap: 10px; }
.who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; font-weight: 700; flex: none; }
.who span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { display: block; color: var(--muted); font-size: 11px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.topbar .grow { flex: 1; min-width: 0; }
.menu-btn { display: none; }
.content { padding: 20px 24px 32px; display: grid; gap: 20px; align-content: start; width: 100%; max-width: 1320px; }
.overlay { display: none; }

/* ===== Boutons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; padding: 9px 14px; font: 600 13px var(--font); cursor: pointer; border: 1px solid transparent; min-height: 40px; text-decoration: none; transition: background-color .15s ease, border-color .15s ease, color .15s ease; background: none; color: var(--text); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-hover); }
.btn-ghost { border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { color: var(--ko); border-color: rgba(255, 82, 82, .5); }
.btn-danger:hover { background: var(--ko-soft); }
.btn-sm { padding: 6px 10px; min-height: 34px; font-size: 12px; }
.icon-btn { width: 40px; padding: 0; }

/* ===== Messages ===== */
.flash { display: grid; gap: 8px; }
.flash p { margin: 0; border-radius: 10px; padding: 11px 14px; border: 1px solid var(--line-strong); background: var(--surface); }
.flash .success { border-color: rgba(105, 240, 174, .4); background: var(--ok-soft); color: var(--ok); }
.flash .error { border-color: rgba(255, 82, 82, .5); background: var(--ko-soft); color: var(--ko); }
.flash .info { border-color: rgba(13, 202, 240, .4); background: var(--info-soft); color: var(--info); }

/* ===== Blocs ===== */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.section-title span { color: var(--muted); font-size: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; align-content: start; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 15px; }
.note { display: flex; gap: 10px; align-items: flex-start; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--muted); line-height: 1.5; }
.note .ic { color: var(--gold); margin-top: 3px; }
.note b { color: var(--text); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi { padding: 14px 16px; display: grid; gap: 4px; border-right: 1px solid var(--line); align-content: start; }
.kpi:last-child { border-right: 0; }
.kpi-label { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.kpi-value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value.small-value { font-size: 18px; }
.kpi-hint { font-size: 12px; color: var(--muted); }
.kpi-hint.good { color: var(--ok); }
.kpi-hint.bad { color: var(--ko); }

/* Graphiques en barres (dessinés par le serveur) */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 6px 14px; border-radius: 999px; font: 500 12px var(--font); cursor: pointer; min-height: 32px; }
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.chart { margin: 0; }
.chart figcaption { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.chart figcaption b { color: var(--text); font-variant-numeric: tabular-nums; }
.bars { height: 150px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.bar { display: block; background: var(--gold); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar.light { background: rgba(255, 215, 0, .55); }
.bar.zero { background: rgba(255, 255, 255, .12); }
.axis { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; font-size: 11px; color: var(--muted); text-align: center; padding-top: 6px; font-variant-numeric: tabular-nums; }
.axis span { overflow: hidden; white-space: nowrap; }
.range-30 .axis span:not(:nth-child(5n + 1)) { visibility: hidden; }

/* ===== Tableaux ===== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { background: var(--surface-2); text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.sub { color: var(--muted); font-size: 12px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 28px 14px !important; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-wait { background: var(--warn-soft); color: var(--warn); }
.chip-ko { background: var(--ko-soft); color: var(--ko); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-neutral { background: rgba(255, 255, 255, .08); color: var(--muted); }

/* ===== Contenu ===== */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.subtabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
.subtabs a:hover { color: var(--text); }
.subtabs a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
.count { background: rgba(255, 255, 255, .1); color: var(--text); border-radius: 999px; padding: 0 8px; font-size: 11px; }
.with-editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.item-list { display: grid; gap: 10px; align-content: start; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.item.editing { border-color: var(--gold-line); background: var(--gold-soft); }
.item.no-icon { grid-template-columns: minmax(0, 1fr) auto; }
.fic { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--gold-line); color: var(--gold); display: grid; place-items: center; font-size: 20px; }
.item b { display: block; overflow-wrap: anywhere; }
.item p { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.item-actions form { margin: 0; }
.editor { background: var(--surface-2); border: 1px solid var(--gold-line); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; position: sticky; top: 12px; }
.editor h2 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }

.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: 12px; font-weight: 600; }
.field em { font-style: normal; color: var(--muted); font-weight: 400; }
.input { background: rgba(255, 255, 255, .06); border: 1px solid var(--line-strong); color: var(--text); border-radius: 8px; padding: 9px 12px; font: 400 14px var(--font); min-height: 40px; width: 100%; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
input[type="file"].input { padding: 7px 10px; }
.input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(255, 215, 0, .2); }
.help { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 10px; }
.help .tip { color: var(--ok); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions .push { margin-left: auto; }
.current-image { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
.current-image img { height: 44px; width: 78px; object-fit: cover; border-radius: 8px; }

.icon-picker { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.icon-picker legend { font-size: 12px; font-weight: 600; margin-bottom: 6px; padding: 0; }
/* Case = <label><input radio><span class="pick">…</span></label> : l'état coché passe par
   « input:checked + .pick », sans :has(), pour les navigateurs plus anciens. */
.icon-picker label { position: relative; display: block; cursor: pointer; }
.icon-picker input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.icon-picker .pick { aspect-ratio: 1; border: 1px solid var(--line-strong); border-radius: 10px; display: grid; place-items: center; font-size: 19px; color: var(--muted); transition: border-color .15s ease, color .15s ease; }
.icon-picker label:hover .pick { border-color: var(--gold-line); color: var(--text); }
.icon-picker input:checked + .pick { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.icon-picker input:focus-visible + .pick { outline: 2px solid var(--gold); outline-offset: 2px; }
.icon-picker .pick.auto { font-size: 10px; font-weight: 700; text-align: center; line-height: 1.15; }

/* ===== Page d'accueil (hero) ===== */
.settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.preview { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.preview-bar { background: #0B0016; padding: 8px 12px; display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11px; }
.preview-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: inline-block; }
.preview-body { background: radial-gradient(400px 260px at 90% 10%, rgba(74, 20, 140, .55), transparent 70%), #1A0033; padding: 26px 22px; display: grid; gap: 12px; }
.eyebrow { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.preview-title { margin: 0; font-size: 34px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.preview-title em { font-style: normal; color: var(--gold); }
.preview-text { margin: 0; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.preview-body .btn-gold { justify-self: start; min-height: 46px; font-size: 14px; pointer-events: none; }

/* ===== Connexion ===== */
.login-stage { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(500px 340px at 80% 10%, rgba(74, 20, 140, .5), transparent 70%), var(--night); }
.login { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 28px; display: grid; gap: 16px; }
.login p { margin: 0; color: var(--muted); }
.login .btn-gold { min-height: 46px; }
.pw { display: flex; gap: 6px; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; text-align: center; }
.back:hover { color: var(--text); }

/* Confirmation dans la page (suppressions) */
.confirm-step { border: 1px dashed rgba(255, 82, 82, .6); background: var(--ko-soft); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.confirm-step p { margin: 0; color: var(--text); }
.confirm-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== Petits écrans ===== */
@media (max-width: 960px) {
  .with-editor, .settings { grid-template-columns: 1fr; }
  .editor { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  .side.open { transform: none; }
  .overlay.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 30; }
  .menu-btn { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi:last-child { border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
