/* ============================================================
   FF Panels — composants Flowbite 4 (chargé EN DERNIER, après app.css, app-pro.css et app-ff.css)
   Thème par défaut de Flowbite 4.0.1 (flowbite/src/themes/default.css) : gris « gray » de Tailwind, bleu de marque
   (blue-700, blue-600 en sombre), rayon de base 12 px (rounded-base), bordures 1 px « default », ombres xs,
   anneaux de focus de 4 px. Les couches précédentes gardent la structure des vues ; celle-ci fixe les jetons et dessine
   chaque composant comme Flowbite : boutons, champs, interrupteurs, cartes, tableaux, badges, onglets, alertes,
   barre latérale, barre du haut, menu déroulant, fenêtre, notification, progression, squelette, zone de dépôt.
   Mobile : barre du bas « Application bar » (bouton rond central = forfaits) ; forfaits : « Pricing card ».
   Noms hérités des thèmes précédents : --gold, --gold-2, --gold-ink, --gold-bg, --on-gold = couleur de marque.
   Pour revenir au rendu précédent : retirer la balise <link … app-flow.css> de index.html.
   ============================================================ */

/* ---------- jetons : clair ---------- */
:root {
    --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb; --gray-300: #d1d5dc; --gray-400: #99a1af;
    --gray-500: #6a7282; --gray-600: #4a5565; --gray-700: #364153; --gray-800: #1e2939; --gray-900: #101828; --gray-950: #030712;
    --blue-50: #eff6ff; --blue-100: #dbeafe; --blue-200: #bedbff; --blue-400: #51a2ff; --blue-500: #2b7fff;
    --blue-600: #155dfc; --blue-700: #1447e6; --blue-800: #193cb8; --blue-900: #1c398e; --blue-950: #162456;

    --bg: var(--gray-50);            /* neutral-secondary-soft : fond de page */
    --bg-2: #ffffff;                 /* barre latérale (neutral-primary-soft) */
    --nav-bg: #ffffff;               /* barre du haut (neutral-primary) */
    --card: #ffffff;                 /* neutral-primary-soft */
    --card-2: var(--gray-50);        /* neutral-secondary-medium : champs, boutons secondaires */
    --card-3: var(--gray-200);       /* neutral-quaternary : pistes, interrupteur éteint */
    --hover: var(--gray-100);        /* neutral-tertiary */
    --hover-2: var(--gray-100);      /* neutral-tertiary-medium (sur un menu) */
    --thead: var(--gray-50);         /* en-tête des tableaux */
    --menu: #ffffff;                 /* neutral-primary-medium : menus déroulants */
    --line: var(--gray-200);         /* border-default */
    --line-2: var(--gray-300);       /* border-default-medium (champs) */
    --line-3: var(--gray-300);       /* border-default-strong */
    --text: var(--gray-900);         /* text-heading */
    --muted: var(--gray-600);        /* text-body */
    --faint: var(--gray-500);        /* text-body-subtle (≥ 4.5:1 sur blanc et gray-50) */
    --accent-rgb: 20 71 230;
    --gold: var(--blue-700);         /* brand */
    --gold-2: var(--blue-600);
    --brand-strong: var(--blue-800); /* survol d'un bouton principal */
    --gold-ink: var(--blue-700);     /* fg-brand : liens, icônes actives */
    --brand-ink: var(--blue-900);    /* fg-brand-strong : texte sur fond de marque pâle */
    --on-gold: #ffffff;
    --gold-bg: var(--blue-50);       /* brand-softer */
    --brand-soft: var(--blue-100);
    --brand-medium: var(--blue-200); /* anneau de focus */
    --brand-subtle: var(--blue-200); /* bordure sur fond de marque pâle */
    --green: #007a55; --green-2: #006045; --green-ink: #004f3b; --green-bg: #ecfdf5; --green-line: #a4f4cf;
    --red: #c70036; --red-fill: #c70036; --red-ink: #8b0836; --red-bg: #fff1f2; --red-line: #ffccd3;
    --amber: #ca3500; --amber-ink: #7e2a0c; --amber-bg: #fff7ed; --amber-line: #ffd6a7;
    --blue: var(--blue-700); --blue-ink: var(--blue-900); --blue-bg: var(--blue-50); --blue-line: var(--blue-200);
    --violet: #8200db; --violet-ink: #59168b; --violet-bg: #faf5ff; --violet-line: #e9d4ff;
    --cyan: #0092b8;
    --banned: #8b0836;
    --q-muted: var(--gray-300);
    --r: 12px; --r-sm: 8px; --r-xs: 6px; --r-lg: 16px;
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
    --glow: 0 0 0 4px var(--brand-medium);
    --backdrop: rgb(3 7 18 / .7);
    --glass: var(--nav-bg);
    --glass-2: var(--card);
    --hero-ink: var(--text);
    color-scheme: light;
}

/* ---------- jetons : sombre (par défaut) ---------- */
:root[data-theme="dark"] {
    --bg: var(--gray-950);
    --bg-2: var(--gray-900);
    --nav-bg: var(--gray-950);
    --card: var(--gray-900);
    --card-2: var(--gray-800);
    --card-3: var(--gray-700);
    --hover: var(--gray-800);
    --hover-2: var(--gray-700);
    --thead: var(--gray-900);
    --menu: var(--gray-800);
    --line: var(--gray-800);
    --line-2: var(--gray-700);
    --line-3: var(--gray-600);
    --text: #ffffff;
    --muted: var(--gray-400);
    --faint: #8b93a1;                /* ≥ 4.5:1 sur gray-900 et gray-800 */
    --accent-rgb: 21 93 252;
    --gold: var(--blue-600);
    --gold-2: var(--blue-500);
    --brand-strong: var(--blue-700);
    --gold-ink: var(--blue-500);
    --brand-ink: var(--blue-400);
    --on-gold: #ffffff;
    --gold-bg: var(--blue-950);
    --brand-soft: var(--blue-900);
    --brand-medium: var(--blue-900);
    --brand-subtle: var(--blue-900);
    --green: #00bc7d; --green-2: #009966; --green-ink: #5ee9b5; --green-bg: #002c22; --green-line: #004f3b;
    --red: #ff2056; --red-fill: #c70036; --red-ink: #ffa1ad; --red-bg: #4d0218; --red-line: #8b0836;
    --amber: #ff8904; --amber-ink: #ffb86a; --amber-bg: #441306; --amber-line: #7e2a0c;
    --blue: var(--blue-400); --blue-ink: var(--blue-400); --blue-bg: var(--blue-950); --blue-line: var(--blue-900);
    --violet: #c27aff; --violet-ink: #dab2ff; --violet-bg: #3c0366; --violet-line: #59168b;
    --cyan: #00d3f2;
    --banned: #ff2056;
    --q-muted: var(--gray-700);
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .3);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .4), 0 1px 2px -1px rgb(0 0 0 / .4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .4), 0 2px 4px -2px rgb(0 0 0 / .4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .5), 0 4px 6px -4px rgb(0 0 0 / .4);
    color-scheme: dark;
}

