/* ============================================================
   FF Panels — thème « Booyah » (chargé APRÈS app.css et app-pro.css)
   Noir chaud + orange doré façon Free Fire. Les couches précédentes gardent la structure des vues ;
   celle-ci fixe les jetons (couleurs, rayons, polices) et ajoute les écrans de la boutique :
   connexion / inscription, menu du profil, forfaits, recharge, points, profil, back-office.

   Mouvement : uniquement transform / opacity (composités par le GPU), 120–220 ms. html.lite (appareil lent,
   économie de données, « réduire les animations », ou choix dans le menu du profil) coupe tout mouvement décoratif.
   ============================================================ */

/* une seule police sur tout le site : LINE Seed Sans TH (déclarée dans app.css), titres, chiffres et codes compris */

/* ---------- jetons : clair ---------- */
:root {
    --bg: #f5f2ec;
    --bg-2: #ede8df;
    --card: #ffffff;
    --card-2: #faf7f1;
    --card-3: #ebe4d8;
    --line: rgba(40, 28, 10, .09);
    --line-2: rgba(40, 28, 10, .18);
    --text: #1d1710;
    --muted: #5a4f42;
    --faint: #766b5c;   /* ≥ 4.5:1 sur --bg, --card et --card-2 */
    --accent-rgb: 255 150 25;
    --gold: #ff9619;
    --gold-2: #ffad45;
    --gold-ink: #a55200;
    --on-gold: #1a0e00;
    --gold-bg: rgb(var(--accent-rgb) / .13);
    --green: #12864f;
    --green-2: #0d703f;
    --green-bg: rgba(18, 134, 79, .1);
    --amber: #8a6100;   /* texte des pastilles : ≥ 4.5:1 sur --amber-bg */
    --amber-bg: rgba(200, 150, 0, .13);
    --red: #cc2f36;
    --red-bg: rgba(204, 47, 54, .09);
    --blue: #1f69c4;
    --blue-bg: rgba(31, 105, 196, .1);
    --violet: #6a4cd3;
    --violet-bg: rgba(106, 76, 211, .1);
    --cyan: #087f93;
    --banned: #8e1f26;
    --r: 12px;
    --r-sm: 8px;
    --r-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(40, 28, 10, .06);
    --shadow-md: 0 10px 26px rgba(40, 28, 10, .1);
    --shadow-lg: 0 24px 60px rgba(40, 28, 10, .22);
    --glow: 0 0 0 3px rgb(var(--accent-rgb) / .3);
    --glass: var(--bg);
    --glass-2: var(--card);
    --backdrop: rgba(20, 14, 6, .5);
    --q-muted: #cfc5b6;
    --display: var(--sans);
    --mono: var(--sans);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --hero-ink: #fff4e3;
    color-scheme: light;
}

/* ---------- jetons : sombre (par défaut) ---------- */
:root[data-theme="dark"] {
    --bg: #0c0b0a;
    --bg-2: #100e0c;
    --card: #171411;
    --card-2: #1e1a16;
    --card-3: #2a251f;
    --line: rgba(255, 226, 184, .075);
    --line-2: rgba(255, 226, 184, .15);
    --text: #f4eee5;
    --muted: #b6ab9b;
    --faint: #8c8272;   /* ≥ 4.5:1 sur --card et --card-2 */
    --accent-rgb: 255 152 31;
    --gold: #ff981f;
    --gold-2: #ffb24a;
    --gold-ink: #ffb24a;
    --on-gold: #1a0e00;
    --gold-bg: rgb(var(--accent-rgb) / .12);
    --green: #3fdc8a;
    --green-2: #2cc277;
    --green-bg: rgba(63, 220, 138, .12);
    --amber: #f2cb4c;
    --amber-bg: rgba(242, 203, 76, .12);
    --red: #ff5f58;
    --red-bg: rgba(255, 95, 88, .12);
    --blue: #67b5ff;
    --blue-bg: rgba(103, 181, 255, .12);
    --violet: #b29dff;
    --violet-bg: rgba(178, 157, 255, .12);
    --cyan: #4fd3e0;
    --banned: #c2414a;
    --shadow-sm: none;
    --shadow-md: 0 12px 30px rgba(0, 0, 0, .45);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, .62);
    --backdrop: rgba(4, 3, 2, .7);
    --q-muted: #3a342c;
    color-scheme: dark;
}

