/* =====================================================================
   AmelTicket — système visuel
   Couleurs du Niger : vert (marque) · orange (accent) · fond blanc · police Manrope
   Palette alternative « sarcelle » via html[data-pal=sarcelle]
   ===================================================================== */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/fonts/manrope-latin-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/fonts/manrope-latin-ext-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --brand: #0A7F22; --brand-600: #086B1C; --brand-50: #E7F6EA; --brand-100: #CDEDD4; --brand-deep: #065516;
  --accent: #E05206; --accent-50: #FDEBDD; --on-brand: #FFFFFF;
  --bg: #F7F7F4; --surface: #FFFFFF; --surface-2: #FAFAF8; --border: #E6E6E0; --border-2: #D5D5CC;
  --text: #1A1C19; --muted: #676B64; --faint: #A2A69E;
  --ok: #15803D; --ok-50: #DCFCE7; --warn: #C2410C; --warn-50: #FFEDD5; --bad: #B91C1C; --bad-50: #FEE2E2; --info: #1D4ED8; --info-50: #DBEAFE;
  --flag: linear-gradient(90deg, #E05206 0 33.3%, #FFFFFF 33.3% 66.6%, #0DB02B 66.6%);
  --r: 12px; --r-sm: 8px; --shadow: 0 1px 2px rgba(26,28,25,.05), 0 8px 24px rgba(26,28,25,.06);
  --font: 'Manrope', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
}
html[data-theme=dark] {
  --brand: #3FB950; --brand-600: #56C866; --brand-50: #12261A; --brand-100: #173322; --brand-deep: #0A3D14;
  --accent: #F0883E; --accent-50: #33200F; --on-brand: #06170B;
  --bg: #0C100D; --surface: #141A16; --surface-2: #1A221C; --border: #26302A; --border-2: #344038;
  --text: #E8EEE9; --muted: #9AA89E; --faint: #64736A;
  --ok: #4ADE80; --ok-50: #10281A; --warn: #F0883E; --warn-50: #33200F; --bad: #F47067; --bad-50: #33171A; --info: #79B8FF; --info-50: #13233A;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.3);
}
html[data-pal=sarcelle] { --brand: #0F766E; --brand-600: #0D655E; --brand-50: #E6F4F1; --brand-100: #CCEAE4; --brand-deep: #134E4A; --accent: #F59E0B; --accent-50: #FEF3C7; --bg: #F5F3EE; --surface-2: #FAF8F4; --border: #E7E2D8; --border-2: #D8D1C3 }
html[data-pal=sarcelle][data-theme=dark] { --brand: #2DD4BF; --brand-600: #14B8A6; --brand-50: #11302B; --brand-100: #164139; --brand-deep: #0B3B36; --accent: #FBBF24; --accent-50: #3A2E0E; --on-brand: #06201C; --bg: #0C1412; --surface: #121D1B; --surface-2: #172522; --border: #23332F; --border-2: #2E433E }
* { box-sizing: border-box }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased }
a { color: var(--brand); text-decoration: none } a:hover { text-decoration: underline }
button, input, select, textarea { font: inherit; color: inherit }
h1 { font-size: 24px; font-weight: 750; letter-spacing: -.3px; margin: 0 } h2 { font-size: 18px; font-weight: 700; margin: 0 } h3 { font-size: 15px; font-weight: 700; margin: 0 }
.i { flex: none; vertical-align: middle }
.muted { color: var(--muted) } .faint { color: var(--faint) } .small { font-size: 12.5px } .tiny { font-size: 11.5px }
.ok { color: var(--ok) } .bad { color: var(--bad) } .warn { color: var(--warn) } .num { font-variant-numeric: tabular-nums }
.right { text-align: right } .center { text-align: center } .nowrap { white-space: nowrap } .hide { display: none !important }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap } .grow { flex: 1; min-width: 0 } .sp { height: 16px }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1.5px solid var(--brand); background: var(--brand); color: #fff;
  border-radius: var(--r-sm); padding: 8px 15px; font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s }
