/* ─────────────────────────────────────────────────────────────────────────
   Callivex Portal — light fintech theme, deep emerald accent.
   Tokens aligned with callivex.com/css/styles.css :root.
   Layout language (sidebar/cards/spacing/typography) follows Vuestic Admin;
   colors stay ours.
   ───────────────────────────────────────────────────────────────────────── */

/* Self-hosted IBM Plex (font-src 'self'): Sans is a variable font covering
   400-700; Mono carries phone numbers, prices and rate columns. */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('fonts/plex-sans-var.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/plex-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/plex-mono-500.woff2') format('woff2'); }

:root {
  /* Surfaces — light, warm */
  --bg:            #fafaf6;
  --bg-lift:       #ffffff;
  --bg-elev:       #ffffff;
  --bg-card:       #ffffff;
  --bg-card-inner: #f3f3ed;
  --bg-hover:      rgba(15, 23, 42, 0.04);
  --bg-row:        rgba(15, 23, 42, 0.02);

  --hair:          rgba(15, 23, 42, 0.06);
  --hair-strong:   rgba(15, 23, 42, 0.13);

  --text:          #0c1119;
  --text-soft:     #1c2533;
  --text-mute:     #3c4654;
  --text-dim:      #6e7785;
  --text-faint:    #9aa3b0;

  /* Emerald accent — Callivex signature */
  --acc:           #016c42;
  --acc-hi:        #04935a;
  --acc-deep:      #014e2f;
  --acc-soft:      rgba(1, 108, 66, 0.07);
  --acc-ring:      rgba(1, 108, 66, 0.30);
  --acc-line:      rgba(1, 108, 66, 0.28);
  --acc-glow:      rgba(1, 108, 66, 0.18);

  --ok:            #016c42;
  --warn:          #b87a14;
  --err:           #c0382b;

  --ease-out:      cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer:   cubic-bezier(0.32, 0.72, 0, 1);

  --r-xs:          4px;
  --r-sm:          8px;
  --r:             12px;
  --r-lg:          18px;
  --r-xl:          24px;
  --r-2xl:         32px;

  /* Layered shadows — depth without heaviness */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 28px -16px rgba(15, 23, 42, 0.18), 0 4px 12px -6px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 28px 56px -28px rgba(15, 23, 42, 0.20), 0 12px 24px -12px rgba(15, 23, 42, 0.08);
  --shadow-em: 0 8px 28px -10px rgba(1, 108, 66, 0.30);

  /* legacy token bridge (keep existing templates happy) */
  --color-bg:            var(--bg);
  --color-bg-elev:       var(--bg-lift);
  --color-bg-card:       var(--bg-card);
  --color-bg-row:        var(--bg-row);
  --color-border:        var(--hair);
  --color-border-strong: var(--hair-strong);
  --color-text:          var(--text);
  --color-text-muted:    var(--text-soft);
  --color-text-dim:      var(--text-mute);
  --color-accent:        var(--acc);
  --color-accent-hover:  var(--acc-hi);
  --color-accent-soft:   var(--acc-soft);
  --color-success:       var(--ok);
  --color-warn:          var(--warn);
  --color-err:           var(--err);

  /* IBM Plex — Sans variable 400-700, Mono for numerics */
  --f-sans:  'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display: var(--f-sans);
  --font-mono:    var(--f-mono);

  --sidebar-w: 280px;
  /* Vuestic rhythm: tight, consistent 16-28px spacing (was 40-44px). */
  --content-pad-x: 28px;
  --content-pad-y: 24px;
  --stack-gap: 18px;
}

@supports (font-variation-settings: normal) {
  :root { --f-sans: 'IBM Plex Sans', system-ui, sans-serif; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  font-family: var(--f-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
  position: relative;
  min-height: 100dvh;
}
/* Subtle dot grid + warm wash — matches callivex.com */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.04) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.7), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.7), transparent 70%);
}
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 50% 30% at 18% -8%, rgba(1, 108, 66, 0.08), transparent 60%),
    radial-gradient(ellipse 35% 22% at 92% -2%, rgba(30, 95, 255, 0.04), transparent 65%);
}
body > * { position: relative; z-index: 1; }

a { color: var(--acc); text-decoration: none; transition: color 180ms var(--ease-out); }
a:hover { color: var(--acc-hi); }
a.muted { color: var(--text-mute); }
a.muted:hover { color: var(--text); }

code { font-family: var(--f-mono); font-size: 0.92em; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.small { font-size: 12.5px; color: var(--text-mute); }
.muted { color: var(--text-mute); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.018em; line-height: 1.2; color: var(--text); text-wrap: balance; }

::selection { background: var(--acc); color: var(--bg); }
*:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.003em;
  cursor: pointer;
  border: 1px solid var(--hair);
  background: rgba(15, 23, 42, 0.03);
  color: var(--text);
  transition: transform 160ms var(--ease-out), background 180ms var(--ease-out), border-color 180ms var(--ease-out);
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover { background: rgba(15, 23, 42, 0.06); border-color: var(--hair-strong); color: var(--text); }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--acc);
  /* White-on-emerald — high contrast on light surfaces. */
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--shadow-em);
}
.btn-primary:hover { background: var(--acc-deep); color: #ffffff; border-color: transparent; transform: translateY(-1px); }
.btn-secondary { /* alias */ }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-mute); }
.btn-ghost:hover { color: var(--text); background: rgba(15, 23, 42, 0.04); }
.btn-danger { color: var(--err); border-color: rgba(192, 56, 43, 0.3); }
.btn-danger:hover { background: rgba(192, 56, 43, 0.08); color: var(--err); }
.btn-block { width: 100%; justify-content: center; padding: 12px 20px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Brand mark — matches IZO's .mark__dot: small amber dot with a soft ring. */
/* brand-mark intentionally hidden — the brand wordmark carries enough
   identity on its own and the green dot read as a generic AI-template
   tell. Kept as a no-op rule so the existing markup doesn't have to
   change everywhere it's emitted. */
.brand-mark { display: none; }

/* ─── Auth ─── */
.auth-body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
}
.auth-body::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(1, 108, 66, 0.08), transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(1, 108, 66, 0.04), transparent 55%);
}
.auth-shell { width: 100%; max-width: 420px; padding: 32px 20px; position: relative; z-index: 1; }
.auth-card {
  padding: 6px;
  border-radius: var(--r-xl);
  background: rgba(15, 23, 42, 0.025);
  border: 1px solid var(--hair);
}
.auth-card > .auth-inner {
  background: var(--bg-card-inner);
  border-radius: calc(var(--r-xl) - 6px);
  padding: 36px 32px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.04);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-brand-name { font-weight: 500; font-size: 16px; letter-spacing: -0.02em; }