/* ---------- base : texte courant « body », titres et gras « heading » ---------- */
body { background: var(--bg); color: var(--muted); }
h1, h2, h3, h4, h5, h6, b, strong { color: var(--text); }
::selection { background: var(--brand-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
a { color: var(--gold-ink); font-weight: 500; }
a:hover { color: var(--gold-ink); text-decoration: underline; }
html { scrollbar-color: var(--card-3) transparent; }
::-webkit-scrollbar-thumb { background: var(--card-3); border: 2px solid var(--bg); }
.ic { stroke-width: 2; }
.view { animation: fb-in .15s ease-out; }
@keyframes fb-in { from { opacity: 0; } }
@keyframes fb-pulse { 50% { opacity: .5; } }
.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; }

/* ---------- marque, chargement ---------- */
.logo-mark, .logo-mark.sm { clip-path: none; border: 0; border-radius: var(--r-sm); background: var(--gold); color: var(--on-gold);
    box-shadow: none; font: 700 14px/1 var(--sans); letter-spacing: 0; }
.logo-mark { width: 36px; height: 36px; }
.logo-mark.sm { width: 32px; height: 32px; font-size: 13px; }
.boot-bar { height: 4px; border-radius: 9999px; background: var(--card-3); }
.boot-bar span { border-radius: 9999px; background: var(--gold); }

/* ============================================================
   Boutons (Flowbite : secondaire par défaut, principal = marque, contour rouge = arrêter / supprimer)
   ============================================================ */
:root[data-theme] .btn { height: 40px; padding: 0 16px; gap: 8px; border-radius: var(--r); border: 1px solid var(--line-2);
    background: var(--card-2); color: var(--muted); font: 500 14px/20px var(--sans); box-shadow: var(--shadow-xs);
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
:root[data-theme] .btn .ic { color: currentColor; }
:root[data-theme] .btn:hover { background: var(--hover-2); border-color: var(--line-2); color: var(--text); text-decoration: none; }
:root[data-theme] .btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--hover-2); }
.btn:active { transform: none; }
:root[data-theme] .btn:disabled { opacity: .5; cursor: not-allowed; }
:root[data-theme] .btn.primary, :root[data-theme] .btn.soft-green { background: var(--gold); border-color: transparent; color: var(--on-gold); }
:root[data-theme] .btn.primary .ic, :root[data-theme] .btn.soft-green .ic { color: currentColor; }
:root[data-theme] .btn.primary:hover, :root[data-theme] .btn.soft-green:hover,
:root[data-theme] .btn.primary:active, :root[data-theme] .btn.soft-green:active { background: var(--brand-strong); border-color: transparent; color: var(--on-gold); }
:root[data-theme] .btn.primary:focus-visible, :root[data-theme] .btn.soft-green:focus-visible { box-shadow: 0 0 0 4px var(--brand-medium); }
:root[data-theme] .btn.danger { background: transparent; border-color: var(--red); color: var(--red); box-shadow: none; }
:root[data-theme] .btn.danger .ic { color: currentColor; }
:root[data-theme] .btn.danger:hover { background: var(--red-fill); border-color: var(--red-fill); color: #ffffff; }
:root[data-theme] .btn.danger:focus-visible { box-shadow: 0 0 0 4px var(--red-bg); }
:root[data-theme] .btn.amber { background: transparent; border-color: var(--gold); color: var(--gold-ink); box-shadow: none; }
:root[data-theme] .btn.amber .ic { color: currentColor; }
:root[data-theme] .btn.amber:hover { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
:root[data-theme] .btn.ghost { background: transparent; border-color: transparent; color: var(--text); box-shadow: none; }
:root[data-theme] .btn.ghost .ic { color: currentColor; }
:root[data-theme] .btn.ghost:hover { background: var(--hover); border-color: transparent; color: var(--text); }
:root[data-theme] .btn.ghost[aria-pressed="true"] { background: var(--gold-bg); border-color: transparent; color: var(--gold-ink); }
:root[data-theme] .btn.sm { height: 34px; padding: 0 12px; gap: 6px; font-size: 13px; }
:root[data-theme] .btn.lg { height: 48px; padding: 0 20px; font-size: 16px; border-radius: var(--r); }
:root[data-theme] .btn.icon { width: 40px; padding: 0; }
:root[data-theme] .btn.icon.sm { width: 34px; }
:root[data-theme] .btn.block { width: 100%; }
@media (pointer: coarse) { :root[data-theme] .btn.sm { height: 36px; } :root[data-theme] .btn.icon.sm { width: 36px; } }
.linkish { color: var(--gold-ink); font-weight: 500; }
.linkish:hover { text-decoration: underline; }

/* ============================================================
   Formulaires (Flowbite : champ gris clair, bordure 1 px, rayon 12 px, focus = bordure et anneau de marque)
   ============================================================ */
input, select, textarea { height: 42px; padding: 0 12px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--r);
    color: var(--text); font-size: 14px; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
input[type=checkbox], input[type=radio] { box-shadow: none; accent-color: var(--gold); }
:root[data-theme] select:not([multiple]) { appearance: none; -webkit-appearance: none; padding-right: 40px; background-repeat: no-repeat;
    background-position: right 10px center; background-size: 20px 20px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236a7282' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); }
label { color: var(--text); font-size: 14px; font-weight: 500; gap: 8px; }
label .hint, .hint { color: var(--faint); font-weight: 400; }
label .opt { color: var(--faint); }
.flabel { color: var(--text); font-weight: 500; }
.meaning { color: var(--gold-ink); font-weight: 500; }
.form-error { color: var(--red); }
.field-err { color: var(--red); font-size: 13px; font-weight: 500; }
.bo-set [aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.pw-eye { color: var(--faint); border-radius: var(--r-sm); }
.pw-eye:hover { color: var(--text); background: var(--hover-2); }
.search .ic { top: 13px; color: var(--faint); }
.search input { padding-left: 36px; }
/* interrupteur (Flowbite « Toggle ») : piste 36 × 20, pastille blanche */
.switch { width: 36px; height: 20px; border: 0; border-radius: 9999px; background: var(--card-3); }
.switch::after { top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 9999px; background: #ffffff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.switch.on, .bo-toggle input:checked + .switch { background: var(--gold); border-color: transparent; }
.switch.on::after, .bo-toggle input:checked + .switch::after { transform: translateX(16px); background: #ffffff; }
.bo-toggle input:focus-visible + .switch { outline: none; box-shadow: 0 0 0 4px var(--brand-medium); }
/* compteur (Flowbite « Number input » avec boutons) */
.stepper { border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card-2); box-shadow: var(--shadow-xs); }
.stepper:focus-within { border-color: var(--gold); }
.stepper button { width: 44px; height: 42px; color: var(--text); background: transparent; }
.stepper button:hover { background: var(--hover-2); color: var(--text); }
.stepper input { width: 60px; height: 42px; border: 0; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2);
    border-radius: 0; background: transparent; box-shadow: none; color: var(--text); font-weight: 500; }
.stepper input:focus { box-shadow: none; }
/* case à choisir dans un formulaire : ligne avec interrupteur */
.bo-toggle { gap: 12px; padding: 12px 16px; border-radius: var(--r); background: var(--card-2); border: 1px solid var(--line); color: var(--text); font-weight: 500; }
.bo-toggle small { color: var(--muted); font-size: 13px; }

/* ============================================================
   Surfaces (Flowbite « Card ») et titres
   ============================================================ */
.card, .pcard, .plist, .table-wrap, .kpis, .bo-kpis, .log, .plan-strip, .pkg-admin, .tp-preview, .banner {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-xs); }
.card { padding: 24px; }
.card-head h3 { font-size: 16px; font-weight: 600; }
.section-title h2, .section-head h2 { font-size: 18px; font-weight: 700; }
.section-title .hint { color: var(--muted); }
.money { color: inherit; }

/* ============================================================
   Badges (Flowbite « Badge » : fond pâle, bordure subtile, point de couleur), pastilles, étiquettes
   ============================================================ */
.pill { height: auto; min-height: 22px; padding: 2px 8px; gap: 6px; border-radius: var(--r-xs); border: 1px solid var(--line-2);
    background: var(--card-2); color: var(--text); font-size: 12px; font-weight: 500; line-height: 16px; }
.pill i { width: 8px; height: 8px; border-radius: 9999px; background: var(--faint); }
.pill.no-dot i { display: none; }
.pill.green { background: var(--green-bg); border-color: var(--green-line); color: var(--green-ink); }
.pill.green i { background: var(--green); }
.pill.amber { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber-ink); }
.pill.amber i { background: var(--amber); }
.pill.red { background: var(--red-bg); border-color: var(--red-line); color: var(--red-ink); }
.pill.red i { background: var(--red); }
.pill.blue { background: var(--gold-bg); border-color: var(--brand-subtle); color: var(--brand-ink); }
.pill.blue i { background: var(--gold); }
.pill.violet { background: var(--violet-bg); border-color: var(--violet-line); color: var(--violet-ink); }
.pill.violet i { background: var(--violet); }
.chip, .idchip { border-radius: var(--r-xs); border: 1px solid var(--line-2); background: var(--card-2); color: var(--muted); font-weight: 500; }
.chip b { color: var(--text); }
a.chip:hover, .idchip:hover { border-color: var(--gold); color: var(--text); text-decoration: none; }
.idchip.copied { color: var(--green-ink); border-color: var(--green-line); background: var(--green-bg); }
.mode-tag, .mode-tag.m-br, .mode-tag.m-br_ranked, .mode-tag.m-br_ranked_rank, .mode-tag.m-lone_wolf, .mode-tag.m-clash_squad {
    border-radius: var(--r-xs); border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font-weight: 500; }
.hp-tag { border-radius: var(--r-xs); }
.tag { height: auto; min-height: 22px; padding: 2px 8px; border-radius: var(--r-xs); background: var(--gold); color: var(--on-gold); font-size: 12px; font-weight: 500; }
.tag.soft { background: var(--gold-bg); color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand-subtle); }
.tag.muted { background: var(--card-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ============================================================
   Onglets : « Pills » (filtres), soulignés (back-office, fenêtres), pleine largeur (connexion)
   ============================================================ */
.seg { gap: 6px; padding: 0; background: transparent; border: 0; border-radius: 0; }
.seg button { height: 36px; padding: 0 14px; border-radius: var(--r); background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; box-shadow: none; }
.seg button:hover { background: var(--hover); color: var(--text); }
:root[data-theme] .seg button.active { background: var(--gold); color: var(--on-gold); box-shadow: none; }
.seg button .n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 9999px;
    background: var(--card-3); color: var(--text); font-size: 12px; font-weight: 500; }
:root[data-theme] .seg button.active .n { background: rgb(255 255 255 / .22); color: var(--on-gold); }
.seg.seg-2 { gap: 0; padding: 4px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r); }
.seg.seg-2 button { height: 36px; }
.bo-tabs { background: var(--bg); padding-top: 0; margin-bottom: 20px; }
.bo-tabs .seg { width: 100%; gap: 4px; border-bottom: 1px solid var(--line); }
.bo-tabs .seg button { height: 48px; padding: 0 12px; border-radius: 0; background: transparent; color: var(--muted); }
.bo-tabs .seg button:hover { background: transparent; color: var(--gold-ink); box-shadow: inset 0 -2px 0 var(--line-3); }
:root[data-theme] .bo-tabs .seg button.active { background: transparent; color: var(--gold-ink); box-shadow: inset 0 -2px 0 var(--gold); }
.bo-tabs .seg button .ic { width: 16px; height: 16px; }
.bo-tabs .badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 9999px; background: var(--red-bg); color: var(--red-ink);
    box-shadow: inset 0 0 0 1px var(--red-line); font: 500 12px/1 var(--sans); }