html[data-theme=dark] .btn:not(.ghost):not(.soft):not(.icon):not(.danger):not(.wa):not(.accent) { color: var(--on-brand) }
.btn:hover { background: var(--brand-600); border-color: var(--brand-600); text-decoration: none } .btn:disabled { opacity: .45; cursor: not-allowed }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-2) } .btn.ghost:hover { background: var(--surface-2) }
.btn.soft { background: var(--brand-50); color: var(--brand); border-color: transparent } .btn.soft:hover { background: var(--brand-100) }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff } .btn.accent { background: var(--accent); border-color: var(--accent); color: #1C1917 }
.btn.wa { background: #1FAF55; border-color: #1FAF55; color: #fff }
.btn.sm { padding: 5px 10px; font-size: 13px } .btn.block { width: 100% } .btn.lg { padding: 12px 18px; font-size: 15px }
.btn.icon { padding: 7px; border-color: transparent; background: transparent; color: var(--muted) } .btn.icon:hover { background: var(--surface-2); color: var(--text) }
.linkbtn { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-weight: 650 }

/* ---------- Formulaires ---------- */
input, select, textarea { width: 100%; background: var(--surface); border: 1.5px solid var(--border-2); border-radius: var(--r-sm); padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50) }
textarea { min-height: 96px; resize: vertical } input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand) }
label.f { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); margin: 12px 0 5px }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px }
.hint { font-size: 12px; color: var(--faint); margin-top: 4px }
.sw { position: relative; width: 40px; height: 22px; flex: none; display: inline-block }
.sw input { opacity: 0; width: 0; height: 0 } .sw span { position: absolute; inset: 0; background: var(--border-2); border-radius: 6px; cursor: pointer; transition: .2s }
.sw span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 4px; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25) }
.sw input:checked + span { background: var(--brand) } .sw input:checked + span::before { transform: translateX(18px) } .sw input:disabled + span { opacity: .5; cursor: not-allowed }