/* ---------- base ---------- */
body { background: var(--bg); }
::selection { background: rgb(var(--accent-rgb) / .35); color: var(--text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
a { color: var(--gold-ink); }
html { scrollbar-color: var(--card-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--card-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
input, select, textarea { caret-color: var(--gold); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.display { font-family: var(--display); }
.view { animation: ff-in .2s var(--ease-out); }
@keyframes ff-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes ff-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes ff-up { from { opacity: 0; transform: translateY(14px); } }
.ic { stroke-width: 1.75; }

/* ---------- marque ---------- */
.logo-mark { width: 38px; height: 38px; border-radius: 0; background: var(--gold); color: var(--on-gold);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    font: 700 15px/1 var(--display); letter-spacing: .02em; border: 0; box-shadow: none; }
.logo-mark.sm { width: 32px; height: 32px; font-size: 13px;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }
.boot { background: var(--bg); }
.boot-bar span { background: var(--gold); }

/* ---------- titres et nombres (même police que le texte) ---------- */
.topbar h1 { font: 700 21px/1.2 var(--display); letter-spacing: .005em; }
.kpi .v, .pcard-metrics b, .srv-chart-vals b, .stat-v, .big-num { font-family: var(--display); font-weight: 700; letter-spacing: .01em; }
.card-head h3, .section-head h2, .modal-head h2 { letter-spacing: 0; }

/* ---------- boutons ---------- */
.btn { border-radius: var(--r-sm); transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease-out); }
.btn:active { transform: scale(.98); }
.btn.primary, .btn.soft-green, :root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.soft-green {
    background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn.primary:hover, .btn.soft-green:hover, :root[data-theme="dark"] .btn.primary:hover, :root[data-theme="dark"] .btn.soft-green:hover {
    background: var(--gold-2); border-color: var(--gold-2); }
.btn.lg { height: 46px; font-size: 15px; border-radius: 10px; }
.btn.amber { color: var(--gold-ink); }
.linkish { background: none; border: 0; padding: 0; color: var(--gold-ink); font: inherit; font-weight: 700; cursor: pointer; }
.linkish:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- formulaires ---------- */
input, select, textarea { height: 42px; border-radius: 9px; }
textarea { height: auto; }
input[type=checkbox] { height: 16px; }
.stepper input { height: 40px; }
.stepper button { height: 40px; width: 40px; }
label { gap: 7px; }
label .opt { color: var(--faint); font-weight: 400; }
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 34px; display: grid; place-items: center;
    border: 0; background: none; color: var(--faint); cursor: pointer; border-radius: 7px; }
.pw-eye:hover { color: var(--text); background: var(--card-3); }
.switch { position: relative; width: 38px; height: 22px; flex: none; border-radius: 99px; background: var(--card-3); border: 1px solid var(--line-2);
    transition: background .15s, border-color .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted);
    transition: transform .18s var(--ease-out), background .15s; }
.switch.on { background: var(--gold); border-color: var(--gold); }
.switch.on::after { transform: translateX(16px); background: var(--on-gold); }

/* ============================================================
   Connexion / inscription
   ============================================================ */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); background: var(--bg); }
.auth-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 26px;
    padding: 56px clamp(32px, 6vw, 88px); color: var(--hero-ink); isolation: isolate;
    background:
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 26px),
        radial-gradient(120% 90% at 0% 100%, rgba(255, 120, 0, .38), transparent 60%),
        radial-gradient(80% 70% at 100% 0%, rgba(255, 190, 70, .2), transparent 62%),
        #120d08; }
.auth-hero::after { content: ""; position: absolute; inset: auto -10% -2px -10%; height: 46%; z-index: -1;
    background: linear-gradient(180deg, transparent, rgba(255, 140, 20, .16)); }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand b { font: 700 22px/1.1 var(--display); letter-spacing: .02em; }
