/* ============================================================
   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); }
/* ระบบบอทกำลังรีสตาร์ท : la page attend sur l'écran de chargement et réessaie seule */
.boot-msg { max-width: 320px; margin: 0; padding: 0 16px; color: var(--muted); font: 400 14px/1.5 var(--sans); text-align: center; }

/* ============================================================
   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, .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; }
/* โหมดของทีม glory : ปุ่มขึ้นบรรทัดใหม่แทนเลื่อนแนวนอน (ชื่อ “แรงค์ 4-4 เดี่ยว (ทดสอบ)” ยาว ล้นจอแคบ) ·
   คอลัมน์ grid จำกัดกว้างไม่ให้ seg (width:max-content) ดันเนื้อหาเกินจอ */
.gl-set { grid-template-columns: minmax(0, 1fr); }
#gl-modes { flex-wrap: wrap; width: auto; max-width: 100%; min-width: 0; overflow: visible; }
#gl-modes button { flex: 0 0 auto; }
.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); }
@media (min-width: 641px) { table.acc-grid td.acc-del { width: 1%; padding-top: 8px; padding-bottom: 8px; text-align: right; } }   /* ลบทีละบัญชี */
/* page บัญชี : nombre de comptes + « เลือกทั้งหมด » (téléphone, où l'en-tête du tableau disparaît) + « คัดลอกทั้งหมด » */
.acc-bar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.acc-bar #acc-total { flex: 1 1 auto; min-width: 0; }
.acc-bar-act { display: inline-flex; align-items: center; gap: 14px; margin-left: auto; }
.acc-bar-act .acc-all { display: none; }
@media (max-width: 640px) { .acc-bar-act .acc-all { display: inline-flex; } }

/* ============================================================
   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; }
/* Rang classé (colonne « แรงก์ » des comptes) : couleur du palier */
.rank-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: 999px; border: 1px solid currentColor;
    font-size: 13px; font-weight: 600; white-space: nowrap; }
.rank-ic { flex: none; object-fit: contain; vertical-align: middle; margin-right: 4px; }
.rank-tag .rank-ic { margin-right: 0; }
.rank-tag .faint { font-weight: 400; }
.rank-bronze { color: #c2804f; }
.rank-silver { color: #8f9bab; }
.rank-gold { color: #d4a017; }
.rank-platinum { color: #2fa8b0; }
.rank-diamond { color: #5b8def; }
.rank-heroic { color: #b06ee8; }
.rank-master { color: #e0603a; }
/* « ยืนยันว่าไม่ใช่หุ่นยนต์ » : 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; } }
/* thème sombre / clair : bouton rond à côté du profil (Flowbite « dark mode toggle ») */
.theme-btn { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0;
    border-radius: 9999px; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.theme-btn:hover { background: var(--hover); color: var(--text); }
.theme-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--hover-2); }
.theme-btn .ic { width: 20px; height: 20px; }
.theme-btn:empty { display: none; }
@media (max-width: 1279px) { .topbar .theme-btn { order: 4; } }
@media (min-width: 1024px) { .shell.front-top .topbar .theme-btn { order: 4; } }
/* 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-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); }

/* ============================================================
   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 : le filtre choisi en menu déroulant (« ทั้งหมด 1 ▾ », 20/10 : plus de bande à faire
   défiler), bouton des cartes en icône sur la même ligne, recherche dessous */
.d-filter-dd { display: none; }
:root[data-theme] .d-filter-dd { background: var(--gold); border-color: transparent; color: var(--on-gold); box-shadow: none; }
:root[data-theme] .d-filter-dd:hover { background: var(--brand-strong); color: var(--on-gold); }
.d-filter-dd .n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 9999px;
    background: rgb(255 255 255 / .22); font-size: 12px; font-weight: 500; }
@media (max-width: 640px) {
    .panel-toolbar { flex-wrap: wrap; gap: 8px; }
    .panel-toolbar .seg { display: none; }
    .panel-toolbar .d-filter-dd { display: inline-flex; flex: none; }
    .panel-toolbar .search { order: 5; flex: 1 1 100%; max-width: none; }
    :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; }
/* ต่ออายุ : nombre de comptes affiché, pas modifiable */
.buy-fixed { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-2);
    border-radius: var(--r-sm); background: var(--card); font-size: 15px; font-weight: 700; }
.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; }
.lvl-pick .imp-play { margin-top: 12px; }
.lvl-pick .imp-sum { margin: 14px 0 0; }
@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; }
/* เลเวลที่จะหยุด → « กำหนดเอง » : champ + bouton dans la rangée des puces */
.lv-custom { display: inline-flex; align-items: center; gap: 6px; padding-left: 4px; }
.lv-box { display: inline-flex; flex-direction: row; gap: 0; align-items: center; height: 34px; padding-left: 14px; border: 1px solid var(--line-2);
    border-radius: 9999px; background: var(--card-2); color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap;
    cursor: text; transition: border-color .15s, box-shadow .15s; }
.lv-box-l { padding-right: 10px; border-right: 1px solid var(--line-2); }
.lv-box input { width: 64px; height: 32px; padding: 0 12px 0 10px; border: 0; border-radius: 0 9999px 9999px 0; background: transparent;
    color: var(--text); font-size: 14px; font-weight: 600; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.lv-box input::-webkit-inner-spin-button, .lv-box input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lv-box input::placeholder { color: var(--faint); font-weight: 400; }
.lv-box input:focus { box-shadow: none; }
.lv-box:hover { border-color: var(--gold); }
.lv-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.lv-custom.on .lv-box { border-color: var(--gold); color: var(--text); }
.nowrap { white-space: nowrap; }
/* โหมดเพิ่มแรงค์ → « หยุดเมื่อแต้มแรงก์ถึง » : liste des rangs + champ « แต้ม » (+ ใช้แต้มนี้), puis le rang d'arrêt */
.rk-field { display: flex; flex-direction: column; gap: 8px; grid-column: 1 / -1; font-size: 14px; }
.rk-pick { display: grid; gap: 10px; }
.rk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rk-sel { width: auto; min-width: 240px; max-width: 100%; height: 34px; padding: 0 12px; border-radius: 9999px; font-size: 13.5px; }
.rk-pick .lv-custom { padding-left: 0; }
.rk-pick .lv-box input { width: 104px; }
.rk-stop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 42px; padding: 8px 14px; border: 1px solid var(--line);
    border-radius: var(--r); background: var(--card-2); color: var(--muted); font-size: 13.5px; }
.rk-stop > .ic { width: 16px; height: 16px; flex: none; color: var(--faint); }
.rk-stop .rank-ic { margin-right: 0; }
.rk-stop b { font-size: 15px; }
@media (max-width: 520px) {
    .rk-sel { flex: 1 1 100%; min-width: 0; }
}
/* compte en โหมดเพิ่มแรงค์ : points actuels / points d'arrêt */
.rank-goal { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 3px; border: 1px solid var(--line-2);
    border-radius: 9999px; color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rank-goal .rank-ic { margin-right: 0; }
.rank-goal .faint { font-weight: 400; }

/* หลังบ้าน → สมาชิก : boutons de la ligne sur deux lignes plutôt que coupés à droite (actions : menu « จัดการ ▾ ») */
@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 */

/* 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; }

/* ---- Tableau de bord : comptes actifs d'un Panel en tableau (en-tête + colonnes alignées) ----
   Large : une grille par ligne, mêmes colonnes que l'en-tête (.acc-head) ; étroit : chaque compte en petite carte.
   Les PV des parties ne sont plus sur la ligne : fenêtre du compte (accountRowInner). */
#d-grid .pcard-body { container: accs / inline-size; }
.acc-head { display: none; }
.arow-card, .acc-card-wrap { position: relative; }
.acc-card-wrap { flex: 1 1 280px; max-width: 460px; }
.card-rank { position: absolute; top: 4px; right: 4px; display: flex; pointer-events: auto; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .65)); }
.card-rank:empty { display: none; }
.card-rank .rank-ic { margin: 0; }
#d-grid .arow-card:has(> .arow-card-img:empty) { display: none; }
#d-grid .arow-line:has(> .arow-card > .arow-card-img:empty) .al-id .avatar { display: grid; }
#d-grid .arow-line:has(> .arow-card > .arow-card-img:not(:empty)) .al-id .avatar { display: none; }
/* étroit (téléphone) : petite carte — identité ; état + actions ; matchs · EXP ; niveau sur toute la largeur.
   Les actions (5 boutons) ne partagent plus la ligne des chiffres : leur colonne « auto » écrasait matchs et EXP,
   dont le texte débordait sur la barre de niveau. Sous-lignes (« เล่นอยู่ », « /นาที ») sous la valeur. */
#d-grid .arow-line .al { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px;
    grid-template-areas: "id id" "state act" "m e" "l l"; }
