/* ovpn-admin — "Night shift" theme.
   A denim-indigo header that flows into each page's hero, a fresh mint accent,
   a cool airy canvas and large soft cards that float over the hero's edge. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  /* header / hero */
  --navy: #121A4A;
  --navy-2: #1B2566;
  --navy-line: rgba(255, 255, 255, .12);
  --on-navy: #EEF1FF;
  --on-navy-2: #A9B1E0;
  /* accent */
  --mint: #2FE0B8;
  --mint-strong: #12B892;
  --mint-ink: #08251F;
  --mint-soft: #DDF8F0;
  /* canvas */
  --bg: #F4F6FB;
  --paper: #FFFFFF;
  --line: #E4E8F1;
  --line-strong: #D2D8E6;
  --ink: #0F1733;
  --ink-2: #48516F;
  --ink-3: #7D85A1;
  --hover: #F2F5FA;
  /* status */
  --ok: #0F8F69;
  --ok-soft: #DCF5EC;
  --warn: #A86A09;
  --warn-soft: #FDF0D6;
  --bad: #D2384A;
  --bad-soft: #FCE5E8;
  --focus: #4C6FFF;
  /* avatar tints */
  --t1: #DDF8F0; --t1i: #0C7D63;
  --t2: #E2E9FF; --t2i: #3150C8;
  --t3: #FDEBD7; --t3i: #A2550E;
  --t4: #F1E4FD; --t4i: #7B3EC0;
  --t5: #FDE3EA; --t5i: #B4314F;
  --t6: #DFF2FB; --t6i: #1A6E93;
  /* shape */
  --r-card: 22px;
  --r-ctl: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 51, .04), 0 10px 30px rgba(15, 23, 51, .06);
  --shadow-pop: 0 24px 60px rgba(15, 23, 51, .22), 0 2px 6px rgba(15, 23, 51, .08);
  --max: 1240px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --navy: #0A0F2E;
  --navy-2: #121A48;
  --bg: #0D1230;
  --paper: #151C40;
  --line: #242D5A;
  --line-strong: #323C70;
  --ink: #EDF0FF;
  --ink-2: #B9C0E0;
  --ink-3: #8A93BC;
  --hover: #1C2450;
  --mint-soft: #133A35;
  --ok: #4FD8A8; --ok-soft: #133A31;
  --warn: #F2BE5C; --warn-soft: #3A2E14;
  --bad: #FF7B8A; --bad-soft: #3E1B27;
  --focus: #8EA4FF;
  --t1: #133A35; --t1i: #5BE6C4;
  --t2: #1F2A63; --t2i: #9CB0FF;
  --t3: #3A2A16; --t3i: #F2B36D;
  --t4: #2E2152; --t4i: #C9A2FF;
  --t5: #3E1B2B; --t5i: #FF94AE;
  --t6: #14334A; --t6i: #7DCDF0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px; line-height: 1.55; color: var(--ink); background: var(--bg);
  font-feature-settings: "kern", "liga";
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sprite { display: none; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.xs { width: 14px; height: 14px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.text-bad { color: var(--bad); }
.text-warn { color: var(--warn); }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 32px; }

/* ---------- navy header + hero ---------- */
.topbar { background: var(--navy); color: var(--on-navy); position: sticky; top: 0; z-index: 30; }
.topbar-inner { max-width: var(--max); margin: 0 auto; padding: 0 32px; height: 68px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none; position: relative;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 2px, transparent 2px 5px),
    linear-gradient(140deg, #3A4DB8, #1C2672);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.brand-mark::after {   /* the mint "stitch" */
  content: ""; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 0 3px var(--navy);
}
.brand-mark.big { width: 52px; height: 52px; border-radius: 16px; }
.brand-mark.big::after { width: 16px; height: 16px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-org { font-weight: 700; font-stretch: 115%; font-size: 16px; }
.brand-sub { color: var(--on-navy-2); font-size: 12px; }

.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 999px;
  text-decoration: none; color: var(--on-navy-2); font-weight: 550; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.nav a:hover { color: var(--on-navy); background: rgba(255,255,255,.07); }
.nav a.is-active { color: var(--navy); background: var(--mint); font-weight: 650; }
[data-theme="dark"] .nav a.is-active { color: var(--mint-ink); }

.topbar-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.live-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid var(--navy-line); color: var(--on-navy);
  text-decoration: none; font-size: 13px; font-weight: 600;
}
.live-count { color: var(--mint); font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #8A93BC; flex: none; position: relative; }
.dot.on { background: var(--mint); }
.dot.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--mint); opacity: 0; animation: ping 2.2s ease-out infinite; }
.dot.off { background: #FF7B8A; }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: transparent; color: var(--on-navy-2); cursor: pointer; list-style: none;
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: var(--on-navy); }
.icon-btn::-webkit-details-marker, .avatar-btn::-webkit-details-marker { display: none; }
.content .icon-btn, .menu .icon-btn { color: var(--ink-3); }
.content .icon-btn:hover { background: var(--hover); color: var(--ink); }
[data-theme="dark"] .theme-dark, :root:not([data-theme="dark"]) .theme-light { display: none; }
.avatar-btn { list-style: none; cursor: pointer; border-radius: 50%; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--mint); color: var(--navy); font-weight: 700; font-size: 13px; font-stretch: 112%;
}