.tabs { border-bottom: 1px solid var(--line); }
.tabs button { height: 44px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.tabs button:hover { color: var(--gold-ink); }
.tabs button.active { color: var(--gold-ink); border-bottom-color: var(--gold); }
.auth-tabs { gap: 0; padding: 0; margin: 4px 0 24px; background: transparent; border: 1px solid var(--line); border-radius: var(--r);
    overflow: hidden; box-shadow: var(--shadow-xs); }
.auth-tabs button { height: 48px; border-radius: 0; background: var(--card); color: var(--muted); font-weight: 500; }
.auth-tabs button + button { border-left: 1px solid var(--line); }
.auth-tabs button:hover { background: var(--card-2); color: var(--text); }
.auth-tabs button[aria-selected="true"] { background: var(--hover); color: var(--text); }

/* ============================================================
   Tableaux (Flowbite « Table » : en-tête gris pâle, lignes séparées, survol)
   ============================================================ */
table { font-size: 14px; }
th { padding: 12px 16px; background: var(--thead); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px;
    font-weight: 500; letter-spacing: normal; text-transform: none; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
tbody tr { background: var(--card); }
tbody tr:hover { background: var(--card-2); }
.cell-acc b, td b { color: var(--text); }
table.acc-grid tbody tr.sel, table.acc-grid tbody tr.sel:hover { background: var(--gold-bg); }
table.acc-grid tbody tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--gold); }

