/* DConsults panel. Brand tokens from the site (indigo #4F39F6, navy #213F80, midnight #0B0A1F,
   Urbanist). Light by default, dark from the OS or the theme switch (data-theme on <html>). */

@font-face {
  font-family: 'Urbanist';
  src: url("fonts/Urbanist-latin-wght.aa575f0b6551.woff2") format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font: 'Urbanist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic', 'Geeza Pro', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --brand: #4f39f6;
  --brand-hover: #3f2be0;
  --brand-ink: #ffffff;
  --brand-soft: #efedff;
  --brand-line: #d9d4ff;
  --brand-text: #3b27d9;
  --navy: #213f80;
  --lavender: #a298ff;

  --bg: #f5f5fa;
  --surface: #ffffff;
  --surface-2: #fafafd;
  --sunken: #f0eff7;
  --ink: #0b0a1f;
  --ink-2: #2a2942;
  --muted: #5b5975;
  --faint: #8c8aa4;
  --line: #e8e6f3;
  --line-strong: #d4d1ea;

  --ok: #0b7a54;
  --ok-soft: #e2f5ec;
  --warn: #a14f05;
  --warn-soft: #fdf0dc;
  --danger: #c0283a;
  --danger-soft: #fde7ea;
  --info: #1c64c4;
  --info-soft: #e4effc;

  --side-bg: #0b0a1f;
  --side-ink: #c9c6f2;
  --side-ink-strong: #ffffff;
  --side-hover: rgba(255, 255, 255, 0.06);
  --side-active: rgba(162, 152, 255, 0.16);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(11, 10, 31, 0.06);
  --shadow: 0 1px 2px rgba(11, 10, 31, 0.04), 0 10px 30px -14px rgba(11, 10, 31, 0.14);
  --shadow-lg: 0 30px 70px -24px rgba(11, 10, 31, 0.42);
  --ring: 0 0 0 3px rgba(79, 57, 246, 0.22);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand: #7b6bff;
    --brand-hover: #8f81ff;
    --brand-soft: rgba(123, 107, 255, 0.14);
    --brand-line: rgba(123, 107, 255, 0.34);
    --brand-text: #b3aaff;
    --bg: #0a0918;
    --surface: #131226;
    --surface-2: #17162d;
    --sunken: #0f0e21;
    --ink: #f3f2ff;
    --ink-2: #dddbf5;
    --muted: #a9a6c8;
    --faint: #7c79a0;
    --line: #26244a;
    --line-strong: #353266;
    --ok: #4cd6a0;
    --ok-soft: rgba(76, 214, 160, 0.12);
    --warn: #f3b25e;
    --warn-soft: rgba(243, 178, 94, 0.12);
    --danger: #ff7d8c;
    --danger-soft: rgba(255, 125, 140, 0.12);
    --info: #7fb2ff;
    --info-soft: rgba(127, 178, 255, 0.12);
    --side-bg: #070614;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --brand: #7b6bff;
  --brand-hover: #8f81ff;
  --brand-soft: rgba(123, 107, 255, 0.14);
  --brand-line: rgba(123, 107, 255, 0.34);
  --brand-text: #b3aaff;
  --bg: #0a0918;
  --surface: #131226;
  --surface-2: #17162d;
  --sunken: #0f0e21;
  --ink: #f3f2ff;
  --ink-2: #dddbf5;
  --muted: #a9a6c8;
  --faint: #7c79a0;
  --line: #26244a;
  --line-strong: #353266;
  --ok: #4cd6a0;
  --ok-soft: rgba(76, 214, 160, 0.12);
  --warn: #f3b25e;
  --warn-soft: rgba(243, 178, 94, 0.12);
  --danger: #ff7d8c;
  --danger-soft: rgba(255, 125, 140, 0.12);
  --info: #7fb2ff;
  --info-soft: rgba(127, 178, 255, 0.12);
  --side-bg: #070614;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* Base ------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
p { margin: 0; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--sunken); padding: 1px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Shell ----------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--side-bg); color: var(--side-ink);
  padding: 18px 14px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: #fff; }