/* ---------- Structure : menu latéral + barre du haut ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh }
.rail { background: var(--surface); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px 20px; display: flex; flex-direction: column }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 800; font-size: 17px; letter-spacing: -.2px }
.brand small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); letter-spacing: 0 }
.nav-g { font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); padding: 16px 10px 6px }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--muted); font-weight: 600; position: relative; margin-bottom: 1px }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none }
.nav a.on { background: var(--brand-50); color: var(--brand) } .nav a.on::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand) }
.nav .cnt { margin-left: auto; background: var(--accent); color: #1C1917; font-size: 11px; font-weight: 750; border-radius: 6px; padding: 0 6px }
.rail-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--border) }
.main { min-width: 0; display: flex; flex-direction: column }
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); padding: 12px 28px; display: flex; align-items: center; gap: 14px }
.topbar .ttl { flex: 1; min-width: 0 } .topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.chip-bal { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 6px 6px 12px; font-weight: 700 }
.chip-bal .btn { padding: 4px 9px; font-size: 12.5px }
.iconbtn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text) }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 5px; background: var(--accent); color: #1C1917; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 3px }
.avatar { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: 14px; overflow: hidden; flex: none; border: 0; cursor: pointer }
html[data-theme=dark] .avatar { color: var(--on-brand) } .avatar img { width: 100%; height: 100%; object-fit: cover } .avatar.xl { width: 96px; height: 96px; font-size: 32px; border-radius: 18px }
.content { padding: 24px 28px 90px; max-width: 1320px; width: 100%; margin: 0 auto }
.menu-pop { position: absolute; right: 28px; top: 60px; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; z-index: 50 }
.menu-pop a, .menu-pop button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--r-sm); background: none; border: 0; cursor: pointer; color: var(--text); font-weight: 600; text-align: left }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); text-decoration: none } .menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0 }
.bottomnav { display: none }
.mob-only { display: none }
.banner-imp { background: var(--accent); color: #1C1917; padding: 8px 16px; text-align: center; font-weight: 650 } .banner-imp a { color: #1C1917; text-decoration: underline }

/* ---------- Panneaux, tuiles, listes ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border) } .panel-h h2, .panel-h h3 { flex: 1 }
.panel-b { padding: 16px 18px } .panel.flat .panel-b { padding: 0 }
.grid { display: grid; gap: 16px } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)) } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)) } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start } .split.lead { grid-template-columns: 320px minmax(0, 1fr) }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: flex; gap: 14px; align-items: flex-start }
.kpi .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand) }
.kpi .ic.acc { background: var(--accent-50); color: var(--warn) } .kpi .ic.inf { background: var(--info-50); color: var(--info) } .kpi .ic.okc { background: var(--ok-50); color: var(--ok) }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 600 } .kpi .v { font-size: 23px; font-weight: 800; letter-spacing: -.4px; font-variant-numeric: tabular-nums; line-height: 1.25 } .kpi .s { font-size: 12px; color: var(--faint) }
.rows > .r { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border) } .rows > .r:last-child { border-bottom: 0 }
.rows > .r.click { cursor: pointer } .rows > .r.click:hover { background: var(--surface-2) }
.r .t { flex: 1; min-width: 0 } .r .t b { display: block; font-weight: 650 } .r .t span { color: var(--muted); font-size: 12.5px }
.r .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--brand); display: grid; place-items: center; flex: none }
.r .val { color: var(--muted); font-size: 13px; text-align: right }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 2px; background: currentColor }
.badge.ok { background: var(--ok-50); color: var(--ok); border-color: transparent } .badge.warn { background: var(--warn-50); color: var(--warn); border-color: transparent }
.badge.bad { background: var(--bad-50); color: var(--bad); border-color: transparent } .badge.info { background: var(--info-50); color: var(--info); border-color: transparent }
.badge.brand { background: var(--brand-50); color: var(--brand); border-color: transparent } .badge.plain::before { display: none }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; min-width: 80px }
.meter i { display: block; height: 100%; background: var(--brand) } .meter i.w { background: var(--accent) } .meter i.d { background: var(--bad) }
.empty { text-align: center; padding: 44px 20px; color: var(--muted) }
.empty .ill { width: 64px; height: 64px; border-radius: 16px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--brand); margin-bottom: 10px }
.callout.warn { border-left-color: var(--accent) } .callout.bad { border-left-color: var(--bad) } .callout b { display: block } .callout span { color: var(--muted); font-size: 13px }
.callout.click { cursor: pointer } .callout.click:hover { background: var(--surface) }

/* Tableaux */
.tblw { overflow-x: auto } table { width: 100%; border-collapse: collapse }
th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 750; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2) }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px } tr:last-child td { border-bottom: 0 }
tbody tr:hover td { background: var(--surface-2) } tr.click { cursor: pointer }

/* Onglets soulignés */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none }
.tabs button, .tabs a { background: none; border: 0; padding: 10px 12px; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center }
.tabs .on { color: var(--brand); border-bottom-color: var(--brand) } .tabs a:hover { text-decoration: none; color: var(--text) }
.seg { display: inline-flex; border: 1.5px solid var(--border-2); border-radius: var(--r-sm); overflow: hidden }
.seg button { background: var(--surface); border: 0; padding: 7px 13px; font-weight: 650; color: var(--muted); cursor: pointer; border-right: 1px solid var(--border) }
.seg button:last-child { border-right: 0 } .seg button.on { background: var(--brand); color: #fff } html[data-theme=dark] .seg button.on { color: var(--on-brand) }

/* Cartes routeur */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px }
.rcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 15px 16px; cursor: pointer; position: relative; overflow: hidden; transition: border-color .15s, transform .15s }
.rcard:hover { border-color: var(--brand); transform: translateY(-1px) }
.rcard::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--faint) }
.rcard.on::before { background: var(--ok) } .rcard.off::before { background: var(--accent) } .rcard.sus::before { background: var(--bad) }
.rcard .nm { font-weight: 800; font-size: 15.5px; letter-spacing: .2px } .rcard .md { font-size: 12px; color: var(--muted) }
.rcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border) }
.rcard .stats b { display: block; font-size: 16px; font-variant-numeric: tabular-nums } .rcard .stats span { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; font-weight: 700 }
.health { width: 44px; height: 44px; flex: none }
.devhead { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 18px; }
.devmark { width: 56px; height: 56px; border-radius: 14px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center }
.factline { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px } .factline b { color: var(--text) }

