/* CasinoPro platform stylesheet — plain CSS, no build step. */

:root {
    --bg: #f3f5fb;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --text: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-soft: #eef2f7;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: #eef2ff;
    --accent: #7c3aed;
    --success: #047857;
    --success-bg: #ecfdf5;
    --success-line: #a7f3d0;
    --danger: #be123c;
    --danger-bg: #fff1f2;
    --danger-line: #fecdd3;
    --warning: #b45309;
    --warning-bg: #fffbeb;
    --warning-line: #fde68a;
    --info: #0369a1;
    --info-bg: #f0f9ff;
    --blue: #2563eb;
    --violet: #7c3aed;
    --emerald: #059669;
    --amber: #d97706;
    --rose: #e11d48;
    --cyan: #0891b2;
    --indigo: #4f46e5;
    --slate: #475569;
    --sidebar-bg: #0b1120;
    --sidebar-bg-2: #131c36;
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #64748b;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, .12);
    --gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #db2777 100%);
    --sidebar-width: 256px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.6px; margin: 2px 0 6px; font-weight: 800; }
h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.2px; margin: 0 0 12px; font-weight: 750; }
p { margin: 6px 0 14px; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.mono { font: 12px/1.6 var(--mono); overflow-wrap: anywhere; }
code { font: 12px var(--mono); background: var(--panel-soft); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 6px; }
pre { font: 12px/1.6 var(--mono); max-width: 640px; white-space: pre-wrap; word-break: break-word; background: #0b1120; color: #dbeafe; border-radius: 12px; padding: 14px 16px; }
summary { cursor: pointer; color: var(--primary); font-weight: 650; }
.icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.hide-sm { display: inline; }

/* App shell ------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width); flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; color: var(--sidebar-text);
    background: radial-gradient(120% 60% at 0% 0%, rgba(124, 58, 237, .28) 0%, transparent 60%), linear-gradient(180deg, var(--sidebar-bg-2) 0%, var(--sidebar-bg) 100%);
    scrollbar-width: thin; scrollbar-color: #334155 transparent;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px 12px; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -.3px; }
.brand:hover { color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { font-size: 10.5px; font-weight: 650; letter-spacing: 1.4px; text-transform: uppercase; color: #a5b4fc; margin-top: 3px; }
.brand-mark { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 11px; background: var(--gradient); color: #fff; font-weight: 900; font-size: 17px; box-shadow: 0 8px 22px rgba(124, 58, 237, .45); }
.nav { padding: 4px 12px 16px; flex: 1; }
.nav-group { margin: 14px 10px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--sidebar-muted); }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 7px 11px; margin: 1px 0; border-radius: 9px; color: var(--sidebar-text); font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s; }
.nav-link .icon { color: #8b9bb8; transition: color .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link:hover .icon { color: #c7d2fe; }
.nav-link.active { background: linear-gradient(90deg, rgba(99, 102, 241, .95), rgba(124, 58, 237, .85)); color: #fff; box-shadow: 0 6px 18px rgba(79, 70, 229, .35); }
.nav-link.active .icon { color: #fff; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin: 0 12px 14px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); }
.sidebar-user { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar-user strong { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: var(--sidebar-muted); font-size: 11.5px; }
.avatar { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--slate); }
.avatar.small { width: 26px; height: 26px; border-radius: 8px; font-size: 10.5px; }
.avatar.role-administrator { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.avatar.role-wholesaler { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.avatar.role-retailer { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.avatar.role-operator { background: linear-gradient(135deg, #d97706, #f59e0b); }
.avatar.role-player { background: linear-gradient(135deg, #059669, #10b981); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 28px; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-brand { display: none; align-items: center; gap: 8px; color: var(--text); font-weight: 800; }
.topbar-brand .brand-mark { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
.topbar-clock { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.identity { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.identity form { margin: 0; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--panel-soft); border: 1px solid var(--line); font-size: 13px; font-weight: 650; }
.icon-button { display: none; padding: 7px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--text); }
.icon-button:hover { background: var(--panel-soft); color: var(--text); transform: none; }
.nav-backdrop { display: none; }
.content { width: 100%; max-width: 1480px; padding: 26px 32px 64px; }
.shell { display: block; }

/* Guest (login) --------------------------------------------------------- */
body.is-guest { background: radial-gradient(80% 60% at 0% 0%, rgba(124, 58, 237, .18), transparent 60%), radial-gradient(70% 60% at 100% 100%, rgba(37, 99, 235, .16), transparent 60%), var(--bg); }
.guest-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.guest-main > .notice, .guest-main > .errors { width: 100%; max-width: 920px; }
.auth-card { width: 100%; max-width: 920px; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--panel); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.auth-hero { position: relative; padding: 40px; color: #fff; background: var(--gradient); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; width: 320px; height: 320px; right: -110px; bottom: -130px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.auth-hero h1 { color: #fff; font-size: 30px; }
.auth-hero p { color: rgba(255, 255, 255, .85); }
.auth-hero .brand { padding: 0; }
.auth-hero .brand-mark { background: rgba(255, 255, 255, .18); box-shadow: none; border: 1px solid rgba(255, 255, 255, .3); }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 10px; align-items: center; font-weight: 600; color: rgba(255, 255, 255, .92); }
.auth-form { padding: 40px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.auth-form form { display: grid; gap: 16px; margin-top: 10px; }
.login { max-width: 440px; margin: 40px auto; }

/* Page header ----------------------------------------------------------- */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs [aria-current] { color: var(--text-soft); }
.breadcrumbs .sep { color: #a3afc0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p.muted { margin: 0; max-width: 760px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.eyebrow { text-transform: uppercase; font-size: 11px; letter-spacing: 1.6px; font-weight: 800; color: var(--primary); margin: 0 0 4px; }
.section-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 12px; }

/* Cards ----------------------------------------------------------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 0 0 20px; box-shadow: var(--shadow); }
.card > h2:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 12px; margin: 0; border-bottom: 1px solid var(--line-soft); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 16px; }
.card-head a { font-size: 13px; font-weight: 650; }
.toolbar-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 0 20px; align-items: start; }
.two-col > .card, .two-col > div > .card { margin: 0 0 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.grid > .card { margin: 0; }
.two-col > *, .stats > *, .grid > *, .filters > *, .grid-form > * { min-width: 0; }
.danger-zone { border-color: var(--danger-line); background: linear-gradient(180deg, #fff 0%, #fff8f9 100%); }
.danger-zone h2 { color: var(--danger); }
.material-card-primary { background: linear-gradient(135deg, #fff 0%, var(--primary-soft) 100%); }
.material-card-accent { background: linear-gradient(135deg, #fff 0%, #fff7ed 100%); border-color: #fed7aa; }
.material-card-accent h2 { color: #9a3412; }

/* Stat tiles ------------------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 0 0 22px; }
.stat { --tone: var(--indigo); position: relative; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tone); opacity: .9; }
.stats > .stat:nth-child(6n+1) { --tone: var(--indigo); }
.stats > .stat:nth-child(6n+2) { --tone: var(--cyan); }
.stats > .stat:nth-child(6n+3) { --tone: var(--violet); }
.stats > .stat:nth-child(6n+4) { --tone: var(--emerald); }
.stats > .stat:nth-child(6n+5) { --tone: var(--amber); }
.stats > .stat:nth-child(6n+6) { --tone: var(--rose); }
.stat.tone-blue, .stats > .stat.tone-blue { --tone: var(--blue); }
.stat.tone-violet, .stats > .stat.tone-violet { --tone: var(--violet); }
.stat.tone-emerald, .stats > .stat.tone-emerald { --tone: var(--emerald); }
.stat.tone-amber, .stats > .stat.tone-amber { --tone: var(--amber); }
.stat.tone-rose, .stats > .stat.tone-rose { --tone: var(--rose); }
.stat.tone-cyan, .stats > .stat.tone-cyan { --tone: var(--cyan); }
.stat.tone-indigo, .stats > .stat.tone-indigo { --tone: var(--indigo); }
.stat.tone-slate, .stats > .stat.tone-slate { --tone: var(--slate); }
.stat-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, white); }
.stat-body { min-width: 0; width: 100%; }
.stat-label { margin: 0; font-size: 11.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stat-value { margin: 4px 0 0; font-size: clamp(18px, 1.55vw, 23px); font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.stat-hint { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.stat-hint a { font-weight: 650; }
.stat.good, .stats > .stat.good { --tone: var(--emerald); }
.stat.bad, .stats > .stat.bad { --tone: var(--rose); }
.stat.good .stat-value { color: var(--success); }
.stat.bad .stat-value { color: var(--danger); }
.stat.accent { --tone: var(--primary); }
.amount { font-size: 38px; letter-spacing: -1px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.card.balance { position: relative; overflow: hidden; color: #fff; border: 0; background: var(--gradient); box-shadow: 0 16px 40px rgba(79, 70, 229, .28); }
.card.balance::after { content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -90px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.card.balance .eyebrow, .card.balance p { color: rgba(255, 255, 255, .85); }
.card.balance .secondary, .card.balance button.secondary { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .45); color: #fff; }
.card.balance .secondary:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.card.balance .money.negative { color: #fff; }

/* Buttons ---------------------------------------------------------------- */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border-radius: var(--radius-sm); padding: 9px 16px; font: 650 13.5px/1.4 var(--font); cursor: pointer; text-align: center; transition: transform .12s, box-shadow .15s, background .15s; box-shadow: 0 4px 12px rgba(79, 70, 229, .22); white-space: nowrap; }
button:hover, .button:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(79, 70, 229, .3); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 3px solid #c7d2fe; outline-offset: 2px; }
button.secondary, .button.secondary, .secondary { background: #fff; color: var(--text-soft); border-color: var(--line); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
button.secondary:hover, .button.secondary:hover { background: var(--panel-soft); color: var(--text); border-color: #cbd5e1; box-shadow: 0 2px 6px rgba(15, 23, 42, .06); }
button.danger, .button.danger { background: linear-gradient(135deg, #e11d48, #be123c); box-shadow: 0 4px 12px rgba(225, 29, 72, .25); }
button.compact, .button.compact { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
button:disabled, .button[aria-disabled=true] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.button-link { background: none; border: 0; box-shadow: none; color: var(--primary); padding: 0; font-weight: 650; }
.button-link:hover { background: none; color: var(--primary-dark); box-shadow: none; transform: none; }

/* Forms ------------------------------------------------------------------ */
label { display: block; font-size: 13px; font-weight: 650; color: var(--text-soft); margin: 0; }
input, select, textarea { display: block; margin-top: 6px; width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm); background: #fff; color: var(--text); font: 14px/1.45 var(--font); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #a5b4c8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 4px rgba(99, 102, 241, .15); }
input:disabled, input[readonly] { background: var(--panel-soft); color: var(--muted); }
input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); box-shadow: none; }
textarea { min-height: 88px; resize: vertical; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 18px; align-items: start; }
.form-actions { display: flex; align-items: flex-end; gap: 10px; }
.form-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; margin-top: 22px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.field { display: block; }
.grid-form.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field.span-2 { grid-column: span 2; }
.req { color: var(--danger); margin-left: 2px; }
.help { font-size: 12px; color: var(--muted); font-weight: 500; display: block; margin-top: 5px; }
.field-error { font-size: 12px; color: var(--danger); font-weight: 650; display: block; margin-top: 5px; }
.has-error input, .has-error select, .has-error textarea { border-color: #fb7185; background: #fff9fa; }
.input-group { position: relative; margin-top: 6px; }
.input-group input { margin-top: 0; padding-right: 64px; }
.input-group .toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 4px 9px; font-size: 12px; border-radius: 7px; background: var(--panel-soft); color: var(--text-soft); border: 1px solid var(--line); box-shadow: none; }
.input-group .toggle:hover { transform: translateY(-50%); background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.checkbox { display: flex; gap: 9px; align-items: center; font-weight: 600; }
.checkbox input { width: 16px; margin: 0; }
.inline, .row { display: flex; align-items: center; gap: 10px; }
.row { justify-content: space-between; }
form.inline { margin: 0; }
.inline input { max-width: 260px; margin-top: 0; }
.search-form { align-items: end; }
.form-section { margin: 4px 0 18px; }
.form-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 0 0 12px; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--primary-soft); border: 1px solid #c7d2fe; color: #3730a3; font-size: 13.5px; }
.callout .icon { color: var(--primary); margin-top: 1px; }
.callout strong { color: #312e81; }

/* Filters ----------------------------------------------------------------- */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 14px; align-items: end; }
.filters label { font-size: 12px; color: var(--muted); }
.filters input, .filters select { padding: 8px 10px; font-size: 13.5px; margin-top: 5px; }
.filters .filter-actions { display: flex; gap: 10px; align-items: center; }
.filters .filter-actions a { font-size: 13px; font-weight: 650; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text-soft); font-weight: 650; font-size: 13px; }
.tabs a:hover { border-color: #c7d2fe; color: var(--primary); }
.tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .25); }
.tabs .count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: rgba(15, 23, 42, .06); }
.tabs a.active .count { background: rgba(255, 255, 255, .22); }

/* Tables ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: separate; border-spacing: 0; width: 100%; text-align: left; font-size: 13px; }
th { font-size: 11px; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); background: var(--panel-soft); font-weight: 750; border-bottom: 1px solid var(--line); }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
table.data th, table.data td { padding: 10px 14px; }
table.data th:first-child, table.data td:first-child { padding-left: 20px; }
table.data th:last-child, table.data td:last-child { padding-right: 20px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8f9ff; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); font-size: 11.5px; }
td.num, th.num { text-align: right; }
tr.empty-row td { text-align: center; color: var(--muted); padding: 34px 12px; white-space: normal; }
tr.empty-row:hover { background: none; }
tr.highlight { background: var(--success-bg); }
.strong-link { font-weight: 700; color: var(--text); }
.strong-link:hover { color: var(--primary); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.negative { color: var(--danger); }
.ts { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ts .tz { color: var(--muted, #64748b); font-size: .85em; margin-left: 1px; }
.truncate { display: inline-block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { width: 30px; height: 30px; font-size: 11px; border-radius: 9px; }

/* Badges ------------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; line-height: 1.6; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; font-weight: 750; letter-spacing: .5px; background: #f1f5f9; color: #475569; border: 1px solid transparent; white-space: nowrap; }
.badge.success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.badge.warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.badge.info { background: var(--info-bg); color: var(--info); border-color: #bae6fd; }
.badge.role { text-transform: capitalize; letter-spacing: .2px; font-size: 11.5px; }
.badge.role-administrator { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.badge.role-wholesaler { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge.role-retailer { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.badge.role-operator { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge.role-player { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.env-badge { text-transform: uppercase; }

/* Notices ------------------------------------------------------------------ */
.notice, .errors { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; font-size: 13.5px; }
.notice .icon, .errors .icon { margin-top: 1px; }
.notice { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.notice a { font-weight: 700; color: var(--success); text-decoration: underline; }
.notice.warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.errors { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.errors ul { margin: 4px 0 0; padding-left: 18px; }

/* Detail lists, hierarchy, numbers --------------------------------------- */
dl.kv { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 9px 16px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); font-weight: 650; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.tree-path { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; margin-bottom: 16px; }
.tree-path .sep { color: #a3afc0; }
.number-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.number-tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: linear-gradient(180deg, #fff, var(--panel-soft)); }
.number-tile.winner { border-color: #6ee7b7; background: linear-gradient(180deg, #f0fdf4, #dcfce7); box-shadow: 0 6px 18px rgba(5, 150, 105, .15); }
.number-tile .n { font-size: 22px; font-weight: 850; display: flex; align-items: center; gap: 8px; }
.number-tile p { margin: 2px 0; font-size: 12px; color: var(--muted); }
.role-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.mini-stat { border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px; background: linear-gradient(180deg, #fff, var(--panel-soft)); }
.mini-stat p { margin: 0; color: var(--muted); font-weight: 650; }
.mini-stat h2 { font-size: 28px; margin: 6px 0 0; }
details.panel > summary { font-weight: 700; }
.error-page { max-width: 560px; margin: 60px auto; text-align: center; }

/* Pagination -------------------------------------------------------------- */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0 0; }
.card.flush .pager { padding: 12px 20px 16px; border-top: 1px solid var(--line-soft); }
.pager-info { font-size: 12.5px; color: var(--muted); }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-link { display: inline-block; min-width: 32px; text-align: center; padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; font-weight: 700; background: #fff; color: var(--text-soft); }
a.pager-link:hover { border-color: #c7d2fe; color: var(--primary); }
.pager-link.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-link.disabled { color: #a3afc0; background: var(--panel-soft); }

/* Player-facing extras ------------------------------------------------------ */
.hero-card { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 0 0 22px; padding: 30px; border-radius: 20px; color: #fff; background: var(--gradient); box-shadow: 0 20px 50px rgba(79, 70, 229, .28); }
.hero-card::before { content: ""; position: absolute; inset: auto -80px -120px auto; width: 280px; height: 280px; border-radius: 999px; background: rgba(255, 255, 255, .14); }
.hero-card h1 { color: #fff; }
.hero-card p, .hero-card .eyebrow { color: rgba(255, 255, 255, .85); }
.hero-orb { position: relative; width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); font-size: 26px; font-weight: 900; }
.dashboard-grid { margin-bottom: 4px; }
.stat-card { position: relative; overflow: hidden; color: #fff; border: 0; }
.stat-card .eyebrow, .stat-card p { color: rgba(255, 255, 255, .85); }
.stat-card h2 { font-size: 38px; color: #fff; }
.stat-card.blue { background: linear-gradient(135deg, #0284c7, #2563eb); }
.stat-card.purple { background: linear-gradient(135deg, #7c3aed, #db2777); }
.stat-card.green { background: linear-gradient(135deg, #059669, #16a34a); }
.stat-card .button.secondary { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .16); color: #fff; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1100px) {
    .content { padding: 22px 22px 56px; }
    .topbar { padding: 10px 22px; }
}
@media (max-width: 900px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .45); }
    body.nav-open { overflow: hidden; }
    .icon-button { display: inline-flex; }
    .topbar-brand { display: inline-flex; }
    .topbar-clock { display: none; }
    .topbar { padding: 8px 16px; min-height: 56px; gap: 10px; }
    .user-chip .badge, .user-chip .user-name, .env-badge { display: none; }
    .user-chip { padding: 3px; }
    .hide-sm { display: none; }
    .content { padding: 18px 16px 48px; }
    h1 { font-size: 24px; }
    .card { padding: 18px; border-radius: 12px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stats > .stat:only-child, .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .stat { padding: 13px; gap: 10px; }
    .stat-icon { width: 30px; height: 30px; }
    .stat-value { font-size: 19px; }
    .two-col, .grid { grid-template-columns: 1fr; }
    .grid-form, .grid-form.cols-2 { grid-template-columns: 1fr; }
    .field.span-2 { grid-column: auto; }
    .number-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    dl.kv { grid-template-columns: 1fr; gap: 2px; }
    dl.kv dt { margin-top: 8px; }
    .amount { font-size: 32px; }
    .page-head { align-items: flex-start; }
    .auth-card { grid-template-columns: 1fr; }
    .auth-hero { padding: 28px; }
    .auth-hero .auth-points { display: none; }
    .auth-form { padding: 28px; }
    .row, .section-title, .toolbar-card { flex-wrap: wrap; }
    .hero-card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* Point control ------------------------------------------------------------ */
.point-controls { display: inline-flex; gap: 6px; align-items: center; }
.pc-btn { width: 30px; height: 30px; padding: 0; border-radius: 9px; border: 0; box-shadow: 0 3px 8px rgba(15, 23, 42, .12); }
.pc-btn .icon { stroke-width: 2.6; }
.pc-btn.pc-positive { background: linear-gradient(135deg, #10b981, #4f46e5); }
.pc-btn.pc-negative { background: linear-gradient(135deg, #f59e0b, #e11d48); }
.pc-btn.pc-positive:hover { box-shadow: 0 6px 14px rgba(16, 185, 129, .35); }
.pc-btn.pc-negative:hover { box-shadow: 0 6px 14px rgba(225, 29, 72, .3); }
.point-controls.labeled .pc-btn { width: auto; height: auto; padding: 8px 14px; gap: 6px; font-size: 13px; }
@media (max-width: 900px) { .pc-btn { width: 36px; height: 36px; } }
.point-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(15, 23, 42, .35); color: var(--text); overflow: hidden; }
.point-dialog[open] { display: flex; flex-direction: column; }
.point-dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.point-dialog form { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 24px); }
.pd-head { --accent: var(--emerald); display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, white), #fff 70%); border-top: 4px solid var(--accent); }
.tone-negative .pd-head { --accent: var(--rose); }
.pd-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex-shrink: 0; background: linear-gradient(135deg, #10b981, #4f46e5); }
.tone-negative .pd-icon { background: linear-gradient(135deg, #f59e0b, #e11d48); }
.pd-icon .icon { stroke-width: 2.6; }
.pd-heading { flex: 1; min-width: 0; }
.pd-heading h2 { margin: 0; font-size: 19px; }
.pd-heading .eyebrow { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-close { width: 34px; height: 34px; padding: 0; background: transparent; color: var(--muted); box-shadow: none; border-radius: 9px; }
.pd-close:hover { background: var(--panel-soft); color: var(--text); box-shadow: none; transform: none; }
.pd-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 14px; }
.pd-loading { margin: 0; color: var(--muted); }
.pd-alert { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }
.pd-alert.success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.pd-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.pd-facts > div { background: var(--panel-soft); border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.pd-facts dt { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.pd-facts dd { margin: 2px 0 0; font-weight: 750; font-size: 15px; overflow-wrap: anywhere; }
.pd-fields { display: grid; gap: 12px; }
.pd-fields textarea { min-height: 60px; }
.pd-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pd-preview > div { border-radius: 10px; padding: 10px 12px; background: color-mix(in srgb, var(--emerald) 8%, white); border: 1px solid color-mix(in srgb, var(--emerald) 25%, white); }
.tone-negative .pd-preview > div { background: color-mix(in srgb, var(--amber) 9%, white); border-color: color-mix(in srgb, var(--amber) 30%, white); }
.pd-preview span { display: block; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.pd-preview strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.pd-preview strong.negative { color: var(--danger); }
.pd-warning { margin: 0; font-size: 13px; font-weight: 650; color: var(--danger); }
.pd-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); background: var(--panel-soft); }
.tone-positive #pd-submit { background: linear-gradient(135deg, #10b981, #4f46e5); }
.tone-negative #pd-submit { background: linear-gradient(135deg, #f59e0b, #e11d48); box-shadow: 0 4px 12px rgba(225, 29, 72, .22); }
@media (max-width: 480px) {
    .pd-facts, .pd-preview { grid-template-columns: 1fr 1fr; }
    .pd-body { padding: 14px 16px; }
    .pd-head { padding: 14px 16px; }
    .pd-foot { padding: 12px 16px; }
    .pd-foot button { flex: 1; }
}
.movement { display: flex; flex-direction: column; gap: 2px; }
.movement small { color: var(--muted); font-size: 11.5px; }
.points-card .page-actions { margin-top: 14px; }
.points-card dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 10px; margin: 16px 0 0; position: relative; z-index: 1; }
.points-card dl > div { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.points-card dt { font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .5px; color: rgba(255, 255, 255, .75); }
.points-card dd { margin: 2px 0 0; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.points-card .pc-btn { background: rgba(255, 255, 255, .95); color: var(--primary-dark); }
.points-card .pc-btn.pc-negative { color: #be123c; }
@media (max-width: 480px) { .points-card dl { grid-template-columns: 1fr; } }

/* Result Engine --------------------------------------------------------------- */
.engine-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: 0 0 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); scrollbar-width: thin; }
.engine-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; font-weight: 650; font-size: 13.5px; color: var(--text-soft); white-space: nowrap; }
.engine-tabs a:hover { background: var(--panel-soft); color: var(--primary); }
.engine-tabs a.active { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .28); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.choice-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 14px 42px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; min-width: 0; }
.choice-card:hover { border-color: #a5b4fc; }
.choice-card input { position: absolute; left: 14px; top: 16px; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.choice-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(99, 102, 241, .14); }
.choice-card.compact { padding: 10px 10px 10px 38px; }
.choice-title { font-weight: 800; color: var(--text); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.choice-text { font-size: 12.5px; color: var(--muted); font-weight: 500; line-height: 1.45; }
.is-muted { opacity: .55; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; transition: background .15s; flex-shrink: 0; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: transform .15s; }
.switch input:checked + .switch-track { background: linear-gradient(135deg, #10b981, #4f46e5); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid #c7d2fe; outline-offset: 2px; }
.label-like { display: block; font-size: 13px; font-weight: 650; color: var(--text-soft); }
ol.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; color: var(--text-soft); }
.callout.warn { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }
.callout.warn .icon { color: var(--warning); }
.callout.danger { background: var(--danger-bg); border-color: var(--danger-line); color: #9f1239; }
.callout.danger .icon { color: var(--danger); }
.outcome-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.outcome-pick legend { font-size: 13px; font-weight: 650; color: var(--text-soft); margin-bottom: 8px; padding: 0; }
.outcome-pick label { position: relative; }
.outcome-pick input { position: absolute; opacity: 0; }
.outcome-pick span { display: grid; place-items: center; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 850; font-size: 17px; cursor: pointer; background: #fff; }
.outcome-pick input:checked + span { border-color: var(--rose); background: var(--danger-bg); color: var(--danger); box-shadow: 0 0 0 3px rgba(225, 29, 72, .14); }
.outcome-pick input:focus-visible + span { outline: 3px solid #fecdd3; }
.manual-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.manual-item:last-child { border-bottom: 0; }
h3.sub { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 18px 0 10px; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 36px 1fr minmax(96px, auto); gap: 10px; align-items: center; font-size: 12.5px; }
.bar-label { font-weight: 800; text-align: right; }
.bar { height: 10px; border-radius: 999px; background: var(--panel-soft); border: 1px solid var(--line-soft); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.bar-value { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 900px) {
    .choice-grid.two, .choice-grid.three { grid-template-columns: 1fr; }
    .choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .outcome-pick { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Result Engine — simplified modes ---------------------------------------------- */
.choice-grid.three-big { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-card.big { padding: 18px 18px 18px 46px; }
.choice-card.big .choice-title { font-size: 17px; }
.choice-card.big input { top: 21px; left: 18px; }
.mode-panel { margin-top: 18px; padding: 18px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel-soft); }
.panel-lead { margin: 0 0 14px; font-weight: 600; color: var(--text-soft); }
.percent-grid { display: grid; gap: 12px; max-width: 640px; }
.percent-row { display: grid; grid-template-columns: 210px 140px 1fr; gap: 6px 14px; align-items: center; }
.percent-row label { margin: 0; }
.percent-row .help, .percent-row .field-error { grid-column: 1 / -1; margin-top: 0; }
.suffix-input { position: relative; }
.suffix-input input { margin-top: 0; padding-right: 30px; text-align: right; font-weight: 750; font-size: 16px; }
.suffix-input span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.suffix-input input[readonly] { background: #eef2ff; color: var(--primary-dark); border-style: dashed; }
.percent-total { padding: 10px 14px; border-radius: 10px; font-weight: 750; font-size: 14px; }
.percent-total.ok { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-line); }
.percent-total.bad { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }
.preview-card { margin-top: 16px; padding: 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); max-width: 640px; }
.preview-rows { display: grid; gap: 6px; margin: 0; }
.preview-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.preview-rows > div:last-child { border-bottom: 0; }
.preview-rows dt { color: var(--muted); font-weight: 650; }
.preview-rows dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.advanced-settings { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: #fff; }
@media (max-width: 900px) {
    .choice-grid.three-big { grid-template-columns: 1fr; }
    .percent-row { grid-template-columns: 1fr 120px; }
    .percent-row label { grid-column: 1 / -1; }
}

/* Dashboard analytics (Chart.js canvases sized by their box) */
.small { font-size: 12.5px; }
.analytics { margin: 6px 0 4px; }
.analytics-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.analytics-head .eyebrow { margin-bottom: 2px; }
.analytics-head p { margin: 0; }
.analytics.loading .chart-card { opacity: .6; transition: opacity .15s; }
.chart-card { margin-bottom: 20px; }
.chart-card .card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chart-card .card-head p { margin: 4px 0 0; }
.chart-box { position: relative; height: 280px; min-width: 0; }
.chart-box.lg { height: 320px; }
.chart-box canvas { max-width: 100%; }
.chart-empty { display: grid; place-items: center; min-height: 160px; margin: 0; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--panel-soft); color: var(--muted); font-size: 13.5px; text-align: center; padding: 16px; }
.chart-empty[hidden] { display: none !important; }
.chart-totals { display: flex; gap: 18px; margin: 0; flex-wrap: wrap; }
.chart-totals div { min-width: 0; }
.chart-totals dt { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.chart-totals dd { margin: 2px 0 0; font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.segmented .segment { border: 0; background: transparent; color: var(--text-soft); font-weight: 650; font-size: 13px; padding: 6px 14px; border-radius: 999px; box-shadow: none; min-height: 0; }
.segmented .segment:hover { background: var(--primary-soft); color: var(--primary-dark); }
.segmented .segment[aria-pressed="true"] { background: var(--primary); color: #fff; }
.segmented.small .segment { font-size: 12px; padding: 4px 11px; }
.re-summary dl.kv { margin-bottom: 12px; }
@media (max-width: 640px) {
    .chart-box, .chart-box.lg { height: 240px; }
    .chart-totals { gap: 12px; }
    .chart-totals dd { font-size: 14px; }
}

/* Player dashboard: game launcher */
.game-launch { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, #0a1a44, #13307a 55%, #0e4a30); color: #f4f7ff; border: 0; }
.game-launch .eyebrow { color: #ffd977; }
.game-launch h2 { margin: 2px 0 4px; color: #fff; }
.game-launch .muted { color: #c5d0ea; margin: 0; }
.game-launch-body { display: flex; align-items: center; gap: 16px; min-width: 0; }
.game-launch-mark { flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; font-weight: 900; font-size: 22px; color: #3b2306; background: radial-gradient(circle at 35% 30%, #ffe9a8, #f5b82e 45%, #b9720d); box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.game-launch-actions { display: flex; align-items: center; gap: 14px; }
.game-launch-actions .button { min-width: 120px; justify-content: center; font-weight: 900; letter-spacing: .1em; background: linear-gradient(180deg, #ffe08a, #f5b82e 60%, #d38f10); color: #3b2306; border: 0; }
.game-launch .small-link { color: #c5d0ea; font-size: 13px; }

/* Gullak Pool */
.card-foot { padding: 12px 20px; }
.card-foot:empty { display: none; }
code.wrap { word-break: break-all; white-space: normal; }
.gullak-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 20px; margin-bottom: 20px; padding: 22px 24px; border-radius: var(--radius); color: #3b2306;
    background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .55), transparent 55%), linear-gradient(135deg, #fff4cf, #fde68a 45%, #fbbf24); border: 1px solid #f5c95a; box-shadow: 0 10px 30px rgba(180, 115, 9, .18); }
.gullak-hero.state-ready, .gullak-hero.state-armed { background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .55), transparent 55%), linear-gradient(135deg, #fff4cf, #fde68a 40%, #86efac); border-color: #6ee7b7; }
.gullak-hero.state-off { background: linear-gradient(135deg, #f8fafc, #e2e8f0); border-color: var(--line); color: var(--text-soft); box-shadow: none; }
.gullak-hero-main { display: flex; gap: 18px; align-items: flex-start; min-width: 0; }
.gullak-hero-text { min-width: 0; flex: 1; }
.gullak-hero .eyebrow { color: #92400e; margin: 0 0 4px; }
.gullak-hero.state-off .eyebrow { color: var(--muted); }
.gullak-icon { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; color: #fff; background: linear-gradient(160deg, #f59e0b, #b45309); box-shadow: 0 8px 18px rgba(180, 83, 9, .35), inset 0 1px 0 rgba(255, 255, 255, .4); }
.gullak-hero.state-ready .gullak-icon, .gullak-hero.state-armed .gullak-icon { background: linear-gradient(160deg, #22c55e, #047857); }
.gullak-hero.state-off .gullak-icon { background: linear-gradient(160deg, #94a3b8, #475569); box-shadow: none; }
.gullak-hero h2 { margin: 0 0 6px; }
.gullak-state { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; background: rgba(120, 53, 15, .12); color: #78350f; }
.state-ready .gullak-state, .state-armed .gullak-state { background: #047857; color: #fff; }
.state-distributing .gullak-state { background: #7c3aed; color: #fff; }
.state-off .gullak-state { background: #e2e8f0; color: #475569; }
.gullak-amount { margin: 0; font-size: clamp(26px, 3.4vw, 36px); font-weight: 850; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.gullak-amount .gullak-of { font-size: 15px; font-weight: 650; opacity: .75; margin-left: 4px; }
.gullak-progress { height: 14px; margin: 12px 0 6px; border-radius: 999px; background: rgba(120, 53, 15, .14); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
.gullak-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f59e0b, #d97706); transition: width .4s ease; }
.state-ready .gullak-progress span, .state-armed .gullak-progress span { background: linear-gradient(90deg, #22c55e, #047857); }
.gullak-progress-text { margin: 0; font-size: 13.5px; }
.gullak-next { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.gullak-next a, .gullak-hero-side a { color: #92400e; font-weight: 750; }
.gullak-hero-side { align-self: stretch; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .7); }
.gullak-hero-side p { margin: 0 0 6px; font-size: 13.5px; }
.gullak-side-big { font-size: 24px !important; font-weight: 850; font-variant-numeric: tabular-nums; }
.gullak-side-big small { font-size: 13px; font-weight: 650; opacity: .7; }
.gullak-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.gullak-chart-head .eyebrow { margin: 0; }
.gullak-policy { margin: 16px 0 0; padding: 0; border: 0; }
.gullak-policy legend { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.gullak-rules { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--text-soft); font-size: 13.5px; }
.gullak-settings .callout { margin-top: 14px; }
.gullak-settings .callout .checkbox { margin-top: 6px; }
.gullak-mini { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.gullak-mini-main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 320px; }
.gullak-mini .gullak-icon { width: 48px; height: 48px; border-radius: 14px; }
.gullak-mini-body { flex: 1; min-width: 0; }
.gullak-mini-body h2 { margin: 0 0 2px; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gullak-mini .gullak-progress { margin: 8px 0 4px; height: 10px; background: #f1f5f9; }
@media (max-width: 760px) {
    .gullak-hero { grid-template-columns: minmax(0, 1fr); padding: 18px; }
    .gullak-icon { width: 52px; height: 52px; border-radius: 16px; }
}

.gullak-recent > .card { margin-bottom: 20px; }
.suffix-input.wide input { padding-right: 76px; }

/* Player lobby */
.lobby-grid { display: grid; gap: 14px; margin-bottom: 20px; }
.lobby-card { margin: 0; }
.lobby-empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 36px 20px; }
.lobby-empty h2 { margin: 0; font-size: 18px; }
.lobby-empty p { margin: 0; max-width: 460px; }
.lobby-empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--primary-soft); color: var(--primary); }

/* Game Access */
.access-defaults .access-default-list { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.access-defaults .switch.is-off { opacity: .6; }
.access-bulk { padding: 12px 16px; }
.access-bulk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.access-bulk-row .field { margin: 0; min-width: 180px; }
.access-bulk-row select { margin-top: 0; }
.access-matrix .select-col { width: 36px; }
.access-matrix td, .access-matrix th { vertical-align: middle; }
.access-toggle-form { margin: 0; }
.access-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-soft); color: var(--text-soft); font-weight: 750; font-size: 12.5px; min-height: 0; box-shadow: none; }
.access-toggle:hover { background: var(--primary-soft); }
.access-track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #cbd5e1; transition: background .15s; }
.access-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.access-toggle[aria-checked="true"] { border-color: #a7f3d0; background: var(--success-bg); color: var(--success); }
.access-toggle[aria-checked="true"] .access-track { background: #10b981; }
.access-toggle[aria-checked="true"] .access-track::after { transform: translateX(14px); }
.access-toggle:disabled { opacity: .6; }
.access-state { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; background: #f1f5f9; color: var(--muted); }
.access-state.on { background: var(--success-bg); color: var(--success); }
.access-state.disabled { background: var(--danger-bg); color: var(--danger); }
.access-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.access-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.access-list li:last-child { border-bottom: 0; }
@media (max-width: 640px) {
    .access-matrix .player-name { display: none; }
    .access-matrix th, .access-matrix td { padding-left: 8px; padding-right: 8px; }
    .access-toggle { padding-right: 8px; font-size: 12px; gap: 6px; }
    .access-matrix .select-col { width: 28px; padding-right: 2px; }
}