/* ============================================================
   Alertes (Flowbite « Alert »), états vides, bandeaux
   ============================================================ */
.notice, .tp-closed { align-items: flex-start; gap: 10px; padding: 16px; border-radius: var(--r); border: 1px solid var(--amber-line);
    background: var(--amber-bg); color: var(--amber-ink); font-size: 14px; }
.notice > .ic { flex: none; margin-top: 2px; }
.notice b { color: inherit; }
.announce { padding: 16px; border-radius: var(--r); border: 1px solid var(--brand-subtle); background: var(--gold-bg); color: var(--brand-ink); font-size: 14px; }
.announce .ic { color: var(--gold-ink); }
.scopebar { border-radius: var(--r); border: 1px solid var(--brand-subtle); background: var(--gold-bg); color: var(--brand-ink); }
.scopebar > .ic { color: var(--gold-ink); }
.scopebar b { color: inherit; }
.scopebar .chip { background: var(--card); }
.settings-summary { border-radius: var(--r); border: 1px solid var(--brand-subtle); background: var(--gold-bg); color: var(--brand-ink); }
.settings-summary > .ic { color: var(--gold-ink); }
.settings-summary b { color: inherit; }
.settings-summary .warn { color: var(--amber); }
.banner > .ic { color: var(--gold-ink); }
.banner span { color: var(--muted); }
.empty { border: 1px dashed var(--line-3); border-radius: var(--r); background: transparent; color: var(--muted); }
.empty .ic { color: var(--faint); opacity: 1; }
#d-grid .empty { background: var(--card-2); border: 0; }
.auth-form .form-error { padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--red-line); background: var(--red-bg); color: var(--red-ink); font-size: 14px; }
/* « ยืนยันว่าไม่ใช่หุ่นยนต์ » : widget Cloudflare Turnstile (65 px de haut, largeur du formulaire) */
.captcha { min-height: 65px; color: var(--muted); font-size: 14px; }
.captcha[hidden] { display: none; }
.captcha-test .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.captcha-test .captcha { margin-top: 12px; min-height: 0; }
.auth-note { padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--brand-subtle); background: var(--gold-bg); color: var(--brand-ink); font-size: 14px; }
.auth-closed { border-radius: var(--r); border: 1px solid var(--line); background: var(--card-2); color: var(--muted); }

/* ============================================================
   Barre latérale (Flowbite « Sidebar ») et barre du haut (« Navbar »)
   ============================================================ */
.sidebar { background: var(--bg-2); border-right: 1px solid var(--line); }
.side-brand { border-bottom: 1px solid var(--line); }
.side-brand b { color: var(--text); font-weight: 700; letter-spacing: 0; }
.nav-group + .nav-group { border-top: 1px solid var(--line); }
.nav-group-label { color: var(--faint); font-size: 12px; font-weight: 500; }
.nav-item { border-radius: var(--r); color: var(--muted); font-weight: 500; box-shadow: none; transition: background-color .15s, color .15s; }
.nav-item .ic, .nav-item:hover .ic, .nav-item.active .ic { color: inherit; }
.nav-item:hover { background: var(--hover); color: var(--gold-ink); }
.nav-item.active { background: var(--hover); color: var(--gold-ink); box-shadow: none; }
.nav-item.active::before { content: none; }
.nav-item .count { padding: 2px 6px; border-radius: var(--r-xs); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2);
    color: var(--text); font: 500 12px/16px var(--sans); }