/* Outils */
.toolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px }
.tool { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s }
.tool:hover { border-color: var(--brand) } .tool .ic { width: 36px; height: 36px; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center }
.tool b { font-size: 14.5px } .tool p { margin: 0; color: var(--muted); font-size: 13px } .tool .tag { font-size: 11.5px; color: var(--warn); font-weight: 700 }

/* Choix (tuiles radio) */
.choices { display: grid; gap: 8px } .choices.c2 { grid-template-columns: 1fr 1fr }
.choice { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--border-2); border-radius: var(--r-sm); cursor: pointer; background: var(--surface) }
.choice:hover { border-color: var(--brand) } .choice.on { border-color: var(--brand); background: var(--brand-50) }
.choice .box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border-2); flex: none; display: grid; place-items: center; color: #fff }
.choice.on .box { background: var(--brand); border-color: var(--brand) } .choice .t { flex: 1 } .choice .t span { display: block; font-size: 12.5px; color: var(--muted) }
.choice.dis { opacity: .5; pointer-events: none }

/* Étapes */
.stepper { display: flex; gap: 0; margin: 4px 0 20px }
.stepper .st { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--faint) }
.stepper .st .n { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--border-2); display: grid; place-items: center; flex: none; background: var(--surface) }
.stepper .st::after { content: ''; flex: 1; height: 2px; background: var(--border); margin: 0 8px } .stepper .st:last-child::after { display: none }
.stepper .st.on { color: var(--brand) } .stepper .st.on .n { border-color: var(--brand); color: var(--brand) }
.stepper .st.done { color: var(--text) } .stepper .st.done .n { background: var(--brand); border-color: var(--brand); color: #fff }

/* Fenêtres (dialogue sur ordinateur, feuille sur mobile) */
.dlg-wrap { position: fixed; inset: 0; background: rgba(12,20,18,.5); display: none; align-items: center; justify-content: center; z-index: 80; padding: 18px }
.dlg-wrap.open { display: flex }
.dlg { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.25); border: 1px solid var(--border) }
.dlg.wide { width: min(900px, 100%) } .dlg.narrow { width: min(440px, 100%) }
.dlg-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border) } .dlg-h h2 { flex: 1; font-size: 16.5px }
.dlg-b { padding: 18px; overflow-y: auto } .dlg-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap }
pre.code { background: #0E1614; color: #CFFAEE; padding: 14px; border-radius: var(--r-sm); font-size: 11.5px; overflow: auto; max-height: 320px; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Consolas, monospace; margin: 0 }
#toast { position: fixed; top: 16px; right: 16px; background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); display: none; z-index: 99; max-width: min(440px, calc(100vw - 32px)); font-weight: 600 }
#toast.e { background: var(--bad); color: #fff }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; vertical-align: middle } @keyframes sp { to { transform: rotate(360deg) } }

/* Graphiques simples */
.bars { display: flex; gap: 6px; align-items: flex-end; height: 120px }
.bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0 }
.bars .b { width: 100%; max-width: 26px; background: var(--brand); border-radius: 4px 4px 1px 1px; min-height: 2px } .bars .b.alt { background: var(--accent) }
.bars .pair { display: flex; gap: 3px; width: 100%; justify-content: center; align-items: flex-end; height: 100% } .bars .pair .b { max-width: 12px }
.bars small { font-size: 10.5px; color: var(--faint) }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted) } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); margin-right: 5px; vertical-align: -1px } .legend i.alt { background: var(--accent) }

