/* =========================================================================
   Serenity Console — design system
   ========================================================================= */
:root {
  --bg: #07090f;
  --bg-2: #0b0f19;
  --surface: rgba(18, 23, 38, 0.72);
  --surface-solid: #121726;
  --surface-2: #161c2e;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #e8ecf6;
  --text-2: #a5afc6;
  --muted: #6b7690;
  --primary: #7c5cff;
  --primary-2: #a78bfa;
  --accent: #22d3ee;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --discord: #5865f2;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  --ring: 0 0 0 3px rgba(124, 92, 255, 0.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); font: 14.5px/1.55 var(--font);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: "Cairo", var(--font); }
svg { width: 1em; height: 1em; fill: currentColor; flex: none; }
a { color: inherit; }
button { font: inherit; }
.muted { color: var(--muted); }
.gradient-text {
  background: linear-gradient(90deg, var(--primary-2), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  text-decoration: none;
}
.btn:hover { border-color: rgba(167, 139, 250, .5); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; box-shadow: var(--ring);
}
.btn--primary {
  border: 0; color: #fff;
  background: linear-gradient(135deg, var(--primary), #5b8cff);
  box-shadow: 0 8px 24px -10px rgba(124, 92, 255, .8);
}
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; }
.btn[disabled] { opacity: .6; cursor: progress; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer;
  transition: color .2s, background .2s, border-color .2s; font-size: 18px;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }

.logo-mark {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-size: 20px;
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 22px -8px rgba(124, 92, 255, .9);
}
.pill {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; color: var(--primary-2);
  background: rgba(124, 92, 255, .14); border: 1px solid rgba(124, 92, 255, .3);
}

/* =========================================================================
   Sign-in page
   ========================================================================= */
.auth {
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, .18), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(34, 211, 238, .12), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
.auth::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(148, 163, 184, .06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148, 163, 184, .06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.auth-glow { position: fixed; width: 420px; height: 420px; border-radius: 50%; filter: blur(90px); opacity: .35; pointer-events: none; }
.auth-glow--a { background: var(--primary); top: -120px; left: -80px; }
.auth-glow--b { background: var(--accent); bottom: -160px; right: -100px; opacity: .22; }

.auth-shell {
  position: relative; z-index: 1; flex: 1; width: min(1120px, 100%); margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding: 48px 28px;
}
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.hero-title { font-size: clamp(34px, 4.4vw, 54px); line-height: 1.06; letter-spacing: -.035em; margin: 0 0 18px; font-weight: 800; }
.hero-sub { color: var(--text-2); font-size: 16.5px; max-width: 520px; margin: 0 0 34px; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; max-width: 520px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list strong { display: block; font-weight: 650; }
.feature-list span { color: var(--text-2); font-size: 14px; }
.check {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; margin-top: 1px;
  color: var(--success); background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .3); font-size: 15px;
}

.auth-card {
  background: linear-gradient(180deg, rgba(22, 28, 46, .9), rgba(14, 18, 30, .9));
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 36px;
  box-shadow: var(--shadow-lg); backdrop-filter: blur(16px);
}
.auth-card__head h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.auth-card__head p { margin: 0 0 24px; color: var(--text-2); }
.btn-discord {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 52px;
  border-radius: 12px; background: var(--discord); color: #fff; font-weight: 700; font-size: 15.5px;
  text-decoration: none; box-shadow: 0 12px 30px -12px rgba(88, 101, 242, .9);
  transition: transform .12s ease, filter .2s ease;
}
.btn-discord svg { font-size: 22px; }
.btn-discord:hover { filter: brightness(1.08); }
.btn-discord:active { transform: translateY(1px); }
.divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 18px; color: var(--muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.trust-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: var(--text-2); font-size: 13.5px; }
.trust-list li { display: flex; gap: 10px; align-items: center; }
.trust-list svg { color: var(--primary-2); font-size: 16px; }
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; font-size: 13.5px; border: 1px solid; }
.alert strong { display: block; margin-bottom: 2px; }
.alert--error { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); color: #fecaca; }
.alert--warn { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); color: #fde68a; }
.auth-footer { position: relative; z-index: 1; display: flex; justify-content: center; align-items: center; gap: 10px;
  padding: 20px; color: var(--muted); font-size: 12.5px; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }

/* =========================================================================
   Console
   ========================================================================= */
.app-body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(124, 92, 255, .12), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
}
.app { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; border-inline-end: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(12, 16, 27, .95), rgba(9, 12, 20, .95));
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; border-bottom: 1px solid var(--border); }
.sidebar__brand-text { display: grid; line-height: 1.25; min-width: 0; }
.sidebar__brand-text strong { font-weight: 750; letter-spacing: -.01em; }
.sidebar__brand-text span { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__nav { display: grid; gap: 3px; overflow-y: auto; padding-inline: 2px 6px; }
.nav-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 10px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; text-align: start;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { background: rgba(148, 163, 184, .07); color: var(--text); }
.nav-item.is-active {
  color: var(--text); background: linear-gradient(90deg, rgba(124, 92, 255, .2), rgba(124, 92, 255, .04));
  border-color: rgba(124, 92, 255, .3);
}
.nav-item__icon { width: 22px; text-align: center; font-size: 15px; }
.nav-item__label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item__count { font-size: 11.5px; font-weight: 700; color: var(--muted); background: rgba(148, 163, 184, .1);
  padding: 1px 8px; border-radius: 999px; }
.nav-item.is-active .nav-item__count { color: var(--primary-2); background: rgba(124, 92, 255, .18); }
.sidebar__footer { margin-top: auto; display: grid; gap: 10px; }
.lang-switch {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer;
  color: var(--text-2); background: transparent; border: 1px solid var(--border);
}
.lang-switch:hover { color: var(--text); border-color: var(--border-strong); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-2);
  border: 1px solid var(--border-strong); }