.nav-item .count:empty { display: none; }
@media (min-width: 1024px) {
    .nav-item { height: auto; min-height: 40px; padding: 8px 10px; gap: 12px; font-size: 14px; }
    .nav-item .ic { width: 20px; height: 20px; }
}
.side-foot { border-top: 1px solid var(--line); }
.topbar { background: var(--nav-bg); border-bottom: 1px solid var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar h1 { color: var(--text); letter-spacing: 0; }
/* actions de la page : un seul jeu de boutons (le bouton « รีเฟรช » encadré comme les autres, même taille) */
:root[data-theme] #top-actions .btn.ghost { background: var(--card-2); border-color: var(--line-2); box-shadow: var(--shadow-xs); color: var(--muted); }
:root[data-theme] #top-actions .btn.ghost:hover { background: var(--hover-2); color: var(--text); }
:root[data-theme] #top-actions .btn.icon { width: 34px; height: 34px; }
@media (pointer: coarse) { :root[data-theme] #top-actions .btn.icon { width: 36px; height: 36px; } }
@media (max-width: 640px) { :root[data-theme] #top-actions .btn { width: 36px; height: 36px; padding: 0; } }
/* bouton du profil (Flowbite : avatar + nom dans la barre du haut) */
.pf-btn { border: 0; background: transparent; color: var(--text); font-weight: 500; }
.pf-btn:hover, .pf-btn[aria-expanded="true"] { border-color: transparent; background: var(--hover); color: var(--gold-ink); }
.pf-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--hover-2); }
.pf-name { font-weight: 500; font-size: 14px; }
.pf-chev { color: inherit; }
.pf-btn.dot::after { background: var(--red); border-color: var(--nav-bg); }
.live.on i { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }

/* ============================================================
   Menus (Flowbite « Dropdown ») : profil, clic droit ; feuille « เมนู » (« Drawer » du bas)
   ============================================================ */
.pf-menu { padding: 0 0 8px; background: var(--menu); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.pf-head { padding: 12px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.pf-head b { font-size: 14px; font-weight: 500; }
.pf-head small { color: var(--muted); font-size: 13px; }
.pf-plan { margin: 0 8px 8px; border-radius: var(--r-sm); font-size: 13px; color: var(--muted); }
.pf-plan.on { background: var(--green-bg); color: var(--green-ink); }
.pf-plan.on b { color: inherit; }
.pf-plan.on .ic { color: var(--green); }
.pf-plan.off { background: var(--hover-2); }
.pf-sep { margin: 8px 0; background: var(--line-2); }
.pf-item { width: calc(100% - 16px); margin: 0 8px; min-height: 40px; padding: 8px; gap: 10px; border-radius: var(--r-sm);
    color: var(--muted); font: 500 14px var(--sans); }
.pf-item .ic, .pf-item:hover .ic, .pf-item:focus-visible .ic { width: 18px; height: 18px; color: inherit; }
.pf-item:hover, .pf-item:focus-visible { background: var(--hover-2); color: var(--text); }
.pf-item.danger, .pf-item.danger .ic { color: var(--red); }
.pf-item.admin, .pf-item.admin .ic { color: var(--gold-ink); }
.pf-item .pf-aside { color: var(--faint); font-weight: 500; }
.ctxmenu { padding: 8px; background: var(--menu); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.ctxmenu button { border-radius: var(--r-sm); color: var(--muted); font-size: 14px; font-weight: 500; }
.ctxmenu button:hover, .ctxmenu button:focus-visible { background: var(--hover-2); color: var(--text); }
.ctxmenu button.danger { color: var(--red); }
.ctxmenu hr { border-top-color: var(--line-2); }
.ctxmenu kbd { border-color: var(--line-2); border-radius: var(--r-xs); }
.more-sheet { background: var(--backdrop); }
.more-panel { background: var(--bg); border-top: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.more-grab { background: var(--card-3); }
/* feuille « เมนู » : Flowbite « List group » (icône, libellé, chevron) */
.more-list { display: grid; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-xs); }
.more-list + .more-list { margin-top: 12px; }
.more-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line);
    background: transparent; color: var(--text); font: 500 15px var(--sans); text-align: left; cursor: pointer; }
.more-item:last-child { border-bottom: 0; }
.more-item .ic { width: 20px; height: 20px; color: var(--muted); }
.more-item .more-chev { margin-left: auto; width: 16px; height: 16px; color: var(--faint); transform: rotate(-90deg); }
.more-item:hover, .more-item:focus-visible { background: var(--card-2); outline: none; }
.more-item.active, .more-item.active .ic { color: var(--gold-ink); }
.more-item.danger, .more-item.danger .ic { color: var(--red); }

/* ============================================================
   Fenêtres (Flowbite « Modal ») et notifications (« Toast »)
   ============================================================ */
.modal-backdrop { background: var(--backdrop); backdrop-filter: none; }
.modal { padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.modal-head { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; font-weight: 600; letter-spacing: 0; }
:root[data-theme] .modal-head .btn.icon.ghost { width: 36px; height: 36px; border-radius: var(--r); color: var(--muted); }
:root[data-theme] .modal-head .btn.icon.ghost:hover { background: var(--hover); color: var(--text); }
.modal-foot { gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.bo-form > .modal-foot { margin-top: 0; }       /* le formulaire espace déjà ses lignes (gap) */
.toast { gap: 12px; padding: 16px; max-width: 384px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
    box-shadow: var(--shadow-lg); color: var(--text); font-size: 14px; }
.toast .ic { width: 28px; height: 28px; padding: 6px; border-radius: var(--r-sm); background: var(--green-bg); color: var(--green); flex: none; }
.toast.error { border-color: var(--line); }
.toast.error .ic { background: var(--red-bg); color: var(--red); }

/* ============================================================
   Progression (Flowbite « Progress »), squelette (« Skeleton »), avatar
   ============================================================ */
.meter, .pbar, .lvl-bar { background: var(--card-3); border-radius: 9999px; }
.meter span, .pbar span, .lvl-bar .lb-gain { background: var(--gold); border-radius: 9999px; }
.meter.ok span { background: var(--green); }
.meter.warn span { background: var(--amber); }
.lvl-bar .lb-before { background: var(--gold); opacity: .35; }
.skeleton { background: var(--card-3); border-radius: var(--r); animation: fb-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
.skeleton::after { content: none; }
.gcard { border-radius: var(--r-sm); border-color: var(--line); background: var(--card-3); }
.gcard-skel { background: var(--card-3); animation: fb-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
.avatar { border: 0; font-weight: 500; }
.avatar .sdot { border-color: var(--card); }

/* ============================================================
   Tableau de bord, Panels, comptes, indicateurs
   ============================================================ */
.plan-strip > div + div { border-color: var(--line); }
.plan-strip small { color: var(--muted); font-size: 13px; font-weight: 500; }
.plan-strip .stat-v { color: var(--text); }
.plan-strip.none .ps-cta .ic { color: var(--gold-ink); }
.plan-strip.none .ps-cta span { color: var(--muted); }
.kpi .l, .bo-kpi small { color: var(--muted); font-weight: 500; }
.kpi .v, .bo-kpi .stat-v { color: var(--text); }
.kpi-ic { border-radius: var(--r-sm); }
.bo-kpi { box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
button.bo-kpi:hover { background: var(--card-2); }
.bo-kpi.alert .stat-v { color: var(--red); }
.pcard-title h3 { letter-spacing: 0; }
.pcard-metrics, .pcard-metrics > div + div, .arow-grid, .arow-grid > div + div { border-color: var(--line); }
.arow { background: var(--card-2); border-color: var(--line); border-radius: var(--r); }
.arow:hover { border-color: var(--line-2); }
.prow:hover { background: var(--hover); }
.tx { border-top-color: var(--line); }
.tx-ic { border-radius: var(--r-sm); }
.tx-ic.plus { background: var(--green-bg); color: var(--green); }
.tx-ic.minus { background: var(--gold-bg); color: var(--gold-ink); }
.prof-kv > div { border-top-color: var(--line); }
.prof-head h2 { letter-spacing: 0; }

/* ============================================================
   Forfaits : « Pricing card » de Flowbite (nom, prix, liste à coches, bouton pleine largeur)
   ============================================================ */
.pkg-grid { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); container-type: inline-size; }
/* une seule colonne : la carte sans badge s'ouvre sur son nom (la ligne vide ne sert qu'à aligner les prix côte à côte) */
@container (max-width: 555px) { .pkg-tags:empty { display: none; } }
.pkg { position: relative; display: flex; flex-direction: column; gap: 0; padding: 24px; border-radius: var(--r); background: var(--card);
    border: 1px solid var(--line); box-shadow: var(--shadow-xs); color: var(--muted); text-align: left; cursor: pointer;
    transition: border-color .15s, box-shadow .15s; }
.pkg:hover { transform: none; border-color: var(--line-3); }
.pkg.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow-xs); }
.pkg-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 22px; margin-bottom: 12px; }
.pkg-name { margin: 0 0 16px; color: var(--muted); font-size: 20px; font-weight: 500; line-height: 28px; text-wrap: balance; }
.pkg-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0; color: var(--text); }
.pkg-price .pkg-amt { color: var(--text); font: 800 48px/1 var(--sans); letter-spacing: -.025em; }
.pkg-price .pkg-per { margin-left: 8px; color: var(--muted); font-size: 16px; font-weight: 500; }
.pkg .pkg-desc { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.pkg .pkg-feats { margin: 24px 0; padding: 0; list-style: none; display: grid; gap: 16px; font-size: 15px; }
.pkg .pkg-feats li { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.pkg .pkg-feats li .ic { width: 20px; height: 20px; flex: none; color: var(--gold-ink); }
.pkg .pkg-feats li.off { text-decoration: line-through; text-decoration-color: var(--muted); }
.pkg .pkg-pick { margin-top: auto; }
/* récapitulatif d'achat, moyens de paiement (Flowbite « Radio card ») */
.buy-sum { border-top-color: var(--line); }
.buy-sum .row { color: var(--muted); }
.buy-sum .total { border-top: 1px solid var(--line); }
.buy-sum .total .money { color: var(--text); }
.method { padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); transition: border-color .15s, background-color .15s; }
.method:hover { background: var(--card-2); border-color: var(--line-3); }
.method[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-bg); box-shadow: 0 0 0 1px var(--gold); }
.method .m-ic { border-radius: var(--r-sm); background: var(--gold-bg); color: var(--gold-ink); }
.method[aria-pressed="true"] .m-ic { background: var(--gold); color: var(--on-gold); }
.method b { color: var(--text); font-weight: 600; }
.method small { color: var(--muted); }
.pay-pick .flabel { color: var(--text); font-size: 14px; }
.pay-note { border-radius: var(--r); border: 1px solid var(--line); background: var(--card-2); color: var(--muted); }
/* zone de dépôt (Flowbite « Dropzone ») */
.slip-drop, .dropzone { border: 1px dashed var(--line-3); border-radius: var(--r); background: var(--card-2); color: var(--muted); }
.slip-drop:hover, .slip-drop.over, .dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--hover-2); color: var(--text); }
.slip-drop .ic, .dropzone .ic { color: var(--muted); }
/* commande en cours, paiement par portefeuille */
.order-what { border-radius: var(--r); border: 1px solid var(--line); background: var(--card-2); }
.order-what > .ic { color: var(--gold-ink); }
.tmn-field .tmn-amount b { color: var(--text); }
.tmn-amount .money, .tmn-field .tmn-amount .money { color: var(--text); }
.tmn-code .tmn-amount b { color: var(--gold-ink); }
.tmn-qr img { border: 1px solid var(--line); border-radius: var(--r); }
.tmn-meta .btn { margin-left: 0; }
.tmn-meta > .btn:last-child { margin-left: auto; }      /* « ดูสลิป » à gauche, « ยกเลิก » à droite */
@media (min-width: 641px) { .rtable td .btn-row { flex-wrap: nowrap; } }
@media (max-width: 640px) { table.rtable td[data-label=""] { justify-content: flex-end; } }
.tmn-wait { border-top-color: var(--line); color: var(--muted); }
.tmn-wait .ic { color: var(--gold-ink); }
.copy-row { border-top-color: var(--line); }
.tp-preview { padding: 16px; color: var(--muted); }
.tp-preview-top > .ic { color: var(--gold-ink); }
.tp-switches { border-top-color: var(--line); }