.hero {
  color: var(--on-navy); padding: 30px 0 88px;
  background:
    radial-gradient(900px 300px at 85% -40%, rgba(47, 224, 184, .22), transparent 70%),
    radial-gradient(700px 260px at 10% 120%, rgba(76, 111, 255, .28), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.022) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
}
.content { flex: 1; margin-top: -56px; position: relative; z-index: 2; padding-bottom: 40px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.hello { margin: 0 0 6px; color: var(--mint); font-weight: 600; }
.page-title { margin: 0; font-size: 32px; line-height: 1.1; font-weight: 680; font-stretch: 118%; letter-spacing: -.012em; }
.page-sub { margin: 8px 0 0; color: var(--on-navy-2); max-width: 70ch; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-actions form { margin: 0; }
.crumb { display: inline-block; color: var(--on-navy-2); text-decoration: none; font-size: 13px; margin-bottom: 8px; }
.crumb:hover { color: var(--mint); }
.hero .btn-quiet { background: rgba(255,255,255,.08); border-color: var(--navy-line); color: var(--on-navy); }
.hero .btn-quiet:hover { background: rgba(255,255,255,.14); }

/* live block on the dashboard hero */
.live { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.5fr); gap: 40px; margin-top: 34px; align-items: end; }
.live-number { font-size: 112px; line-height: .86; font-weight: 720; font-stretch: 125%; letter-spacing: -.04em; font-variant-numeric: tabular-nums lining-nums; }
.live-label { margin-top: 12px; font-size: 18px; color: var(--on-navy); }
.live-state { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--on-navy-2); font-size: 13.5px; }
.live-chart { margin: 0; min-width: 0; padding: 18px 20px 14px; border-radius: 20px; background: rgba(255,255,255,.05); border: 1px solid var(--navy-line); }
.live-chart figcaption { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--on-navy-2); margin-bottom: 6px; }
.rates { display: flex; gap: 16px; font-variant-numeric: tabular-nums; font-weight: 650; }
.rate-in { color: var(--mint); }
.rate-out { color: #AFC0FF; }
#chart { width: 100%; height: 140px; display: block; overflow: visible; }
#chart .grid line { stroke: rgba(255,255,255,.08); stroke-width: 1; vector-effect: non-scaling-stroke; }
#chart .line-in { fill: none; stroke: var(--mint); stroke-width: 2.25; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
#chart .line-out { fill: none; stroke: #AFC0FF; stroke-width: 1.75; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-dasharray: 5 4; }
#chart .area-in { stroke: none; }
.chart-note { margin: 6px 0 0; font-size: 12.5px; color: var(--on-navy-2); }
.dashboard-hero-spacer { height: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 650; font-size: 14px; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--mint); color: var(--navy); }
.btn-primary:hover { background: #5BEAC9; }
[data-theme="dark"] .btn-primary { color: var(--mint-ink); }
.btn-quiet { background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink-3); }
.btn-glass { background: rgba(255,255,255,.08); border-color: var(--navy-line); color: var(--on-navy); }
.btn-glass:hover { background: rgba(255,255,255,.15); }
.btn-danger { background: var(--bad); color: #fff; }
[data-theme="dark"] .btn-danger { color: #2A0A12; }
.btn-danger-quiet { background: var(--paper); border-color: var(--line-strong); color: var(--bad); }
.btn-danger-quiet:hover { background: var(--bad-soft); border-color: transparent; }
.hero .btn-danger-quiet { background: rgba(255,255,255,.08); border-color: var(--navy-line); color: #FFB3BD; }
.btn-sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .65; cursor: progress; }
.link { color: var(--mint-strong); text-decoration: none; font-weight: 650; font-size: 13.5px; }
[data-theme="dark"] .link { color: var(--mint); }
.link:hover { text-decoration: underline; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--mint-strong); font-weight: 650; cursor: pointer; text-decoration: none; font-size: 13.5px; }
[data-theme="dark"] .link-btn { color: var(--mint); }
.strong-link { font-weight: 650; text-decoration: none; }
.strong-link:hover { color: var(--mint-strong); text-decoration: underline; }

/* ---------- cards ---------- */
.sheet { background: var(--paper); border-radius: var(--r-card); padding: 24px 26px; margin-bottom: 24px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sheet-head h2, .setting h2, .steps h2 { margin: 0; font-size: 17px; font-weight: 680; font-stretch: 108%; }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.split .sheet { margin-bottom: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.kpi {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: var(--r-card);
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; min-width: 0;
}
a.kpi:hover { border-color: var(--line-strong); }
.kpi-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.kpi-icon .icon { width: 21px; height: 21px; }
.t-mint { background: var(--t1); color: var(--t1i); }
.t-blue { background: var(--t2); color: var(--t2i); }
.t-amber { background: var(--t3); color: var(--t3i); }
.t-violet { background: var(--t4); color: var(--t4i); }
.kpi-text { display: flex; flex-direction: column; min-width: 0; }
.kpi-value { font-size: 28px; line-height: 1.1; font-weight: 700; font-stretch: 118%; font-variant-numeric: tabular-nums; }
.kpi-value.small { font-size: 22px; }
.kpi-label { color: var(--ink-3); font-size: 13px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -26px -24px; position: relative; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: color-mix(in srgb, var(--bg) 60%, var(--paper)); }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 26px; }
.table th:last-child, .table td:last-child { padding-right: 26px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table .num { text-align: right; }
.table .num-l { white-space: nowrap; }
.table .sub, .sub { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.table tr.empty td { text-align: center; color: var(--ink-3); padding: 38px 16px; }
.table tr.is-dim td { color: var(--ink-3); }
.table tr.is-new td { animation: flash-row 2.4s ease-out; }
@keyframes flash-row { from { background: var(--mint-soft); } to { background: transparent; } }
.actions-col { text-align: right; white-space: nowrap; width: 1%; }
.actions-col > * { vertical-align: middle; }
.actions-col form { display: inline; margin: 0; }

.who { display: inline-flex; align-items: center; gap: 12px; }
.who strong { white-space: nowrap; font-weight: 620; }
.tile {
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 720; font-stretch: 115%; background: var(--t2); color: var(--t2i);
}
.tile.t1 { background: var(--t1); color: var(--t1i); } .tile.t2 { background: var(--t2); color: var(--t2i); }
.tile.t3 { background: var(--t3); color: var(--t3i); } .tile.t4 { background: var(--t4); color: var(--t4i); }
.tile.t5 { background: var(--t5); color: var(--t5i); } .tile.t6 { background: var(--t6); color: var(--t6i); }
.tile.is-online { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--mint); }
.online-tag { font-size: 12px; font-weight: 650; color: var(--ok); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 620; background: var(--hover); color: var(--ink-2); white-space: nowrap; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.act { display: inline-flex; align-items: center; gap: 5px; font-weight: 550; }
.act-bad { color: var(--bad); }

/* toolbar, filters */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.segmented { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--hover); border: 0; margin: 0; flex-wrap: wrap; }
.seg {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: 999px;
  border: 0; background: transparent; color: var(--ink-2); font-weight: 580; font-size: 13.5px; cursor: pointer;
}
.seg input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.seg .count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.seg.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 51, .12); }
.seg.is-on .count { color: var(--mint-strong); }
.seg:has(input:focus-visible) { outline: 2px solid var(--focus); }
.segmented.wide { margin-bottom: 20px; }
fieldset.segmented { min-width: 0; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 40px; width: 280px; height: 40px; border-radius: 999px; }
.search::after { content: "/"; position: absolute; right: 12px; font-size: 12px; color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 6px; line-height: 18px; pointer-events: none; }

/* menus */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 230px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 6px;
  box-shadow: var(--shadow-pop); text-align: left;
}
.menu-list form { display: block !important; margin: 0; }
.menu-list button, .menu-list a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; font-size: 13.5px; font-weight: 550; color: var(--ink); text-decoration: none;
}
.menu-list button:hover, .menu-list a:hover, .menu-list button:focus-visible, .menu-list a:focus-visible { background: var(--hover); outline: none; }
.menu-list .icon { color: var(--ink-3); }
.menu-list button.danger, .menu-list button.danger .icon { color: var(--bad); }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu-head { display: flex; flex-direction: column; padding: 8px 11px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head span { color: var(--ink-3); font-size: 12.5px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 620; color: var(--ink-2); min-width: 0; }
.field .opt { font-weight: 400; color: var(--ink-3); }
.label-row { display: flex; gap: 6px; align-items: baseline; }
.field .hint, .hint { font-weight: 400; font-size: 12.5px; color: var(--ink-3); margin: 0; }
input, select, textarea {
  width: 100%; min-width: 0; height: 44px; padding: 0 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--mint-strong); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint) 28%, transparent); }
