/* Number Manager — shared design system (user app + admin panel).
   Tokens first; components below only reference tokens. */

:root {
  --bg: #f3f5f7;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(16, 163, 146, .07), transparent 60%),
             radial-gradient(900px 500px at -10% 110%, rgba(59, 130, 246, .05), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --surface-3: #eef2f4;
  --glass: rgba(255, 255, 255, .78);
  --border: #e4e9ed;
  --border-strong: #d2dae0;
  --text: #0f1b24;
  --text-2: #435261;
  --muted: #7b8894;
  --accent: #0e9384;
  --accent-2: #0b7a6e;
  --accent-grad: linear-gradient(180deg, #13a595 0%, #0c8175 100%);
  --accent-hover: #0a6f64;
  --accent-soft: #e4f5f2;
  --accent-soft-2: #cdebe6;
  --accent-text: #0a6b61;
  --on-accent: #ffffff;
  --danger: #d0453d;
  --danger-grad: linear-gradient(180deg, #df554d 0%, #c13a33 100%);
  --danger-soft: #fdeeed;
  --warn: #b86e00;
  --warn-soft: #fdf4e3;
  --ok: #188a4a;
  --ok-soft: #e5f6ec;
  --info: #2f6fdb;
  --info-soft: #e9f0fd;
  --ring: 0 0 0 3px rgba(14, 147, 132, .18);
  --shadow-xs: 0 1px 2px rgba(15, 27, 36, .05);
  --shadow: 0 1px 2px rgba(15, 27, 36, .04), 0 6px 20px -6px rgba(15, 27, 36, .08);
  --shadow-lg: 0 24px 60px -12px rgba(15, 27, 36, .28);
  --shadow-btn: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 1px 2px rgba(15, 27, 36, .12), 0 4px 12px -4px rgba(14, 147, 132, .45);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --font: "Inter", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --topbar-h: 62px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f13;
    --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(19, 190, 170, .09), transparent 60%),
               radial-gradient(900px 500px at -10% 110%, rgba(59, 130, 246, .06), transparent 60%);
    --surface: #11181d;
    --surface-2: #151e24;
    --surface-3: #1b262d;
    --glass: rgba(17, 24, 29, .78);
    --border: #212d35;
    --border-strong: #2e3d47;
    --text: #e8eef2;
    --text-2: #b1bfc8;
    --muted: #7c8c97;
    --accent: #22b8a6;
    --accent-2: #1ea293;
    --accent-grad: linear-gradient(180deg, #25c3b0 0%, #169a8b 100%);
    --accent-hover: #3dd0be;
    --accent-soft: #0f2e2b;
    --accent-soft-2: #164440;
    --accent-text: #6fe0d1;
    --on-accent: #04201d;
    --danger: #f06a61;
    --danger-grad: linear-gradient(180deg, #f27a72 0%, #d9534b 100%);
    --danger-soft: #361a19;
    --warn: #eaa53f;
    --warn-soft: #33260f;
    --ok: #4ccb82;
    --ok-soft: #12301f;
    --info: #6aa0ff;
    --info-soft: #14233d;
    --ring: 0 0 0 3px rgba(34, 184, 166, .25);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
    --shadow-btn: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 1px 2px rgba(0, 0, 0, .4), 0 6px 16px -6px rgba(34, 184, 166, .45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0f13;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(19, 190, 170, .09), transparent 60%),
             radial-gradient(900px 500px at -10% 110%, rgba(59, 130, 246, .06), transparent 60%);
  --surface: #11181d;
  --surface-2: #151e24;
  --surface-3: #1b262d;
  --glass: rgba(17, 24, 29, .78);
  --border: #212d35;
  --border-strong: #2e3d47;
  --text: #e8eef2;
  --text-2: #b1bfc8;
  --muted: #7c8c97;
  --accent: #22b8a6;
  --accent-2: #1ea293;
  --accent-grad: linear-gradient(180deg, #25c3b0 0%, #169a8b 100%);
  --accent-hover: #3dd0be;
  --accent-soft: #0f2e2b;
  --accent-soft-2: #164440;
  --accent-text: #6fe0d1;
  --on-accent: #04201d;
  --danger: #f06a61;
  --danger-grad: linear-gradient(180deg, #f27a72 0%, #d9534b 100%);
  --danger-soft: #361a19;
  --warn: #eaa53f;
  --warn-soft: #33260f;
  --ok: #4ccb82;
  --ok-soft: #12301f;
  --info: #6aa0ff;
  --info-soft: #14233d;
  --ring: 0 0 0 3px rgba(34, 184, 166, .25);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  --shadow-btn: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 1px 2px rgba(0, 0, 0, .4), 0 6px 16px -6px rgba(34, 184, 166, .45);
  color-scheme: dark;
}

/* ------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft-2); }
:focus-visible { outline: none; box-shadow: var(--ring); }

.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 20px; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------- icons */
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i-sm svg.i, svg.i.i-sm { width: 15px; height: 15px; }
.i-lg svg.i, svg.i.i-lg { width: 22px; height: 22px; }

/* ----------------------------------------------------------- buttons */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap; user-select: none;
  box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .06s, filter .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-grad); border-color: transparent; color: var(--on-accent); box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--accent-grad); filter: brightness(1.06); border-color: transparent; }
.btn-danger { background: var(--danger-grad); border-color: transparent; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 4px 12px -4px rgba(208, 69, 61, .5); }
.btn-danger:hover { background: var(--danger-grad); filter: brightness(1.06); border-color: transparent; }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); box-shadow: none; }
.btn-soft:hover { background: var(--accent-soft-2); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13.5px; gap: 6px; border-radius: 8px; }
.btn-sm svg.i { width: 16px; height: 16px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--text-2) transparent var(--text-2) transparent; animation: spin .7s linear infinite;
}
.btn-primary.loading::after, .btn-danger.loading::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent;
  color: var(--text-2); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 7px; }