.auth-title { font-size: 26px; margin-bottom: 8px; letter-spacing: -0.03em; font-weight: 500; }
.auth-sub { color: var(--text-mute); font-size: 14px; margin: 0 0 28px; }
.auth-form label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--text-mute); font-weight: 500; }
.auth-form input {
  display: block; width: 100%;
  margin-top: 8px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 14px;
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.auth-form input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.auth-form .btn { margin-top: 10px; }
.auth-foot {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 12.5px;
  flex-wrap: wrap;
  gap: 10px;
}
.auth-foot a { color: var(--text-mute); }
.auth-demo {
  padding: 3px 8px;
  background: var(--acc-soft);
  border: 1px solid var(--acc-ring);
  border-radius: 4px;
  color: var(--acc);
  font-weight: 500;
}

/* ─── Alerts ─── */
.alert {
  padding: 13px 18px;
  border-radius: var(--r);
  margin-bottom: 24px;
  font-size: 13.5px;
  border: 1px solid;
}
.alert-err,
.alert-error { background: rgba(192, 56, 43, 0.08); border-color: rgba(192, 56, 43, 0.3); color: #8c2519; }
.alert-ok { background: var(--acc-soft); border-color: var(--acc-ring); color: var(--acc-deep); }

/* ─── App shell ─── */
.app { background: var(--bg); }
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.app-main { display: flex; flex-direction: column; min-width: 0; }

/* ─── Sidebar ─── */
.sidebar {
  background: var(--bg-lift);
  border-right: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  padding: 24px 14px 18px;
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 2px 10px 26px;
  color: var(--text);
}
.sidebar-logo { max-width: 152px; height: auto; display: block; }
.sidebar-brand .role-chip,
.sidebar-brand .brand-badge {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-mute);
  font-weight: 400;
  margin-left: auto;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  transition: color 180ms var(--ease-out), background 180ms var(--ease-out);
  border: 1px solid transparent;
}
.sidebar-nav a:hover { color: var(--text); background: rgba(15, 23, 42, 0.05); }
.sidebar-nav a.active {
  color: var(--acc);
  background: var(--acc-soft);
}
.sidebar-nav a svg { opacity: 0.75; flex-shrink: 0; width: 20px; height: 20px; }
.sidebar-nav a.active svg { opacity: 1; }
.sidebar-nav .nav-sub {
  padding: 18px 12px 8px;
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 500;
}
.sidebar-footer {
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid var(--hair);
}
.sidebar-ext {
  font-size: 12.5px;
  color: var(--text-mute);
  background: transparent;
  border: none;
  padding: 4px 0;
  cursor: pointer;
}
.sidebar-ext:hover { color: var(--acc); }

/* ─── Topbar ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--content-pad-x) 22px;
  border-bottom: 1px solid var(--hair);
  background: rgba(250, 250, 246, 0.85);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 24px;
}
.topbar-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--text);
}
.topbar-user { display: flex; align-items: center; gap: 20px; }
.user-balance { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; gap: 3px; }
.user-balance-label { font-size: 11px; color: var(--text-mute); font-weight: 500; }
.user-balance-val {
  font-family: var(--f-mono);
  font-weight: 500;
  color: var(--ok);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.user-balance-val.low { color: var(--err); }

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  border-left: 1px solid var(--hair);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--acc), var(--acc-deep));
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px var(--acc-ring),
    var(--shadow-xs);
}
.user-info { line-height: 1.3; }
.user-name { font-weight: 500; font-size: 13.5px; color: var(--text); }
.user-email { color: var(--text-mute); font-size: 12px; }
.user-logout button {
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--text-mute);
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color 180ms var(--ease-out), border-color 180ms var(--ease-out), background 180ms var(--ease-out);
}
.user-logout button:hover { color: var(--err); border-color: rgba(192, 56, 43, 0.35); background: rgba(192, 56, 43, 0.06); }

/* ─── Content — generous padding + stack rhythm ─── */
.app-content {
  padding: var(--content-pad-y) var(--content-pad-x) 80px;
  max-width: 1460px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}
.app-content > section + section,
.app-content > .panel + .panel,
.app-content > .panel + section,
.app-content > section + .panel,
.app-content > div + div { /* no extra margin — gap handles it */ }
.app-content > * { margin: 0; }

/* Danger zone: irreversible actions, fenced off + red (Smashing pattern). */
.danger-zone { border: 1px solid rgba(192,56,43,0.35); border-radius: var(--r-lg); padding: 18px 22px; background: rgba(192,56,43,0.035); }
.danger-zone > h2 { color: var(--err); font-size: 15px; margin: 0 0 4px; }
.danger-zone .dz-note { color: var(--text-mute); font-size: 13px; margin: 0 0 12px; max-width: 70ch; }
.danger-zone .dz-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.danger-zone .btn-danger { background: var(--err); color: #fff; border-color: transparent; }
.danger-zone .btn-danger:hover { background: #a32e23; color: #fff; }

/* Progressive disclosure (native <details>, CSP-safe, no JS). */
details.adv { border-top: 1px solid var(--hair); }
details.adv > summary { cursor: pointer; font-weight: 600; padding: 12px 0 12px; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--text); }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: '▸'; color: var(--text-dim); font-size: 12px; transition: transform 160ms var(--ease-out); }
details.adv[open] > summary::before { content: '▾'; }
details.adv > summary .adv-hint { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--text-dim); }
details.adv > .adv-body { padding: 4px 0 14px; }