/* ============================================================
   Back-office : rubriques des réglages (Flowbite « List group »), groupes, barre « บันทึก », forfaits
   ============================================================ */
.bo-set-glabel { color: var(--faint); font-weight: 500; }
.bo-set-item { border-radius: var(--r); color: var(--muted); }
.bo-set-item:hover { background: var(--hover); color: var(--text); }
.bo-set-item.active { background: var(--hover); box-shadow: none; color: var(--text); }
.bo-set-ic { border-radius: var(--r-sm); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.bo-set-item.active .bo-set-ic { background: var(--gold-bg); box-shadow: inset 0 0 0 1px var(--brand-subtle); color: var(--gold-ink); }
.bo-set-txt b { font-weight: 600; }
.bo-set-flag { background: var(--gold); }
.bo-pane-head h2 .ic { color: var(--gold-ink); }
.bo-group + .bo-group { border-top-color: var(--line); }
.bo-group h3 { font-size: 16px; font-weight: 600; }
.bo-save { border-radius: var(--r); border: 1px solid var(--line-2); background: var(--card); box-shadow: var(--shadow-lg); }
.bo-save span { color: var(--muted); }
.pkg-row + .pkg-row { border-top-color: var(--line); }
.pkg-row small { color: var(--muted); }

/* ============================================================
   Connexion / inscription : présentation neutre + carte de formulaire Flowbite
   ============================================================ */
.auth { background: var(--bg); }
.auth-hero { color: var(--text); background: var(--card); border-right: 1px solid var(--line); }
.auth-hero::after { content: none; }
.auth-embers { display: none; }
.auth-brand b { color: var(--text); letter-spacing: 0; }
.auth-title { color: var(--text); font-weight: 800; letter-spacing: -.02em; }
.auth-points li { color: var(--muted); font-size: 16px; }
.ap-ic { width: 40px; height: 40px; border-radius: var(--r); background: var(--gold-bg); color: var(--gold-ink); border: 1px solid var(--brand-subtle); }
.ap-ic .ic { width: 20px; height: 20px; }
.auth-card { padding: 24px 32px 32px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-xs); }
.auth-switch { color: var(--muted); }
.auth-foot { color: var(--muted); }
@media (max-width: 900px) {
    .auth-hero { border-right: 0; border-bottom: 1px solid var(--line); }
    .auth-panel { margin-top: 0; padding-top: 20px; }
    .auth-card { padding: 20px; }
}

/* ============================================================
   Mobile : barre du bas « Application bar » (pilule flottante, bouton rond central = forfaits)
   ============================================================ */