.auth-title { font: 700 clamp(30px, 3.6vw, 50px)/1.12 var(--display); max-width: 15ch; text-wrap: balance; color: #fff; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 46ch; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255, 244, 227, .82); }
.ap-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px;
    background: rgba(255, 152, 31, .14); color: #ffb24a; border: 1px solid rgba(255, 152, 31, .28); }
.ap-ic .ic { width: 17px; height: 17px; }
/* braises : 12 points qui montent (transform + opacity seulement) */
.auth-embers { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.auth-embers i { position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 50%; background: #ffb24a; opacity: 0;
    box-shadow: 0 0 8px 2px rgba(255, 150, 30, .55); will-change: transform, opacity; animation: ember 9s linear infinite; }
.auth-embers i:nth-child(1) { left: 6%; animation-delay: -1s; }
.auth-embers i:nth-child(2) { left: 14%; animation-duration: 11s; animation-delay: -6s; }
.auth-embers i:nth-child(3) { left: 23%; animation-duration: 8s; animation-delay: -3s; width: 3px; height: 3px; }
.auth-embers i:nth-child(4) { left: 31%; animation-duration: 12s; animation-delay: -8s; }
.auth-embers i:nth-child(5) { left: 42%; animation-duration: 10s; animation-delay: -2s; width: 3px; height: 3px; }
.auth-embers i:nth-child(6) { left: 51%; animation-duration: 9s; animation-delay: -7s; }
.auth-embers i:nth-child(7) { left: 60%; animation-duration: 13s; animation-delay: -4s; width: 5px; height: 5px; }
.auth-embers i:nth-child(8) { left: 68%; animation-duration: 8.5s; animation-delay: -9s; }
.auth-embers i:nth-child(9) { left: 77%; animation-duration: 11.5s; animation-delay: -5s; width: 3px; height: 3px; }
.auth-embers i:nth-child(10) { left: 85%; animation-duration: 10s; animation-delay: -1.5s; }
.auth-embers i:nth-child(11) { left: 92%; animation-duration: 12.5s; animation-delay: -10s; width: 3px; height: 3px; }
.auth-embers i:nth-child(12) { left: 47%; animation-duration: 14s; animation-delay: -11s; width: 5px; height: 5px; }
@keyframes ember {
    0% { transform: translate3d(0, 0, 0); opacity: 0; }
    10% { opacity: .9; }
    70% { opacity: .5; }
    100% { transform: translate3d(28px, -92vh, 0); opacity: 0; }
}
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; padding: 40px clamp(16px, 4vw, 56px); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 10px 26px 26px; box-shadow: var(--shadow-md); animation: ff-up .35s var(--ease-out); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 16px 0 22px; background: var(--card-2);
    border: 1px solid var(--line); border-radius: 11px; }
.auth-tabs button { height: 40px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 700 14px var(--sans);
    cursor: pointer; transition: background .15s, color .15s; }
.auth-tabs button:hover { color: var(--text); }
.auth-tabs button[aria-selected="true"] { background: var(--gold); color: var(--on-gold); }
.auth-tabs.single { grid-template-columns: 1fr; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form .hint { margin-top: -1px; }
.auth-form .form-error:empty { display: none; }
.auth-form .form-error { padding: 10px 12px; border-radius: 9px; background: var(--red-bg); color: var(--red); font-size: 13px; }
.auth-note { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--gold-bg); color: var(--text); font-size: 13px; }
.auth-submit { margin-top: 4px; }
.auth-switch { margin: 2px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.auth-closed { padding: 14px; border-radius: 10px; background: var(--card-2); color: var(--muted); font-size: 14px; text-align: center; }
.auth-foot { margin: 0; font-size: 13px; color: var(--faint); text-align: center; max-width: 420px; }
.auth-foot a { font-weight: 700; }
.auth-form.busy .auth-submit { pointer-events: none; opacity: .75; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-hero { padding: 28px 20px 30px; gap: 14px; }
    .auth-title { font-size: 26px; max-width: none; }
    .auth-points { display: none; }
    .auth-panel { justify-content: flex-start; padding: 0 16px 28px; margin-top: -18px; }
    .auth-card { padding: 6px 18px 20px; }
}

/* ============================================================
   Structure : barre latérale (bureau), rail (tablette), barre du bas (mobile)
   ============================================================ */
@media (min-width: 1024px) { .shell { grid-template-columns: 236px minmax(0, 1fr); } }
.sidebar { background: var(--bg-2); padding: 18px 12px 12px; }
.side-brand { gap: 12px; padding: 4px 8px 18px; }
.side-brand b { font: 700 16px/1.2 var(--display); letter-spacing: .015em; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.nav-group-label { padding: 0 12px 6px; font-size: 11.5px; font-weight: 700; color: var(--faint); }
.nav-item { height: 40px; font-weight: 600; }
.nav-item.active { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.nav-item.active::before { background: var(--gold); }
.nav-item.active .ic { color: var(--gold); }
.nav-item .count { font-family: var(--display); }
.side-foot { justify-content: center; }
.side-foot .live { width: auto; padding: 4px 6px 2px; }

.topbar { gap: 10px; background: var(--bg); }
.topbar .live.mobile-only { margin-left: 2px; }

/* bouton du profil */
.pf-btn { display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 8px 0 5px; border-radius: 99px; border: 1px solid var(--line-2);
    background: var(--card); color: var(--text); cursor: pointer; flex: none; transition: border-color .15s, background .15s; }
.pf-btn:hover, .pf-btn[aria-expanded="true"] { border-color: var(--gold); background: var(--card-2); }
.pf-btn .avatar { width: 32px; height: 32px; }
.pf-name { font-weight: 700; font-size: 13.5px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chev { display: grid; color: var(--faint); transition: transform .18s var(--ease-out); }
.pf-chev .ic { width: 15px; height: 15px; }
.pf-btn[aria-expanded="true"] .pf-chev { transform: rotate(180deg); }
.pf-btn { position: relative; }
.pf-btn.dot::after { content: ""; position: absolute; top: 3px; left: 29px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--gold); border: 2px solid var(--bg); }

/* menu du profil (dropdown) : positionné en fixed, hors de tout overflow */
.pf-menu { position: fixed; z-index: 120; width: min(320px, calc(100vw - 20px)); max-height: calc(100vh - 80px); overflow-y: auto;
    background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px;
    transform-origin: top right; animation: ff-pop .15s var(--ease-out); }
.pf-head { display: flex; align-items: center; gap: 12px; padding: 12px 10px 14px; }
.pf-head .avatar { width: 44px; height: 44px; font-size: 15px; }
.pf-head b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-head small { display: block; color: var(--faint); font-size: 12.5px; }
.pf-plan { margin: 0 4px 6px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pf-plan b { color: var(--text); }
.pf-plan.on { background: var(--green-bg); }
.pf-plan.on .ic { color: var(--green); }
.pf-plan.off { background: var(--card-2); }
.pf-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pf-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 10px; border: 0; border-radius: 9px;
    background: none; color: var(--text); font: 600 14px var(--sans); text-align: left; cursor: pointer; }
.pf-item .ic { color: var(--muted); width: 18px; height: 18px; }
.pf-item:hover, .pf-item:focus-visible { background: var(--card-2); outline: none; }
.pf-item:hover .ic, .pf-item:focus-visible .ic { color: var(--gold); }
.pf-item .pf-aside { margin-left: auto; color: var(--faint); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pf-item.danger, .pf-item.danger .ic { color: var(--red); }
.pf-item.admin { color: var(--gold-ink); }
.pf-item.admin .ic { color: var(--gold); }

/* feuille « เมนู » (mobile) */
.more-sheet { position: fixed; inset: 0; z-index: 110; display: flex; align-items: flex-end; background: var(--backdrop); animation: fade-in .15s ease-out; }
.more-panel { width: 100%; background: var(--card); border-radius: 18px 18px 0 0; border-top: 1px solid var(--line-2);
    padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); animation: ff-up .22s var(--ease-out); }
.more-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 2px auto 12px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.more-grid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 84px; padding: 10px 6px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); color: var(--text); font: 600 13px var(--sans); cursor: pointer; }
.more-grid button .ic { width: 22px; height: 22px; color: var(--gold); }
.more-grid button.active { border-color: var(--gold); background: var(--gold-bg); }

/* tablette : rail d'icônes */
@media (min-width: 768px) and (max-width: 1023px) {
    .shell { grid-template-columns: 84px minmax(0, 1fr); }
    .sidebar { display: flex; padding: 14px 8px 10px; align-items: stretch; }
    .side-brand { justify-content: center; padding: 2px 0 14px; }
    .side-brand > div:last-child, .nav-group-label, .nav-item .count, .side-foot .live span { display: none; }
    .nav-group + .nav-group { margin-top: 10px; padding-top: 10px; }
    .nav-item { flex-direction: column; justify-content: center; height: auto; min-height: 58px; padding: 8px 2px; gap: 5px;
        font-size: 11px; text-align: center; }
    .nav-item span { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nav-item.active::before { left: -8px; }
    .mobile-only { display: none !important; }
    .bottom-nav { display: none !important; }
    .topbar .logo-mark { display: none !important; }
    .t-long { display: inline; } .t-short { display: none; }
    main { padding-bottom: 48px; }
    #toasts { left: auto; right: 20px; bottom: 20px; align-items: flex-end; }
    .modal-backdrop { padding: 5vh 20px; align-items: flex-start; }
    .modal, .modal.wide { border-radius: 14px; max-height: none; padding: 24px; }
}

/* écran étroit (mobile, tablette, petit portable) : titre + solde + profil sur la 1re ligne de l'en-tête,
   actions de la page sur une 2e ligne défilante (le titre n'est plus écrasé) */
@media (max-width: 1279px) {
    .topbar { flex-wrap: wrap; row-gap: 10px; }
    .topbar h1 { flex: 1 1 auto; min-width: 0; }
    .topbar .live.mobile-only { order: 2; }
    .topbar .pf-btn { order: 4; }
    #top-actions { order: 5; flex: 1 0 100%; margin-left: 0; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    #top-actions::-webkit-scrollbar { display: none; }
    #top-actions:empty { display: none; }
    #top-actions .btn { flex: none; }
}

/* mobile : barre du bas (5 places au plus) */
@media (max-width: 767px) {
    .topbar { min-height: 58px; padding: 10px 14px; row-gap: 8px; }
    .topbar h1 { font-size: 18px; }
    .topbar .logo-mark { display: grid !important; }
    .pf-name, .pf-chev { display: none; }
    .pf-btn { padding: 0 4px; height: 40px; border-radius: 50%; }
    /* cible tactile d'au moins 44 px sans changer le dessin */
    .pf-btn::before { content: ""; position: absolute; inset: -2px; }
    .bottom-nav { height: calc(66px + env(safe-area-inset-bottom)); padding: 6px 4px env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); }
    .bottom-nav button { gap: 4px; font-size: 11px; min-height: 48px; }
    .bottom-nav button .ic { width: 22px; height: 22px; }
    .bottom-nav button.active { color: var(--gold-ink); }
    .bottom-nav button.active::before { background: var(--gold); }
    main { padding: 16px 14px calc(66px + 28px + env(safe-area-inset-bottom)); }
}
@media (pointer: coarse) { .btn.sm { height: 36px; } }
@media (max-width: 520px) {
    .plan-strip > div { padding: 14px; }
    .plan-strip .stat-v { font-size: 21px; }
    .plan-strip .ps-plan .stat-v { font-size: 16px !important; white-space: normal; line-height: 1.3; }
}

/* ============================================================
   Composants communs de la boutique
   ============================================================ */
.ff-grid { display: grid; gap: 20px; }
/* corps des vues de la boutique et bandeau du tableau de bord : blocs espacés régulièrement */
#d-banner:not(:empty), #st-body, #pf-body, #bo-body { display: grid; gap: 20px; min-width: 0; }
#d-banner { gap: 14px; }
#d-banner:empty { display: none; }
.ff-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .ff-cols { grid-template-columns: 1fr; } }
.stat-v { font-size: 28px; line-height: 1.1; }
.big-num { font-size: 40px; line-height: 1; }
.unit { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 6px; font-family: var(--sans); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700;
    background: var(--gold); color: var(--on-gold); white-space: nowrap; }
.tag.soft { background: var(--gold-bg); color: var(--gold-ink); }
.tag.muted { background: var(--card-3); color: var(--muted); }
.section-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.section-title h2 { font: 700 17px/1.3 var(--sans); }
.section-title .hint { margin-left: auto; }
.money { font-family: var(--display); font-weight: 700; }
.state-on { color: var(--green); } .state-off { color: var(--faint); }
.copy-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.copy-row:first-child { border-top: 0; }
.copy-row small { display: block; font-size: 12px; color: var(--faint); }
.copy-row b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.copy-row .btn { margin-left: auto; }
.skeleton { position: relative; overflow: hidden; background: var(--card-2); border-radius: var(--r); min-height: 120px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .04), transparent); animation: sk 1.3s linear infinite; }
@keyframes sk { to { transform: translateX(100%); } }