#d-grid .arow-line .al-id { grid-area: id; }
#d-grid .arow-line .al-state { grid-area: state; }
#d-grid .arow-line .al-matches { grid-area: m; }
#d-grid .arow-line .al-exp { grid-area: e; }
#d-grid .arow-line .al-lvl { grid-area: l; }
#d-grid .arow-line .al .icon-actions { grid-area: act; justify-content: flex-end; flex-wrap: nowrap; }
#d-grid .arow-line .al-live { display: flex; margin: 2px 0 0; }
#d-grid .arow-line .al-stat em { display: block; margin: 2px 0 0; }
/* très étroit : actions sur leur propre ligne */
@container accs (max-width: 340px) {
    #d-grid .arow-line .al { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "id id" "state state" "act act" "m e" "l l"; }
    #d-grid .arow-line .al .icon-actions { justify-content: flex-start; }
}
/* moyen (tablette) : matchs · EXP · niveau sur une ligne, assez larges pour leurs chiffres */
@container accs (min-width: 560px) {
    #d-grid .arow-line .al { grid-template-columns: minmax(90px, 1fr) minmax(110px, 1fr) minmax(0, 2fr) auto;
        grid-template-areas: "id id id act" "state state state state" "m e l l"; }
}
@container accs (min-width: 1000px) {
    #d-grid .acc-head, #d-grid .arow-line { display: grid; align-items: center; column-gap: 16px;
        grid-template-columns: 216px minmax(170px, 1.3fr) minmax(150px, 1fr) 96px 128px minmax(160px, 1fr) 186px; }
    #d-grid .no-cards .acc-head, #d-grid .no-cards .arow-line {
        grid-template-columns: minmax(200px, 1.5fr) minmax(150px, 1fr) 96px 128px minmax(160px, 1fr) 186px; }
    #d-grid .no-cards .ah-card, #d-grid .no-cards .arow-line > .arow-card { display: none; }
    #d-grid .acc-head { padding: 2px 12px 8px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--faint); }
    #d-grid .acc-head .ah-act { text-align: right; }
    #d-grid .pcard-body:has(> .acc-list:empty) > .acc-head { display: none; }
    #d-grid .arow-line { padding: 8px 12px; }
    #d-grid .arow-line > .arow-card { margin: 0; }
    #d-grid .arow-line > .arow-body, #d-grid .arow-line .al { display: contents; }
    /* même poids que les règles « étroit » (#d-grid .arow-line .al .icon-actions…) : sinon une zone nommée inconnue
       ici crée une colonne et une ligne implicites (actions renvoyées sous la ligne) */
    #d-grid .arow-line .al > *, #d-grid .arow-line .al .icon-actions, #d-grid .arow-line .al .al-id,
    #d-grid .arow-line .al .al-state, #d-grid .arow-line .al .al-matches, #d-grid .arow-line .al .al-exp,
    #d-grid .arow-line .al .al-lvl { grid-area: auto; min-width: 0; }
    #d-grid .arow-line .al-matches > small, #d-grid .arow-line .al-exp > small { display: none; }
    #d-grid .arow-line .al-live { display: flex; margin: 2px 0 0; }
    #d-grid .arow-line .al-stat em { display: block; margin: 2px 0 0; }
    #d-grid .arow-line .icon-actions { justify-content: flex-end; flex-wrap: nowrap; }
}

/* ============================================================
   ยศตัวแทน : bandeau (page แพ็กเกจ, profil), pastille du rang, ราคาตัวแทน, montant à payer
   ============================================================ */
.agent-card { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 16px 20px; }
.agent-card.on { border-color: var(--amber-line); }
.agent-card.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow-xs); }
.ag-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--amber-bg); color: var(--amber); }
.ag-ic .ic { width: 20px; height: 20px; }
.ag-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.ag-main b { color: var(--text); font-size: 15px; }
.ag-main small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.ag-main small b { font-size: inherit; }
.agent-card > .btn { flex: none; }
.ag-main small:empty { display: none; }
/* ตั้งค่าระบบ → ยศตัวแทน : aperçu de la carte (inerte) */
.ag-preview { display: grid; gap: 6px; }
.ag-preview .agent-card { margin: 0; pointer-events: none; }
@media (max-width: 640px) {
    .agent-card { flex-wrap: wrap; padding: 14px 16px; }
    .ag-main { flex-basis: calc(100% - 54px); }
    .agent-card > .btn { width: 100%; justify-content: center; }
}
.agent-pill { gap: 4px; margin-left: 6px; }
.agent-pill .ic { width: 13px; height: 13px; }
.pf-crown { width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; color: var(--amber); }
.pkg-agent { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--amber-ink); font-size: 13px; font-weight: 500; }
.pkg-agent .ic, .pkg-agent-adm .ic, .ag-row span .ic { width: 14px; height: 14px; color: var(--amber); }
.pkg-agent s, .buy-sum s { color: var(--faint); font-weight: 400; }
.pkg-agent-adm { display: flex !important; align-items: center; gap: 4px; margin-top: 2px; color: var(--amber-ink); }
.ag-row span { display: inline-flex; align-items: center; gap: 6px; }
.buy .buy-rows.ag-rows { grid-template-columns: minmax(0, 1fr); }
.amt-chips { margin-top: 2px; }
.ag-note { display: flex; margin: 0 0 12px; font-size: 13px; }
.bo-st { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ag-cell { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; text-decoration: none; }
.ag-cell .agent-pill { margin-left: 0; }
.ag-cell small { color: var(--muted); font-size: 12px; font-weight: 400; }

/* ============================================================
   หลังบ้าน sur téléphone (≤ 767 px) : tiroir de menu à groupes repliables (Sidebar Flowbite à sous-menus) et
   « Speed dial » horizontal à la place de la barre du bas de หน้าบ้าน ; tablette et ordinateur : barre latérale
   ============================================================ */
.drawer-btn { display: none; }
.bo-drawer-wrap { position: fixed; inset: var(--top-h, 60px) 0 0 0; z-index: 45; }
.bo-drawer-wrap[hidden] { display: none; }
.bo-drawer-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: fade-in .15s ease-out; }
.bo-drawer { position: absolute; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; gap: 8px; width: min(320px, 86vw);
    overflow-y: auto; overscroll-behavior: contain; padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
    background: var(--bg); border-right: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
html.drawer-open { overflow: hidden; }
.drw-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: var(--r);
    background: var(--gold-bg); color: var(--text); font: 600 15px/1.3 var(--sans); text-align: left; cursor: pointer; }
.drw-head > .ic:first-child { flex: none; width: 20px; height: 20px; color: var(--gold-ink); }
.drw-head .drw-chev { flex: none; margin-left: auto; width: 16px; height: 16px; color: var(--gold-ink); transition: transform .15s; }
.drw-head[aria-expanded="true"] .drw-chev { transform: rotate(180deg); }
.drw-head:focus-visible, .drw-item:focus-visible { outline: 2px solid var(--brand-medium); outline-offset: -2px; }
.drw-items { display: grid; gap: 2px; padding: 4px 0 2px 8px; }
.drw-items[hidden] { display: none; }
.drw-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r);
    background: transparent; color: var(--muted); font: 500 14.5px/1.3 var(--sans); text-align: left; cursor: pointer; }
.drw-item .ic { flex: none; width: 20px; height: 20px; color: var(--faint); }
.drw-item:hover { background: var(--hover); color: var(--text); }
.drw-item.active { background: var(--gold-bg); color: var(--gold-ink); font-weight: 600; }
.drw-item.active .ic { color: var(--gold-ink); }
.drw-item.danger, .drw-item.danger .ic { color: var(--red); }
.drw-count { display: inline-grid; place-items: center; margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 9999px;
    background: var(--red-fill); color: #ffffff; font-size: 12px; font-weight: 600; }
.drw-count:empty { display: none; }
.drw-foot { display: grid; gap: 2px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }

html.lite .bo-drawer, html.lite .bo-drawer-backdrop { animation: none; }
@media (prefers-reduced-motion: reduce) {
    .bo-drawer, .bo-drawer-backdrop { animation: none; }
    .drw-head .drw-chev, .dd-btn .ic { transition: none; }
}
@media (max-width: 767px) {
    .shell.admin-area .drawer-btn { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; margin-left: -6px; padding: 0;
        border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); cursor: pointer; }
    .shell.admin-area .drawer-btn:hover { background: var(--hover); }
    .shell.admin-area .drawer-btn:focus-visible { outline: 2px solid var(--brand-medium); outline-offset: 0; }
    .shell.admin-area .drawer-btn .ic { width: 24px; height: 24px; }
    .shell.admin-area .drawer-btn { position: relative; }
    .shell.admin-area .drawer-btn.dot::after { content: ""; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px;
        border-radius: 50%; background: var(--red-fill); border: 2px solid var(--bg); }
    .shell.admin-area .topbar > .logo-mark.sm { display: none !important; }    /* app-ff.css : !important sur téléphone */
}
@media (min-width: 768px) { .bo-drawer-wrap { display: none !important; } }