/* Portefeuille */
.walletcard { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 55%, var(--brand-deep) 100%); color: #fff; border-radius: 14px; padding: 20px; position: relative; overflow: hidden }
.walletcard::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; border: 22px solid color-mix(in srgb, var(--accent) 35%, transparent) }
.walletcard .v { font-size: 32px; font-weight: 800; letter-spacing: -.6px } .walletcard .btn { background: #fff; color: #065516; border-color: #fff } .walletcard .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5) }
.amount-in { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 6px 0 }
.amount-in input { font-size: 38px; font-weight: 800; text-align: center; border: 0; border-bottom: 2px solid var(--border-2); border-radius: 0; width: 210px; padding: 2px; background: transparent; box-shadow: none }
.amount-in input:focus { border-bottom-color: var(--brand); box-shadow: none }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px }
.quick button { border: 1.5px solid var(--border-2); background: var(--surface); border-radius: var(--r-sm); padding: 8px 4px; font-weight: 700; cursor: pointer }
.quick button.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand) }
.payline { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border) } .payline:last-child { border-bottom: 0 }
.receipt { border: 1.5px dashed var(--border-2); border-radius: var(--r); padding: 16px; background: var(--surface-2) }
.pm-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none }

/* Ambassadeur */
.ambassador { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; border-top: 4px solid var(--accent) }
.codebox { font-family: ui-monospace, Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: 2px; background: var(--accent-50); color: var(--text); padding: 8px 14px; border-radius: var(--r-sm); display: inline-block }

/* Connexion */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr }
.auth-art { background: var(--brand-deep); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden }
.auth-art::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 18px 18px }
.auth-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid color-mix(in srgb, var(--accent) 30%, transparent) }
.auth-art > * { position: relative; z-index: 1 } .auth-art h1 { font-size: 34px; line-height: 1.2; max-width: 460px; margin: 18px 0 12px } .auth-art p { opacity: .85; max-width: 440px }
.auth-art ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; max-width: 440px }
.auth-art li { display: flex; gap: 12px; align-items: flex-start } .auth-art li .i { color: #FDBA74; margin-top: 2px }
.auth-form { display: grid; place-items: center; padding: 32px }
.auth-form .box { width: min(400px, 100%) } .auth-form h2 { font-size: 24px; margin-bottom: 4px }
.err { color: var(--bad); min-height: 20px; font-size: 13px; margin-top: 8px }

/* ---------- Mobile ---------- */
@media (max-width: 1100px) { .split, .split.lead { grid-template-columns: 1fr } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr } .rail { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 70; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow) }
  .rail.open { transform: none } .mob-only { display: inline-grid } .desk-only { display: none !important }
  .topbar { padding: 10px 14px } .content { padding: 16px 14px 96px } .menu-pop { right: 14px }
  .g2, .g3 { grid-template-columns: 1fr } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) } .choices.c2 { grid-template-columns: 1fr }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)) }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 4px 0; border-radius: 8px }
  .bottomnav a.on { color: var(--brand) } .bottomnav a:hover { text-decoration: none }
  .dlg-wrap { align-items: flex-end; padding: 0 } .dlg, .dlg.wide, .dlg.narrow { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0 }
  .auth { grid-template-columns: 1fr } .auth-art { padding: 28px 22px } .auth-art h1 { font-size: 26px } .auth-art ul { display: none }
  .ambassador { grid-template-columns: 1fr } .kpi { padding: 12px; gap: 10px } .kpi .ic { width: 32px; height: 32px; border-radius: 8px } .kpi .ic svg { width: 16px; height: 16px } .kpi .v { font-size: 17px }
  .toolgrid { grid-template-columns: 1fr 1fr; gap: 10px } .tool { padding: 13px } .tool p { font-size: 12px } .chip-bal .lbl { display: none }
  #toast { left: 14px; right: 14px; top: 12px; max-width: none }
}
@media print { .rail, .topbar, .bottomnav { display: none } }