/* Page content motion (Vuestic-style route transition): gentle fade + rise. */
@keyframes appFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.app-content { animation: appFadeUp 300ms var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) { .app-content { animation: none; } }

/* ─── Page header — strong hierarchy so users know where they are ─── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 18px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.page-header .ph-left { flex: 1; min-width: 0; }
.page-header .eyebrow {
  display: inline-block;
  font-size: 12px;
  color: var(--acc);
  font-weight: 500;
  margin-bottom: 12px;
}
.page-header h1, .page-header .ph-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text);
  margin: 0;
}
.page-header .ph-sub {
  color: var(--text-mute);
  font-size: 14px;
  margin-top: 8px;
  max-width: 64ch;
}
.page-header .ph-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── Section head — to group content under a label within a page ─── */
.section-head,
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2,
.block-head h2 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
}
.section-head .section-sub,
.block-head .sub {
  color: var(--text-mute);
  font-size: 13px;
  margin-top: 4px;
}
.section-head .eyebrow,
.block-head .eyebrow {
  display: inline-block;
  font-size: 12px;
  color: var(--acc);
  font-weight: 500;
}

/* ─── Card / stat grid — real gaps, not 1px seams ─── */
.stat-grid,
.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.stat-grid-3,
.grid-cards-3 { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .stat-grid, .grid-cards, .stat-grid-3, .grid-cards-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .stat-grid, .grid-cards, .stat-grid-3, .grid-cards-3 { grid-template-columns: 1fr; } }

.stat-card,
.card {
  background: var(--bg-card);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 24px 26px 22px;
  transition: border-color 200ms var(--ease-out), background 200ms var(--ease-out);
  display: flex;
  flex-direction: column;
}
.stat-card:hover,
.card:hover { border-color: var(--hair-strong); background: var(--bg-card-inner); }

.stat-label,
.card-label {
  font-size: 12.5px;
  color: var(--text-mute);
  font-weight: 500;
  margin-bottom: 14px;
}
.stat-value,
.card-value {
  font-family: var(--f-sans);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-value.low,
.card-value.low { color: var(--err); }
.stat-value.ok,
.card-value.ok { color: var(--ok); }
.stat-sub,
.card-sub {
  display: block;
  margin-top: 10px;
  color: var(--text-mute);
  font-size: 12.5px;
  font-family: var(--f-mono);
  letter-spacing: 0.02em;
}
.stat-action {
  display: inline-flex;
  margin-top: 14px;
  color: var(--acc);
  font-size: 12.5px;
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
  align-items: center;
  gap: 4px;
}
.stat-action::after { content: '→'; transition: transform 180ms var(--ease-out); }
.stat-action:hover::after { transform: translateX(2px); }

/* ─── Grid of 2 — bigger gap ─── */
.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ─── Panels — real padding + clear surface ─── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.panel-flush { padding: 0; }
.panel-narrow { max-width: 560px; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.panel-flush .panel-head {
  padding: 22px 26px 18px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--hair);
}
.panel-head h2,
.panel-head h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text);
}
.panel-sub { color: var(--text-mute); font-size: 13px; }
.panel-link {
  color: var(--acc);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--f-mono);
  letter-spacing: 0.02em;
}

/* ─── Chart ─── */
.chart { display: flex; gap: 4px; height: 190px; align-items: flex-end; padding: 14px 0 10px; }
.chart-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.chart-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--acc) 0%, rgba(1, 108, 66, 0.30) 100%);
  border-radius: 3px 3px 0 0;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  transform-origin: bottom;
  min-height: 2px;
  box-shadow: 0 -2px 8px -2px rgba(1, 108, 66, 0.20);
}
.chart-bar:hover .chart-fill { opacity: 0.8; transform: scaleY(1.02); }
.chart-label {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 10px;
  letter-spacing: 0.04em;
}

/* Top destinations */
.topdest { display: flex; flex-direction: column; gap: 14px; }
.topdest-row { display: grid; grid-template-columns: 92px 1fr 100px 54px; gap: 14px; align-items: center; font-size: 13.5px; }
.topdest-country { font-weight: 500; color: var(--text); }
.topdest-bar { height: 5px; background: var(--hair); border-radius: 3px; overflow: hidden; }
.topdest-fill { height: 100%; background: var(--acc); border-radius: 3px; }
.topdest-val { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; color: var(--acc); }
.topdest-calls { text-align: right; color: var(--text-mute); font-family: var(--f-mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ─── Tables — more breathing room ─── */
.tbl,
.table,
table.tbl,
table.table {
  width: 100%;
  border-collapse: collapse;
}
.tbl th, .tbl td,
.table th, .table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--hair);
  font-size: 13.5px;
}
.tbl th,
.table th {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--bg-lift);
  padding: 12px 16px;
  text-align: left;
}
.tbl tbody tr,
.table tbody tr { transition: background 160ms var(--ease-out); }
.tbl tbody tr:hover,
.table tbody tr:hover { background: var(--bg-hover); }
.tbl tbody tr:last-child td,
.table tbody tr:last-child td { border-bottom: none; }
.tbl .r, .table .r { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--f-mono); }
.tbl-dense th, .tbl-dense td { padding: 9px 14px; font-size: 12.5px; }