/* bandeau de forfait (tableau de bord, profil) */
.plan-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: stretch; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.plan-strip > div { padding: 16px 18px; min-width: 0; }
.plan-strip > div + div { border-left: 1px solid var(--line); }
.plan-strip small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.plan-strip .stat-v { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-strip .sub { display: block; font-size: 12px; color: var(--faint); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-strip .ps-actions { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 14px 16px; }
.plan-strip.none { grid-template-columns: minmax(0, 1fr) auto; }
.plan-strip.none .ps-cta { display: flex; align-items: center; gap: 14px; }
.plan-strip.none .ps-cta .ic { width: 22px; height: 22px; color: var(--gold); flex: none; }
.plan-strip.none .ps-cta b { display: block; font-size: 15px; }
.plan-strip.none .ps-cta span { color: var(--muted); font-size: 13px; }
.meter { height: 6px; border-radius: 99px; background: var(--card-3); overflow: hidden; margin-top: 10px; }
.meter span { display: block; height: 100%; border-radius: 99px; background: var(--gold); transform-origin: left; transition: transform .5s var(--ease-out); }
.meter.ok span { background: var(--green); }
.meter.warn span { background: var(--amber); }
@media (max-width: 1100px) {
    /* forfait sur toute la largeur, puis comptes en jeu | temps restant, puis le bouton */
    .plan-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .plan-strip .ps-plan { grid-column: 1 / -1; }
    .plan-strip > div + div { border-top: 1px solid var(--line); }
    .plan-strip > div:nth-child(2) { border-left: 0; }
    .plan-strip .ps-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; border-left: 0; }
    .plan-strip .ps-actions .btn { flex: 1 1 140px; }
    .plan-strip.none { grid-template-columns: 1fr; }
    .plan-strip.none > div + div { border-left: 0; border-top: 1px solid var(--line); }
}
.announce { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r); background: var(--gold-bg);
    border: 1px solid rgb(var(--accent-rgb) / .28); color: var(--text); font-size: 14px; white-space: pre-line; }