/* ============================================================
   Menu déroulant (« Dropdown » de Flowbite) : actions d'une ligne écrites en mots (หลังบ้าน → สมาชิก : « จัดการ ▾ »)
   ============================================================ */
.dd-menu { position: fixed; z-index: 120; min-width: 210px; max-width: calc(100vw - 16px); padding: 6px; border: 1px solid var(--line);
    border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-lg); }
.dd-menu[hidden] { display: none; }
.dd-head { margin: 0 0 4px; padding: 6px 10px 8px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 12.5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-item { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text);
    font: 500 14px/1.3 var(--sans); text-align: left; cursor: pointer; }
.dd-item:hover, .dd-item:focus-visible { background: var(--hover); outline: none; }
.dd-btn { gap: 4px; }
/* entrées à choix unique (filtre) : coche, libellé, nombre */
.dd-opt { display: flex; align-items: center; gap: 8px; }
.dd-opt .dd-check { flex: none; display: inline-grid; place-items: center; width: 16px; color: var(--gold-ink); }
.dd-opt .dd-check .ic { width: 16px; height: 16px; }
.dd-opt .n { display: inline-grid; place-items: center; margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 9999px;
    background: var(--card-3); color: var(--text); font-size: 12px; font-weight: 500; }
.dd-opt.sel { color: var(--gold-ink); font-weight: 600; }
.dd-btn .ic { width: 14px; height: 14px; transition: transform .15s; }
.dd-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }

/* หลังบ้าน → สมาชิก sur téléphone : une ligne compacte par membre (nom + « จัดการ » en haut, le reste en petit dessous)
   au lieu d'une carte « libellé : valeur » par champ */
