/* KeyLedger — light design system */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f2f4f7;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --accent: #2f6fed;
  --accent-hover: #255fd6;
  --accent-soft: #eef4ff;
  --accent-ink: #1d4ed8;
  --ring: 0 0 0 4px rgba(47, 111, 237, 0.16);
  --good-bg: #ecfdf3; --good-fg: #067647; --good: #17b26a;
  --warn-bg: #fffaeb; --warn-fg: #b54708; --warn: #f79009;
  --serious-bg: #fef3ee; --serious-fg: #c4320a; --serious: #ef6820;
  --crit-bg: #fef3f2; --crit-fg: #b42318; --crit: #f04438;
  --info-bg: #eff8ff; --info-fg: #175cd3; --info: #2e90fa;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --grid: #eaecf0;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
  --radius: 12px;
  --sidebar: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 32px; margin: 0; font-weight: 650; letter-spacing: -0.02em; }
h2 { font-size: 15px; line-height: 22px; margin: 0; font-weight: 600; }
h3 { font-size: 13px; margin: 0 0 8px; color: var(--ink-2); font-weight: 600; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.i { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--surface) var(--sidebar), var(--bg) var(--sidebar)); }
@media (max-width: 860px) { .shell { background: var(--bg); } }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 30;
  width: var(--sidebar); min-width: 0; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #2f6fed 55%, #1d4ed8); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), var(--shadow-xs);
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav { padding: 4px 12px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 16px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 550; margin-bottom: 2px; position: relative;
}
.nav a svg.i { color: var(--faint); }
.nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.nav a:hover svg.i { color: var(--muted); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.active svg.i { color: var(--accent); }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 0 8px; line-height: 20px; background: var(--crit-bg); color: var(--crit-fg); }
.nav .count.neutral { background: var(--surface-3); color: var(--ink-2); }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sync-card { min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.sync-card .grow { flex: 1; min-width: 0; }
.sync-card .t { font-size: 12.5px; font-weight: 600; }
.sync-card .s { font-size: 12px; color: var(--muted); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 4px 4px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 650; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid #d1e0ff; flex: none; }
.user-row .grow { flex: 1; min-width: 0; }
.user-row .e { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .r { font-size: 12px; color: var(--muted); text-transform: capitalize; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); min-width: 0; flex: 1; }
.crumbs a { color: var(--muted); font-weight: 500; }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.crumbs .sep svg.i { width: 14px; height: 14px; color: var(--faint); }
.crumbs .cur { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--crit); border: 2px solid #fff; }
.topbar .menu-btn { display: none; }
.content { padding: 28px; max-width: 1320px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.g-tiles { grid-template-columns: repeat(auto-fit, minmax(min(172px, 100%), 1fr)); }
.g-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-2e { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mt { margin-top: 20px; }
.scrim { display: none; }

@media (max-width: 1100px) { .g-2, .g-2e { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 25; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px; }
  .topbar .hide-sm { display: none; }
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.tile { padding: 18px 20px; }
.tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tile .label { color: var(--muted); font-size: 13px; font-weight: 550; }
.tile .chip { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--border); }
.tile .chip.blue { background: var(--accent-soft); color: var(--accent); border-color: #d1e0ff; }
.tile .chip.green { background: var(--good-bg); color: var(--good-fg); border-color: #abefc6; }
.tile .chip.amber { background: var(--warn-bg); color: var(--warn-fg); border-color: #fedf89; }
.tile .chip.red { background: var(--crit-bg); color: var(--crit-fg); border-color: #fecdca; }
.tile .value { font-size: 28px; line-height: 36px; font-weight: 650; letter-spacing: -0.02em; }
.tile .value .unit { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.tile .foot { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.delta.up { background: var(--crit-bg); color: var(--crit-fg); }
.delta.down { background: var(--good-bg); color: var(--good-fg); }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-size: 13.5px; font-weight: 600; height: 38px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; text-decoration: none !important;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-xs);
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 2px rgba(16,24,40,.08);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { color: var(--crit-fg); border-color: #fecdca; }
.btn-danger:hover { background: var(--crit-bg); color: var(--crit-fg); }
.btn-success { color: var(--good-fg); border-color: #abefc6; background: var(--good-bg); }
.btn-success:hover { background: #dcfae6; color: var(--good-fg); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-icon.btn-xs { width: 28px; }
.btn-block { width: 100%; height: 44px; font-size: 14.5px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; box-shadow: none; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.on { background: var(--surface-3); color: var(--ink); }
.btn-group { box-shadow: var(--shadow-xs); border-radius: 8px; }

/* ---------- forms ---------- */
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 0 12px; height: 40px; width: 100%; min-width: 0; box-shadow: var(--shadow-xs);
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: #84adff; box-shadow: var(--ring); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
label { display: block; font-size: 13px; font-weight: 550; color: var(--ink-2); }
label > input, label > select, label > textarea { display: block; margin-top: 6px; }
label > .input-icon, label > .otp { margin-top: 6px; }
label .hint { font-weight: 400; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.span-all { grid-column: 1 / -1; }
.form-section { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 18px; }
.form-section-head { margin-bottom: 12px; }
.form-section-head h3 { margin: 0; font-size: 14px; color: var(--ink); }
.form-section-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 550; cursor: pointer; }
.check input { width: 16px; height: 16px; box-shadow: none; accent-color: var(--accent); }
.switch { position: relative; display: inline-flex !important; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.input-icon { position: relative; }
.input-icon svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.input-icon input { padding-left: 36px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13.5px; }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--surface-2); }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main .t { font-weight: 600; color: var(--ink); }
.cell-main .s { font-size: 12.5px; color: var(--muted); }

/* ---------- provider avatar ---------- */
.pv { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); letter-spacing: -.02em; }
.pv.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 17px; }

/* ---------- badges & status ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 550; padding: 1px 8px; line-height: 20px; border-radius: 999px; border: 1px solid var(--border); color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.badge.live { color: var(--good-fg); background: var(--good-bg); border-color: #abefc6; }
.badge.derived { color: var(--info-fg); background: var(--info-bg); border-color: #b2ddff; }
.badge.manual { color: var(--ink-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 8px; line-height: 20px; border-radius: 999px; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--good-bg); color: var(--good-fg); }
.pill.warning { background: var(--warn-bg); color: var(--warn-fg); }
.pill.serious { background: var(--serious-bg); color: var(--serious-fg); }
.pill.critical { background: var(--crit-bg); color: var(--crit-fg); }
.pill.info { background: var(--info-bg); color: var(--info-fg); }
.pill.paused { background: var(--surface-3); color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; line-height: 20px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); margin: 2px 4px 2px 0; border: 1px solid var(--border); }

/* ---------- meter ---------- */
.meter { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; min-width: 70px; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter.warning > span { background: var(--warn); }
.meter.critical > span { background: var(--crit); }

/* ---------- lists ---------- */
.list-item { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-start; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1 1 150px; min-width: 0; }
.list-item .title { font-weight: 600; color: var(--ink); }
.list-item .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.list-item .body { font-size: 13px; color: var(--ink-2); margin-top: 4px; white-space: pre-wrap; }
.list-item .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ico.info { background: var(--info-bg); color: var(--info-fg); }
.ico.warning { background: var(--warn-bg); color: var(--warn-fg); }
.ico.serious { background: var(--serious-bg); color: var(--serious-fg); }
.ico.critical { background: var(--crit-bg); color: var(--crit-fg); }
.ico.ok { background: var(--good-bg); color: var(--good-fg); }
.list-item.unread { background: linear-gradient(90deg, rgba(47,111,237,.05), transparent 40%); }
.list-item.unread .title::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: 2px; }
.list-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.empty { color: var(--muted); padding: 40px 20px; text-align: center; }
.empty .ico-lg { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); }
.empty h2 { color: var(--ink); margin-bottom: 4px; }
.empty p { margin: 0 auto 16px; max-width: 420px; }
.empty.sm { padding: 24px 16px; font-size: 13px; }

/* ---------- charts ---------- */
.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 220px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 170px) 1fr auto; gap: 12px; align-items: center; font-size: 13px; padding: 7px 0; }
.hbar .track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: 999px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }

/* ---------- modal ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 48px -12px rgba(16,24,40,.25); }
dialog.sm { width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 18px; line-height: 28px; }
.modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.callout { border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.55; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.callout svg.i { margin-top: 1px; }
.callout.info { background: var(--info-bg); border-color: #b2ddff; color: #1849a9; }
.callout.warn { background: var(--warn-bg); border-color: #fedf89; color: #93370d; }
.callout.ok { background: var(--good-bg); border-color: #abefc6; color: #085d3a; }
.callout.err { background: var(--crit-bg); border-color: #fecdca; color: #912018; }
.cap-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.provider-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.provider-opt { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); font-weight: 600; font-size: 13px; transition: border-color .12s, box-shadow .12s; }
.provider-opt:hover { border-color: var(--border-strong); }
.provider-opt.on { border-color: var(--accent); box-shadow: var(--ring); }
.provider-opt .pv { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 10px; z-index: 100; }
.toast { background: var(--surface); color: var(--ink); border: 1px solid var(--border); padding: 12px 14px; border-radius: 12px; font-size: 13.5px; max-width: 380px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: slidein .18s ease; }
.toast .ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.toast .ico svg.i { width: 14px; height: 14px; stroke-width: 2.4; }
.toast.ok .ico { background: var(--good-bg); color: var(--good-fg); }
.toast.err .ico { background: var(--crit-bg); color: var(--crit-fg); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { display: grid; place-items: center; padding: 80px; color: var(--muted); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; }
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; margin: 20px 0 10px; }
.detail-head { display: flex; align-items: center; gap: 16px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-side {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at -10% -20%, #5b8cff 0%, transparent 60%), linear-gradient(160deg, #1e3a8a 0%, #1d4ed8 45%, #2f6fed 100%);
}
.auth-side::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(180deg, rgba(0,0,0,.6), transparent 80%); pointer-events: none; }
.auth-side > * { position: relative; z-index: 1; }
.auth-side .brand { padding: 0; }
.auth-side .brand-mark { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.auth-side h1 { font-size: 34px; line-height: 42px; max-width: 460px; margin-bottom: 14px; }
.auth-side p.lead { font-size: 15px; color: rgba(255,255,255,.8); max-width: 440px; margin: 0; }
.auth-points { display: grid; gap: 14px; margin-top: 36px; max-width: 440px; }
.auth-points div { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: rgba(255,255,255,.92); }
.auth-points svg.i { background: rgba(255,255,255,.14); border-radius: 8px; padding: 6px; width: 30px; height: 30px; flex: none; }
.auth-preview { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 16px; max-width: 440px; backdrop-filter: blur(4px); }
.auth-preview .r { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.auth-preview .r:last-child { border: 0; }
.auth-preview .r b { font-variant-numeric: tabular-nums; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; line-height: 34px; font-weight: 650; letter-spacing: -.02em; }
.auth-card .sub { color: var(--muted); margin: 6px 0 28px; }
.auth-card form { display: grid; gap: 18px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.otp input { height: 56px; text-align: center; font-size: 22px; font-weight: 650; padding: 0; font-variant-numeric: tabular-nums; }
.auth-foot { margin-top: 28px; font-size: 12.5px; color: var(--faint); text-align: center; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; }
.linkish:disabled { color: var(--faint); cursor: default; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }
.check > input, .switch > input { margin-top: 0 !important; }
