/* Pixel DNS design system — shared by the site, the customer panel and the
   admin panel. White and blue, minimal, RTL-first, no build step. */

@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/vazirmatn-var.woff2") format("woff2-variations"),
       url("/fonts/vazirmatn-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;

  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --border: #e5eaf2;
  --border-strong: #d4dbe6;
  --primary: var(--blue-600);
  --primary-hover: var(--blue-700);
  --primary-soft: var(--blue-50);
  --ok: #16a34a;
  --ok-soft: #ecfdf3;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 4px 24px rgba(30, 58, 138, .07);
  --shadow-lg: 0 20px 60px rgba(30, 58, 138, .14);
  --ring: 0 0 0 3px rgba(37, 99, 235, .25);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.35; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; color: var(--text-2); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; direction: ltr; unicode-bidi: embed; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.muted { color: var(--text-3); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Icons are inline SVG (Lucide geometry), sized by font. */
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 42px; padding: 0 1.1em;
  font: inherit; font-weight: 700; font-size: .92rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; cursor: pointer;
  transition: background .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--primary-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: var(--blue-100); color: var(--primary-hover); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { min-height: 34px; padding: 0 .8em; font-size: .85rem; }
.btn-lg { min-height: 52px; padding: 0 1.6em; font-size: 1rem; border-radius: var(--radius); }
.btn-icon { width: 36px; min-height: 36px; padding: 0; background: transparent; color: var(--text-3); border-color: transparent; }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }

/* Cards and surfaces */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

.stat { display: flex; gap: 14px; align-items: center; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.stat-label { color: var(--text-3); font-size: .85rem; }
.stat-value { font-size: 1.45rem; font-weight: 800; line-height: 1.2; }

/* Badges and chips */
.badge { display: inline-flex; align-items: center; gap: .35em; padding: .15em .65em; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.badge-blue { background: var(--primary-soft); color: var(--primary); border-color: var(--blue-200); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: .85rem; direction: ltr; }
.chip button { border: 0; background: none; color: var(--text-3); cursor: pointer; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; }
.chip button:hover { background: var(--danger-soft); color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Forms */
.field { display: block; }
.field + .field { margin-top: 14px; }
.label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 6px; }
.hint { font-size: .8rem; color: var(--text-3); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input.ltr, .textarea.ltr { direction: ltr; text-align: left; }
.input-group { display: flex; gap: 8px; }
.search { position: relative; }
.search .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search .input { padding-inline-start: 38px; }
.error { color: var(--danger); font-size: .85rem; margin-top: 6px; }

.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; cursor: pointer; transition: background .18s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform .18s var(--ease); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(-18px); }
[dir="ltr"] .switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; font-weight: 700; color: var(--text-3); font-size: .8rem; background: var(--surface-2); padding: 10px 14px; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
.table .actions { white-space: nowrap; text-align: end; }
.cell-strong { font-weight: 700; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; min-width: 90px; border: 1px solid var(--border); }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.progress.warn > i { background: #f59e0b; }
.progress.danger > i { background: var(--danger); }

@media (max-width: 720px) {
  .table-cards thead { display: none; }
  .table-cards tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .table-cards td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 14px; }
  .table-cards td::before { content: attr(data-label); color: var(--text-3); font-size: .8rem; }
  .table-cards .actions { justify-content: flex-end; }
  .table-cards .actions::before { display: none; }
}

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; }
.pagination button { min-width: 36px; height: 36px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; font: inherit; color: var(--text-2); }
.pagination button[aria-current="page"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button[disabled] { opacity: .4; cursor: default; }

.empty { text-align: center; padding: 40px 16px; color: var(--text-3); }
.empty .icon { width: 40px; height: 40px; color: var(--blue-200); margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f6f8fb 50%, #eef2f7 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; min-height: 18px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Modal and toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .38); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s var(--ease); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px; animation: pop .18s var(--ease); }
.modal-wide { width: min(760px, 100%); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .9rem; animation: pop .2s var(--ease); max-width: 360px; }
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }

/* App shell (admin + customer panel) */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-inline-end: 1px solid var(--border); padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.15rem; color: var(--text); padding: 6px 10px 18px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue-500), var(--blue-700)); box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-sep { height: 1px; background: var(--border); margin: 10px 6px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(246, 248, 252, .85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 1.2rem; margin: 0; }
.page { padding: 24px 28px 60px; max-width: 1280px; }
.menu-btn { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; z-index: 40; transform: translateX(110%); transition: transform .2s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .page { padding: 18px 16px 60px; }
  .topbar { padding: 12px 16px; }
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 14px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--primary); border-color: var(--primary); }

.flag { font-size: 1.1em; line-height: 1; }
.kbd { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; direction: ltr; }

/* ---- dashboard widgets ---- */
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
.kpi { position: relative; overflow: hidden; padding: 18px 18px 0; display: flex; flex-direction: column; gap: 6px; }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; }
.kpi-label { color: var(--text-3); font-size: .85rem; font-weight: 600; }
.kpi-value { font-size: 1.75rem; font-weight: 900; line-height: 1.15; letter-spacing: -.02em; }
.kpi-sub { font-size: .8rem; color: var(--text-3); min-height: 1.2em; }
.kpi .spark { display: block; width: calc(100% + 36px); margin: 4px -18px 0; height: 46px; }
.tone-blue .kpi-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 6px 14px rgba(37, 99, 235, .3); }
.tone-indigo .kpi-icon { background: linear-gradient(135deg, #818cf8, #4f46e5); box-shadow: 0 6px 14px rgba(79, 70, 229, .3); }
.tone-cyan .kpi-icon { background: linear-gradient(135deg, #22d3ee, #0891b2); box-shadow: 0 6px 14px rgba(8, 145, 178, .3); }
.tone-emerald .kpi-icon { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 6px 14px rgba(5, 150, 105, .3); }
.tone-blue { --tone: #2563eb; } .tone-indigo { --tone: #4f46e5; } .tone-cyan { --tone: #0891b2; } .tone-emerald { --tone: #059669; }
.spark path.line { fill: none; stroke: var(--tone); stroke-width: 2; }
.spark path.area { fill: var(--tone); opacity: .1; }

.card-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1rem; margin: 0; }
.card-title .icon { color: var(--primary); }
.chart-box { position: relative; height: 260px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 700; color: var(--text-3); padding: 4px 12px; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--text-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }

.gauges { display: flex; justify-content: space-around; gap: 12px; padding: 6px 0 14px; }
.gauge { --v: 0; --c: var(--primary); width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), #e8eef8 0); transition: background .6s var(--ease); }
.gauge::before { content: ""; position: absolute; inset: 11px; background: var(--surface); border-radius: 50%; }
.gauge span { position: relative; text-align: center; line-height: 1.2; }
.gauge b { display: block; font-size: 1.35rem; font-weight: 900; }
.gauge small { color: var(--text-3); font-size: .75rem; }

.kv { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px dashed var(--border); font-size: .88rem; }
.kv:first-child { border-top: 0; }
.kv span:first-child { color: var(--text-3); }
.kv b { font-weight: 800; }

.bar-row { display: grid; grid-template-columns: 54px 1fr 64px; align-items: center; gap: 10px; font-size: .85rem; margin: 8px 0; }
.bar-row .track { height: 8px; background: #eef3fb; border-radius: 999px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, #2563eb); }
.bar-row .track i.warm { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.bar-row .track i.hot { background: linear-gradient(90deg, #f87171, #dc2626); }
.bar-row .num { text-align: end; font-weight: 700; direction: ltr; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: .88rem; min-width: 0; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--primary); background: var(--primary-soft); flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.blue { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.dot.warn { background: #f59e0b; } .dot.danger { background: var(--danger); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ok); font-weight: 700; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); } 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
.page-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-hero h2 { margin: 0; font-size: 1.35rem; }
.page-hero p { margin: 2px 0 0; font-size: .9rem; }

/* sidebar polish */
.sidebar { background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%); }
.nav-item .icon { color: var(--text-3); }
.nav-item.active .icon { color: var(--primary); }
.nav-item.active { box-shadow: inset -3px 0 0 var(--primary); }
[dir="ltr"] .nav-item.active { box-shadow: inset 3px 0 0 var(--primary); }
.side-foot { font-size: .75rem; color: var(--text-3); padding: 8px 12px; }
.grid > * { min-width: 0; }
.card-head { flex-wrap: wrap; }
.num-unit { direction: ltr; unicode-bidi: isolate; display: inline-block; }
body { overflow-x: hidden; }
html, body { overflow-x: clip; }
@media (max-width: 960px) {
  .sidebar { visibility: hidden; transition: transform .2s var(--ease), visibility 0s .2s; }
  .sidebar.open { visibility: visible; transition: transform .2s var(--ease); }
}
.chip { max-width: 100%; }
.chips .chip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 1.8; }
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1250px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: minmax(0, 1fr); } }
.table-compact td, .table-compact th { padding: 8px 12px; white-space: nowrap; }

/* ---- admin: game page wizard, rich text editor, SEO preview ---- */
.wz-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.wz-steps button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; font: inherit; font-weight: 700; font-size: .88rem; color: var(--text-2); cursor: pointer; text-align: start; }
.wz-steps button b { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.wz-steps button.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.wz-steps button.on b { background: var(--primary); color: #fff; }
.wz-card { min-height: 320px; }
.wz-img { display: grid; place-items: center; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 10px; overflow: hidden; }
.rte { border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.rte-bar button { min-width: 34px; height: 32px; border: 0; background: none; border-radius: 7px; font: inherit; font-weight: 800; color: var(--text-2); cursor: pointer; }
.rte-bar button:hover { background: var(--surface); color: var(--primary); }
.rte-count { margin-inline-start: auto; padding-inline: 8px; }
.rte-body { min-height: 280px; max-height: 60vh; overflow: auto; padding: 16px 18px; outline: none; line-height: 2; }
.rte-body h2 { font-size: 1.35rem; margin: 1em 0 .4em; } .rte-body h3 { font-size: 1.12rem; margin: .9em 0 .3em; }
.rte-body a { color: var(--primary); text-decoration: underline; }
.rte-body blockquote { margin: 1em 0; padding: 10px 14px; background: var(--primary-soft); border-inline-start: 4px solid var(--primary); border-radius: 6px; }
.rte-body ul, .rte-body ol { padding-inline-start: 22px; }
.serp { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fff; font-family: arial, sans-serif; }
.serp-url { font-size: .8rem; color: #202124; }
.serp-title { color: #1a0dab; font-size: 1.15rem; margin: 4px 0; line-height: 1.4; }
.serp-desc { color: #4d5156; font-size: .88rem; line-height: 1.6; }
.seo-checks { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: .88rem; }
.seo-checks li.ok { color: var(--ok); } .seo-checks li.no { color: #b45309; }
@media (max-width: 900px) { .wz-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* media library */
.mlib { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.mlib-item { position: relative; aspect-ratio: 1; padding: 0; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; background:
  repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; cursor: pointer; }
.mlib-item img { width: 100%; height: 100%; object-fit: contain; }
.mlib-item:hover { border-color: var(--border-strong); }
.mlib-item.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.mlib-cap { position: absolute; inset-inline: 0; bottom: 0; padding: 4px 6px; background: rgba(15, 23, 42, .6); color: #fff; font-size: .72rem; text-align: start;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; }
.mlib-noalt { font-style: normal; background: #f59e0b; color: #111; border-radius: 4px; padding: 0 4px; margin-inline-end: 4px; font-weight: 800; }

/* article editor */
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.ed-side { display: grid; gap: 14px; position: sticky; top: 76px; max-height: calc(100vh - 90px); overflow: auto; padding-bottom: 6px; }
.ed-side .card { margin: 0; }
.ed-title { font-size: 1.45rem; font-weight: 900; padding: 12px 14px; }
.input-sm { padding: 6px 10px; font-size: .9rem; min-height: 0; }
.gchips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; }
.gchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; cursor: pointer; }
.gchip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.faq-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.faq-row textarea { grid-column: 1; }
.faq-row [data-rm] { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
.rte-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; }
.rte-src { width: 100%; min-height: 280px; border: 0; padding: 14px; font: 13px/1.6 ui-monospace, monospace; background: #0f172a; color: #e2e8f0; outline: none; resize: vertical; }
.rte-body h4 { font-size: 1rem; margin: .8em 0 .3em; }
.rte-body img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 6px; }
.rte-body figure { margin: 1em 0; } .rte-body figcaption { text-align: center; font-size: .85rem; color: var(--text-3, #64748b); }
.rte-body table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.rte-body th, .rte-body td { border: 1px solid var(--border-strong); padding: 6px 8px; }
.rte-body th { background: var(--surface-2); }
.rte-body code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; direction: ltr; unicode-bidi: embed; }
.rte-body hr { border: 0; border-top: 2px dashed var(--border-strong); margin: 1.4em 0; }
@media (max-width: 1100px) { .ed-grid { grid-template-columns: minmax(0, 1fr); } .ed-side { position: static; max-height: none; } }

/* the drawer's backdrop (narrow screens only) */
.scrim { position: fixed; inset: 0; z-index: 39; background: rgba(10, 21, 64, .38); opacity: 0; pointer-events: none; transition: opacity .2s; }
@media (max-width: 960px) { .scrim.on { opacity: 1; pointer-events: auto; } }

/* plan icon picker */
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span { display: grid; place-items: center; width: 52px; height: 52px; border: 2px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.icon-pick span svg { width: 30px; height: 30px; }
.icon-pick input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.icon-pick input:focus-visible + span { outline: 2px solid var(--primary); }
.plan-ico { display: inline-flex; width: 26px; margin-inline-end: 8px; vertical-align: middle; }
.plan-ico svg { width: 26px; height: auto; }

/* users: one line each, details on demand */
.ulist { display: grid; gap: 6px; }
.urow { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: border-color .15s; }
.urow.open { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.urow-head { width: 100%; display: grid; grid-template-columns: 64px minmax(0, 1.4fr) auto minmax(0, 1fr) 110px minmax(0, .8fr) 20px; align-items: center; gap: 12px;
  padding: 10px 14px; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.urow-head:hover { background: var(--surface-2); }
.uno { font-weight: 800; color: var(--text-3, #64748b); font-size: .85rem; }
.uname { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uexp, .usrv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uuse .progress { display: block; margin: 0; }
.uchev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; color: var(--text-3, #64748b); }
.urow.open .uchev { transform: rotate(180deg); }
.urow-body { padding: 4px 14px 14px; border-top: 1px dashed var(--border); }
.ugrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 20px; padding: 10px 0; font-size: .9rem; }
.ugrid .k { display: block; font-size: .75rem; font-weight: 800; color: var(--text-3, #64748b); margin-bottom: 2px; }
.uacts { flex-wrap: wrap; gap: 6px; }
.select-sm { padding: 4px 8px; min-height: 0; font-size: .85rem; width: auto; }
@media (max-width: 760px) {
  .urow-head { grid-template-columns: 52px minmax(0, 1fr) auto 18px; gap: 8px; }
  .urow-head .uexp, .urow-head .uuse, .urow-head .usrv { display: none; }
}
.srv-chart { position: relative; height: 150px; margin-top: 12px; }
.cc-badge { display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 4px; border-radius: 4px; background: var(--primary-soft, #eef4ff); color: var(--primary, #2451ff); font: 800 .7rem/1 ui-monospace, monospace; direction: ltr; vertical-align: middle; letter-spacing: .04em; }
.pairs { display: grid; gap: 8px; }
.pair-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }

/* editor previews of the content blocks */
.rte-body ul.check, .rte-body ul.cross { list-style: none; padding-inline-start: 4px; }
.rte-body ul.check li::before { content: "✓ "; color: #16a34a; font-weight: 900; }
.rte-body ul.cross li::before { content: "✕ "; color: #dc2626; font-weight: 900; }
.rte-body ol.steps { list-style: none; counter-reset: s; padding-inline-start: 4px; }
.rte-body ol.steps li { counter-increment: s; margin: 6px 0; }
.rte-body ol.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-inline-end: 8px; background: var(--primary); color: #fff; font-weight: 900; font-size: .8rem; border-radius: 4px; }
.rte-body div.note, .rte-body div.tip, .rte-body div.warn { margin: 10px 0; padding: 10px 12px; border-radius: 8px; border-inline-start: 4px solid; }
.rte-body div.note { background: var(--primary-soft); border-color: var(--primary); }
.rte-body div.tip { background: #ecfdf3; border-color: #16a34a; }
.rte-body div.warn { background: #fff7e6; border-color: #f59e0b; }

/* page layout picker in the game wizard */
.layout-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.layout-pick label { cursor: pointer; }
.layout-pick input { position: absolute; opacity: 0; pointer-events: none; }
.layout-pick span { display: grid; gap: 4px; padding: 12px 14px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); }
.layout-pick small { color: var(--text-3, #64748b); }
.layout-pick input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ===== admin shell: navy sidebar, grouped menu, brand blue ===== */
body.admin { --primary: #2451ff; --primary-hover: #1636c9; --primary-soft: #eef3ff; --text: #0a1540; --text-2: #3b4670; --text-3: #6a7598;
  --border: #e3e8f4; --border-strong: #cfd8ec; --bg: #f3f6fd; --ring: 0 0 0 3px rgba(36, 81, 255, .22); }
body.admin .sidebar { background: #0a1540; color: #c9d4f5; border: 0; padding: 14px 12px; gap: 0; }
body.admin .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; margin-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
body.admin .brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: #2451ff; box-shadow: 3px 3px 0 #000a2a; padding: 4px; }
body.admin .brand-mark svg { width: 100%; height: auto; }
body.admin .brand b { display: block; font-size: 1.05rem; font-weight: 900; line-height: 1.2; }
body.admin .brand small { display: block; font-size: .72rem; color: #8b98c7; }
body.admin .nav-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: #1f2b5c transparent; }
body.admin .nav-group { font-size: .7rem; font-weight: 800; color: #6f7cab; letter-spacing: .02em; padding: 14px 10px 4px; }
body.admin .nav-item { color: #c9d4f5; border-radius: 8px; padding: 8px 10px; font-weight: 700; font-size: .9rem; position: relative; }
body.admin .nav-item .icon { color: #8b98c7; }
body.admin .nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
body.admin .nav-item.active { background: #2451ff; color: #fff; box-shadow: 3px 3px 0 #000a2a; }
body.admin .nav-item.active .icon { color: #fff; }
.nav-count { margin-inline-start: auto; min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 10px; background: #ffd23f; color: #0a1540; font-size: .72rem; font-weight: 900; }
body.admin .nav-logout { border: 0; background: none; font: inherit; cursor: pointer; width: 100%; margin-top: 6px; border-top: 1px solid rgba(255, 255, 255, .08); border-radius: 0; padding-top: 12px; }
body.admin .topbar { background: rgba(255, 255, 255, .86); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); gap: 12px; }
.tb-title { display: flex; flex-direction: column; line-height: 1.25; }
.tb-title h1 { margin: 0; font-size: 1.15rem; }
.tb-group { font-size: .72rem; font-weight: 800; color: var(--text-3); min-height: 1em; }
.tb-search { display: inline-flex; align-items: center; gap: 8px; min-width: 260px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text-3); font: inherit; font-size: .85rem; cursor: pointer; }
.tb-search:hover { border-color: var(--primary); color: var(--text); }
.tb-search .icon { width: 16px; height: 16px; }
.tb-search kbd { margin-inline-start: auto; font: 700 .7rem/1 ui-monospace, monospace; padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 5px; background: #fff; direction: ltr; }
@media (max-width: 900px) { .tb-search { min-width: 0; } .tb-search-txt, .tb-search kbd, .tb-site { display: none; } }
body.admin .card { border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(10, 21, 64, .04); }
body.admin .btn:not(.btn-ghost):not(.btn-soft):not(.btn-icon):not(.btn-danger) { box-shadow: 0 2px 0 #1636c9; }
body.admin .page-hero h2 { font-size: 1.35rem; }
body.admin .kpi-icon { border-radius: 8px; box-shadow: 2px 2px 0 #0a1540 !important; }

/* command palette */
.palette-back { position: fixed; inset: 0; z-index: 60; background: rgba(10, 21, 64, .45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade .12s; }
.palette { width: min(620px, 100%); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--border); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 16px 18px; font: inherit; font-size: 1.05rem; outline: none; background: transparent; color: var(--text); }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.palette li .icon { color: var(--text-3); width: 18px; height: 18px; }
.palette li small { margin-inline-start: auto; color: var(--text-3); }
.palette li.on { background: var(--primary-soft); color: var(--primary); }
.palette li.on .icon { color: var(--primary); }
.palette .pal-sec { font-size: .72rem; font-weight: 800; color: var(--text-3); padding: 8px 12px 2px; cursor: default; }
.palette .pal-empty { color: var(--text-3); cursor: default; }

.prot-grp { padding: 10px 0; border-top: 1px dashed var(--border); }
.prot-grp:first-of-type { border-top: 0; padding-top: 0; }
.prot-off .chip { opacity: .7; }

/* ===== admin content pages ===== */
body.admin .page { padding: 22px 26px 48px; max-width: 1360px; }
body.admin .page-hero { padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
body.admin .page-hero h2 { font-size: 1.3rem; font-weight: 900; }
body.admin .page-hero p { color: var(--text-3); max-width: 760px; line-height: 1.8; }
/* KPI tiles: compact, a coloured edge, the number first */
body.admin .kpis { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; }
body.admin .kpis > .card:not(.kpi) { padding: 14px 16px; border-inline-start: 4px solid var(--primary); display: grid; gap: 2px; }
body.admin .kpis > .card:not(.kpi) .kpi-label { font-size: .78rem; font-weight: 800; color: var(--text-3); }
body.admin .kpis > .card:not(.kpi) .kpi-value { font-size: 1.45rem; }
body.admin .kpis > .card:nth-child(2):not(.kpi) { border-inline-start-color: #16a34a; }
body.admin .kpis > .card:nth-child(3):not(.kpi) { border-inline-start-color: #f59e0b; }
body.admin .kpis > .card:nth-child(4):not(.kpi) { border-inline-start-color: #0a1540; }
body.admin .kpi { padding: 16px 16px 0; }
body.admin .kpi-value { font-size: 1.55rem; }
/* cards */
body.admin .card { border-radius: 12px; padding: 18px; }
body.admin .card-head { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
body.admin .card-title { font-weight: 900; }
body.admin .kv { padding: 8px 0; border-bottom: 1px dashed var(--border); }
body.admin .kv:last-of-type { border-bottom: 0; }
/* segmented tabs */
body.admin .tabs { display: inline-flex; gap: 4px; padding: 4px; background: #e8edf8; border: 0; border-radius: 10px; margin-bottom: 16px; max-width: 100%; }
body.admin .tab { border: 0; border-radius: 8px; padding: 7px 14px; font-weight: 800; color: var(--text-2); }
body.admin .tab:hover { color: var(--text); }
body.admin .tab[aria-selected="true"] { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(10, 21, 64, .14); }
/* tables */
body.admin .table-wrap { border-radius: 12px; border-color: var(--border); }
body.admin .table thead th { background: #f4f7fd; color: var(--text-2); font-size: .78rem; font-weight: 800; padding: 10px 14px; border-bottom: 1px solid var(--border); }
body.admin .table td { padding: 11px 14px; border-bottom: 1px solid #eef1f8; vertical-align: middle; }
body.admin .table tbody tr:hover td { background: #fafbff; }
body.admin .table tbody tr:last-child td { border-bottom: 0; }
/* form controls */
body.admin .input, body.admin .select { min-height: 40px; border-radius: 9px; border-color: var(--border-strong); }
body.admin .input:focus, body.admin .select:focus { border-color: var(--primary); box-shadow: var(--ring); }
body.admin .field .label { font-weight: 800; font-size: .82rem; color: var(--text-2); }
body.admin .badge { border-radius: 6px; font-weight: 800; }
body.admin .empty { padding: 34px 20px; }
body.admin .empty .icon { width: 34px; height: 34px; color: var(--primary); }

/* settings: sections on the side, one section shown */
.set-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.set-nav { position: sticky; top: 80px; display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
.set-nav button { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 800; color: var(--text-2); cursor: pointer; text-align: start; }
.set-nav button .icon { width: 18px; height: 18px; color: var(--text-3); }
.set-nav button:hover { background: var(--surface-2); }
.set-nav button.on { background: var(--primary-soft); color: var(--primary); }
.set-nav button.on .icon { color: var(--primary); }
.set-body { display: grid; gap: 16px; }
.set-body > .card { margin: 0; }
@media (max-width: 900px) { .set-layout { grid-template-columns: minmax(0, 1fr); } .set-nav { position: static; display: flex; overflow-x: auto; } .set-nav button { white-space: nowrap; } }
body.admin [hidden] { display: none !important; }

/* ===== admin pages v2: shared header, toolbar, users list, games list ===== */
body.admin #page:focus, body.admin #page:focus-visible { outline: none; box-shadow: none; }
body.admin .tb-title { flex-direction: row; align-items: baseline; gap: 6px; }
body.admin .tb-title h1 { font-size: 1rem; font-weight: 800; }
body.admin .tb-group:not(:empty)::after { content: '›'; margin-inline-start: 6px; color: var(--border-strong); }
body.admin .tb-group { font-size: .85rem; font-weight: 700; }
.page-head { padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.page-head h2 { margin: 0; font-size: 1.3rem; font-weight: 900; }
.page-head p { margin: 4px 0 0; color: var(--text-3); font-size: .9rem; line-height: 1.8; max-width: 760px; }
/* a header inside a tab is a section title, smaller than the page's own */
body.admin #page .tabs ~ .page-hero, body.admin #page .tabs ~ * .page-hero, body.admin #page-head:not(.hidden) ~ #page .page-hero { border-bottom: 0; padding-bottom: 0; margin: 4px 0 14px; }
body.admin #page .tabs ~ .page-hero h2, body.admin #page .tabs ~ * .page-hero h2, body.admin #page-head:not(.hidden) ~ #page .page-hero h2 { font-size: 1.05rem; }
body.admin #page > .tabs:first-child { margin-bottom: 18px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 220px; }
.toolbar .tabs { margin: 0; }
.tab-n { display: inline-block; min-width: 20px; padding: 0 6px; margin-inline-start: 4px; border-radius: 10px; background: var(--surface-2); color: var(--text-3); font-size: .72rem; font-weight: 800; }
.tab[aria-selected="true"] .tab-n { background: var(--primary-soft); color: var(--primary); }

/* users */
.ukpis { margin-bottom: 16px; }
.ukpi { font: inherit; text-align: start; cursor: pointer; color: inherit; transition: border-color .15s, box-shadow .15s; }
.ukpi .kpi-label { display: flex; align-items: center; gap: 6px; }
.ukpi .kpi-label .icon { width: 15px; height: 15px; }
.ukpi:hover { border-color: var(--border-strong); }
body.admin .kpis > .ukpi.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ulist-head, .urow-head { grid-template-columns: 70px minmax(0, 1.5fr) 96px minmax(0, 1fr) 150px minmax(0, .7fr) 20px; }
.ulist-head { display: grid; gap: 12px; padding: 0 14px 6px; font-size: .75rem; font-weight: 800; color: var(--text-3); }
.urow-head { padding: 10px 14px; }
.uname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.uname .avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 900; }
.uname-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.uname-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uname-t small { font-weight: 500; color: var(--text-3); font-size: .74rem; }
.uexp { color: var(--text-2); }
.uuse { display: flex; flex-direction: column; gap: 4px; }
.uuse small { color: var(--text-3); font-size: .72rem; white-space: nowrap; }
@media (max-width: 760px) {
  .ulist-head { display: none; }
  .urow-head { grid-template-columns: 52px minmax(0, 1fr) auto 18px; }
}

/* games and services */
.glist { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.gitem { display: grid; grid-template-columns: 60px minmax(0, 1fr); grid-template-rows: auto auto; gap: 8px 12px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.gitem:hover { border-color: var(--border-strong); box-shadow: 0 4px 14px rgba(10, 21, 64, .06); }
.gitem.off { opacity: .6; }
.gthumb { grid-row: span 2; width: 60px; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface-2); }
.gthumb > div { font-size: .5rem !important; padding: 4px !important; line-height: 1.2; }
.gmeta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gmeta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.gbadges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gbadges .badge { font-size: .7rem; padding: 1px 7px; }
.gacts { display: flex; gap: 4px; align-items: center; }
.gacts .btn-soft { flex: 1; }
body.admin .kpis > .card:not(.kpi) { border-inline-start-width: 3px; }
body.admin .kpis > .card:nth-child(4):not(.kpi) { border-inline-start-color: #94a3b8; }
body.admin .ukpis > .card:nth-child(4) { border-inline-start-color: #e11d48; }
@media (max-width: 600px) {
  body.admin .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body.admin .kpis > .card:not(.kpi) { padding: 10px 12px; }
  body.admin .kpis > .card:not(.kpi) .kpi-value { font-size: 1.2rem; }
  body.admin .page-hero > .row { width: 100%; }
  body.admin .page-hero > .row > .btn { flex: 1; }
  .toolbar .tabs { max-width: 100%; overflow-x: auto; }
}
@media (max-width: 600px) { body.admin .tb-group { display: none; } body.admin .tb-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

/* admin: support tickets */
body.admin .tk-tr { cursor: pointer; }
body.admin .tk-tr.tk-unread .cell-strong { font-weight: 900; }
body.admin .tk-last { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.admin .tk-dot { display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; background: var(--primary); vertical-align: middle; }
body.admin .tk-late { color: var(--danger); }
body.admin .tk-ctl .input { width: auto; min-width: 120px; }
body.admin .tk-thread { display: grid; gap: 12px; margin: 16px 0; }
body.admin .tk-msg { max-width: min(680px, 92%); padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
body.admin .tk-msg.user { justify-self: start; background: var(--surface-2); }
body.admin .tk-msg.staff { justify-self: end; background: var(--primary-soft); border-color: var(--blue-200); }
body.admin .tk-msg.internal { background: var(--warn-soft); border-style: dashed; border-color: var(--warn); }
body.admin .tk-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; margin-bottom: 6px; }
body.admin .tk-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
body.admin .tk-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
body.admin .tk-files img { width: 130px; height: 96px; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: block; }
body.admin .tk-sys { justify-self: center; font-size: .78rem; color: var(--text-3); padding: 3px 12px; border: 1px dashed var(--border); border-radius: 99px; }
body.admin .cn-item { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
body.admin .cn-item .btn { justify-self: start; }
body.admin .nav-count.hot { background: var(--danger); color: #fff; }
@media (max-width: 760px) { body.admin .tk-msg { max-width: 100%; } body.admin .tk-last { max-width: 220px; } }
/* ===== admin pixel layer: the site's 8-bit identity (square corners, hard
   offset shadows, 8-bit buttons, pixel tags). Everything below is scoped to
   body.admin and only restyles; layout stays as above. ===== */
body.admin {
  --ink: #0a1540; --blue: #2451ff; --blue-d: #1636c9; --blue-dd: #0f2596; --sky: #7cb2ff; --ice: #eef4ff; --ice-2: #dfe9ff; --gold: #ffd23f;
  --radius-sm: 0; --radius: 0; --radius-lg: 0;
  --border: #e2e8f5; --border-strong: #cfd8ec; --bg: #f5f7fc;
  --shadow-sm: none; --shadow: 5px 5px 0 var(--ice-2); --shadow-lg: 8px 8px 0 var(--ink);
  --ring: 0 0 0 3px rgba(36, 81, 255, .28);
}
body.admin .px-text { display: block; height: 100%; width: auto; }
body.admin .px-sprite { display: block; width: 100%; height: auto; }
body.admin .px-tag { display: inline-flex; height: 18px; padding: 5px 7px; background: var(--blue); color: #fff; direction: ltr; box-shadow: 0 -3px 0 var(--blue), 0 3px 0 var(--blue); margin-block: 3px; flex: none; }
body.admin .px-tag:empty { display: none; }
body.admin .px-tag.gold { background: var(--gold); color: var(--ink); box-shadow: 0 -3px 0 var(--gold), 0 3px 0 var(--gold); }

/* sidebar */
body.admin .brand small .px-tag { height: 14px; padding: 3px 5px; margin-top: 4px; }
body.admin .nav-item { border-radius: 0; }
body.admin .nav-item.active { box-shadow: 4px 0 0 var(--sky) inset, 3px 3px 0 #000a2a; }
body.admin .nav-group { display: flex; align-items: center; gap: 6px; }
body.admin .nav-group::before { content: ""; width: 6px; height: 6px; background: var(--blue); box-shadow: 2px 2px 0 #000a2a; }
body.admin .nav-count { border-radius: 0; box-shadow: 2px 2px 0 #000a2a; }
body.admin .nav-count.hot { background: var(--danger); color: #fff; }
body.admin .nav-logout { border-radius: 0; }

/* topbar */
body.admin .topbar { background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 2px solid var(--border); }
body.admin .tb-title { align-items: center; }
body.admin .tb-title .px-tag { margin-inline-end: 4px; }
body.admin .tb-search { border-radius: 0; border: 1.5px solid var(--border-strong); background: #fff; box-shadow: 3px 3px 0 var(--ice-2); }
body.admin .tb-search:hover { border-color: var(--blue); }
body.admin .tb-search kbd { border-radius: 0; }
body.admin #health { box-shadow: 2px 2px 0 #bbf7d0; }

/* page heads: a pixel bullet and a dotted rule */
body.admin .page-head, body.admin .page-hero { border-bottom: 2px dashed var(--border-strong); }
body.admin .page-head h2, body.admin .page-hero h2 { display: flex; align-items: center; gap: 10px; }
body.admin .page-head h2::before, body.admin #page > .page-hero h2::before { content: ""; width: 10px; height: 10px; flex: none; background: var(--blue); box-shadow: 3px 3px 0 var(--ink); }

/* surfaces */
body.admin .card { border-radius: 0; border: 1.5px solid var(--border); box-shadow: 5px 5px 0 var(--ice-2); }
body.admin .card-head { border-bottom: 2px dotted var(--border-strong); }
body.admin .card-title .icon { color: var(--blue); }
body.admin .kv { border-bottom: 2px dotted var(--border); }
body.admin .kpis > .card:not(.kpi) { border-inline-start-width: 5px; }
body.admin .kpi-icon { border-radius: 0; box-shadow: 3px 3px 0 var(--ink) !important; }
body.admin .kpis > .ukpi.on { border-color: var(--blue); box-shadow: 5px 5px 0 var(--blue); }
body.admin .skeleton { border-radius: 0; background: linear-gradient(90deg, var(--ice) 25%, #f6f8fd 50%, var(--ice) 75%); background-size: 200% 100%; }
body.admin .empty .icon { color: var(--blue); }

/* buttons: the site's 8-bit button */
body.admin .btn { border-radius: 0; font-weight: 800; }
body.admin .btn:not(.btn-ghost):not(.btn-soft):not(.btn-icon):not(.btn-danger) { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-dd); margin-bottom: 4px; }
body.admin .btn:not(.btn-ghost):not(.btn-soft):not(.btn-icon):not(.btn-danger):hover { background: var(--blue-d); }
body.admin .btn:not(.btn-ghost):not(.btn-soft):not(.btn-icon):active { transform: translateY(4px); box-shadow: none; }
body.admin .btn-danger { box-shadow: 0 4px 0 #991b1b; margin-bottom: 4px; }
body.admin .btn-ghost { border: 1.5px solid var(--border-strong); background: #fff; box-shadow: 0 3px 0 var(--ice-2); margin-bottom: 3px; }
body.admin .btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
body.admin .btn-ghost:active { transform: translateY(3px); box-shadow: none; }
body.admin .btn-soft { background: var(--ice); color: var(--ink); }
body.admin .btn-soft:hover { background: var(--ice-2); color: var(--ink); }
body.admin .btn-icon { border-radius: 0; }
body.admin .btn-icon:hover { background: var(--ice); color: var(--blue); }

/* tabs and segmented switches: pixel blocks */
body.admin .tabs { border-radius: 0; background: var(--ice); padding: 4px; box-shadow: inset 0 0 0 1.5px var(--ice-2); }
body.admin .tab { border-radius: 0; }
body.admin .tab:hover { background: rgba(36, 81, 255, .07); }
body.admin .tab[aria-selected="true"] { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-dd); }
body.admin .tab[aria-selected="true"] .tab-n { background: rgba(255, 255, 255, .22); color: #fff; }
body.admin .tab-n { border-radius: 0; }
body.admin .seg { border-radius: 0; background: var(--ice); border-color: var(--ice-2); }
body.admin .seg button { border-radius: 0; }
body.admin .seg button[aria-pressed="true"] { background: var(--blue); color: #fff; box-shadow: 0 2px 0 var(--blue-dd); }

/* badges: square chips with a square dot */
body.admin .badge { border-radius: 0; border-width: 1.5px; }
body.admin .badge::before { border-radius: 0; }

/* tables */
body.admin .table-wrap { border-radius: 0; border: 1.5px solid var(--border); box-shadow: 5px 5px 0 var(--ice-2); }
body.admin .card .table-wrap { box-shadow: none; }
body.admin .table thead th { background: var(--ice); color: var(--ink); border-bottom: 2px solid var(--ice-2); }
body.admin .table tbody tr:hover td { background: #f7f9ff; }

/* form controls */
body.admin .input, body.admin .select, body.admin .textarea { border-radius: 0; border-width: 1.5px; }
body.admin .input:focus, body.admin .select:focus, body.admin .textarea:focus { border-color: var(--blue); box-shadow: 3px 3px 0 var(--ice-2); }
body.admin .switch span { border-radius: 0; }
body.admin .switch span::before { border-radius: 0; box-shadow: 2px 2px 0 rgba(10, 21, 64, .25); }
body.admin .switch input:checked + span { background: var(--blue); box-shadow: inset 0 -3px 0 var(--blue-dd); }
body.admin .layout-pick span, body.admin .chip { border-radius: 0; }

/* overlays */
body.admin .modal-backdrop { background: rgba(10, 21, 64, .5); }
body.admin .modal { border-radius: 0; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
body.admin .toast { border-radius: 0; font-weight: 700; background: var(--ink); box-shadow: 5px 5px 0 rgba(10, 21, 64, .25); }
body.admin .toast.ok { box-shadow: inset 5px 0 0 var(--sky), 5px 5px 0 rgba(10, 21, 64, .25); }
body.admin .toast.err { box-shadow: inset 5px 0 0 #f87171, 5px 5px 0 rgba(10, 21, 64, .25); }
body.admin .palette { border-radius: 0; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
body.admin .palette li { border-radius: 0; }
body.admin .palette li.on { box-shadow: 4px 0 0 var(--blue) inset; }
body.admin .pagination button { border-radius: 0; border-width: 1.5px; }
body.admin .pagination button[aria-current="page"] { box-shadow: 0 3px 0 var(--blue-dd); }

/* page-specific pieces */
body.admin .set-nav { border-radius: 0; border-width: 1.5px; box-shadow: 5px 5px 0 var(--ice-2); }
body.admin .set-nav button { border-radius: 0; }
body.admin .set-nav button.on { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-dd); }
body.admin .set-nav button.on .icon { color: #fff; }
body.admin .uname .avatar { border-radius: 0; box-shadow: 2px 2px 0 var(--ice-2); }
body.admin .gitem { border-radius: 0; border-width: 1.5px; }
body.admin .gitem:hover { border-color: var(--blue); box-shadow: 4px 4px 0 var(--ice-2); }
body.admin .gthumb { border-radius: 0; }
body.admin .live::before { border-radius: 0; animation-timing-function: steps(2); }
body.admin .tk-msg { border-radius: 0; box-shadow: 4px 4px 0 var(--ice-2); }
body.admin .tk-msg.staff { border-color: var(--blue); box-shadow: 4px 4px 0 var(--blue); }
body.admin .tk-msg.internal { box-shadow: 4px 4px 0 #fde68a; }
body.admin .tk-sys { border-radius: 0; }
body.admin .tk-files img { border-radius: 0; }
body.admin .tk-dot { box-shadow: 2px 2px 0 var(--ink); }body.admin .urow { border-radius: 0; border-width: 1.5px; box-shadow: 4px 4px 0 var(--ice-2); }
body.admin .urow:hover, body.admin .urow.open { border-color: var(--blue); }
body.admin .stat-icon, body.admin .chip, body.admin .chip button, body.admin .kbd, body.admin .wz-steps button, body.admin .wz-steps button b, body.admin .wz-img,
body.admin .rte, body.admin .rte-bar button, body.admin .serp, body.admin .mlib-item, body.admin .icon-pick span, body.admin .pair-row, body.admin .brand-mark { border-radius: 0; }
body.admin .wz-steps button[aria-current], body.admin .wz-steps button.on { box-shadow: 3px 3px 0 var(--ice-2); }
body.admin .icon-pick input:checked + span { box-shadow: 3px 3px 0 var(--blue); }