.panel-flush .tbl th:first-child, .panel-flush .tbl td:first-child,
.panel-flush .table th:first-child, .panel-flush .table td:first-child { padding-left: 26px; }
.panel-flush .tbl th:last-child,  .panel-flush .tbl td:last-child,
.panel-flush .table th:last-child,  .panel-flush .table td:last-child { padding-right: 26px; }

/* Key-value table */
.table-keyvalue td:first-child,
.tbl.table-keyvalue td:first-child {
  color: var(--text-mute);
  width: 200px;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
}
.table-keyvalue td,
.tbl.table-keyvalue td { padding: 12px 16px; font-size: 14px; }

/* ─── Pills flattened to plain coloured text per user preference.
   The .pill, .pill-* class names stay so existing templates keep working;
   only the chrome (background, border, rounded shape, uppercase, mono
   font, micro size) is stripped. Status colour stays so green/amber/red
   are still readable at a glance. */
.pill {
  display: inline;
  font-weight: 500;
  white-space: nowrap;
}
.pill-out        { color: var(--acc); }
.pill-in         { color: #1e5fff; }
.pill-active     { color: var(--ok); }
.pill-suspended  { color: var(--warn); }
.pill-closed     { color: var(--err); }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid;
  color: var(--text-mute);
  background: var(--bg-lift);
  border-color: var(--hair);
}
.badge-beta { background: rgba(184, 122, 20, 0.08); border-color: rgba(184, 122, 20, 0.3); color: var(--warn); }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--bg-lift);
  border: 1px solid var(--hair);
  color: var(--text-soft);
}
.tag-local     { background: var(--acc-soft); border-color: var(--acc-ring); color: var(--acc); }
.tag-mobile    { background: rgba(30, 95, 255, 0.07); border-color: rgba(30, 95, 255, 0.30); color: #1e5fff; }
.tag-tollfree  { background: rgba(184, 122, 20, 0.08); border-color: rgba(184, 122, 20, 0.3); color: var(--warn); }

.dispo {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500;
  border: 1px solid;
}
.dispo-ok    { background: var(--acc-soft); border-color: var(--acc-ring); color: var(--acc); }
.dispo-warn  { background: rgba(184, 122, 20, 0.08); border-color: rgba(184, 122, 20, 0.3); color: var(--warn); }
.dispo-err   { background: rgba(192, 56, 43, 0.08); border-color: rgba(192, 56, 43, 0.3); color: var(--err); }
.dispo-muted { background: var(--bg-lift); border-color: var(--hair); color: var(--text-mute); }

.empty,
.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13.5px;
  border: 1px dashed var(--hair);
  border-radius: var(--r-lg);
  background: rgba(15, 23, 42, 0.015);
}
.empty b,
.empty-state b {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

/* ─── Filters ─── */
.filters {
  background: var(--bg-card);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 18px 22px;
}
.filters-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filters label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px;
  color: var(--text-mute);
  font-weight: 500;
}
.filters input, .filters select {
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 9px 13px;
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 13.5px;
  min-width: 140px;
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.filters input:focus, .filters select:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }

.cdr-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: var(--acc-soft);
  border: 1px solid var(--acc-ring);
  border-radius: var(--r);
  font-size: 13px;
  color: var(--text-soft);
}
.cdr-summary strong { color: var(--text); font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.cdr-summary-right { margin-left: auto; }

.pagination { display: flex; justify-content: center; gap: 14px; align-items: center; padding: 24px 0; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--text-mute); }

/* ─── Balance ─── */
.balance-card { text-align: center; padding: 18px 0 8px; }
.balance-val {
  font-family: var(--f-sans);
  font-size: 3.4rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--ok);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.balance-val.low { color: var(--err); }
.balance-warn { color: var(--err); font-size: 13px; margin-top: 12px; font-family: var(--f-mono); }
.balance-stats {
  display: flex; justify-content: space-between;
  padding-top: 22px; margin-top: 26px;
  border-top: 1px solid var(--hair);
  font-size: 13px; color: var(--text-mute);
}
.balance-stats strong { color: var(--text); font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Topup */
.topup-form label { display: block; font-size: 13px; color: var(--text-mute); font-weight: 500; margin-bottom: 14px; }
.topup-form input {
  display: block; width: 100%; margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--f-mono);
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: border-color 180ms var(--ease-out);
}
.topup-form input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.topup-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.topup-amount {
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  color: var(--text-soft);
  font-family: var(--f-mono);
  font-size: 13px;
  cursor: pointer;
  transition: color 180ms var(--ease-out), border-color 180ms var(--ease-out), background 180ms var(--ease-out);
}
.topup-amount:hover { border-color: var(--acc); color: var(--acc); background: var(--acc-soft); }
.topup-note { margin-top: 18px; font-size: 12.5px; color: var(--text-mute); line-height: 1.6; }
.topup-note code { background: var(--bg-lift); padding: 2px 7px; border: 1px solid var(--hair); border-radius: 3px; }

/* ─── Profile / prof-row — wider labels, more space ─── */
.profile { display: flex; flex-direction: column; }
.prof-row {
  display: grid; grid-template-columns: 220px 1fr;
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
  align-items: center;
  gap: 16px;
}
.prof-row:last-child { border-bottom: none; }
.prof-row span {
  color: var(--text-mute);
  font-size: 13px;
  font-weight: 500;
}
.prof-row strong { font-weight: 500; font-size: 14.5px; color: var(--text); }