.side-brand img { width: 26px; height: 39px; }
.side-brand b { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; display: block; }
.side-brand span { font-size: 12px; color: var(--side-ink); opacity: 0.8; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8a86c4; padding: 14px 12px 6px; }
.side a.nav {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--side-ink); font-weight: 600; font-size: 14.5px;
  transition: background 0.15s, color 0.15s;
}
.side a.nav:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.side a.nav[aria-current='page'] { background: var(--side-active); color: #fff; }
.side a.nav[aria-current='page'] .i { color: var(--lavender); }
.side a.nav.sub { padding-left: 41px; font-size: 13.5px; font-weight: 600; }
.side .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: grid; gap: 4px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--side-ink); border-radius: 10px; min-width: 0; }
.side-user:hover { background: var(--side-hover); text-decoration: none; }
.side-user div { min-width: 0; }
.side-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user b { color: #fff; font-size: 14px; display: block; line-height: 1.2; }
.side-user span { font-size: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(140deg, var(--brand), var(--navy)); color: #fff; font-size: 12.5px; font-weight: 700; flex: none; }
.side form button { width: 100%; }
.side .side-btn { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; border: 0; background: none; color: var(--side-ink); font: 600 14px var(--font); cursor: pointer; text-align: left; }
.side .side-btn:hover { background: var(--side-hover); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 32px; min-height: 68px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 21px; font-weight: 700; }
.topbar .crumb { font-size: 13px; color: var(--muted); font-weight: 600; }
.topbar .crumb a { color: var(--muted); }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 26px 32px 64px; max-width: 1440px; width: 100%; }
.content.wide { max-width: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 60; transform: translateX(-100%); transition: transform 0.25s var(--ease); }
  .shell.open .side { transform: none; box-shadow: var(--shadow-lg); }
  .shell.open::after { content: ''; position: fixed; inset: 0; background: rgba(11, 10, 31, 0.45); z-index: 50; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 48px; }
}

/* Buttons --------------------------------------------------------------------------- */
.btn {
  --b-bg: var(--surface); --b-ink: var(--ink); --b-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--b-line); border-radius: 10px;
  background: var(--b-bg); color: var(--b-ink);
  font: 650 14px/1 var(--font); white-space: nowrap;
  cursor: pointer; text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-busy { opacity: 0.55; pointer-events: none; }