.code-input { font-size: 24px; letter-spacing: .3em; font-weight: 650; font-variant-numeric: tabular-nums; height: 56px; text-align: center; }
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit span { position: absolute; right: 14px; color: var(--ink-3); font-weight: 400; pointer-events: none; }
.input-unit input { padding-right: 56px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 18px 0 0; }
.inline-form .field { flex: 1 1 240px; }
.inline-form .field:has(.code-input) { flex: 0 1 230px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 16px; }
.field.narrow { max-width: 190px; margin-top: 16px; }
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.more-line { margin: 14px 0 0; }

/* ---------- bulk ---------- */
.bulk-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; }
.bulk-grid > * { min-width: 0; }
.bulk-options { display: flex; flex-direction: column; gap: 18px; padding: 22px; border-radius: 18px; background: var(--hover); }
.preview { margin-top: 20px; padding: 16px 18px; border-radius: 16px; border: 1px dashed var(--line-strong); }
.preview-label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
.preview-names { font-weight: 650; word-break: break-word; }
.meter { display: block; width: 130px; height: 7px; border-radius: 7px; background: var(--hover); overflow: hidden; margin-bottom: 5px; }
.meter-fill { display: block; height: 100%; width: 0; background: var(--mint-strong); border-radius: 7px; }

/* ---------- stats, bars, key/values ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.stats > div { padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats > div:nth-child(2n) { border-right: 0; }
.stats > div:nth-last-child(-n+2) { border-bottom: 0; }
.stats dt { color: var(--ink-3); font-size: 13px; }
.stats dd { margin: 2px 0 0; font-size: 28px; font-weight: 700; font-stretch: 118%; font-variant-numeric: tabular-nums; }
.stats.wide { grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; background: var(--paper); box-shadow: var(--shadow); border-radius: var(--r-card); }
.stats.wide > div { border-bottom: 0; }
.stats.wide > div:nth-child(2n) { border-right: 1px solid var(--line); }
.stats.wide > div:last-child { border-right: 0; }
.bars { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.bar-row { display: grid; grid-template-columns: 80px 1fr 44px; gap: 12px; align-items: center; }
.bar-label { color: var(--ink-2); font-size: 13.5px; }
.bar-track { height: 10px; border-radius: 10px; background: var(--hover); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 10px; transition: width .6s ease-out; }
.b-ok { background: var(--mint-strong); } .b-warn { background: #F0B23C; } .b-bad { background: var(--bad); } .b-muted { background: var(--ink-3); }
.bar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: minmax(150px, max-content) 1fr; gap: 10px 22px; margin: 18px 0 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv.compact { margin-top: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.attention li:last-child { border-bottom: 0; }
.empty-state { display: flex; align-items: center; gap: 14px; padding: 8px 0; color: var(--ink-2); }
.empty-state p { margin: 0; }
.empty-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex: none; }

/* ---------- settings ---------- */
.setting { display: grid; grid-template-columns: 280px 1fr; gap: 36px; padding: 6px 0 30px; scroll-margin-top: 90px; }
.setting-intro { padding-top: 22px; }
.setting:first-of-type .setting-intro { padding-top: 76px; }
.setting-intro p { color: var(--ink-3); margin: 8px 0 0; font-size: 13.5px; }
.setting-body { margin-bottom: 0; }
.status-line { display: flex; align-items: center; gap: 14px; }
.status-line strong { font-size: 15.5px; }
.status-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--hover); color: var(--ink-3); flex: none; }
.status-icon.ok { background: var(--ok-soft); color: var(--ok); }
.status-icon.warn { background: var(--warn-soft); color: var(--warn); }