/* Password form */
.pw-form label { display: block; margin-bottom: 18px; font-size: 13px; color: var(--text-mute); font-weight: 500; }
.pw-form input {
  display: block; width: 100%; margin-top: 10px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 14px;
}
.pw-form input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.pw-form .btn { margin-top: 4px; }

/* ─── Credentials ─── */
.creds { display: flex; flex-direction: column; }
.cred-row {
  display: grid; grid-template-columns: 200px 1fr auto;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
  align-items: center;
}
.cred-row:last-child { border-bottom: none; }
.cred-row span:first-child {
  font-size: 13px;
  color: var(--text-mute);
  font-weight: 500;
}
.cred-row code {
  background: var(--bg);
  border: 1px solid var(--hair);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--acc);
  font-variant-numeric: tabular-nums;
}
.cred-row code.redacted { filter: blur(5px); cursor: pointer; user-select: none; transition: filter 200ms var(--ease-out); }
.cred-row code.redacted.revealed { filter: none; user-select: text; }
.cred-hint { font-size: 12px; color: var(--text-dim); }

/* Role/scope label — plain text, no pill. */
.brand-badge {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-mute);
}

/* ─── Stacked forms (.form). Vertical labels with field + helper stacked.
   Was using browser defaults — <small> rendered inline, mashing the help
   into the input. Force everything inside a label to display: block. */
.form label {
  display: block;
  margin-bottom: 18px;
}
.form label > span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.form label > input,
.form label > select,
.form label > textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  box-sizing: border-box;
  transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.form label > input:focus,
.form label > select:focus,
.form label > textarea:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
}
.form label > small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-mute);
}
.form fieldset { margin: 8px 0 18px; }
.form fieldset label:last-child { margin-bottom: 0; }
.form .check-inline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: var(--text);
}
.form .check-inline input[type=radio],
.form .check-inline input[type=checkbox] { margin-top: 3px; flex-shrink: 0; width: auto; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* Inline forms */
.form-inline {
  display: grid;
  grid-template-columns: 2fr 1.5fr .8fr .8fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 24px;
}
.form-inline label { display: flex; flex-direction: column; gap: 6px; }
.form-inline label > span { font-size: 12.5px; color: var(--text-mute); font-weight: 500; }
.form-inline input, .form-inline select {
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  padding: 9px 13px;
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 13.5px;
}
.form-inline input:focus, .form-inline select:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }

.form-inline-compact { display: inline-flex; gap: 6px; align-items: center; }
.form-inline-compact select,
.form-inline-compact input { padding: 5px 11px; font-size: 12.5px; background: var(--bg); border: 1px solid var(--hair); border-radius: var(--r-sm); color: var(--text); font-family: inherit; }
.form-inline-compact .btn { padding: 4px 12px; font-size: 12.5px; }

/* ─── Chips + code blocks ─── */
.chip-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chip {
  padding: 5px 11px;
  background: var(--bg-lift);
  border: 1px solid var(--hair);
  border-radius: 6px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-soft);
}
.code-block {
  background: #0c1119;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  padding: 16px 18px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  overflow-x: auto;
  white-space: pre;
  color: #e2e8f0;
  line-height: 1.7;
}
.code-block .k { color: #5eead4; }
.code-block .s { color: #fbbf77; }
.code-block .c { color: #6b7280; }

details summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--text-mute);
  font-size: 13px;
  font-weight: 500;
  transition: color 160ms var(--ease-out);
}
details summary:hover { color: var(--acc); }
.spend-breakdown { margin-bottom: 14px; }

/* ─── Accessibility ─── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 50ms !important; }
}

/* ─── Mobile ─── */
@media (max-width: 900px) {
  :root { --content-pad-x: 20px; --content-pad-y: 24px; --stack-gap: 28px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 30;
    border-right: none; border-bottom: 1px solid var(--hair);
    flex-direction: row; overflow-x: auto;
    padding: 10px; gap: 4px;
    background: var(--bg-lift);
  }
  .sidebar-brand { display: none; }
  .sidebar-nav { flex-direction: row; }
  .sidebar-nav a { padding: 7px 11px; font-size: 12.5px; white-space: nowrap; }
  .sidebar-footer { display: none; }
  .topbar { padding: 14px 20px; gap: 12px; }
  .topbar-title { font-size: 17px; }
  .user-balance { display: none; }
  .user-info { display: none; }
}

/* Skip-to-content link — hidden until focused by keyboard */
.skip-link {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--acc);
  color: #ffffff;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  transform: translateY(-200%);
  transition: transform 180ms var(--ease-out);
  z-index: 100;
  box-shadow: var(--shadow-em);
}
.skip-link:focus { transform: translateY(0); outline: none; }

/* ─── Form: collapsible advanced section ─── */
.form-advanced {
  margin-top: 4px;
  border-top: 1px solid var(--hair);
  padding-top: 18px;
}
.form-advanced > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-mute);
  list-style: none;
  padding: 6px 0;
  user-select: none;
}
.form-advanced > summary::-webkit-details-marker { display: none; }
.form-advanced > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  color: var(--acc);
  transition: transform 180ms var(--ease-out);
}
.form-advanced[open] > summary::before { transform: rotate(90deg); }
.form-advanced > summary:hover { color: var(--text); }
.form-advanced > label { margin-top: 14px; }
.form-note {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-mute);
}

/* ─── kv-grid (label/value pairs in panels, e.g. trunk bundle) ─── */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px 24px;
  margin-top: 8px;
}
.kv-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bg-row);
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
}
.kv-grid .k {
  font-size: 11.5px;
  color: var(--text-mute);
  font-weight: 500;
}
.kv-grid .v {
  color: var(--text);
  font-size: 14px;
  word-break: break-all;
}