.announce .ic { color: var(--gold); flex: none; margin-top: 2px; }

/* ---------- forfaits (boutique) ---------- */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.pkg { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--r); cursor: pointer; text-align: left;
    background: var(--card); border: 1px solid var(--line); color: var(--text); font: inherit;
    transition: border-color .15s, transform .18s var(--ease-out), background .15s; }
.pkg:hover { border-color: var(--line-2); transform: translateY(-2px); }
.pkg[aria-pressed="true"] { border-color: var(--gold); background: linear-gradient(180deg, rgb(var(--accent-rgb) / .09), transparent 60%), var(--card);
    box-shadow: inset 0 0 0 1px var(--gold); }
.pkg[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.pkg-top { display: flex; align-items: flex-start; gap: 10px; }
.pkg-top h3 { font: 700 17px/1.3 var(--sans); flex: 1; min-width: 0; }
.pkg-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pkg-price .big-num { font-size: 38px; color: var(--gold-ink); }
.pkg-price span { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.pkg-desc { margin: 0; color: var(--muted); font-size: 13.5px; }
.pkg-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.pkg-feats li { display: flex; align-items: center; gap: 9px; }
.pkg-feats .ic { width: 16px; height: 16px; color: var(--green); flex: none; }
.pkg-check { position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; }
.pkg[aria-pressed="true"] .pkg-check { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.pkg-check .ic { width: 13px; height: 13px; stroke-width: 3; opacity: 0; }
.pkg[aria-pressed="true"] .pkg-check .ic { opacity: 1; }
.pkg .tag { position: absolute; top: -10px; left: 18px; }

/* configurateur d'achat */
.buy { position: sticky; top: calc(var(--top-h, 64px) + 20px); }
.bulkbar { top: calc(var(--top-h, 64px) + 12px); }
.buy-rows { display: grid; gap: 16px; }
.buy-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.buy-row > div:first-child { flex: 1 1 160px; min-width: 0; }
.buy-row b { display: block; font-size: 14px; }
.buy-row small { display: block; color: var(--faint); font-size: 12.5px; }
.buy-sum { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.card-head + .buy-sum { padding-top: 0; border-top: 0; }
.buy-sum .row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--muted); }
.buy-sum .row b { color: var(--text); text-align: right; }
.buy-sum .total { padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 15px; color: var(--text); font-weight: 700; align-items: baseline; }
.buy-sum .total .money { font-size: 26px; color: var(--gold-ink); }
.buy-sum.stale { opacity: .55; transition: opacity .15s; }
.buy-sum .short { color: var(--red); }
.buy-err { margin: 10px 0 0; color: var(--red); font-size: 13px; }
.buy-err:empty { display: none; }
.buy .btn.block { margin-top: 14px; }
@media (max-width: 1100px) { .buy { position: static; } }

/* ---------- paiement d'une commande (page « แพ็กเกจ ») ---------- */
#st-pay.stale { opacity: .55; transition: opacity .15s; }
.pay-pick { display: grid; gap: 8px; margin-top: 16px; }
.pay-pick .flabel { font-size: 13px; font-weight: 600; color: var(--muted); }
.pay-manual { display: grid; gap: 12px; margin-top: 14px; }
.pay-manual .slip-drop { min-height: 140px; }
.pay-after { margin: 10px 0 0; text-align: center; }
.order-what { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px;
    background: var(--card-2); border: 1px solid var(--line); }
.order-what > .ic { flex: none; color: var(--gold); }
.order-what b { display: block; font-size: 14.5px; }
.order-what small { display: block; color: var(--faint); font-size: 12.5px; }
.order-pay .tmn-qr { justify-self: center; }
.tx-amt .pill { margin-top: 4px; }
.amount-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.amount-grid button { height: 52px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); cursor: pointer;
    font: 700 17px var(--display); transition: border-color .15s, background .15s, transform .12s; }
.amount-grid button:hover { border-color: var(--gold); }
.amount-grid button[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-bg); box-shadow: inset 0 0 0 1px var(--gold); }
.amount-grid button:active { transform: scale(.97); }
.methods { display: grid; gap: 10px; }
.method { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2);
    color: var(--text); cursor: pointer; text-align: left; font: inherit; transition: border-color .15s, background .15s; }