/* 2FA */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 5px 0 28px 56px; }
.steps > li:last-child { padding-bottom: 4px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--mint); color: var(--navy); font-weight: 750; font-size: 15px;
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 17.5px; top: 44px; bottom: 6px; width: 1px; background: var(--line-strong); }
.qr-row { display: flex; gap: 30px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.qr { width: 204px; height: 204px; padding: 12px; background: #fff; border-radius: 20px; border: 1px solid var(--line); flex: none; box-shadow: var(--shadow); }
.qr svg { width: 100%; height: 100%; display: block; }
.qr svg path { fill: #0F1733; }
.secret { font-size: 18px; font-weight: 650; letter-spacing: .08em; margin: 6px 0 12px; word-break: break-all; font-variant-numeric: tabular-nums; }
.codes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 210px)); gap: 10px 24px; }
.codes li { font-size: 18px; font-weight: 650; letter-spacing: .06em; padding: 10px 12px; background: var(--hover); border-radius: 12px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- notices, toasts, dialogs ---------- */
.notice { padding: 13px 18px; border-radius: 16px; background: var(--warn-soft); color: var(--warn); margin: 0 0 18px; font-size: 13.5px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice-error { background: var(--bad-soft); color: var(--bad); }
.content > .notice:first-child { box-shadow: var(--shadow); }
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(440px, calc(100vw - 44px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: 16px;
  background: var(--navy); color: var(--on-navy); box-shadow: var(--shadow-pop); font-size: 14px;
  border: 1px solid var(--navy-line); animation: toast-in .25s ease-out;
}
.toast > .icon { margin-top: 1px; color: var(--mint); }
.toast-error > .icon { color: #FF8B99; }
.toast span { flex: 1; }
.toast-close { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 2px; }
.toast-close:hover { opacity: 1; }
.toast.is-leaving { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

.dialog { border: 0; padding: 0; border-radius: 24px; width: min(480px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pop); }
.dialog::backdrop { background: rgba(10, 15, 46, .55); backdrop-filter: blur(3px); }
.dialog[open] { animation: dialog-in .2s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 28px; margin: 0; }
.dialog-title { margin: 0; font-size: 20px; font-weight: 680; font-stretch: 110%; line-height: 1.25; }
.dialog-text { margin: -6px 0 0; color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- footer ---------- */
.site-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 26px; color: var(--ink-3); font-size: 12.5px; border-top: 1px solid var(--line); }
.site-foot span:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint-strong); margin-right: 8px; vertical-align: 1px; }

/* ---------- sign-in ---------- */
body.auth { background: var(--navy); }
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 40px 20px;
  color: var(--on-navy);
  background:
    radial-gradient(800px 420px at 85% 0%, rgba(47, 224, 184, .2), transparent 70%),
    radial-gradient(760px 420px at 0% 100%, rgba(76, 111, 255, .3), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.022) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, var(--navy), var(--navy-2));
}
.auth-wrap.single { color: var(--ink); }
.auth-brand { display: flex; align-items: center; gap: 16px; }
.auth-org { display: block; font-size: 30px; line-height: 1; font-weight: 720; font-stretch: 125%; letter-spacing: -.02em; }
.auth-tag { display: block; margin-top: 4px; font-size: 14px; color: var(--on-navy-2); }
.auth-panel { width: min(420px, 100%); background: var(--paper); color: var(--ink); border-radius: 26px; padding: 34px; box-shadow: var(--shadow-pop); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .muted { margin: -8px 0 4px; }
.auth-title { margin: 0; font-size: 26px; font-weight: 700; font-stretch: 116%; }
.auth-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--mint-soft); color: var(--mint-strong); }
.auth-icon .icon { width: 22px; height: 22px; }
.auth-form .link-btn { align-self: center; }
.auth-foot { margin: 0; color: var(--on-navy-2); font-size: 12.5px; }
.auth-foot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); margin-right: 8px; vertical-align: 1px; }
.error-sheet { max-width: 580px; padding: 38px; }
.error-code { margin: 0 0 6px; font-size: 64px; line-height: 1; font-weight: 720; font-stretch: 125%; color: var(--mint-strong); }
.error-sheet .page-title { color: var(--ink); }
.error-sheet .btn { margin-top: 12px; }