.user-card__text { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.user-card__text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.user-card__text span { color: var(--muted); font-size: 12px; }
.logout-form { margin: 0; }

/* ---------- main ---------- */
.main { padding: 26px 34px 48px; min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: -.025em; font-weight: 800; }
.topbar p { margin: 4px 0 0; color: var(--text-2); }
.search {
  position: relative; display: flex; align-items: center; gap: 10px; width: min(380px, 100%); height: 42px;
  padding: 0 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--muted); transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: rgba(124, 92, 255, .55); box-shadow: var(--ring); }
.search input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; min-width: 0; }
.search input:focus { outline: none; box-shadow: none; }
kbd { font: 600 11px var(--font); color: var(--muted); border: 1px solid var(--border-strong); border-radius: 6px; padding: 1px 6px; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 30px; }
.kpi {
  position: relative; overflow: hidden; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.kpi::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--kpi-accent, var(--primary)); opacity: .9; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.kpi__icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-size: 15px;
  background: rgba(148, 163, 184, .08); }
.kpi__value { margin-top: 10px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi--money { --kpi-accent: linear-gradient(90deg, var(--success), var(--accent)); }
.kpi--pending { --kpi-accent: linear-gradient(90deg, var(--warning), #fb923c); }
.kpi--orders { --kpi-accent: linear-gradient(90deg, var(--primary), #5b8cff); }
.skeleton { height: 90px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border: 1px solid var(--border); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* action cards */
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; }
.section-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; text-align: start; color: inherit;
  transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-2px); border-color: rgba(124, 92, 255, .45); outline: none;
  box-shadow: 0 18px 40px -18px rgba(124, 92, 255, .5); background: rgba(24, 30, 50, .85);
}
.card__head { display: flex; align-items: center; gap: 12px; }
.card__icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-size: 18px;
  background: rgba(124, 92, 255, .12); border: 1px solid rgba(124, 92, 255, .25); }
.card__title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; line-height: 1.3; }
.card__cmd { display: inline-block; direction: ltr; unicode-bidi: isolate; color: var(--muted); font: 500 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.card__desc { color: var(--text-2); font-size: 13.5px; margin: 0; flex: 1; }
.card__foot { display: flex; align-items: center; justify-content: space-between; }
.card__run { color: var(--primary-2); font-weight: 650; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid; letter-spacing: .02em; }
.badge--admin { color: #c4b5fd; background: rgba(124, 92, 255, .12); border-color: rgba(124, 92, 255, .3); }
.badge--restricted { color: #fca5a5; background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .3); }
.badge--staff { color: #67e8f9; background: rgba(34, 211, 238, .1); border-color: rgba(34, 211, 238, .3); }
.badge--everyone { color: #86efac; background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .3); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- action sheet ---------- */
.sheet { padding: 0; border: 0; background: transparent; color: var(--text); width: min(720px, 94vw); max-height: 92vh; }
.sheet::backdrop { background: rgba(3, 5, 10, .7); backdrop-filter: blur(6px); }
.sheet[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.sheet__inner { display: flex; flex-direction: column; max-height: 92vh; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #151b2c, #10141f); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 0; }
.sheet__head h2 { margin: 2px 0 0; font-size: 20px; letter-spacing: -.02em; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-2); }
.sheet__desc { margin: 10px 24px 0; color: var(--text-2); font-size: 13.5px; }
.sheet__fields { display: grid; gap: 16px; padding: 20px 24px; overflow-y: auto; }
.sheet__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; border-top: 1px solid var(--border); }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 650; color: var(--text); }
.field .req { color: var(--danger); margin-inline-start: 3px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: #0b101b; color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(124, 92, 255, .6); }
.field .filter { height: 34px; padding: 6px 10px; font-size: 13px; }
.dropzone { display: grid; place-items: center; gap: 6px; padding: 18px; border-radius: 12px; text-align: center;
  border: 1.5px dashed var(--border-strong); background: rgba(11, 16, 27, .6); color: var(--text-2); cursor: pointer; }
.dropzone:hover { border-color: rgba(124, 92, 255, .55); }
.dropzone input { display: none; }
.dropzone__hint { font-size: 12px; color: var(--muted); }
.no-fields { padding: 14px; border-radius: 12px; background: rgba(148, 163, 184, .06); color: var(--text-2); text-align: center; }

.result { margin: 0 24px 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); font-size: 13.5px; }
.result--ok { border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .07); }
.result--err { border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .07); color: #fecaca; }
.result__title { font-weight: 700; margin-bottom: 8px; }
.result__kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.result__kv div { padding: 10px; border-radius: 10px; background: rgba(11, 16, 27, .7); border: 1px solid var(--border); }
.result__kv span { display: block; color: var(--muted); font-size: 11.5px; }
.result__kv strong { font-variant-numeric: tabular-nums; }
.result__kv { order: 0; }
.meter { margin-top: 10px; padding: 12px; border-radius: 10px; background: rgba(11, 16, 27, .7); border: 1px solid var(--border); }
.meter__head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.meter__head strong { color: var(--text); font-variant-numeric: tabular-nums; }
.meter__track { height: 8px; border-radius: 999px; background: rgba(148, 163, 184, .14); overflow: hidden; }
.meter__fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.meter__fill--hot { background: linear-gradient(90deg, var(--warning), var(--danger)); }
.table-wrap { margin-top: 10px; max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.table-wrap table { margin-top: 0; }
.result th { position: sticky; top: 0; background: #121828; }
.result td.num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: end; }
.result td:first-child, .result th { white-space: nowrap; }
.result tr:last-child td { border-bottom: 0; }
.result table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12.5px; }
.result th, .result td { padding: 8px; text-align: start; border-bottom: 1px solid var(--border); }
.result th { color: var(--muted); font-weight: 600; }
.result__actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- toasts ---------- */
.toasts { position: fixed; inset-inline-end: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 50; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: pop .2s ease-out; font-size: 13.5px; }
.toast--ok { border-color: rgba(34, 197, 94, .45); }
.toast--err { border-color: rgba(239, 68, 68, .45); }
.toast__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.toast--err .toast__dot { background: var(--danger); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; gap: 32px; padding-top: 28px; }
  .auth-hero .feature-list { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .sidebar__nav { min-width: 0; max-width: 100%; }
  .sidebar { position: static; height: auto; flex-direction: column; border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .sidebar__nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .nav-label { display: none; }
  .main { padding: 20px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- scrollbars (thin, dark, on-brand) ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .28) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, .22); border-radius: 999px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(167, 139, 250, .55); background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* Horizontal section bar on narrow screens: swipe/scroll without a visible bar, soft fade at the edges. */
@media (max-width: 860px) {
  .sidebar__nav {
    scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: 2px;
    mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
  }
  .sidebar__nav::-webkit-scrollbar { display: none; }
  .nav-item { scroll-snap-align: start; }
}

/* ---------- calculator editor ---------- */
.calc { display: grid; gap: 16px; padding-bottom: 40px; min-width: 0; }
.calc > *, .calc-methods > * { min-width: 0; }
.calc-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow); display: grid; gap: 12px;
}
.calc-bar .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 600;
}
.chip:hover { border-color: rgba(167, 139, 250, .5); }
.chip.is-active { background: linear-gradient(135deg, rgba(124, 92, 255, .35), rgba(91, 140, 255, .25)); border-color: var(--primary); }
.chip__count { font-size: 11.5px; color: var(--text-2); background: rgba(11, 16, 27, .6); border-radius: 999px; padding: 1px 8px; }
.calc-label { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.calc-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.calc-input {
  height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: rgba(11, 16, 27, .7); color: var(--text); font: inherit; min-width: 0;
}
.calc-input:focus { border-color: rgba(124, 92, 255, .6); outline: none; box-shadow: var(--ring); }
.calc-input--grow { flex: 1 1 220px; }
.calc-input--emoji { width: 72px; text-align: center; }
.calc-input--rate { width: 110px; }
.calc-input--name { font-weight: 700; font-size: 15px; flex-basis: 120px; }
.calc-cat { grid-template-columns: auto 1fr auto auto; align-items: center; }
.calc-cat__emoji { display: flex; align-items: center; gap: 8px; }
.calc-emoji { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; }
.calc-emoji--img { width: 22px; height: 22px; object-fit: contain; }
.calc-quote__line em { color: var(--text-2); }
.calc-cat__titles h3 { margin: 0; font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.calc-methods { display: grid; gap: 12px; }
.calc-svc.is-new { border-style: dashed; border-color: rgba(124, 92, 255, .45); }
.calc-svc__top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.calc-svc__foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.calc-hint { flex: 1 1 200px; font-size: 12.5px; }
.calc-tiers { width: 100%; border-collapse: separate; border-spacing: 0 6px; table-layout: fixed; }
.calc-tiers th { text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 6px; }
.calc-tiers td { padding: 0 6px 0 0; }
.calc-tiers .calc-input { width: 100%; }
.calc-tiers th:nth-child(1), .calc-tiers th:nth-child(2) { width: 17%; }
.calc-tiers th:nth-child(3) { width: 19%; }
.calc-tiers th:last-child, .calc-tiers td:last-child { width: 48px; }
.calc-tiers th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn--icon { width: 40px; padding: 0; }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn--danger { border-color: rgba(239, 68, 68, .45); color: #fecaca; }
.btn--danger:hover { border-color: var(--danger); background: rgba(239, 68, 68, .12); }
.btn--dashed { border-style: dashed; background: transparent; justify-self: start; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.calc-preview h3 { margin: 0; font-size: 15px; }
.calc-preview__title { font-weight: 700; color: var(--text-2); }
.calc-quote { padding: 12px 14px; border-radius: 12px; background: rgba(11, 16, 27, .6); border: 1px solid var(--border); display: grid; gap: 6px; }
.calc-quote.is-off { opacity: .6; }
.calc-quote__name { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.calc-quote__line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; direction: ltr; justify-content: flex-start; }
.calc-quote__line code { font: 500 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(148, 163, 184, .12); padding: 2px 7px; border-radius: 6px; }
.calc-quote__total { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-weight: 700; }
@media (max-width: 640px) {
  .calc-cat { grid-template-columns: auto 1fr; }
  .calc-panel { padding: 14px; }
  .calc-hint { display: none; }
  .calc-tiers .calc-input { padding: 8px; }
  .calc-tiers, .calc-tiers tbody, .calc-tiers tr { display: block; }
  .calc-tiers thead { display: none; }
  .calc-tiers tr { display: grid; grid-template-columns: 1fr 1fr 1fr 44px; gap: 6px; margin-bottom: 8px; }
  .calc-tiers td { padding: 0; }
  .calc-tiers td:nth-child(4) { grid-column: 1 / 4; grid-row: 2; }
  .calc-tiers td:last-child { width: auto; grid-column: 4; grid-row: 1; }
}

/* ---------- services menu editor ---------- */
.svc-warn { padding: 10px 12px; border-radius: 10px; background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35); color: #fcd34d; font-size: 13px; }
.svc-cat { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.svc-list { display: grid; gap: 10px; }
.svc-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; flex-wrap: wrap; }
.svc-row__titles { display: grid; flex: 1 1 200px; min-width: 0; }
.svc-row__titles strong, .svc-row__titles span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-editor { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 18px; border-color: rgba(124, 92, 255, .45); }
.svc-form { display: grid; gap: 14px; min-width: 0; }
.svc-side { position: sticky; top: 16px; display: grid; gap: 8px; min-width: 0; }
.svc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.svc-span { grid-column: 1 / -1; }
.svc-field { display: grid; gap: 6px; min-width: 0; }
.svc-field .calc-input { width: 100%; }
.svc-textarea { height: auto; min-height: 84px; resize: vertical; line-height: 1.5; font: inherit; }
.svc-image { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.svc-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border-strong); }
.segmented { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(11, 16, 27, .7); border: 1px solid var(--border-strong); width: max-content; }
.segmented__btn { border: 0; background: transparent; color: var(--text-2); font-weight: 650; padding: 8px 16px; border-radius: 9px; cursor: pointer; }
.segmented__btn.is-active { background: linear-gradient(135deg, var(--primary), #5b8cff); color: #fff; }
.svc-block { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: rgba(11, 16, 27, .35); }
.svc-block__title { font-weight: 700; font-size: 13.5px; }
.svc-group { display: grid; gap: 6px; padding: 10px; border-radius: 12px; border: 1px dashed var(--border-strong); }
.svc-rowline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 6px; align-items: center; }
.svc-group > .svc-rowline:first-child { grid-template-columns: minmax(0, 1fr) 40px; }
.svc-rowline .calc-input { width: 100%; }
.svc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.svc-move { width: auto; max-width: 220px; }
/* Discord-like preview card */
.dc-embed { background: #2b2d31; border-radius: 6px; border-inline-start: 4px solid #0099ff; padding: 12px 14px; color: #dbdee1; font: 14px/1.4 "gg sans", var(--font); }
.dc-embed__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.dc-embed__title { display: flex; gap: 6px; align-items: center; font-weight: 700; color: #f2f3f5; font-size: 15px; }
.dc-embed__thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.dc-embed__body p { margin: 8px 0 0; }
.dc-embed code { background: #1e1f22; border-radius: 3px; padding: 1px 4px; font-size: 12.5px; }
.dc-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-field__name { font-weight: 700; color: #f2f3f5; margin-top: 10px; }
.dc-field__line { margin-top: 2px; }
@media (max-width: 980px) {
  .svc-editor { grid-template-columns: minmax(0, 1fr); }
  .svc-side { position: static; }
}
@media (max-width: 640px) {
  .svc-grid { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================================
   Serenity theme — gold & gem teal, OSRS artwork
   ========================================================================= */
:root { --gold: #e8c26a; --gold-2: #b8862f; --gem: #2dd4bf; }
.gold-text {
  background: linear-gradient(92deg, #f7e2a1 0%, var(--gold) 40%, var(--gold-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pill--gold { color: var(--gold); background: rgba(232, 194, 106, .12); border-color: rgba(232, 194, 106, .35); }
.auth--serenity {
  background: #05080d;
}
.auth--serenity::before { opacity: .18; }
.auth-bg {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(1100px 700px at 75% 40%, rgba(45, 212, 191, .10), transparent 60%),
    linear-gradient(90deg, rgba(5, 8, 13, .92) 0%, rgba(5, 8, 13, .55) 55%, rgba(5, 8, 13, .80) 100%),
    url("/static/bg.webp") center / cover no-repeat;
}
.auth--serenity .auth-glow--a { background: var(--gold-2); opacity: .22; }
.auth--serenity .auth-glow--b { background: var(--gem); opacity: .16; }
.brand-logo { height: 132px; width: auto; filter: drop-shadow(0 12px 30px rgba(232, 194, 106, .25)); }
.auth--serenity .brand-row { margin-bottom: 26px; align-items: flex-end; }
.auth--serenity .check { color: var(--gold); background: rgba(232, 194, 106, .10); border-color: rgba(232, 194, 106, .32); }
.auth--serenity .auth-card {
  position: relative; overflow: visible; padding-top: 78px;
  background: linear-gradient(180deg, rgba(14, 22, 30, .92), rgba(8, 12, 18, .94));
  border-color: rgba(232, 194, 106, .28);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(247, 226, 161, .08);
}
.auth--serenity .auth-card::before {
  content: ""; position: absolute; inset: 0 24px auto; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gem), transparent);
}
.auth-emblem {
  position: absolute; top: -66px; left: 50%; translate: -50% 0; width: 132px; height: 132px; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(232, 194, 106, .55), 0 0 0 9px rgba(5, 8, 13, .85), 0 18px 40px -8px rgba(45, 212, 191, .45);
}
.auth--serenity .auth-card__head { text-align: center; }
.auth--serenity .trust-list svg { color: var(--gold); }
.auth-footer .credit strong { color: var(--gold); font-weight: 700; letter-spacing: .02em; }
/* console */
.sidebar__logo { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 6px 14px rgba(232, 194, 106, .3)); }
.sidebar__credit { font-size: 11.5px; color: var(--muted); text-align: center; padding: 2px 0 8px; }
.sidebar__credit strong { color: var(--gold); font-weight: 700; }
@media (max-width: 980px) {
  .brand-logo { height: 96px; }
  .auth--serenity .auth-shell { gap: 96px; }
}
@media (max-width: 640px) {
  .auth-footer { flex-direction: column; gap: 4px; text-align: center; }
  .auth-footer .dot { display: none; }
}