@media (max-width: 767px) {
    .bottom-nav { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); position: fixed; z-index: 50;
        left: 50%; right: auto; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
        width: calc(100% - 24px); max-width: 512px; height: 64px; padding: 0;
        background: var(--card); border: 1px solid var(--line); border-radius: 9999px; box-shadow: var(--shadow-lg); }
    .bottom-nav button { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        height: 100%; min-height: 0; min-width: 0; padding: 0 4px; border: 0; border-radius: 0; background: transparent;
        color: var(--muted); font: 500 12px/1.25 var(--sans); transition: background-color .15s, color .15s; }
    .bottom-nav > button:first-child { border-radius: 9999px 0 0 9999px; }
    .bottom-nav > button:last-child { border-radius: 0 9999px 9999px 0; }
    .bottom-nav button:hover { background: var(--card-2); color: var(--gold-ink); }
    .bottom-nav button .ic { width: 24px; height: 24px; }
    .bottom-nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bottom-nav button.active { color: var(--gold-ink); }
    .bottom-nav button.active::before { content: none; }
    .bottom-nav .bn-cta { display: flex; align-items: center; justify-content: center; }
    .bottom-nav .bn-cta button { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 9999px; background: var(--gold); color: var(--on-gold);
        box-shadow: var(--shadow-xs); }
    .bottom-nav .bn-cta button:hover { background: var(--brand-strong); color: var(--on-gold); }
    .bottom-nav .bn-cta button:focus-visible, .bottom-nav .bn-cta button.active { outline: none; box-shadow: 0 0 0 4px var(--brand-medium); }
    .bottom-nav .bn-cta .ic { width: 24px; height: 24px; }
    main { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
    #toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
    .bo-save { bottom: calc(92px + env(safe-area-inset-bottom)); }
    body:has(.bo-save:not([hidden])) #toasts { bottom: calc(204px + env(safe-area-inset-bottom)); }
    .modal, .modal.wide { border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
    .card { padding: 16px; }
    .pkg { padding: 20px; }
}
/* tableau de bord sur téléphone : filtres en bande défilante (fondu au bord), bouton des cartes en icône sur la même ligne */
@media (max-width: 640px) {
    .panel-toolbar { flex-wrap: nowrap; gap: 8px; }
    .panel-toolbar .spacer { display: none; }
    .panel-toolbar .seg { flex: 1 1 auto; width: auto; min-width: 0; padding-right: 20px; scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
    .panel-toolbar .seg::-webkit-scrollbar { display: none; }
    .panel-toolbar .seg button { flex: none; padding: 0 12px; }
    :root[data-theme] .panel-toolbar [data-act="toggle-cards"] { flex: none; width: 36px; height: 36px; padding: 0; }
    .panel-toolbar [data-act="toggle-cards"] span { display: none; }
}

/* ============================================================
   Mode allégé : pas d'ombre portée ni d'animation de squelette
   ============================================================ */
html.lite { --shadow-sm: none; --shadow-md: none; --shadow-lg: 0 1px 0 rgb(0 0 0 / .2); }
html.lite .skeleton, html.lite .gcard-skel { animation: none; }

/* ============================================================
   Forfaits par Panel (« แพ็กเกจของคุณ » : ต่ออายุ) et พ้อย
   ============================================================ */
.my-plans { margin-bottom: 16px; }
.my-plans .card-head h3 { display: flex; align-items: center; gap: 8px; }
.mp-list { display: flex; flex-direction: column; }
.mp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 16px; align-items: center;
    padding: 12px; border: 1px solid transparent; border-top-color: var(--line); }
.mp-row:first-child { border-top-color: transparent; }
.mp-row.sel { border-color: var(--brand-subtle); border-radius: var(--r); background: var(--gold-bg); }
.mp-row.off .mp-main b { color: var(--muted); }
.mp-main { min-width: 0; display: grid; gap: 2px; }
.mp-main b { font-size: 14.5px; overflow-wrap: anywhere; }
.mp-main small, .mp-time small { color: var(--faint); font-size: 12.5px; }
.mp-time { display: grid; justify-items: end; gap: 1px; text-align: right; }
.mp-time b { font-size: 13.5px; }
@media (max-width: 640px) {
    .mp-row { grid-template-columns: minmax(0, 1fr) auto; }
    .mp-time { justify-items: start; text-align: left; grid-row: 2; }
}
.buy-mode { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r-sm);
    background: var(--gold-bg); color: var(--brand-ink); font-size: 13px; }