.btn.primary { --b-bg: var(--brand); --b-ink: var(--brand-ink); --b-line: var(--brand); }
.btn.primary:hover { --b-bg: var(--brand-hover); --b-line: var(--brand-hover); }
.btn.success { --b-bg: var(--ok); --b-ink: #fff; --b-line: var(--ok); }
.btn.danger { --b-bg: var(--surface); --b-ink: var(--danger); --b-line: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger:hover { --b-bg: var(--danger-soft); }
.btn.danger.solid { --b-bg: var(--danger); --b-ink: #fff; --b-line: var(--danger); }
.btn.ghost { --b-bg: transparent; --b-line: transparent; }
.btn.ghost:hover { --b-bg: var(--sunken); }
.btn.soft { --b-bg: var(--brand-soft); --b-ink: var(--brand-text); --b-line: transparent; }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.xs { min-height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn.icon { padding: 0; width: 38px; }
.btn.icon.sm { width: 32px; }
.btn.icon.xs { width: 26px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Forms ------------------------------------------------------------------------------ */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); display: flex; align-items: baseline; gap: 8px; }
.label small { font-weight: 600; color: var(--faint); font-size: 12px; }
.label .counter { margin-left: auto; }
.help { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.help.warn { color: var(--warn); }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font: 500 14.5px/1.45 var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input.invalid, .textarea.invalid { border-color: var(--danger); }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238c8aa4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input.sm, .select.sm { min-height: 34px; font-size: 13.5px; padding-top: 5px; padding-bottom: 5px; }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; cursor: pointer; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch b { display: block; font-size: 14px; }
.switch span { font-size: 12.5px; color: var(--muted); }
.switch input { appearance: none; width: 40px; height: 23px; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; flex: none; transition: background 0.2s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(17px); }
.switch input:focus-visible { outline: none; box-shadow: var(--ring); }
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--danger); font-size: 13px; font-weight: 600; }

/* Cards, sections ------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 700; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.stack { display: grid; gap: 18px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
.section-title { font-size: 12px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }

/* KPIs ----------------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.kpi .k-label { font-size: 13px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .k-label .i { color: var(--brand); }
.kpi .k-value { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--faint); font-weight: 600; }
.kpi.accent { background: linear-gradient(145deg, var(--brand) 0%, var(--navy) 100%); border-color: transparent; color: #fff; }
.kpi.accent .k-label, .kpi.accent .k-sub { color: rgba(255, 255, 255, 0.78); }
.kpi.accent .k-label .i { color: #fff; }

/* Toolbar, filters, tabs --------------------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 260px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a, .tabs button {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
  color: var(--muted); font: 650 14px var(--font); white-space: nowrap; text-decoration: none !important;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs [aria-current='page'], .tabs [aria-selected='true'] { color: var(--brand-text); border-bottom-color: var(--brand); }
.tabs .n { font-size: 12px; padding: 0 7px; border-radius: 99px; background: var(--sunken); color: var(--muted); }
.tabs [aria-current='page'] .n, .tabs [aria-selected='true'] .n { background: var(--brand-soft); color: var(--brand-text); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; }
.seg button, .seg a { border: 0; background: none; padding: 5px 11px; border-radius: 7px; font: 650 13px var(--font); color: var(--muted); cursor: pointer; text-decoration: none !important; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover, .seg a:hover { color: var(--ink); }
.seg .on, .seg [aria-pressed='true'], .seg [aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 150px; }
.filters .field .label { font-size: 12px; color: var(--muted); }
.filters .grow { flex: 1 1 240px; }

/* Tables ---------------------------------------------------------------------------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.table .row-link { color: var(--ink); font-weight: 700; }
.table .sub { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table .truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }

/* Badges, chips -------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; line-height: 1.6; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.brand, .badge.new, .badge.scheduled { background: var(--brand-soft); color: var(--brand-text); }
.badge.ok, .badge.won, .badge.published, .badge.sent { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .badge.contacted, .badge.deferred, .badge.queued { background: var(--warn-soft); color: var(--warn); }
.badge.info, .badge.qualified, .badge.proposal, .badge.sending { background: var(--info-soft); color: var(--info); }
.badge.danger, .badge.spam, .badge.failed { background: var(--danger-soft); color: var(--danger); }
.badge.lost, .badge.draft { background: var(--sunken); color: var(--muted); }
.badge.ads { background: #fff4d6; color: #8a5a00; }
:root[data-theme='dark'] .badge.ads { background: rgba(255, 200, 80, 0.14); color: #ffd27a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .badge.ads { background: rgba(255, 200, 80, 0.14); color: #ffd27a; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--sunken); border: 1px solid var(--line); font-size: 13px; font-weight: 650; }
.chip button { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 0; display: inline-flex; }
.chip button:hover { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ref { font-family: var(--mono); font-weight: 700; letter-spacing: 0.06em; padding: 1px 7px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-text); font-size: 12.5px; }

/* Key/value, timeline ---------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 9px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 650; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.timeline .t-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); color: var(--muted); }
.timeline .t-icon.note { background: var(--brand-soft); color: var(--brand-text); }
.timeline .t-meta { font-size: 12.5px; color: var(--faint); font-weight: 600; }
.timeline .t-body { white-space: pre-wrap; font-size: 14px; }
.message-box { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 14.5px; line-height: 1.6; }

/* Alerts, empty states ---------------------------------------------------------------- */
.alerts { display: grid; gap: 8px; margin-bottom: 16px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 600; background: var(--info-soft); color: var(--info); border: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.alert.success { background: var(--ok-soft); color: var(--ok); }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.warning { background: var(--warn-soft); color: var(--warn); }
.alert .grow { flex: 1; }
.alert button { border: 0; background: none; color: inherit; cursor: pointer; opacity: 0.7; padding: 0; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .e-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand-soft); color: var(--brand-text); }
.empty h3 { font-size: 17px; margin-bottom: 6px; color: var(--ink); }
.empty p { max-width: 420px; margin: 0 auto 16px; font-size: 14px; }

/* Pagination ------------------------------------------------------------------------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages a, .pager .pages span { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 8px; color: var(--ink-2); font-weight: 700; text-decoration: none; }
.pager .pages a:hover { background: var(--sunken); }
.pager .pages .on { background: var(--brand); color: #fff; }

/* Dialogs, toasts -------------------------------------------------------------------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog.modal.wide { width: min(940px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(11, 10, 31, 0.5); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop 0.22s var(--ease); display: flex; flex-direction: column; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; font-weight: 750; }
.modal-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 650; box-shadow: var(--shadow-lg); animation: pop 0.25s var(--ease); max-width: 380px; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success .i { color: #6ff0bd; }

/* Login ------------------------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 85% 0%, #4f39f6 0%, #2a1f9a 38%, #0b0a1f 78%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::after { content: ''; position: absolute; inset: auto -20% -40% auto; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(closest-side, rgba(162, 152, 255, 0.35), transparent); }
.auth-art h2 { color: #fff; font-size: clamp(30px, 3.4vw, 46px); font-weight: 650; letter-spacing: -0.025em; max-width: 520px; position: relative; z-index: 1; }
.auth-art h2 span { color: var(--lavender); }
.auth-art p { color: #c9c6f2; max-width: 440px; margin-top: 14px; font-size: 16px; position: relative; z-index: 1; }
.auth-art img { width: 150px; position: relative; z-index: 1; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; }
.auth-card .lead { color: var(--muted); margin: 6px 0 26px; }
.auth-card .btn { width: 100%; min-height: 46px; font-size: 15px; }
.auth-card .input { min-height: 46px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* Misc ------------------------------------------------------------------------------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.flex { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.bar { height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--lavender)); }
.rank { display: grid; gap: 12px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 14px; }
.rank li .bar { grid-column: 1 / -1; }
.rank b { font-variant-numeric: tabular-nums; }
.thumb { width: 64px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--sunken); border: 1px solid var(--line); flex: none; display: block; }
.copy { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 2px; display: inline-flex; vertical-align: middle; }
.copy:hover { color: var(--brand-text); }