/* ─── page-header right-side actions slot ─── */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.page-header .ph-right { flex-shrink: 0; }

/* ─── pill-warn flattened (was amber "shown once" badge). ─── */
.pill-warn { color: var(--acc); }

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Mobile / tap-target hardening (added 2026-05-03)
   ───────────────────────────────────────────────────────────────────────── */

/* Wrap any wide table in a horizontally-scrollable container instead of
   overflowing the viewport on phones. Tables now opt in via .table-wrap. */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
  border-radius: var(--r);
}
.table-wrap > table { min-width: 720px; }

/* All sidebar nav rows hit at least 44px tall — meets WCAG / iOS HIG tap
   target minimums. */
.sidebar-nav a,
.sidebar-nav button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Sidebar footer / log-out tap target. */
.sidebar-footer .sidebar-ext,
.sidebar-footer button,
.sidebar-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Buttons in lists / table rows respect the tap minimum. */
.btn { min-height: 36px; }
@media (max-width: 720px) {
  .btn { min-height: 44px; padding-left: 14px; padding-right: 14px; }
  .form-inline { grid-template-columns: 1fr; gap: 14px; }
  .form-inline label { width: 100%; }
  .grid-2 { grid-template-columns: 1fr !important; }
  :root { --content-pad-x: 18px; --content-pad-y: 22px; }
}