/* Bande tricolore (Niger) */
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--flag); z-index: 200; pointer-events: none }
html[data-pal=sarcelle] body::before { background: linear-gradient(90deg, var(--brand), var(--accent)) }
.flagdot { display: inline-block; width: 22px; height: 15px; border-radius: 3px; background: linear-gradient(180deg, #E05206 0 33.3%, #fff 33.3% 66.6%, #0DB02B 66.6%); box-shadow: 0 0 0 1px rgba(0,0,0,.12); position: relative }
.flagdot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #E05206 }
.palettes { display: flex; gap: 8px; align-items: center; padding: 6px 12px 8px }
.palettes button[data-pal] { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--border-2); cursor: pointer; padding: 0 }
.palettes button[data-pal].on { box-shadow: 0 0 0 2px var(--text) }
.palettes .lbl { font-size: 12px; color: var(--muted); font-weight: 650; margin-right: auto }
.menu-pop .seg button { width: auto; padding: 6px 12px; border-radius: 0; display: grid; place-items: center } .menu-pop .seg button.on, .menu-pop .seg button.on:hover { background: var(--brand); color: var(--on-brand) }
html[data-theme=dark] .walletcard { background: linear-gradient(135deg, #0A7F22 0%, #086B1C 55%, #065516 100%) }
html[data-theme=dark][data-pal=sarcelle] .walletcard { background: linear-gradient(135deg, #0F766E 0%, #115E59 55%, #134E4A 100%) }
.vcard { padding: 0; overflow: hidden; cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s, transform .15s } .vcard:hover { border-color: var(--brand); transform: translateY(-1px) } .vcard:hover .vplay { transform: scale(1.08) } .vplay { transition: transform .15s }
.vthumb { position: relative; display: block; aspect-ratio: 16/9; background: #065516 } .vthumb img { width: 100%; height: 100%; object-fit: cover; display: block }
.vplay { position: absolute; right: 12px; bottom: 12px; width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.3) }
.dlg-h h2 .i { vertical-align: -3px; color: var(--accent) }
/* Tickets illustrés */
.tdprev { display: grid; place-items: center; padding: 18px; background: repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--bg) 10px 20px); border-radius: var(--r); border: 1px solid var(--border) }
.tdprev .at-t { box-shadow: 0 8px 26px rgba(0,0,0,.18); color: #1A1C19; zoom: 1.3 }
.tdgrid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start }
.tdlist { max-height: 320px; overflow: auto } .tdlist .r.sel { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand) }
.tdthumb { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; overflow: hidden } .tdthumb img { width: 32px; height: 32px; border-radius: 50%; background: #fff; object-fit: cover }
.tdarts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px }
.tdart { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border: 1.5px solid var(--border); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; font: inherit; font-size: 12px; font-weight: 650; color: var(--text); position: relative }
.tdart img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover } .tdart:hover { border-color: var(--brand) }
.tdart.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-100) } .tdart.on::after { content: '✓'; position: absolute; top: 4px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; display: grid; place-items: center }
.tdplus { width: 64px; height: 64px; border-radius: 50%; border: 2px dashed var(--border-2); display: grid; place-items: center; color: var(--brand) }
.tdcolors { gap: 6px } .tdcol { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2); cursor: pointer; padding: 0 } .tdcol.on { box-shadow: 0 0 0 2px var(--text) }
#tdcc { width: 36px; height: 30px; padding: 2px; border-radius: 8px }
@media (max-width: 860px) { .tdgrid { grid-template-columns: 1fr } .tdprev .at-t { --w: 78mm !important } }
/* Assistant Config Pro */
.asprog { margin: -2px 0 16px } .asbody { min-height: 300px }
.asgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px }
.ascard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 12px; border: 1.5px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); position: relative; transition: border-color .15s, transform .15s }
.ascard:hover { border-color: var(--brand); transform: translateY(-1px) } .ascard.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100) }
.ascard b { font-size: 14.5px } .ascard > span:not(.asic) { font-size: 12.5px; color: var(--muted); line-height: 1.4 }
.ascard.dis { opacity: .55; cursor: not-allowed; transform: none } .ascard em { position: absolute; top: 8px; right: 8px; font-style: normal; font-size: 10.5px; font-weight: 750; background: var(--accent-50); color: var(--warn); padding: 1px 7px; border-radius: 6px }
.asic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; margin: 0 auto }
.ascard:nth-child(2) .asic { background: linear-gradient(135deg, var(--accent), #9A3412) } .ascard:nth-child(3) .asic { background: linear-gradient(135deg, #0E7490, #164E63) } .ascard:nth-child(4) .asic { background: linear-gradient(135deg, #7C3AED, #4C1D95) }
.asic.big { width: 72px; height: 72px; border-radius: 22px } .asic.ok { background: linear-gradient(135deg, #16A34A, #065516) } .asic .spin { border-color: rgba(255,255,255,.35); border-top-color: #fff }
.asrouters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px }
.asrt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px; border: 1.5px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); position: relative }
.asrt .i { color: var(--brand) } .asrt span { font-size: 12px; color: var(--muted) } .asrt.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100) } .asrt:disabled { opacity: .5; cursor: not-allowed }
.asdot { position: absolute; top: 10px; left: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--faint) } .asdot.ok { background: var(--ok) }
.asports { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px }
.asport { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--r-sm); cursor: pointer; background: var(--surface) }
.asport input { margin: 0 } .asport span { margin-left: auto; font-size: 11.5px; color: var(--muted) } .asport.on { border-color: var(--brand); background: var(--brand-50) }
.asplit { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start }
#asfr { width: 100%; height: 470px; border: 1px solid var(--border); border-radius: 12px; background: #fff }
@media (max-width: 860px) { .asgrid { grid-template-columns: 1fr 1fr } .asplit { grid-template-columns: 1fr } #asfr { height: 380px } }
/* Tickets de support */
.tkbar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(4, auto) auto; gap: 8px; align-items: center }
.tksearch { position: relative } .tksearch .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted) } .tksearch input { padding-left: 34px; width: 100% }
.tkk { text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100% } .tkk:hover { border-color: var(--brand) } .tkk.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-100) }
.tkrow { cursor: pointer } .tkrow:hover td { background: var(--surface-2) } .tkrow:focus { outline: 2px solid var(--brand); outline-offset: -2px }
.tkrow.unread .tksub { color: var(--text) } .tkrow:not(.unread) .tksub { font-weight: 600 }
.tkdot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none }
.tkthread { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow: auto; padding: 4px 2px 10px }
.tkmsg { max-width: 86%; padding: 10px 13px; border-radius: 14px; border: 1px solid var(--border) }
.tkmsg.client { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px }
.tkmsg.support { align-self: flex-end; background: var(--brand-50); border-color: var(--brand-100); border-bottom-right-radius: 4px }
.tkmsg.sys { align-self: center; border: 0; padding: 2px 8px; font-size: 12px; color: var(--muted); max-width: 100%; text-align: center }
.tkmeta { font-size: 11.5px; color: var(--muted); margin-bottom: 4px } .tkbody { white-space: pre-wrap; word-break: break-word; line-height: 1.5 }
.tkcat { flex-wrap: wrap }
@media (max-width: 1100px) { .tkbar { grid-template-columns: 1fr 1fr } .tksearch { grid-column: 1 / -1 } #tkR { justify-self: start } }
@media (max-width: 860px) { .tktable td, .tktable th { padding-left: 10px; padding-right: 10px } .tktable td:last-child { font-size: 12px } }