/* ---------- connection limits ---------- */
.choices { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.choices legend { font-size: 13.5px; font-weight: 620; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.choice {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--paper); transition: border-color .15s, background-color .15s;
}
.choice:hover { border-color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--mint-strong); background: color-mix(in srgb, var(--mint-soft) 55%, var(--paper)); }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice > input[type=radio] {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; min-width: 20px; margin: 1px 0 0; padding: 0;
  border-radius: 50%; border: 2px solid var(--line-strong); background: var(--paper); display: grid; place-items: center;
}
.choice > input[type=radio]::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--mint-strong); transform: scale(0); transition: transform .15s; }
.choice > input[type=radio]:checked { border-color: var(--mint-strong); }
.choice > input[type=radio]:checked::after { transform: scale(1); }
.choice-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.choice-body strong { font-weight: 650; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.choice-body > span { color: var(--ink-3); font-size: 13px; }
.choice-body .limit-row { margin-top: 8px; color: var(--ink-2); }
.tag { font-size: 11.5px; font-weight: 650; padding: 1px 9px; border-radius: 999px; background: var(--mint-soft); color: var(--ok); }

.limit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.limit-unit { color: var(--ink-2); font-weight: 450; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); padding: 3px; }
.stepper input { width: 56px; height: 34px; border: 0; padding: 0; text-align: center; font-size: 16px; font-weight: 700; background: transparent; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { box-shadow: none; }
.stepper:focus-within { border-color: var(--mint-strong); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint) 28%, transparent); }
.step-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--hover); color: var(--ink); }
.step-btn:hover { background: var(--mint-soft); color: var(--ok); }
.stepper.is-off { opacity: .45; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background-color .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,51,.25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--mint-strong); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.limit-form { gap: 20px; }
.setting-body .limit-form { margin-top: 22px; }
.form-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.setting-note { color: var(--ink-2); margin: 16px 0 18px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 22px 0 14px; }
.danger-link { color: var(--bad) !important; }
.dialog-wide { width: min(560px, calc(100vw - 32px)); }