.icon-btn.sm svg.i { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn.bordered { border-color: var(--border); background: var(--surface); }

/* ------------------------------------------------------------ inputs */
.field { display: grid; gap: 6px; }
.field > .label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .help { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s; box-shadow: var(--shadow-xs);
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8894' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-strong)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input-sm, .select.input-sm { height: 34px; font-size: 14px; }
.input-icon { position: relative; display: block; }
.input-icon > svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 38px; }
.input-icon > .input-suffix { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.form-error { color: var(--danger); font-size: 13.5px; display: flex; gap: 6px; align-items: flex-start; }
.form-error svg.i { width: 16px; height: 16px; margin-top: 2px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }

/* toggle switch: <label class="switch"><input type="checkbox"><span class="track"></span></label> */
.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { width: 100%; height: 100%; border-radius: 99px; background: var(--border-strong); transition: background .2s; position: relative; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.switch input:disabled + .track { opacity: .5; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 30px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* ------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 650; }
.card-head .sub { font-size: 13px; color: var(--muted); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; margin-bottom: 14px; }
.card-title > svg.i { color: var(--accent); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

.stat-card { padding: 18px 20px; display: grid; gap: 4px; position: relative; overflow: hidden; }
.stat-card .label { font-size: 13px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card .label svg.i { width: 15px; height: 15px; }
.stat-card .value { font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-card .foot { font-size: 12.5px; color: var(--muted); }
.stat-card.accent .value { color: var(--accent-text); }
.stat-card .glyph { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }

/* progress */
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent-grad); border-radius: 99px; transition: width .35s cubic-bezier(.2,.8,.2,1); }
.bar.lg { height: 9px; }
.bar.warn > span { background: var(--warn); }
.bar.danger > span { background: var(--danger); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge svg.i { width: 12px; height: 12px; }
.badge-neutral { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; }
.notice svg.i { margin-top: 2px; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-info { background: var(--info-soft); color: var(--info); }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.notice-danger { background: var(--danger-soft); color: var(--danger); }
.notice-accent { background: var(--accent-soft); color: var(--accent-text); }

kbd { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-2); color: var(--text-2); }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th, .table td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); letter-spacing: .02em; position: sticky; top: 0; z-index: 1; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; }
.table td.actions { text-align: right; width: 1%; }
.table .row-actions { display: inline-flex; gap: 2px; }
.table.compact th, .table.compact td { padding: 8px 14px; }

/* ------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 13px 12px 12px; border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { font-family: var(--mono); font-size: 11.5px; background: var(--surface-3); padding: 0 7px; border-radius: 99px; color: var(--text-2); font-weight: 500; line-height: 19px; }

/* ------------------------------------------------------ empty/skeleton */
.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty-state .glyph { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 4px; }
.empty-state .glyph svg.i { width: 24px; height: 24px; }
.empty-state h4 { color: var(--text); font-size: 15.5px; font-weight: 600; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: sk 1.3s infinite linear; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* -------------------------------------------------------------- brand */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16.5px; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-grad); color: var(--on-accent); box-shadow: var(--shadow-btn); flex: none; }
.brand-mark svg.i { width: 18px; height: 18px; stroke-width: 2.1; }
.brand .brand-sub { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

/* -------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h); padding: 0 20px; background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

/* user menu / dropdown */
.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; display: grid; gap: 1px; animation: pop .14s;
}
.menu-panel .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--text); text-align: left; width: 100%; }
.menu-item:hover { background: var(--surface-3); }
.menu-item svg.i { width: 16px; height: 16px; color: var(--muted); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg.i { color: var(--danger); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 13px; flex: none; text-transform: uppercase; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }

/* --------------------------------------------------------------- auth */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 28px 28px; box-shadow: var(--shadow-lg); display: grid; gap: 18px; }
.auth-card .brand { justify-content: center; font-size: 19px; }
.auth-card .auth-title { text-align: center; display: grid; gap: 4px; }
.auth-card .auth-title h1 { font-size: 21px; font-weight: 700; }
.auth-card .auth-title p { color: var(--muted); font-size: 14px; }
.auth-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-foot { text-align: center; font-size: 14px; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* -------------------------------------------------------------- modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6, 12, 16, .52); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .15s; }
.modal { width: 100%; max-width: 500px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2,.8,.2,1); }
.modal.lg { max-width: 760px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head .m-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.modal-head .m-icon.danger { background: var(--danger-soft); color: var(--danger); }
.modal-head h3 { font-size: 16.5px; font-weight: 700; flex: 1; }
.modal-body { padding: 20px; display: grid; gap: 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }

/* ------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 300; width: min(400px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 14px; animation: toast-in .22s cubic-bezier(.2,.8,.2,1); }
.toast .t-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.toast .t-icon svg.i { width: 15px; height: 15px; }
.toast.ok .t-icon { background: var(--ok-soft); color: var(--ok); }
.toast.err .t-icon { background: var(--danger-soft); color: var(--danger); }
.toast.warn .t-icon { background: var(--warn-soft); color: var(--warn); }
.toast .t-body { flex: 1; padding-top: 2px; min-width: 0; }
.toast .t-title { font-weight: 600; }
.toast .t-msg { color: var(--text-2); font-size: 13.5px; }
.toast .t-action { border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 7px; cursor: pointer; font-weight: 600; padding: 3px 10px; font-size: 13px; color: var(--text); align-self: center; }
.toast .t-action:hover { border-color: var(--accent); color: var(--accent-text); }
.toast.out { animation: toast-out .18s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* ------------------------------------------------------------- misc */
.banner { display: flex; align-items: center; gap: 10px; padding: 9px 20px; font-size: 14px; background: var(--info-soft); color: var(--info); border-bottom: 1px solid var(--border); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner .spacer { flex: 1; }
.page-loader { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 500; }
.page-loader .spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--accent-soft-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }

@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .card-pad { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .stat-card { padding: 14px 16px; }
  .stat-card .value { font-size: 22px; }
  .toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