.method:hover { border-color: var(--faint); }
.method[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-bg); }
.method[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.method .m-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--card-3); color: var(--gold); flex: none; }
.method b { display: block; font-size: 14.5px; }
.method small { display: block; color: var(--faint); font-size: 12.5px; }
.method .tag { margin-left: auto; }
.slip-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 170px;
    padding: 16px; border: 1.5px dashed var(--line-2); border-radius: 12px; text-align: center; color: var(--muted); cursor: pointer;
    transition: border-color .15s, background .15s; }
.slip-drop:hover, .slip-drop.over { border-color: var(--gold); background: var(--gold-bg); color: var(--text); }
.slip-drop .ic { width: 28px; height: 28px; color: var(--gold); }
.slip-drop img { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; }
.slip-drop .slip-x { position: absolute; top: 8px; right: 8px; }
.pay-note { margin: 0 0 4px; padding: 11px 13px; border-radius: 10px; background: var(--card-2); color: var(--muted); font-size: 13px; white-space: pre-line; }

/* liste de mouvements / demandes */
.tx-list { display: flex; flex-direction: column; }
.tx { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); }
.tx:first-child { border-top: 0; }
.tx-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--card-2); color: var(--muted); }
.tx-ic.plus { background: var(--green-bg); color: var(--green); }
.tx-ic.minus { background: var(--gold-bg); color: var(--gold-ink); }
.tx b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx small { display: block; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amt { text-align: right; font: 700 16px var(--display); white-space: nowrap; }
.tx-amt.plus { color: var(--green); }
.tx-amt small { font: 500 11.5px var(--sans); color: var(--faint); }

/* profil */
.prof-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.prof-head .avatar { width: 64px; height: 64px; font-size: 22px; }
.prof-head h2 { font: 700 22px/1.2 var(--display); }
.prof-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.prof-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 0 20px; }
.prof-kv > div { padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.prof-kv small { display: block; font-size: 12.5px; color: var(--faint); }
.prof-kv b { display: block; font-size: 15px; margin-top: 3px; overflow-wrap: anywhere; }

/* ============================================================
   Back-office (หลังบ้าน)
   ============================================================ */
.bo-tabs { position: sticky; top: var(--top-h, 64px); z-index: 6; margin: 0 0 18px; background: var(--bg); padding-top: 2px; }
/* deux colonnes seulement quand le tableau des recharges tient sur une ligne par demande (sinon les cartes s'empilent) */
@media (min-width: 1360px) { .bo-split { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); } }
@media (max-width: 1359px) { .bo-split { grid-template-columns: minmax(0, 1fr); } }
.bo-tabs .seg button { height: 34px; }
.bo-tabs .badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
    background: var(--red); color: #fff; font: 700 11px/1 var(--sans); }
.bo-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); background: var(--card);
    border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.bo-kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: transparent; border: 0; border-radius: 0;
    box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); text-align: left; color: var(--text); font: inherit; }
button.bo-kpi { cursor: pointer; transition: background .15s; }
button.bo-kpi:hover { background: var(--card-2); }
button.bo-kpi:focus-visible { outline-offset: -3px; border-radius: 0; }
.bo-kpi small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.bo-kpi .stat-v { font-size: 26px; }
.bo-kpi.alert .stat-v { color: var(--gold-ink); }
.bo-form { display: grid; gap: 18px; }
.bo-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px 16px; }
.bo-fields .wide { grid-column: 1 / -1; }
.bo-fields textarea { min-height: 90px; font-family: var(--sans); font-size: 14px; }
.bo-toggle { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line);
    color: var(--text); cursor: pointer; font-weight: 600; }
.bo-toggle small { display: block; font-weight: 400; color: var(--faint); font-size: 12.5px; }
.bo-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bo-toggle input:focus-visible + .switch { outline: 2px solid var(--gold); outline-offset: 2px; }
.bo-toggle input:checked + .switch { background: var(--gold); border-color: var(--gold); }
.bo-toggle input:checked + .switch::after { transform: translateX(16px); background: var(--on-gold); }
.bo-soon .bo-fields { opacity: .6; }
/* ตั้งค่าระบบ : liste des rubriques (en groupes) à gauche, une rubrique à la fois à droite ; < 900 px : la liste, puis la rubrique */
.bo-set { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px 28px; align-items: start;
    scroll-margin-top: calc(var(--top-h, 64px) + 64px); }