/* Balance hero (live) */
.balance-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px 32px;
  margin: 0 0 28px;
  background: linear-gradient(135deg, var(--bg-elev, #fff) 0%, var(--bg, #fafafa) 100%);
  border: 1px solid var(--hair, #e4e4e7);
  border-radius: var(--r-lg, 14px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 6px 18px rgba(0,0,0,0.03);
}
.balance-hero .bh-label { font-size: 12.5px; color: var(--text-mute, #71717a); font-weight: 500; margin-bottom: 6px; }
.balance-hero .bh-value { font-size: 44px; line-height: 1.05; font-weight: 600; color: var(--text, #18181b); font-variant-numeric: tabular-nums; }
.balance-hero .bh-value.low { color: #c0382b; }
.balance-hero .bh-sub { margin-top: 8px; font-size: 13px; color: var(--text-mute, #71717a); font-variant-numeric: tabular-nums; }
.balance-hero .bh-sub .dot { display: none; }
.balance-hero .bh-actions { display: flex; gap: 10px; align-items: center; }
.balance-hero .bh-actions .btn-primary { font-size: 14px; padding: 10px 20px; }
@media (max-width: 640px) {
  .balance-hero { grid-template-columns: 1fr; }
  .balance-hero .bh-value { font-size: 32px; }
}

/* Status cell — left-anchored colored bar, no pill chrome. Used inside
   table cells where rows represent services or runs with up/down state. */
.status-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--text-mute);
}
.status-cell::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  border-radius: 1.5px;
  background: var(--text-faint);
}
.status-cell.is-up   { color: var(--ok);  }
.status-cell.is-down { color: var(--err); }
.status-cell.is-up::before   { background: var(--ok);  }
.status-cell.is-down::before { background: var(--err); }

/* ─── Breadcrumbs — minimal text wayfinding on detail pages ─── */
.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  margin: 0 0 6px;
  line-height: 1;
}
.crumbs a { color: var(--text-mute); text-decoration: none; }
.crumbs a:hover { color: var(--acc); }
.crumbs .sep { color: var(--text-faint); }
.crumbs .cur { color: var(--text-soft); font-weight: 500; }

/* ─── Empty-state icon (subtle, monochrome) ─── */
.empty-state .es-icon,
.empty .es-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--text-faint);
}


/* ───────────────────────────────────────────────────────────────────────────
   Design tokens + utilities (2026 UI pass). Additive: formalises the type,
   spacing and motion scales the research called for, plus a few utility
   classes so detail panels stop carrying ad-hoc inline styles.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  /* Type scale — Major Third (1.25), the most common web UI ratio */
  --fs-xs:  12px;
  --fs-sm:  13px;
  --fs-base:15px;
  --fs-md:  17px;
  --fs-lg:  19px;
  --fs-xl:  24px;
  --fs-2xl: 30px;

  /* Spacing scale — 8px base with a 4px detail step */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* Motion durations to pair with the existing easing tokens */
  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 300ms;
}

/* Paste-ready config / code surface (e.g. the SIP trunk sip.conf block). */
.code-block {
  background: #0e1320;
  color: #e6edf3;
  padding: var(--sp-3);
  border-radius: var(--r-sm);
  overflow: auto;
  white-space: pre;
  margin: 0;
  font-family: var(--f-mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
  box-shadow: var(--shadow-xs);
}

/* Standard inner padding for panels whose body is not a flush table. */
.panel-body { padding: 0 var(--sp-4) var(--sp-4); }

/* Responsive two-column detail layout (single column under 980px). */
.cols-2 { display: grid; grid-template-columns: 1fr; gap: var(--sp-6); align-items: start; }
.cols-2 > .col { display: flex; flex-direction: column; gap: var(--stack-gap, var(--sp-6)); min-width: 0; }
.cols-2 > .col > .panel { margin: 0; }
@media (min-width: 980px) { .cols-2 { grid-template-columns: 1fr 1fr; } }

/* Inline flash auto-dismiss helper keyframe (used opt-in via .alert--auto). */
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.alert { animation: flash-in var(--dur-3) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .alert { animation: none; } }

/* Sidebar nav group labels (sentence-case, low-key — not an uppercase eyebrow). */
.sidebar-nav .nav-group { margin: var(--sp-5) 0 var(--sp-1); padding: 0 var(--sp-3); font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); }
.sidebar-nav .nav-group:first-of-type { margin-top: var(--sp-2); }
.nav-badge { margin-left: auto; background: var(--err); color: #fff; border-radius: 10px; padding: 0 .5em; font-size: var(--fs-xs); font-weight: 600; }

/* Read-only impersonation banner (admin "view as"). */
.imp-banner { position: sticky; top: 0; z-index: 60; background: var(--warn); color: #fff; text-align: center; padding: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em; }
.imp-banner a { color: #fff; text-decoration: underline; margin-left: var(--sp-3); }

/* Content pane organization (2026 content-area pass): cap readable width and
   centre it; let wide tables opt out with .full-bleed; cap prose line length;
   normalise panel body padding to 24px. */
:root { --content-max: 1280px; --prose-max: 62ch; }
.app-content { max-width: var(--content-max); margin-left: auto; margin-right: auto; }
.app-content .full-bleed { max-width: none; margin-left: 0; margin-right: 0; }
.ph-sub { max-width: var(--prose-max); }
.panel-body { padding: 0 var(--sp-6) var(--sp-6); }

/* ── Floating-card visual polish (2026) ──────────────────────────────────────
   Adds soft elevation, status dots and a KPI summary strip. Status dots reuse
   the existing .pill-* status classes, so they appear wherever status already
   renders — no template changes needed. Respects the flat-pill preference
   (a dot + word, never a chip). */
.card, .panel { box-shadow: var(--shadow-sm); transition: box-shadow 180ms var(--ease-out), border-color 200ms var(--ease-out), background 200ms var(--ease-out); }
.card:hover, .stat-card:hover { box-shadow: var(--shadow-md); }

.pill-active::before, .pill-suspended::before, .pill-closed::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; margin-right: 7px; vertical-align: middle; position: relative; top: -1px;
}

.cell-sub { display: block; color: var(--text-faint); font-size: var(--fs-xs); margin-top: 2px; font-family: var(--f-sans); }

.kpi-strip { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-6); }
.kpi { flex: 1 1 160px; background: var(--bg-card); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: var(--sp-4) var(--sp-5); }
.kpi .k-label { font-size: var(--fs-xs); color: var(--text-mute); font-weight: 500; }
.kpi .k-value { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; margin-top: var(--sp-1); line-height: 1.1; }
.kpi .k-value.accent { color: var(--acc); }

/* Wider content cap so data tables breathe (full-bleed can not escape the capped container, so widen it instead). */
:root { --content-max: 1440px; }

/* ─── Dashboard: Vuestic-inspired metric cards + content grid (our palette) ─── */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .metric-grid { grid-template-columns: 1fr; } }

.metric-card {
  background: var(--bg-card); border: 1px solid var(--hair); border-radius: var(--r-lg);
  padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out), transform 160ms var(--ease-out);
}
.metric-card:hover { border-color: var(--hair-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.metric-card .metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.metric-card .metric-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-card .metric-label { margin-top: 10px; color: var(--text-mute); font-size: 13.5px; }
.metric-card .metric-delta { margin-top: 4px; font-size: 12px; color: var(--text-dim); }
.metric-card .metric-delta .up { color: var(--ok); font-weight: 600; }
.metric-card .metric-delta .down { color: var(--err); font-weight: 600; }

.metric-badge {
  width: 40px; height: 40px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; background: rgba(15,23,42,0.05); color: var(--text-mute);
}
.metric-badge svg { width: 20px; height: 20px; }
.metric-badge--accent { background: var(--acc-soft); color: var(--acc); }
.metric-badge--warn   { background: rgba(184,122,20,0.12); color: var(--warn); }
.metric-badge--err    { background: rgba(192,56,43,0.10); color: var(--err); }

/* Asymmetric content rows (Vuestic 70/30 etc.), wrap to stacked on narrow. */
.dash-rows { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.dash-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; }
.dash-row > * { min-width: 0; }
.dash-w70 { flex: 1 1 0; } .dash-w30 { flex: 0 0 340px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) { .dash-row { flex-direction: column; } .dash-w30 { flex: 1 1 auto; } }

/* Service status rows + key/value rows inside a card. */
.svc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.svc-row:last-child { border-bottom: 0; }
.svc-name { font-weight: 500; }
.svc-note { color: var(--text-dim); font-size: 12px; }
.svc-state .svc-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.svc-state.up .svc-dot { background: var(--ok); } .svc-state.up { color: var(--ok); }
.svc-state.down .svc-dot { background: var(--err); } .svc-state.down { color: var(--err); font-weight: 600; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.kv-row:last-child { border-bottom: 0; } .kv-row .kv-v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Lightweight CSS bar chart (no chart lib). */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 14px 4px 0; }
.bars .bar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; height: 100%; }
.bars .bar-wrap { width: 100%; max-width: 42px; flex: 1; display: flex; align-items: flex-end; }
.bars .bar { width: 100%; background: var(--acc-soft); border: 1px solid var(--acc-line); border-bottom: 0; border-radius: 7px 7px 0 0; min-height: 3px; transition: background 160ms var(--ease-out); }
.bars .bar-col:hover .bar { background: var(--acc); }
.bars .bar-lbl { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.bars .bar-val { font-size: 11px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
/* Top-list (destinations) inside a side card. */
.toplist .tl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.toplist .tl-row:last-child { border-bottom: 0; }
.toplist .tl-name { font-weight: 500; } .toplist .tl-sub { color: var(--text-dim); font-size: 12px; }
.toplist .tl-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.toplist .tl-bar { height: 6px; border-radius: 4px; background: var(--acc-soft); margin-top: 6px; overflow: hidden; }
.toplist .tl-bar > span { display: block; height: 100%; background: var(--acc); border-radius: 4px; }

/* chart.js canvas containers (canvas needs a sized relative parent). */
.chart-box { position: relative; height: 300px; padding: 8px 4px 0; }
.chart-box-sm { position: relative; height: 150px; }
.spark-box { position: relative; height: 56px; margin-top: 8px; }
.donut-wrap { position: relative; height: 170px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center .dc-val { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); line-height: 1; }
.donut-center .dc-lbl { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---- Split-screen login ---- */
.login-split { display: flex; min-height: 100vh; }
.login-hero {
  flex: 1.1;
  background: linear-gradient(160deg, #f3f9f5 0%, #e3f0e9 100%);
  color: #0f3a2c; display: flex; align-items: center; justify-content: center; padding: 48px;
  border-right: 1px solid #e2ece6;
}
.login-hero-inner { max-width: 420px; text-align: center; }
.login-logo-img { max-width: 300px; max-height: 130px; height: auto; }
.login-logo-fallback .brand-mark-lg {
  display: inline-block; width: 68px; height: 68px; border-radius: 16px;
  background: #04935a; box-shadow: 0 12px 34px -10px rgba(0,0,0,.4);
}
.login-hero-name { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 18px; }
.login-hero-tag { color: #016c42; font-size: 15px; font-weight: 500; margin-top: 20px; line-height: 1.6; }
.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px; background: #fff; }
.login-form-wrap { width: 100%; max-width: 340px; }
.login-form-head { margin-bottom: 22px; }
.login-form-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; color: var(--text); }
@media (max-width: 780px) {
  .login-split { flex-direction: column; }
  .login-hero { flex: none; min-height: 210px; padding: 36px; }
  .login-panel { flex: none; padding: 34px 24px 48px; }
}

/* ── SVG quality charts (ASR/ACD) ───────────────────────────────── */
.qchart { width: 100%; height: auto; display: block; }
.qchart text { font-family: inherit; }
.qch-tick { font-size: 10px; fill: var(--text-dim); }
.qch-endlab { font-size: 11px; font-weight: 600; fill: var(--text-soft); }
.ch-tip {
  position: absolute; z-index: 90; pointer-events: none; max-width: 280px;
  background: var(--bg-elev); border: 1px solid var(--hair-strong);
  border-radius: var(--r-sm); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 6px 10px; font-size: 12px; color: var(--text-soft);
}

/* ── layout utilities (referenced by templates) ─────────────────── */
.flex { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-row { display: flex; gap: 12px; }
.form-row > label { flex: 1; }

/* ─────────────────────────────────────────────────────────────────────────
   Astryx pass (2026-07) — status warn variant + native field validation.
   Additive only; no existing rules changed.
   ───────────────────────────────────────────────────────────────────────── */
.status-cell.is-warn { color: var(--warn); }
.status-cell.is-warn::before { background: var(--warn); }

/* Field-level feedback once the user has interacted with a field
   (:user-invalid stays quiet on pristine forms). Server-side errors
   keep the page-level .alert. */
.form input:user-invalid,
.form select:user-invalid,
.form textarea:user-invalid { border-color: var(--err); }
.form input:user-invalid:focus,
.form select:user-invalid:focus,
.form textarea:user-invalid:focus { outline: none; border-color: var(--err); box-shadow: 0 0 0 3px rgba(192, 56, 43, 0.12); }

/* Command palette hint — hidden until the island JS initialises (html.has-cmdk),
   so no-JS pages render exactly as before. */
.cmdk-hint { display: none; }
.has-cmdk .cmdk-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 2px 10px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r-sm);
  background: var(--bg-lift);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.has-cmdk .cmdk-hint:hover { border-color: var(--acc-ring); color: var(--text-soft); }
.cmdk-hint kbd {
  font-family: var(--mono, monospace);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--hair-strong);
  border-radius: 4px;
  background: var(--bg-card-inner);
}
/* No hardware keyboard worth advertising on small screens — and the topbar
   can't fit the button at phone widths without overflowing. */
@media (max-width: 720px) { .has-cmdk .cmdk-hint { display: none; } }

/* Quick action inside a stat-card sub line — match the sub line's metrics
   so the card height doesn't change. */
.stat-sub .panel-link { font-size: inherit; line-height: inherit; }

/* Announcement banner (admin-published, client-facing). Astryx banner rules:
   status wash as the full background, no left-border accent, persistent
   until dismissed. */
.notice-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r);
  margin-bottom: 16px;
  font-size: 14px;
}
.notice-info { background: var(--acc-soft); color: var(--text-soft); }
.notice-warn { background: rgba(184, 122, 20, 0.10); color: var(--text-soft); }
.notice-banner > span { flex: 1; }
.notice-x {
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--r-xs);
}
.notice-x:hover { color: var(--text); background: var(--bg-hover); }

/* When the live-calls console island is mounted, its own empty state replaces
   the server-rendered one. */
.panel:has(.lc-console) [data-livecalls-empty] { display: none; }

/* ─── Top-up page — pay form inside the balance hero ─── */
.topup-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.topup-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.topup-presets .btn[aria-pressed="true"] { border-color: var(--acc); color: var(--acc); background: var(--acc-soft); }
.topup-row { display: flex; gap: 10px; }
.topup-row input {
  width: 160px; padding: 9px 12px; font-size: 15px;
  background: var(--bg); border: 1px solid var(--hair); border-radius: var(--r-sm);
  color: var(--text); font-family: inherit; font-variant-numeric: tabular-nums;
}
.topup-row input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.topup-quote { min-height: 18px; font-size: 12.5px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.topup-note { font-size: 12.5px; color: var(--text-soft); max-width: 420px; text-align: right; }
@media (max-width: 640px) {
  .topup-form { align-items: stretch; }
  .topup-row { flex-direction: column; }
  .topup-row input { width: 100%; }
  .topup-note { text-align: left; }
}