/* the Connections cell on the Clients page */
.conn {
  display: inline-grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; align-items: center;
  padding: 6px 10px; margin: -6px -10px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left;
}
.conn:hover { background: var(--hover); }
.pips { display: inline-flex; gap: 4px; align-items: center; }
.pips i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); display: block; }
.pips i.on { background: var(--mint-strong); }
.pips i.over { background: var(--bad); }
.pips b { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.conn-inf { width: 20px; height: 20px; color: var(--mint-strong); }
.conn-text { font-weight: 620; font-variant-numeric: tabular-nums; }
.conn-src { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }
.conn-src.is-custom { color: var(--ok); font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .live { grid-template-columns: 1fr; gap: 24px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .bulk-grid { grid-template-columns: 1fr; }
  .setting { grid-template-columns: 1fr; gap: 14px; }
  .setting-intro, .setting:first-of-type .setting-intro { padding-top: 0; }
  .setting:first-of-type { padding-top: 70px; }
}
@media (max-width: 860px) {
  .container { padding: 0 16px; }
  .topbar-inner { height: auto; padding: 10px 16px 0; flex-wrap: wrap; gap: 10px 14px; }
  .nav { order: 3; flex: 1 1 100%; width: 100%; padding-bottom: 10px; }
  .topbar-tools { margin-left: auto; }
  .live-chip #pill-state { display: none; }
  .hero { padding: 22px 0 76px; }
  .page-title { font-size: 26px; }
  .page-actions { width: 100%; }
  .live-number { font-size: 84px; }
  .split, .row-2, .row-3 { grid-template-columns: 1fr; }
  .kpis { gap: 12px; }
  .kpi { padding: 16px; gap: 12px; }
  .kpi-value { font-size: 22px; }
  .sheet { padding: 18px; border-radius: 18px; }
  .table-wrap { margin: 0 -18px -18px; }
  .table th:first-child, .table td:first-child { padding-left: 18px; }
  .table th:last-child, .table td:last-child { padding-right: 18px; }
  .toolbar .segmented { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .stats.wide { grid-template-columns: repeat(2, 1fr); }
  .auth-panel { padding: 26px; }
}
@media (max-width: 520px) {
  .kpi { flex-direction: column; align-items: flex-start; gap: 10px; }
  .kpi-icon { width: 38px; height: 38px; border-radius: 12px; }
  .live-chart { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