.bo-set-nav { position: sticky; top: calc(var(--top-h, 64px) + 64px); display: grid; gap: 18px; min-width: 0;
    max-height: calc(100vh - var(--top-h, 64px) - 84px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.bo-set-glabel { padding: 0 10px 6px; font-size: 11.5px; font-weight: 700; color: var(--faint); }
.bo-set-list { display: grid; gap: 2px; }
.bo-set-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 54px; padding: 8px 10px; border: 0; border-radius: 10px;
    background: none; color: var(--muted); font: inherit; text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.bo-set-item:hover { background: var(--card-2); color: var(--text); }
.bo-set-item.active { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.bo-set-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.bo-set-ic { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--card-2); color: var(--faint);
    transition: background .15s, color .15s; }
.bo-set-ic .ic { width: 18px; height: 18px; }
.bo-set-item:hover .bo-set-ic { color: var(--muted); }
.bo-set-item.active .bo-set-ic { background: var(--gold-bg); color: var(--gold); }
.bo-set-txt { display: grid; gap: 2px; flex: 1; min-width: 0; }
.bo-set-txt b { font-size: 14px; font-weight: 700; line-height: 1.3; }
.bo-set-txt small { font-size: 12px; line-height: 1.35; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* pastille : rubrique modifiée (or) ou avec un champ à corriger (rouge) */
.bo-set-flag { display: none; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.bo-set-item.dirty .bo-set-flag, .bo-set-item.err .bo-set-flag { display: block; }
.bo-set-item.err .bo-set-flag { background: var(--red); }
.bo-set-chev { display: none; }
.bo-set-main { min-width: 0; }
.bo-pane { display: grid; gap: 16px; }
.bo-pane:not([hidden]) { animation: ff-in .18s var(--ease-out); }
.bo-pane-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 700 20px/1.3 var(--display); }
.bo-pane-head h2 .ic { width: 20px; height: 20px; color: var(--gold); }
.bo-pane-head h2:focus { outline: none; }
.bo-pane-head .hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); max-width: 70ch; }
.bo-set-back { display: none; }
.card.bo-pane-body { padding: 0; }
.bo-group { padding: 22px 24px; }
.bo-group + .bo-group { border-top: 1px solid var(--line); }
.bo-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bo-group h3 { margin: 0; font-size: 15px; font-weight: 700; }
.bo-group > .hint { margin: 4px 0 0; font-size: 12.5px; max-width: 75ch; }
.bo-group .bo-fields { margin-top: 16px; }
.bo-link { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.bo-link .hint { margin: 4px 0 0; }
.bo-set .bo-save { grid-column: 1 / -1; }
/* champ à corriger : message sous le champ, bordure rouge */
.field-err { font-size: 12.5px; font-weight: 600; color: var(--red); }
.bo-toggle + .field-err { margin-top: -6px; }
.bo-set [aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 899px) {
    .bo-set { display: block; }
    .bo-set[data-open="1"] .bo-set-nav, .bo-set[data-open="0"] .bo-set-main { display: none; }
    .bo-set-nav { position: static; max-height: none; overflow: visible; }
    .bo-set-glabel { padding-left: 4px; }
    .bo-set-list { gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
    .bo-set-item { min-height: 64px; padding: 10px 14px; border-radius: 0; color: var(--text); }
    .bo-set-item + .bo-set-item { border-top: 1px solid var(--line); }
    .bo-set-item.active { background: none; box-shadow: none; }
    .bo-set-ic, .bo-set-item:hover .bo-set-ic { background: var(--gold-bg); color: var(--gold); }
    .bo-set-chev { display: block; flex: none; width: 16px; height: 16px; color: var(--faint); transform: rotate(-90deg); }
    .bo-set-back { display: inline-flex; margin: 0 0 12px -10px; }
    .bo-set-back .back-chev { transform: rotate(90deg); }
    .bo-pane-head h2 { font-size: 18px; }
    .bo-group { padding: 18px 16px; }
    .bo-set .bo-save { margin-top: 16px; }
}
/* Panel d'un client : réglages en lecture seule */
.ro-wrap { border: 0; margin: 0; padding: 0; min-width: 0; }
.settings-form.read-only input:disabled, .settings-form.read-only select:disabled { opacity: 1; color: var(--muted); cursor: default; }
.ro-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.ro-note > .ic { flex: none; color: var(--gold-ink); }
.ro-note > span { flex: 1 1 220px; }
.ro-note .btn { flex: none; margin-left: auto; }
/* choix du niveau visé par le client (fenêtre d'un Panel) */
.lvl-pick { display: grid; gap: 14px; margin-bottom: 16px; }
.lvl-pick h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.lvl-pick h4 .ic { color: var(--gold); }
.lvl-switch small { display: block; margin-top: 2px; }
.lvl-chips button:disabled { opacity: .4; cursor: not-allowed; }
.lvl-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lvl-foot .btn { margin-left: auto; }
/* chiffres alignés là où la police à chasse fixe servait (identifiants, journaux, exemples) */
.mono, .idchip, pre, .log, textarea, .diag-code, kbd { font-variant-numeric: tabular-nums; }
.bo-save { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px;
    border-radius: 12px; background: var(--card); border: 1px solid var(--gold); box-shadow: var(--shadow-md); animation: ff-up .2s var(--ease-out); }
.bo-save span { color: var(--muted); font-size: 13.5px; }
/* les notifications passent au-dessus de la barre « enregistrer » au lieu de la recouvrir */
body:has(.bo-save:not([hidden])) #toasts { bottom: 96px; }
@media (max-width: 767px) {
    .bo-save { bottom: calc(66px + 12px + env(safe-area-inset-bottom)); }
    .bo-save > span:first-child { flex: 1 0 100%; }
    .bo-save .spacer { display: none; }
    .bo-save .btn { flex: 1 1 0; justify-content: center; }
    body:has(.bo-save:not([hidden])) #toasts { bottom: calc(66px + 14px + 112px + env(safe-area-inset-bottom)); }
    /* indicateurs du back-office : deux par ligne (le dernier, seul, prend toute la largeur) */
    .bo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bo-kpi { padding: 14px; }
    .bo-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .bo-kpi .stat-v { font-size: 24px; }
}
/* page « แพ็กเกจ » vue par l'administrateur : ouverture du paiement et des moyens, liens vers les réglages */
.tp-closed { font-size: 14px; }
/* TrueMoney automatique : montant exact, lien de l'application, QR PromptPay, attente du crédit */
.tmn-info { display: grid; gap: 10px; min-width: 0; }
.tmn-info > small { font-size: 12.5px; color: var(--faint); }
.tmn-amount { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tmn-amount .money { font: 700 34px/1.1 var(--display); color: var(--gold-ink); font-variant-numeric: tabular-nums; }
.tmn-info .hint { margin: 0; }
.tmn-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.tmn-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.tmn-info .btn.ghost { justify-self: start; }
.tmn-qr { margin: 0; display: grid; justify-items: center; gap: 8px; }
.tmn-qr img { width: 216px; height: 216px; padding: 8px; border-radius: 12px; background: #fff; }
.tmn-qr figcaption { font-size: 12px; color: var(--faint); text-align: center; }
.tmn-wait { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
    font-size: 13px; color: var(--muted); }
.tmn-wait .ic { width: 16px; height: 16px; color: var(--gold); flex: none; }
.tmn-field { display: grid; gap: 4px; min-width: 0; }
.tmn-field > small { font-size: 12.5px; color: var(--faint); }
.tmn-field .tmn-amount b { font: 700 20px/1.2 var(--display); color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tmn-field .tmn-amount .money { font: 700 34px/1.1 var(--display); color: var(--gold-ink); }
.tmn-code .tmn-amount b { font-size: 24px; letter-spacing: .04em; color: var(--gold-ink); }
.tmn-warn { margin: 0; align-items: flex-start; font-size: 13px; }
.tmn-warn > .ic { flex: none; margin-top: 2px; }
.tmn-meta .btn { margin-left: auto; }
.tmn-hook .copy-row { border-top: 0; padding: 4px 0 0; }
.tmn-hook .copy-row b { font-size: 13.5px; font-weight: 600; }
.tmn-unmatched { border-color: rgb(var(--accent-rgb) / .45); }
.slip-thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--card-3); border: 1px solid var(--line); cursor: zoom-in; display: block; }
.slip-full { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 10px; }
.pkg-admin { display: grid; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pkg-row { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) auto; gap: 14px; align-items: center; padding: 16px 18px; }
.pkg-row + .pkg-row { border-top: 1px solid var(--line); }
.pkg-row b { display: block; font-size: 15px; }
.pkg-row small { display: block; font-size: 12px; color: var(--faint); }
.pkg-row .v { font: 700 16px var(--display); }
.pkg-row.off { opacity: .6; }
@media (max-width: 860px) {
    .pkg-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pkg-row > div:first-child { grid-column: 1 / -1; }
    .pkg-row > div:last-child { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- états vides, notices ---------- */
.empty { border-radius: var(--r); }
.notice { border-radius: var(--r); }
.banner { border-radius: var(--r); }

/* ============================================================
   Finitions
   ============================================================ */
h1, h2, h3 { text-wrap: balance; }
a { text-underline-offset: 3px; }
.rtable td, .num, .tx-amt, .stat-v, .big-num, .money, .kpi .v, .pkg-row .v { font-variant-numeric: tabular-nums; }
/* contrôles segmentés : largeur du contenu (une largeur fixée empêche la grille ou la colonne flex de les étirer) */
.seg { width: max-content; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button .n { margin-left: 0; }
.seg.seg-2 { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
/* pas de carte dans la carte : dans une carte, tableaux et états vides perdent leur propre cadre */
.card .table-wrap { border: 0; border-radius: 0; background: none; box-shadow: none; }
.card .empty, .pcard .empty { border: 0; }
#d-grid .empty { background: var(--card-2); border-radius: var(--r-sm); }
/* indicateurs (tableau de bord admin, serveur) : filets intérieurs seulement, jamais de case orpheline */
.kpis { overflow: hidden; }
.kpi { border-right: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.srv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) {
    .srv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* une seule action de page : elle reste sur la ligne du titre au lieu d'occuper une 2e ligne */
@media (max-width: 1279px) { #top-actions:has(> :only-child) { order: 1; flex: none; } }
/* fenêtre des points : solde après l'opération */
.pm-after { margin: -8px 0 0; min-height: 1.4em; font-size: 13px; color: var(--muted); }
.pm-after b { color: var(--text); font-family: var(--display); }

/* ============================================================
   Mode allégé : aucun mouvement décoratif ni ombre coûteuse
   ============================================================ */
html.lite *, html.lite *::before, html.lite *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
html.lite .auth-embers, html.lite .skeleton::after { display: none; }
html.lite { --shadow-md: 0 1px 0 rgba(0, 0, 0, .25); --shadow-lg: 0 2px 0 rgba(0, 0, 0, .3); }
html.lite .pkg:hover { transform: none; }
@media (prefers-reduced-motion: reduce) { .auth-embers { display: none; } }