@media (max-width: 640px) {
    table.rtable.bo-members tr { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
        padding: 10px 12px 10px 54px; }
    table.rtable.bo-members td { display: block; width: auto; padding: 0; text-align: left; }
    table.rtable.bo-members td::before { content: none; }
    table.rtable.bo-members td.cell-main { order: 0; flex: 1 1 0; min-width: 0; }
    table.rtable.bo-members td.cell-main .avatar { position: absolute; left: 12px; top: 10px; }
    table.rtable.bo-members td.cell-main .cell-acc { display: block; }
    table.rtable.bo-members td.cell-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    table.rtable.bo-members td.cell-main .sub { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    table.rtable.bo-members td.m-act { order: 1; flex: none; }
    /* saut de ligne : nom + « จัดการ » sur la 1re ligne, détails (état, forfait, chiffres) dessous */
    table.rtable.bo-members tr::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
    table.rtable.bo-members td.m-act .btn-row { flex-wrap: nowrap; gap: 6px; }
    table.rtable.bo-members td.m-tag, table.rtable.bo-members td.m-kv { order: 2; color: var(--muted); font-size: 12.5px; }
    table.rtable.bo-members td.m-none { display: none; }
    table.rtable.bo-members td.m-kv::before { content: attr(data-label) " "; display: inline; color: var(--faint); font-size: 12px; }
    table.rtable.bo-members td.m-tag .hint { display: inline; margin-left: 4px; font-size: 12px; }
    table.rtable.bo-members .bo-st { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
    table.rtable.bo-members .ag-cell { flex-direction: row; align-items: center; gap: 4px; }
}

/* คำเตือนก่อนเริ่ม : fenêtre à confirmer avant de démarrer un Panel (texte de l'administrateur, retours à la ligne gardés) */
.start-warn { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 4px; padding: 14px 16px; border-radius: var(--r);
    border: 1px solid var(--amber-line); background: var(--amber-bg); color: var(--amber-ink); }
.start-warn > .ic { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--amber); }
.start-warn p { margin: 0; color: inherit; font-size: 14.5px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
textarea[name="start_confirm_text"] { min-height: 120px; }
.start-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.start-preview .hint { margin: 0; }

/* ============================================================
   หลังบ้าน → ภาพรวม : 4 chiffres + graphique (jour / mois / année). Une série : couleur de marque validée
   (dataviz : #1447e6 sur la carte blanche, #2b7fff sur gray-900) ; grille en traits fins, bulle au survol
   ============================================================ */
:root { --viz-bar: #1447e6; --viz-bar-hover: #155dfc; }
:root[data-theme="dark"] { --viz-bar: #2b7fff; --viz-bar-hover: #51a2ff; }
.bo-stats { display: grid; gap: 16px; transition: opacity .15s; }
.bo-stats.stale { opacity: .55; }
.stat-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stat-nav { display: inline-flex; align-items: center; gap: 6px; }
.stat-nav .stat-period { min-width: 132px; color: var(--text); font-size: 15px; font-weight: 600; text-align: center; }
.stat-nav [data-stat-step="-1"] .ic { transform: rotate(90deg); }
.stat-nav [data-stat-step="1"] .ic { transform: rotate(-90deg); }
.stat-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-kpi { position: relative; gap: 4px; text-align: left; }
.stat-kpi small { display: flex; align-items: center; gap: 6px; }
.stat-kpi small .ic { width: 16px; height: 16px; color: var(--faint); }
.stat-kpi .stat-v { font-variant-numeric: normal; }
.stat-kpi.sel { background: var(--gold-bg); }
.stat-kpi.sel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold); }
.stat-kpi.sel small, .stat-kpi.sel small .ic { color: var(--gold-ink); }
.kpi-delta { font-size: 12.5px; font-weight: 500; }
.kpi-delta.up { color: var(--green-ink); }
.kpi-delta.down { color: var(--red); }
.kpi-delta.flat { color: var(--faint); }
.stat-card .card-head h3 { margin: 0; }
.seg.seg-2.stat-view { display: inline-grid; flex: none; width: auto; padding: 3px; }
.seg.seg-2.stat-view button { height: 30px; padding: 0 14px; font-size: 13px; }
.stat-chart { position: relative; min-height: 260px; }
.stat-chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.stat-chart svg:focus-visible { outline: 2px solid var(--brand-medium); outline-offset: 4px; border-radius: 4px; }
.stat-chart .sg { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.stat-chart .sb { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.stat-chart .sy, .stat-chart .sx { fill: var(--faint); font: 500 11px/1 var(--sans); font-variant-numeric: tabular-nums; }
.stat-chart .sx.now { fill: var(--text); font-weight: 700; }
.stat-chart .sbar { fill: var(--viz-bar); transition: fill .12s; }
.stat-chart .sbar.on { fill: var(--viz-bar-hover); }
.stat-chart .smax { fill: var(--muted); font: 600 11px/1 var(--sans); }
.stat-chart .sempty { fill: var(--faint); font: 500 13px/1 var(--sans); }
.stat-chart .shit { fill: transparent; cursor: crosshair; }
.stat-tip { position: absolute; z-index: 5; display: grid; gap: 2px; padding: 8px 10px; transform: translate(-50%, calc(-100% - 10px));
    border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); box-shadow: var(--shadow-lg);
    pointer-events: none; white-space: nowrap; }
.stat-tip[hidden] { display: none; }
.stat-tip.below { transform: translate(-50%, 10px); }
.stat-tip b { color: var(--text); font-size: 16px; font-weight: 700; }
.stat-tip span { color: var(--muted); font-size: 12.5px; }
.stat-tip small { color: var(--faint); font-size: 12px; }
.stat-table tfoot td { font-weight: 600; color: var(--text); border-top: 1px solid var(--line-2); }
@media (max-width: 760px) { .stat-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .bo-stats, .stat-chart .sbar { transition: none; } }

/* ============================================================
   หลังบ้าน → สมาชิก (22/10 : pages « ผู้ใช้ » et « สมาชิก » réunies) : filtres avec leur nombre, outils, liste,
   fiche du membre dans un « Drawer » de Flowbite à droite (plein écran sur téléphone)
   ============================================================ */
.mbr-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.mbr-head .seg { flex-wrap: wrap; }
.mbr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 14px; }
.mbr-tools .search { flex: 1 1 240px; max-width: 360px; }
.mbr-sort { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; color: var(--faint); font-size: 13px; font-weight: 400; white-space: nowrap; }
.mbr-sort select { width: auto; height: 40px; color: var(--text); }
.mbr-table tbody tr[data-member] { cursor: pointer; }
.mbr-name { all: unset; cursor: pointer; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.mbr-name:hover { color: var(--gold-ink); text-decoration: underline; text-underline-offset: 3px; }
.mbr-name:focus-visible { outline: 2px solid var(--brand-medium); outline-offset: 2px; border-radius: 4px; }
.mbr-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 13px; }
.dd-sep { height: 1px; margin: 4px 0; background: var(--line); }
.dd-item.danger { color: var(--red-ink); }
@media (max-width: 640px) {
    .mbr-head .seg { display: none; }
    .mbr-head .mbr-filter-dd { display: inline-flex; flex: none; }
    .mbr-tools .search { flex-basis: 100%; max-width: none; }
    .mbr-tools .spacer { display: none; }
    .mbr-sort { flex: 1 1 100%; }
    .mbr-sort select { flex: 1; }
    .mbr-tools > .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; }
    table.rtable.bo-members td.cell-main .mbr-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* fiche du membre : panneau collé à droite sur toute la hauteur, en-tête fixe, contenu qui défile */
.modal-backdrop.side { padding: 0; justify-content: flex-end; align-items: stretch; }
.modal.side { display: flex; flex-direction: column; width: min(460px, 100%); max-width: none; height: 100%; max-height: none; margin: 0;
    padding: 0; overflow: hidden; border-width: 0 0 0 1px; border-radius: 0; box-shadow: var(--shadow-lg); animation: side-in .2s cubic-bezier(.16, 1, .3, 1); }
@keyframes side-in { from { transform: translateX(32px); opacity: 0; } }
html.lite .modal.side { animation: none; }
.modal.side .modal-head { flex: none; margin: 0; padding: 16px 16px 16px 20px; }
.mem-head { gap: 12px; }
.mem-title { flex: 1; min-width: 0; display: grid; gap: 6px; }
.mem-title h2 { flex: none; }
.mem-title h2 small { color: var(--faint); font-size: 13px; font-weight: 500; }
.mem-title .bo-st { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.mem-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px calc(24px + env(safe-area-inset-bottom)); }
.mem-pending { margin-bottom: 16px; }
.mem-pending > span { flex: 1; }
.mem-note { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.mem-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 4px; border: 1px solid var(--line); border-radius: var(--r); }
.mem-stats > div { min-width: 0; padding: 10px 14px; }
.mem-stats > div + div { border-left: 1px solid var(--line); }
.mem-stats dt { color: var(--faint); font-size: 12.5px; }
.mem-stats dd { margin: 2px 0 0; color: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mem-sec { padding: 16px 0; border-top: 1px solid var(--line); }
.mem-stats + .mem-sec, .mem-note + .mem-sec { margin-top: 12px; }
.mem-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.mem-sec-head h3 { margin: 0; color: var(--text); font-size: 14.5px; font-weight: 600; }
.mem-sec-head .btn { flex: none; }
.mem-line { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.mem-line b { color: var(--text); font-weight: 600; }
.mem-plans { display: grid; }
.mem-pl { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mem-pl:first-child { padding-top: 0; border-top: 0; }
.mem-pl > div { min-width: 0; display: grid; gap: 2px; }
.mem-pl b { color: var(--text); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.mem-pl small { color: var(--faint); font-size: 12.5px; line-height: 1.45; }
.mem-pl .pill { flex: none; }
.mem-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0 0 14px; font-size: 13.5px; }
.mem-facts dt { color: var(--faint); }
.mem-facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.mem-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mem-danger { padding-bottom: 0; }
@media (max-width: 640px) {
    .modal.side, .modal.side.wide { width: 100%; border-width: 0; border-radius: 0; padding: 0; }
    .modal.side .modal-head { padding: 12px 12px 12px 16px; }
    .mem-body { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
    .mem-stats > div { padding: 10px; }
    .mem-sec-head { flex-wrap: wrap; }
}

/* ============================================================
   « ปิดอัพเดทระบบ » (22/10) : page de fermeture des membres (seule l'en-tête reste : nom du site, thème, profil),
   bandeau de l'équipe, avis sur l'écran de connexion
   ============================================================ */
.shell.maint { grid-template-columns: minmax(0, 1fr); }
.shell.maint .sidebar, .shell.maint .top-nav, .shell.maint .bottom-nav, .shell.maint .drawer-btn, .shell.maint .live,
.shell.maint #top-actions, .shell.maint .topbar > .logo-mark, .shell.maint .topbar h1,
.shell.maint .topbar .live.mobile-only { display: none !important; }
.shell.maint .top-brand { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.shell.maint .top-brand .logo-mark { display: grid !important; }
.shell.maint .top-brand b { overflow: hidden; color: var(--text); font-size: 16px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.shell.maint main { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.maint-view { display: grid; place-items: center; min-height: calc(100vh - var(--top-h, 64px) - 64px); padding: 24px 0; }
.maint-view[hidden] { display: none; }
.maint-card { width: 100%; max-width: 520px; padding: 36px 32px 28px; border: 1px solid var(--line); border-radius: var(--r-lg);
    background: var(--card); box-shadow: var(--shadow-sm); text-align: center; }
.maint-ic { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 9999px;
    background: var(--amber-bg); color: var(--amber-ink); }
.maint-ic .ic { width: 30px; height: 30px; }
.maint-title { margin: 0 0 10px; color: var(--text); font-size: 22px; font-weight: 700; line-height: 1.35; text-wrap: balance; }
.maint-text { margin: 0 auto; max-width: 42ch; color: var(--muted); font-size: 15px; line-height: 1.7; white-space: pre-line; }
.maint-note { display: flex; align-items: flex-start; justify-content: center; gap: 8px; margin: 18px 0 0; padding: 10px 14px;
    border: 1px solid var(--brand-subtle); border-radius: var(--r); background: var(--gold-bg); color: var(--brand-ink); font-size: 14px; text-align: left; }
.maint-note .ic { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.maint-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 24px; }
.maint-actions:empty { display: none; }
.maint-contact { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.maint-contact .ic { color: var(--gold-ink); }
.maint-foot { margin: 18px 0 0; color: var(--faint); font-size: 12.5px; }
.maint-preview { padding: 24px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--bg); }
.maint-preview .maint-card { margin: 0 auto; }

.maint-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; padding: 10px 14px;
    border: 1px solid var(--amber-line); border-radius: var(--r); background: var(--amber-bg); color: var(--amber-ink); font-size: 14px; }
.maint-bar[hidden], #main:has(#bo-freeze .maint-on) .maint-bar { display: none; }   /* ภาพรวม : la carte dit déjà tout */
.maint-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.maint-bar > .ic { flex: none; }
.maint-bar b { color: inherit; font-weight: 600; }
.maint-bar .btn { flex: none; }

.auth-maint { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--amber-line);
    border-radius: var(--r); background: var(--amber-bg); color: var(--amber-ink); }
.auth-maint[hidden] { display: none; }
.auth-maint > .ic { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.auth-maint div { display: grid; gap: 4px; min-width: 0; }
.auth-maint b { color: inherit; font-size: 15px; font-weight: 600; }
.auth-maint span { color: var(--text); font-size: 14px; line-height: 1.6; white-space: pre-line; }
.auth-maint small { color: var(--muted); font-size: 12.5px; }

.maint-freeze { align-items: flex-start; }
.maint-freeze input { flex: none; margin-top: 3px; }
.maint-freeze > span { display: grid; gap: 2px; }
.maint-freeze b { color: var(--text); font-weight: 600; }
.maint-freeze small { font-size: 13px; line-height: 1.5; }
@media (max-width: 640px) {
    .maint-view { min-height: 0; padding: 8px 0; place-items: start stretch; }
    .maint-card { padding: 28px 20px 22px; }
    .maint-title { font-size: 20px; }
    .maint-actions .btn { flex: 1 1 100%; }
    .maint-preview { padding: 12px; }
}

/* ---------- โค้ด (22/10) : หลังบ้าน → โค้ด, et « มีโค้ด? » de la page แพ็กเกจ ---------- */
.code-redeem { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 16px; padding: 16px 20px; }
.code-redeem-text { flex: 1 1 260px; display: grid; gap: 4px; min-width: 0; }
.code-redeem-text b { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; font-weight: 600; }
.code-redeem-text b .ic { color: var(--gold); }
.code-redeem-text small { color: var(--muted); font-size: 14px; line-height: 1.5; }
.code-redeem .input-btn { flex: 1 1 320px; max-width: 460px; }
.code-redeem input { min-width: 0; flex: 1 1 auto; text-transform: uppercase; letter-spacing: .06em; }
.code-redeem input::placeholder { text-transform: none; letter-spacing: 0; }
.code-redeem .btn { flex: none; }
/* filtres sur plusieurs lignes au téléphone : sans min-width 0, la grille de หลังบ้าน s'élargit à leur largeur totale */
.code-tools, #code-filter { min-width: 0; }
#code-filter { flex-wrap: wrap; }
.code-table th.sel, .code-table td.sel { width: 44px; }
.code-table tr.sel-row td { background: var(--brand-soft, var(--hover)); }
.code-cell { display: inline-flex; align-items: center; gap: 4px; }
.code-v { font-family: var(--mono); font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--text); white-space: nowrap; }
.code-note { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.code-pkg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.code-uses { font-variant-numeric: tabular-nums; }
.code-dur { display: flex; gap: 8px; }
.code-dur input { flex: 1 1 auto; min-width: 0; }
.code-dur select { flex: 0 0 auto; width: auto; }
.code-out { min-height: 0; margin: 0 0 4px; font-family: var(--mono); font-size: 14px; letter-spacing: .04em; }
@media (max-width: 760px) {
    .code-redeem { padding: 14px 16px; }
    .code-redeem .input-btn { max-width: none; }
    .code-table td.sel { justify-content: flex-start; }
}

/* เพิ่มแอคเค้า : บัญชีที่ผูก Google / Facebook / Apple / X / VK (ลิงก์ EAT, ffbot.eat) */
.eat-how { margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; line-height: 1.7; }
.eat-how code { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.eat-logins { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.eat-login { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; border: 1px solid var(--line-2);
    border-radius: var(--r-sm); background: var(--card-2); color: var(--text); font-size: 14px; font-weight: 600;
    text-decoration: none; transition: border-color .15s, background .15s; }
.eat-login:hover { border-color: var(--gold); background: var(--hover); }
.eat-login:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.eat-logo { display: grid; place-items: center; flex: none; width: 24px; height: 24px; }
.eat-logo svg { width: 22px; height: 22px; }
.eat-row { display: flex; gap: 8px; margin-top: 14px; }
.eat-row input { flex: 1 1 auto; min-width: 0; font-family: var(--mono); font-size: 13px; }
.eat-found { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.eat-found:empty { display: none; }
.eat-found .ic { flex: none; width: 16px; height: 16px; color: var(--green); }
@media (max-width: 520px) {
    .eat-row { flex-wrap: wrap; }
    .eat-row input { flex-basis: 100%; }
    .eat-row .btn { flex: 1 1 0; justify-content: center; }
}

/* รอบการเล่น (play_minutes / rest_minutes) : fin du tour d'un compte en jeu, comptes en pause sous ceux du Panel */
.round-note { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600;
    white-space: nowrap; cursor: help; font-variant-numeric: tabular-nums; }
.round-note .ic { width: 12px; height: 12px; }
.pc-rest:empty { display: none; }
.pc-rest-list .chip .faint { font-variant-numeric: tabular-nums; }
/* แพ็กเกจ : รอบการเล่น du forfait (จำนวนเกม, ปั้ม / พัก), hors de la liste comparée des points forts */
.pkg .pkg-cycle { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 0; color: var(--text); font-size: 13.5px; font-weight: 600; }
.pkg .pkg-cycle .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--gold-ink); }

/* แพ็กเกจ → โค้ดสำหรับตัวแทน : produits en vente, puis « โค้ดของฉัน » (10 premiers, « แสดงทั้งหมด » pour le reste) */
.cap-list:not(.open) tr.cap-hide { display: none; }
.ag-codes .mp-list + .ag-mine { margin-top: 18px; }
.ag-mine-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ag-code-table td small.hint { display: block; margin: 2px 0 0; }
.ag-code-state { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ag-mine .cap-btn { margin-top: 8px; }

/* bouton « i » (itip) à côté du nom d'un champ, et sa bulle (une seule, en position fixe, gardée dans l'écran) */
.itip { display: inline-grid; place-items: center; width: 17px; height: 17px; margin: 0 0 0 6px; padding: 0; vertical-align: 1px;
    border: 1px solid var(--line-2); border-radius: 50%; background: var(--card-2); color: var(--muted);
    font: 700 11px/1 var(--sans); font-style: italic; cursor: help; transition: color .15s, border-color .15s; }
.itip:hover, .itip:focus-visible { color: var(--text); border-color: var(--gold); outline: none; }
.itip-bubble { position: fixed; z-index: 130; max-width: min(300px, calc(100vw - 16px)); padding: 8px 11px;
    border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); box-shadow: var(--shadow-lg);
    color: var(--text); font-size: 13px; font-weight: 400; line-height: 1.55; pointer-events: none; }

/* bouton « หยุด » d'un Panel : หยุดเมื่อจบแมตช์ / หยุดทันที (stopChoice) */
.stop-opts { display: grid; gap: 8px; margin: 4px 0 10px; }
.stop-opt { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line);
    border-radius: var(--r-sm); background: var(--card-2); color: var(--text); font: inherit; text-align: left; cursor: pointer;
    transition: border-color .15s, background .15s; }
.stop-opt:hover, .stop-opt:focus-visible { border-color: var(--gold); outline: none; }
.stop-opt .ic { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--muted); }
.stop-opt b { display: block; font-size: 14px; font-weight: 700; }
.stop-opt small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.stop-opt.danger .ic, .stop-opt.danger b { color: var(--red); }
.stop-opt.danger:hover, .stop-opt.danger:focus-visible { border-color: var(--red); }

/* แดชบอร์ด : บอท glory, tableau de chaque équipe façon fin de manche du jeu (nous en bleu, l'autre camp en orange) */
/* équipe en partie : « gl-on », pas « live » (déjà pris par l'indicateur de connexion d'app.css, en inline-flex) */
.pc-glory:empty { display: none; }
/* app.css cache le corps d'une carte sans compte en jeu ni message : il reste visible quand il montre des équipes glory */
.pcard-body:has(.acc-list:empty):has(.pc-empty:empty):has(.pc-glory:not(:empty)) { display: flex; }
.gl-boards { display: grid; gap: 12px; }
/* écran de fin de partie du jeu : mode · état · heure, barre ทีมเรา / ฝ่ายตรงข้าม, joueurs sur leur bannière.
   Tableau hors écran : ni mis en page ni dessiné (content-visibility), ses images ne sont pas demandées */
.gl-board { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2);
    content-visibility: auto; contain-intrinsic-size: auto 470px; }
.gl-board.gl-on { border-color: rgb(34 197 94 / .45); }
.gl-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px 16px 6px; }
.gl-mode b { display: block; overflow: hidden; font-size: 14px; font-weight: 800; letter-spacing: .03em; text-overflow: ellipsis; white-space: nowrap; }
.gl-mode small, .gl-when small { display: block; color: var(--muted); font-size: 12px; }
.gl-state { color: var(--muted); font-size: 17px; font-weight: 800; white-space: nowrap; }
.gl-state.on, .gl-state.win { color: #22c55e; }
.gl-state.win, .gl-state.lose { font-size: 26px; letter-spacing: .02em; }
.gl-state.lose { color: #ef4444; }
.gl-when { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.gl-when b { font-weight: 600; }
.gl-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; }
.gl-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 7px 16px; color: #fff; }
.gl-bar.us { background: linear-gradient(90deg, #155dfc, #2b7fff); clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.gl-bar.them { background: linear-gradient(90deg, #ff8a3d, #e8590c); clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%); }
.gl-bar b { overflow: hidden; font-size: 13px; font-weight: 800; letter-spacing: .03em; text-overflow: ellipsis; white-space: nowrap; }
.gl-sc { font-size: 22px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.gl-vs { display: grid; place-items: center; padding: 2px 12px; text-align: center; }
.gl-vs b { color: var(--text); font: italic 800 20px/1 var(--sans); }
.gl-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 8px 10px 10px; }
.gl-col { display: grid; align-content: start; gap: 5px; min-width: 0; }
.gl-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 78px 52px; align-items: center; gap: 6px; min-height: 52px;
    padding: 5px 8px; border-radius: var(--r-xs); background: var(--card); }
.gl-row.head { min-height: 0; padding-block: 0 2px; background: none; color: var(--muted); font-size: 11px; font-weight: 600; }
.gl-row.mvp { box-shadow: inset 0 0 0 2px #f5b301; }
.gl-row.wait { opacity: .55; }
.gl-ava { display: block; width: 42px; height: 42px; border: 1px solid rgb(255 255 255 / .14); border-radius: 4px; object-fit: cover;
    background: #151b24; }
span.gl-ava { opacity: .4; }
.gl-pn { align-self: stretch; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 3px 10px;
    border-radius: 4px; background: #151b24 center / cover no-repeat; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .8); }
.gl-row.wait .gl-pn { background: none; color: var(--muted); text-shadow: none; }
.gl-pn b { display: block; overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.gl-pn small { display: block; overflow: hidden; color: rgb(255 255 255 / .78); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.gl-pn small i { color: #ffd34d; font-style: normal; font-weight: 800; letter-spacing: .04em; }
.gl-rank { white-space: nowrap; }
.gl-rank .rank-ic { margin: -2px 2px 0 0; }
.gl-n { text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gl-n.dmg { color: var(--amber); }
.gl-n.none { color: var(--muted); }
.gl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 0 12px 10px; color: var(--muted); font-size: 12px; }
.gl-more { margin-top: 8px; color: var(--muted); justify-content: center; }
/* d'après la largeur de la carte (pas de l'écran) : les deux camps l'un sous l'autre, puis colonnes resserrées */
.pc-glory { container: glory / inline-size; }
@container glory (max-width: 720px) {
    .gl-cols { grid-template-columns: 1fr; }
}
@container glory (max-width: 460px) {
    .gl-top { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px 6px; }
    .gl-state { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
    .gl-cols { padding: 8px 8px 10px; }
    .gl-row { grid-template-columns: 36px minmax(0, 1fr) 66px 44px; gap: 5px; min-height: 46px; padding: 4px 6px; }
    .gl-ava { width: 36px; height: 36px; }
    .gl-pn { padding: 3px 8px; }
    .gl-bar { padding: 7px 12px; }
    .gl-vs { padding: 2px 6px; }
    .gl-vs b { font-size: 18px; }
}

/* สต๊อกบัญชี : forfait บอท glory sans compte en réserve */
.pkg.out { opacity: .62; cursor: not-allowed; }
.pkg.out .pkg-pick { cursor: not-allowed; }
#sk-text { width: 100%; min-height: 110px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

/* หน้าแพ็กเกจ : un travail par onglet, un forfait par ligne, achat dans un panneau latéral */
#st-body > .agent-card { margin-bottom: 0; }
.st-page { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.st-tabs { margin: 0; }
.st-pane { display: grid; gap: 20px; min-width: 0; }
.st-pane > * { min-width: 0; margin-block: 0; }
.notice.urgent { border-color: var(--red-line); background: var(--red-bg); color: var(--red-ink); }
.notice.urgent [data-left] { color: inherit; font-weight: 700; }
.st-pending { position: sticky; top: calc(var(--top-h, 64px) + 8px); z-index: 5; align-items: center; flex-wrap: wrap; padding: 10px 14px; box-shadow: var(--shadow-lg); }
.st-pending > .ic { margin-top: 0; }
.st-pending > span { flex: 1 1 150px; min-width: 0; }
.my-plans .card-head .hint { margin: 0; }
.mp-plan { padding: 8px 12px; }
.mp-plan .mp-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.mp-plan .mp-time { display: block; color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.mp-plan .mp-time b { color: var(--text); }
/* forfait payé : état final sans animation pour html.lite (les animations y durent 0,01 ms) */
.paid-done { position: fixed; inset: 0; z-index: 2100; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px;
    background: var(--bg); color: var(--text); text-align: center; animation: paid-in .15s ease-out; }
.paid-done svg { width: 96px; height: 96px; margin-bottom: 12px; fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
    animation: paid-pop .4s cubic-bezier(.16, 1, .3, 1); }
.paid-done circle { stroke-dasharray: 151; transform: rotate(-90deg); transform-origin: 26px 26px; animation: paid-circle .45s ease-out; }
.paid-done path { stroke-dasharray: 40; animation: paid-tick .3s .4s ease-out backwards; }
.paid-done b { font-size: 22px; font-weight: 700; }
.paid-done span { color: var(--muted); font-size: 15px; }
@keyframes paid-in { from { opacity: 0; } }
@keyframes paid-pop { from { transform: scale(.8); } }
@keyframes paid-circle { from { stroke-dashoffset: 151; } }
@keyframes paid-tick { from { stroke-dashoffset: 40; } }
#st-side { position: relative; }
#st-side .st-side-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
#st-side .buy { position: static; flex: 1; min-height: 0; overflow-y: auto; border: 0; border-radius: 0; box-shadow: none;
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
#st-side .card-head { padding-right: 44px; }
@media (max-width: 640px) {
    .st-tabs { width: 100%; }
    .st-tabs button { flex: 1 1 auto; justify-content: center; padding: 0 8px; }
    .st-tabs button .ic { display: none; }
    .mp-plan { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 6px 12px; }
    .mp-plan .mp-main { display: contents; }
    .mp-plan .mp-main b { grid-column: 1; grid-row: 1; }
    .mp-plan .mp-main small { grid-column: 1; grid-row: 2; }
    .mp-plan [data-renew] { grid-column: 2; grid-row: 1; justify-self: end; }
    .mp-plan .mp-time { grid-column: 2; grid-row: 2; justify-self: end; text-align: right; white-space: normal; }
}
/* เพิ่มไลค์ : UID et joueur visé dans la carte d'achat, avancement des commandes */
.lk-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 12px; }
.lk-uid-row { display: flex; gap: 8px; min-width: 0; }
.lk-uid-row input { flex: 1 1 0; min-width: 0; width: 100%; }
.lk-uid-row .btn { flex: none; white-space: nowrap; }
.lk-found { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--green-line, var(--line)); border-radius: var(--r);
    background: var(--green-bg, transparent); }
.lk-found .ic { flex: none; margin: 0; color: var(--green-ink, var(--green)); }
.lk-found div { min-width: 0; }
.lk-found b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.lk-found small { display: block; color: var(--muted); font-size: 12.5px; }
.lk-who { min-height: 20px; font-size: 13px; overflow-wrap: anywhere; }
.lk-who .ic { width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; }
.lk-good { color: var(--green-ink, var(--green)); }
.lk-bad { color: var(--red-ink, var(--red)); }
.lk-warn { margin: 0 0 12px; padding: 12px; font-size: 13px; }
/* tableaux de stock : sélection à la souris, mot de passe sur la ligne */
tr[data-sel-row] { cursor: pointer; }
tr[data-sel-row].sel-row > td { background: var(--gold-bg); }
tr[data-sel-row] td.sel { touch-action: none; }
tr[data-sel-row] td.sel input { pointer-events: none; }
.drag-selecting, .drag-selecting * { user-select: none; -webkit-user-select: none; cursor: grabbing !important; }
.sk-drag-hint { margin: 0 0 8px; }
.sk-pass { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sk-pass code { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.sk-pass .btn { flex: none; }
.lk-mine { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--line);
    border-radius: var(--r); background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.lk-mine:hover { border-color: var(--line-2); background: var(--hover); }
.lk-mine:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lk-mine > .ic { flex: none; color: var(--gold-ink); }
.lk-mine b { flex: 1; min-width: 0; font-size: 14.5px; }
.lk-mine small { flex: none; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
    .pf-tabs { display: flex; flex-wrap: wrap; width: 100%; overflow: visible; }
    .pf-tabs button { flex: 1 1 auto; justify-content: center; padding: 0 8px; }
    .pf-tabs button .ic { display: none; }
}
.lk-list { display: grid; }
.lk-job { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
.lk-job:first-child { border-top: 0; }
.lk-job-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lk-job-head .pill { flex: none; }
.lk-bar { display: flex; align-items: center; gap: 10px; }
.lk-bar .meter { flex: 1; min-width: 60px; margin-top: 0; }
.lk-bar b { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; }
.lk-note { margin: 0; }
.lk-td { min-width: 180px; }
/* หลังบ้าน → เพิ่มวันใช้งาน (31/10) */
.gr-card { margin-bottom: 16px; min-width: 0; }
.gr-step { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.gr-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gr-cat { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 12px 14px; text-align: left; color: var(--text);
    background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.gr-cat:hover { background: var(--hover); }
.gr-cat .ic { grid-row: span 2; color: var(--muted); }
.gr-cat small { color: var(--muted); font-size: 13px; }
:root[data-theme] .gr-cat.active { background: var(--gold-bg); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
:root[data-theme] .gr-cat.active .ic { color: var(--gold-ink); }
#gr-pkgs { display: flex; width: auto; flex-wrap: wrap; overflow: visible; }
#gr-pkgs:empty { display: none; }
.gr-amount { display: flex; gap: 8px; max-width: 280px; }
.gr-amount input { flex: 1 1 0; min-width: 0; }
.gr-amount select { flex: 0 0 110px; }
.gr-go { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.gr-sum { display: flex; flex-direction: column; min-width: 0; }
.gr-sum small, .gr-sum span { color: var(--muted); font-size: 13px; }
.gr-group { margin-bottom: 20px; }
.gr-group:last-child { margin-bottom: 0; }
.gr-group h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.gr-group h4 .ic { color: var(--gold-ink); }
.gr-group h4 small, .gr-pkg summary small { color: var(--muted); font-size: 13px; font-weight: 400; }
.gr-pkg { margin-bottom: 8px; }
.gr-pkg summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 4px; cursor: pointer; list-style: none; }
.gr-pkg summary::-webkit-details-marker { display: none; }
.gr-pkg summary .ic { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; transform: rotate(-90deg); }
.gr-pkg[open] summary .ic { transform: none; }
.gr-new b { color: var(--gold-ink); font-weight: 600; }
@media (max-width: 760px) { .gr-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
    .gr-go .btn { width: 100%; }
    .gr-amount { max-width: none; }
    table.rtable.gr-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 0; }
    table.rtable.gr-table td { display: block; padding: 0; text-align: left; white-space: normal; }
    table.rtable.gr-table td::before { display: block; font-size: 12px; }
    table.rtable.gr-table td.cell-main, table.rtable.gr-table td[data-label=""] { grid-column: 1 / -1; }
    table.rtable.gr-table td.cell-main::before { content: none; }
}
/* บัญชีที่ซื้อแล้ว : une ligne par commande */
.bt-rounds { display: grid; gap: 12px; }
.bt-group { margin: 12px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.bt-round { border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); }
.bt-round.latest { border-color: var(--gold); }
.bt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; }
.bt-sum { flex: 1 1 200px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.bt-sum b { font-size: 16px; color: var(--text); }
.bt-sum small { flex-basis: 100%; color: var(--faint); font-variant-numeric: tabular-nums; }
.bt-list { padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.bt-bar { margin-bottom: 10px; }

/* ร้านค้า (03/11, หน้าซื้อบัญชีเดิม) : การ์ดสินค้า, การ์ดสั่งซื้อ, สินค้าที่ซื้อ, หลังบ้าน → ร้านค้า (web/app-shop.js shopCardHTML…) */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.shop-card { display: grid; grid-template-rows: auto 1fr; min-width: 0; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r); overflow: hidden; cursor: pointer; text-align: left; color: inherit; font: inherit; padding: 0;
    transition: border-color .15s, box-shadow .15s; }
.shop-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.shop-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.shop-card.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.shop-card.out { cursor: default; }
.shop-card.out .shop-img img { filter: grayscale(1); opacity: .55; }
.shop-img { position: relative; aspect-ratio: 4 / 3; max-width: 100%; background: var(--card-2); display: grid; place-items: center;
    border-bottom: 1px solid var(--line); overflow: hidden; }
.shop-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-img > .ic { width: 34px; height: 34px; color: var(--faint); }
.shop-img .shop-flag { position: absolute; top: 8px; left: 8px; }
.shop-body { display: grid; align-content: start; gap: 6px; padding: 12px 14px 14px; min-width: 0; }
.shop-name { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; text-wrap: balance; overflow-wrap: anywhere; }
.shop-desc { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.shop-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
.shop-amt { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.shop-per { color: var(--faint); font-size: 12px; }
.shop-agent { display: flex; align-items: center; gap: 5px; color: var(--amber); font-size: 12px; font-weight: 500; }
.shop-agent .ic { width: 13px; height: 13px; }
.shop-agent s { color: var(--faint); font-weight: 400; }
.shop-left { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.shop-left .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.shop-left.low .dot { background: var(--amber); }
.shop-left.none { color: var(--red); }
.shop-left.none .dot { background: var(--red); }
/* การ์ดสั่งซื้อ : รูป ชื่อ คำอธิบายเต็ม */
.shop-buy-head { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 14px; }
.shop-buy-head .shop-img { aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--r-sm); }
.shop-buy-head .shop-img > .ic { width: 26px; height: 26px; }
.shop-buy-head h3 { margin: 0 0 4px; font-size: 16px; overflow-wrap: anywhere; }
.shop-full-desc { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
/* หลังบ้าน : รูป + ชื่อในช่องแรก (กติกามือถือเดิมของ .pkg-row ให้ช่องแรกเต็มแถว) */
@media (min-width: 861px) { .shop-adm .pkg-row { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; } }
.shop-adm-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.shop-adm-name > div:last-child { min-width: 0; }
.shop-adm-name small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-thumb { flex: none; width: 56px; height: 42px; border-radius: 6px; border: 1px solid var(--line); background: var(--card-2); overflow: hidden;
    display: grid; place-items: center; }
.shop-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-thumb .ic { width: 18px; height: 18px; color: var(--faint); }
.shop-pic { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 6px; }
.shop-pic .shop-img { border: 1px dashed var(--line-2); border-radius: var(--r-sm); }
.shop-pic .btn-row { flex-wrap: wrap; }
.shop-pic label.btn { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }
.modal label.shop-all { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.shop-stock-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.shop-stock-kpis > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card-2); }
.shop-stock-kpis small { display: block; color: var(--faint); font-size: 12px; }
.shop-stock-kpis b { font-size: 18px; font-variant-numeric: tabular-nums; }
.shop-lines { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.shop-line { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; font-size: 13px; }
.shop-line + .shop-line { border-top: 1px solid var(--line); }
.shop-line code { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.shop-line small { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.shop-tabs { margin: 16px 0 12px; }
.shop-sel-bar { margin-bottom: 8px; }
.shop-add { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; min-height: 130px; font-family: var(--mono); }
code.shop-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.shop-adm .pkg-row .v + small { display: block; margin-top: 2px; color: var(--amber); }
/* ของที่ได้รับ */
.shop-got { max-height: 220px; overflow: auto; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--card-2); font: 12.5px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
/* มือถือ : 2 การ์ดต่อแถว เหมือนร้านค้าทั่วไป */
@media (max-width: 560px) {
    .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .shop-body { padding: 10px 10px 12px; gap: 5px; }
    .shop-name { font-size: 13.5px; }
    .shop-desc { font-size: 12px; }
    .shop-amt { font-size: 17px; }
    .shop-agent { font-size: 11.5px; }
    .shop-card .btn.block { height: 36px; font-size: 13px; }
}
@media (max-width: 480px) {
    .shop-pic { grid-template-columns: 1fr; }
}

/* ภาพรวม v2 (03/11) : tuiles de รายได้, courbe ช่วงนี้ / ช่วงก่อน, ยอดขายแยกตามสินค้า (web/app-shop.js renderStats) */
:root { --viz-prev: #99a1af; }
:root[data-theme="dark"] { --viz-prev: #6a7282; }
.rev-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.rev-kpi { gap: 4px; min-width: 0; }
.rev-kpi small .faint { font-weight: 400; }
.rev-kpi .stat-v { font-variant-numeric: normal; overflow-wrap: anywhere; }
.rev-kpi.lead .stat-v { font-size: 30px; }
.rev-kpi .rev-sub { color: var(--muted); font-size: 12.5px; }
.rev-kpi .kpi-delta .faint { color: var(--faint); font-weight: 400; }
.stat-bar { margin-bottom: 12px; }
.stat-card .card-head { flex-wrap: wrap; row-gap: 8px; }
.seg.stat-metric { flex: none; }
.seg.stat-metric button, .seg.si-groups button { height: 32px; padding: 0 12px; font-size: 13px; }
.stat-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.stat-legend .lk { display: inline-flex; align-items: center; gap: 8px; }
.stat-legend .lk i { width: 16px; height: 2px; border-radius: 2px; background: var(--viz-bar); }
.stat-legend .lk.prev i { background: var(--viz-prev); }
.stat-legend b { color: var(--text); font-weight: 600; }
.stat-chart .sline { fill: none; stroke: var(--viz-bar); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stat-chart .sline.prev { stroke: var(--viz-prev); }
.stat-chart .sline.open { stroke-dasharray: 4 4; }
.stat-chart .sarea { fill: var(--viz-bar); fill-opacity: .1; }
.stat-chart .sdot { fill: var(--viz-bar); stroke: var(--card); stroke-width: 2; }
.stat-chart .sdot.prev { fill: var(--viz-prev); }
.stat-chart .scross { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.stat-tip .tip-row { display: flex; align-items: center; gap: 8px; }
.stat-tip .tip-row i { width: 12px; height: 2px; border-radius: 2px; background: var(--viz-bar); flex: none; }
.stat-tip .tip-row.prev i { background: var(--viz-prev); }
.stat-tip .tip-row.prev b { color: var(--muted); font-size: 14px; }
/* ยอดขายแยกตามสินค้า */
.stat-items { margin-top: 16px; }
.stat-items .card-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.seg.si-groups { flex-wrap: wrap; width: auto; max-width: 100%; margin-bottom: 12px; overflow: visible; }
.seg.si-groups button .n { margin-left: 6px; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.si-head, .si-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(60px, 1.6fr) 96px 84px 64px 92px; gap: 14px; align-items: center; }
.si-meta { display: contents; }
.si-head { padding: 10px 16px; border-radius: var(--r-sm); background: var(--card-2); color: var(--muted); font-size: 12.5px; font-weight: 500; }
.si-head .num { text-align: right; }
.si-head span:nth-child(2) { grid-column: 2 / 4; }
.si-list { list-style: none; margin: 0; padding: 0; }
.si-row { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.si-row.foot { border-bottom: 0; font-weight: 600; }
.si-name { display: grid; gap: 2px; min-width: 0; }
.si-name b { font-weight: 600; overflow-wrap: anywhere; }
.si-name small { color: var(--faint); font-size: 12px; }
.si-n, .si-share, .si-pts, .si-amt { text-align: right; font-variant-numeric: tabular-nums; }
.si-amt { font-weight: 600; color: var(--text); }
.si-pts { color: var(--faint); }
.si-k { display: none; }
.si-bar { height: 8px; border-radius: 4px; background: var(--card-2); overflow: hidden; }
.si-row.foot .si-bar { background: transparent; }
.si-bar i { display: block; height: 100%; border-radius: 4px; background: var(--viz-bar); }
.si-pay { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.si-pay-i { display: inline-flex; align-items: baseline; gap: 6px; }
.si-pay-i small { color: var(--muted); font-size: 13px; }
.si-pay-i b { color: var(--text); font-variant-numeric: tabular-nums; }
.si-pay-i .faint { font-size: 12px; }
.si-note { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 0; }
.si-note .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; }
@media (max-width: 860px) {
    .rev-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* téléphone : nom et montant sur une ligne, barre dessous, chiffres en petit */
    .si-head { display: none; }
    .si-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name amt" "bar bar" "meta meta"; gap: 6px 12px; padding: 12px 2px; }
    .si-name { grid-area: name; }
    .si-amt { grid-area: amt; align-self: start; }
    .si-bar { grid-area: bar; }
    .si-row.foot .si-bar { display: none; }
    .si-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--muted); font-size: 12.5px; font-weight: 400; }
    .si-meta > span { text-align: left; color: inherit; }
    .si-k { display: inline; }
}
@media (max-width: 560px) {
    .rev-kpi .stat-v { font-size: 22px; }
    .rev-kpi.lead .stat-v { font-size: 28px; }
    .stat-card .card-head .spacer { display: none; }
}

/* เปลี่ยนชื่อในเกม (03/11) : case de la carte d'achat de la boutique, état par compte acheté (web/app-shop.js renameHTML, renameTag) */
.rn-box { margin: 4px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); }
.rn-box.rn-open { background: var(--card); }
.rn-toggle { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; cursor: pointer; }
.rn-toggle input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--gold); }
.rn-toggle span { display: grid; gap: 1px; min-width: 0; }
.rn-toggle small { color: var(--muted); font-size: 12px; }
.rn-body { margin-top: 12px; display: grid; gap: 10px; }
.rn-field { display: grid; gap: 5px; min-width: 0; }
.rn-field .flabel { font-size: 13px; }
.rn-field input, .rn-field select { height: 40px; width: 100%; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--line-2);
    border-radius: var(--r-sm); background: var(--card); color: var(--text); font-size: 14px; }
.rn-grid { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 10px; align-items: end; }
.rn-grid .rn-num input { text-align: center; }
.rn-body .rn-eg { font-family: ui-monospace, monospace; color: var(--gold-ink); }
@media (max-width: 480px) { .rn-grid { grid-template-columns: 1fr 1fr; } .rn-grid .rn-field:first-child { grid-column: 1 / -1; } }
.rn-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 11.5px; color: var(--muted); vertical-align: middle;
    white-space: normal; font-family: var(--sans); }
.rn-chip.rn-ok { color: var(--green-ink); background: var(--green-bg); }
.rn-chip.rn-bad { color: var(--red-ink); background: var(--red-bg); }
.rn-chip .ic { width: 13px; height: 13px; flex: none; }
.rn-got { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 0; }
.rn-got .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; }

/* ตั้งชื่อใหม่ หลังเปลี่ยนชื่อไม่สำเร็จ (04/11, web/app-shop.js shopRenameModal, shopRenameAlert) */
.notice.rn-alert { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 14px; color: var(--red-ink); background: var(--red-bg);
    border-color: var(--red-line); }
.notice.rn-alert > span { flex: 1 1 220px; min-width: 0; }
.rn-detail { display: block; margin-top: 4px; color: var(--faint); font-size: 12px; font-family: var(--sans); font-weight: 400; overflow-wrap: anywhere; }
.btn.rn-retry { margin-left: 6px; vertical-align: middle; height: 28px; }
.rn-has-bad { border-color: var(--red-line); }
.rn-bad-list { list-style: none; margin: 0 0 4px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); }
.rn-bad-list li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 8px 12px; font-size: 13px; }
.rn-bad-list li + li { border-top: 1px solid var(--line); }
.rn-bad-list span { color: var(--red-ink); }
.seg.rr-mode { margin-bottom: 12px; }
.rr-form .rn-body { margin-top: 0; }

/* หลังบ้าน → คำสั่งซื้อ : ประวัติรายคน (05/11) ; แพ็กเกจหมดอายุ เก็บไว้ 3 วัน (05/11) */
.tp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tp-tools .seg.tp-view { flex: none; }
.tp-tools .tp-search { flex: 1 1 220px; max-width: 360px; }
.chip.tp-who { height: auto; gap: 6px; padding: 2px 2px 2px 10px; }
.chip.tp-who .btn { height: 26px; width: 26px; }
.exp-list { max-height: 50vh; overflow: auto; margin-bottom: 4px; }
.mp-row small .exp-left { color: var(--red-ink); }
.seg.tp-status, .tp-tools .seg.tp-view { flex-wrap: wrap; width: auto; max-width: 100%; overflow: visible; }
.seg.tp-status { margin-bottom: 12px; }
.chip.tp-who { max-width: 100%; min-width: 0; }
.chip.tp-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-acts { flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }

/* พร้อมเพย์ : total sous le minimum (06/11, ffbot.billing PROMPTPAY_MIN_SATANG) */
.pay-pick .pp-min { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; }
.pay-pick .pp-min svg { flex: none; margin-top: 2px; }

/* « ดูวิดีโอสอนใช้งาน » (ปั้มแคลน, page เพิ่มแอค) : bouton rouge plein, texte blanc, mêmes couleurs dans les deux thèmes (15/11) */
:root[data-theme] .btn.video { background: var(--red-fill); border-color: var(--red-fill); color: #ffffff; box-shadow: none; }
:root[data-theme] .btn.video .ic { color: currentColor; }
:root[data-theme] .btn.video:hover { background: var(--red-fill); border-color: var(--red-fill); color: #ffffff; filter: brightness(.88); }
:root[data-theme] .btn.video:focus-visible { box-shadow: 0 0 0 4px var(--red-bg); }