.buy-mode .ic { flex: none; margin-top: 2px; }
.linkbtn { all: unset; cursor: pointer; color: var(--gold-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:focus-visible { outline: 2px solid var(--brand-medium); outline-offset: 2px; border-radius: 4px; }
.buy-sum .row b small.hint { display: block; font-weight: 400; }
.pts-box { display: flex; align-items: center; gap: 14px; margin: 12px 0; padding: 12px 14px; border-radius: var(--r);
    border: 1px solid var(--line); background: var(--card-2); }
.pts-box > div { display: grid; gap: 2px; }
.pts-box small { color: var(--faint); font-size: 12px; }
.pts-box b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pts-box .ic { color: var(--faint); }
.pts-box.short { border-color: var(--red-line); background: var(--red-bg); }
.pts-bal { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--gold-ink); }

/* Bouton rouge plein (ยกเลิกคำสั่งซื้อ) : bien visible, plus foncé au survol */
:root[data-theme] .btn.danger.solid { background: var(--red-fill); border-color: var(--red-fill); color: #ffffff; }
:root[data-theme] .btn.danger.solid:hover { background: var(--red-ink); border-color: var(--red-ink); color: #ffffff; }
:root[data-theme="dark"] .btn.danger.solid:hover { background: #a50036; border-color: #a50036; }

/* Achat : nombre de comptes et durée sur une seule ligne (deux colonnes), boutons +/− plus petits */
.buy .buy-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.buy .buy-row { display: grid; grid-template-rows: 1fr auto; gap: 6px; align-items: start; }
.buy .buy-row > div:first-child { flex: none; }
.buy .buy-row b { font-size: 13.5px; }
.buy .buy-row small { font-size: 12px; }
.buy .stepper { display: flex; width: 100%; border-radius: var(--r-sm); }
.buy .stepper button { flex: none; width: 32px; height: 32px; }
.buy .stepper button .ic { width: 15px; height: 15px; }
.buy .stepper input { flex: 1 1 auto; width: 0; min-width: 28px; height: 32px; font-size: 14px; padding: 0 2px; }
@media (max-width: 300px) { .buy .buy-rows { grid-template-columns: 1fr; } }

/* Import : une seule carte (plus de liste des formats ni de dépôt de fichiers) */
.import-grid.one { grid-template-columns: minmax(0, 1fr); max-width: 960px; margin-inline: auto; }
.import-grid.one #imp-text { min-height: 220px; }

/* Espace d'administration : nombres à traiter (commandes, membres en attente) en rouge, menu latéral et barre du bas */
.nav-item .count.alert { background: var(--red-fill); color: #ffffff; box-shadow: none; }
.bottom-nav button { position: relative; }
.bottom-nav .bn-count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9999px; background: var(--red-fill); color: #ffffff; font: 700 11px/18px var(--sans); text-align: center; }
.bottom-nav .bn-count:empty { display: none; }

/* ============================================================
   Ordinateur, หน้าบ้าน : menu en barre horizontale en haut (Flowbite « Navbar ») à la place de la barre latérale.
   หลังบ้าน (.shell sans .front-top) garde la barre latérale ; tablette et mobile : inchangés.
   ============================================================ */
.top-brand, .top-nav { display: none; }
@media (min-width: 1024px) {
    .shell.front-top { grid-template-columns: minmax(0, 1fr); }
    .shell.front-top .sidebar { display: none; }
    .shell.front-top .topbar { flex-wrap: wrap; column-gap: 16px; row-gap: 8px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
    .shell.front-top .topbar > .logo-mark, .shell.front-top .topbar h1 { display: none !important; }
    .shell.front-top .top-brand { display: flex; align-items: center; gap: 10px; flex: none; }
    .shell.front-top .top-brand .logo-mark { display: grid !important; }
    .shell.front-top .top-brand b { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; }
    .shell.front-top .top-nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
    .shell.front-top .top-nav::-webkit-scrollbar { display: none; }
    .top-nav .nav-item { flex: none; width: auto; height: 40px; min-height: 0; padding: 0 12px; gap: 8px; font-size: 14px; white-space: nowrap; }
    .top-nav .nav-item .ic { width: 18px; height: 18px; }
    .shell.front-top .topbar .live.mobile-only { display: inline-flex !important; order: 3; }
    .shell.front-top .topbar .pf-btn { order: 4; }
    .shell.front-top #top-actions { order: 5; flex: 1 0 100%; margin-left: 0; justify-content: flex-end; }
    .shell.front-top #top-actions:empty { display: none; }
}

/* Barre du haut (หน้าบ้าน, ordinateur) : menu en pilule arrondie, au centre de l'en-tête */
@media (min-width: 1024px) {
    .shell.front-top .top-brand { flex: 1 1 0; min-width: max-content; }
    .shell.front-top .topbar .live.mobile-only { flex: 1 1 0; justify-content: flex-end; }
    .shell.front-top .top-nav { flex: 0 1 auto; margin: 0 auto; padding: 4px; gap: 2px; border: 1px solid var(--line);
        border-radius: 9999px; background: var(--card); box-shadow: var(--shadow-xs); }
    .top-nav .nav-item { height: 36px; padding: 0 14px; border-radius: 9999px; }
    .top-nav .nav-item.active { background: var(--gold); color: var(--on-gold); }
    .top-nav .nav-item.active .count { background: rgb(255 255 255 / .2); box-shadow: none; color: inherit; }
}

/* Toute la page au centre : contenu limité en largeur et centré ; l'en-tête (barre du haut, titre) aligné sur les
   mêmes bords que le contenu (หน้าบ้าน et หลังบ้าน) */
:root { --page-max: 1320px; --page-pad: clamp(16px, 3vw, 40px); }
main { max-width: var(--page-max); margin-inline: auto; }
@media (min-width: 768px) {
    .topbar { padding-inline: max(var(--page-pad), calc((100% - var(--page-max)) / 2 + var(--page-pad))); }
}
/* la pilule du menu exactement au milieu de la page, hors du flux (le logo et le profil restent sur la même ligne) ;
   trop étroit pour tout le menu : il défile dans la pilule */
@media (min-width: 1024px) {
    .shell.front-top .top-nav { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); margin: 0;
        max-width: calc(100% - 2 * (var(--page-pad) + 190px)); }
}

/* Forfaits centrés : moins de cartes que de colonnes (ex. 2 forfaits sur un écran large) -> rangée au milieu */
.pkg-grid { display: flex; flex-wrap: wrap; justify-content: center; }
.pkg-grid > * { flex: 1 1 270px; min-width: 0; max-width: 380px; }

/* petit écran d'ordinateur : menu en texte seul (sans icônes) pour qu'il tienne dans la pilule, même avec les
   7 entrées d'un administrateur */
@media (min-width: 1024px) and (max-width: 1279px) {
    .shell.front-top .top-nav .nav-item { padding: 0 11px; }
    .shell.front-top .top-nav .nav-item .ic { display: none; }
}

/* ============================================================
   เพิ่มแอคเค้า : jusqu'où jouer (โนมอล / พรีเมียม, niveau, ทีละแมตช์ / ปั้มเสี่ยง)
   ============================================================ */
.imp-target { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.imp-play { display: grid; gap: 14px; margin-top: 16px; }
.imp-field { display: grid; gap: 8px; }
.imp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line-2);
    border-radius: 9999px; background: var(--card-2); color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 500;
    white-space: nowrap; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.imp-chip .ic { width: 15px; height: 15px; }
.imp-chip:hover:not(:disabled) { border-color: var(--gold); color: var(--text); }
.imp-chip[aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: var(--on-gold); }
.imp-chip:disabled { opacity: .5; cursor: not-allowed; }
.imp-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.imp-field .hint { margin: 0; font-size: 12.5px; }
.imp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px;
    padding-top: 16px; border-top: 1px solid var(--line); }
.imp-sum { color: var(--muted); font-size: 13.5px; }
@media (max-width: 520px) {
    .imp-foot .btn { width: 100%; justify-content: center; }
}
.tgt-tag { margin-top: 2px; color: var(--faint); font-size: 11.5px; white-space: nowrap; }

/* หลังบ้าน → สมาชิก : พ้อย = bouton sur le nombre ; boutons de la ligne sur deux lignes plutôt que coupés à droite */
.pts-cell { gap: 4px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.pts-cell .ic { width: 13px; height: 13px; color: var(--gold-ink); }
@media (min-width: 641px) { .bo-members td:last-child .btn-row { flex-wrap: wrap; } }

/* commande à payer : la page y descend toute seule (QR au centre ; carte sous l'en-tête collant) */
#st-order { scroll-margin-top: 84px; }

/* แดชบอร์ด : « แสดงทั้งหมด » sous les 10 premiers Panels / comptes en jeu */
.dash-more { display: flex; justify-content: center; margin-top: 16px; }
.dash-more:empty, .pc-more:empty { display: none; }
.pc-more { margin-top: 8px; }
.pc-more .btn { width: 100%; justify-content: center; color: var(--muted); }

/* แพ็กเกจ → ต่ออายุ : la carte de prolongation seule, centrée */
.buy-renew { max-width: 640px; margin-inline: auto; width: 100%; }
.buy-renew .card.buy { position: static; }

/* page แพ็กเกจ : en y descendant (ต่ออายุ, choix d'un forfait), le titre de la carte reste sous l'en-tête collant */
#st-buy { scroll-margin-top: 84px; }

/* โปรไฟล์ : titres des cartes avec icône ; listes longues repliées après 10 éléments */
.pf-card .card-head h3 { display: flex; align-items: center; gap: 8px; }
.pf-card .card-head h3 .ic { width: 18px; height: 18px; color: var(--gold-ink); }
.cap-list:not(.open) > .cap-hide { display: none; }
.cap-btn { margin-top: 10px; width: 100%; justify-content: center; color: var(--muted); }
.tx small.tx-note { color: var(--red, #f05252); }

/* โปรไฟล์ : barre d'onglets (ข้อมูลส่วนตัว · ชำระเงิน · คำสั่งซื้อล่าสุด) */
.pf-tabs { margin: 20px 0 16px; }
.pf-tabs button { display: inline-flex; align-items: center; gap: 8px; }
.pf-tabs button .ic { width: 16px; height: 16px; }
:root[data-theme] .pf-tabs button .n.alert { background: var(--red, #e02424); color: #fff; }
.pf-pane { display: grid; gap: 16px; }
.pf-wait { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.pf-wait > span { flex: 1 1 220px; }
