/* ─────────────────────────────────────────────────────────────────────────
   WISKY Portal — IZO IPTV theme port (amber on near-black, Inter)
   Tokens mirror izoiptvapp.com/styles.css :root.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* surfaces — match IZO's bg / surface / card / card-hi */
  --bg:            #050507;
  --bg-lift:       #0b0b10;
  --bg-elev:       #121220;
  --bg-card:       #121220;
  --bg-card-inner: #1a1a28;
  --bg-hover:      rgba(255, 255, 255, 0.04);
  --bg-row:        rgba(255, 255, 255, 0.02);

  --hair:          rgba(255, 255, 255, 0.05);
  --hair-strong:   rgba(255, 255, 255, 0.14);

  --text:          #ececf4;
  --text-soft:     #c7c7d2;
  --text-mute:     #9090a0;
  --text-dim:      #6a6a80;
  --text-faint:    #38384a;

  /* warm amber accent — the IZO signature */
  --acc:           #d4a76a;
  --acc-hi:        #e2b87a;
  --acc-deep:      #8a6a3c;
  --acc-soft:      rgba(212, 167, 106, 0.12);
  --acc-ring:      rgba(212, 167, 106, 0.30);
  --acc-line:      rgba(212, 167, 106, 0.28);
  --acc-glow:      rgba(212, 167, 106, 0.18);

  --ok:            #6fe39a;
  --warn:          #e9c46a;
  --err:           #f07167;

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

  --r-sm:          6px;
  --r:             10px;
  --r-lg:          18px;
  --r-xl:          22px;

  /* 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);

  /* Inter (matches IZO) — variable-font when supported, static otherwise */
  --f-sans:  'Inter var', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-mono:  ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --font-display: var(--f-sans);
  --font-mono:    var(--f-mono);

  --sidebar-w: 252px;
  --content-pad-x: 44px;
  --content-pad-y: 40px;
  --stack-gap: 40px;
}

@supports (font-variation-settings: normal) {
  :root { --f-sans: 'Inter var', 'Inter', 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;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  /* Same warm amber atmospheric glow as izoiptvapp.com hero. */
  background:
    radial-gradient(ellipse 60% 35% at 20% -5%, rgba(212, 167, 106, 0.06), transparent 55%),
    radial-gradient(ellipse 50% 25% at 90% 0%, rgba(212, 167, 106, 0.04), transparent 60%);
}
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: 500; 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: 999px;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.003em;
  cursor: pointer;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 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(255, 255, 255, 0.06); border-color: var(--hair-strong); color: var(--text); }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--acc);
  /* Dark-warm text on the amber pill, matching IZO's btn--primary contrast. */
  color: #17120a;
  border-color: transparent;
}
.btn-primary:hover { background: var(--acc-hi); color: #17120a; border-color: transparent; }
.btn-secondary { /* alias */ }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-mute); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.btn-danger { color: var(--err); border-color: rgba(240, 113, 103, 0.3); }
.btn-danger:hover { background: rgba(240, 113, 103, 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 {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--acc);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--acc-soft);
  position: relative;
}
.brand-mark::after { content: 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(212, 167, 106, 0.10), transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(212, 167, 106, 0.05), 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(255, 255, 255, 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(255, 255, 255, 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-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; 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-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  flex-wrap: wrap;
  gap: 10px;
  text-transform: uppercase;
}
.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(240, 113, 103, 0.08); border-color: rgba(240, 113, 103, 0.3); color: #f89a90; }
.alert-ok { background: rgba(111, 227, 154, 0.08); border-color: rgba(111, 227, 154, 0.3); color: var(--ok); }

/* ─── 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;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 28px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.sidebar-brand .role-chip,
.sidebar-brand .brand-badge {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  padding: 2px 7px;
  background: var(--acc-soft);
  border: 1px solid var(--acc-ring);
  border-radius: 999px;
  color: var(--acc);
  text-transform: uppercase;
  margin-left: auto;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r);
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 400;
  transition: color 180ms var(--ease-out), background 180ms var(--ease-out);
  border: 1px solid transparent;
}
.sidebar-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.sidebar-nav a.active {
  color: var(--acc);
  background: var(--acc-soft);
  border-color: var(--acc-ring);
}
.sidebar-nav a svg { opacity: 0.7; flex-shrink: 0; width: 16px; height: 16px; }
.sidebar-nav a.active svg { opacity: 1; }
.sidebar-nav .nav-sub {
  padding: 18px 12px 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.sidebar-footer {
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid var(--hair);
}
.sidebar-ext {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  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(10, 10, 11, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 24px;
}
.topbar-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.028em;
  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-family: var(--f-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-mute); }
.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: 500;
  font-size: 14px;
  color: var(--bg);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 0 0 1px rgba(52,243,200,0.12);
}
.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(240, 113, 103, 0.35); background: rgba(240, 113, 103, 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; }

/* ─── 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: 28px;
  border-bottom: 1px solid var(--hair);
  flex-wrap: wrap;
}
.page-header .ph-left { flex: 1; min-width: 0; }
.page-header .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 3px;
  border-radius: 999px;
  background: var(--acc-soft);
  border: 1px solid var(--acc-ring);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc);
  font-weight: 500;
  margin-bottom: 14px;
}
.page-header h1, .page-header .ph-title {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.032em;
  line-height: 1.1;
  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-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 2px;
  border-radius: 999px;
  background: var(--acc-soft);
  border: 1px solid var(--acc-ring);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  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 { 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-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  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: 28px 30px;
  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: 24px;
  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: 500;
  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(212, 167, 106, 0.22) 100%);
  border-radius: 3px 3px 0 0;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  transform-origin: bottom;
  min-height: 2px;
}
.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-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 500;
  background: var(--bg-lift);
  padding: 12px 16px;
}
.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-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 12px 16px;
}
.table-keyvalue td,
.tbl.table-keyvalue td { padding: 12px 16px; font-size: 14px; }

/* ─── Pills / tags / dispos ─── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
  white-space: nowrap;
}
.pill-out        { background: var(--acc-soft); border-color: var(--acc-ring); color: var(--acc); }
.pill-in         { background: rgba(180, 157, 255, 0.08); border-color: rgba(180, 157, 255, 0.3); color: #b49dff; }
.pill-active     { background: rgba(111, 227, 154, 0.08); border-color: rgba(111, 227, 154, 0.3); color: var(--ok); }
.pill-suspended  { background: rgba(233, 196, 106, 0.08); border-color: rgba(233, 196, 106, 0.3); color: var(--warn); }
.pill-closed     { background: rgba(240, 113, 103, 0.08); border-color: rgba(240, 113, 103, 0.3); color: var(--err); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  font-weight: 500;
  text-transform: uppercase;
  border: 1px solid;
  color: var(--text-mute);
  background: var(--bg-lift);
  border-color: var(--hair);
}
.badge-beta { background: rgba(233, 196, 106, 0.08); border-color: rgba(233, 196, 106, 0.3); color: var(--warn); }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 5px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  font-weight: 500;
  background: var(--bg-lift);
  border: 1px solid var(--hair);
  color: var(--text-soft);
  text-transform: uppercase;
}
.tag-local     { background: var(--acc-soft); border-color: var(--acc-ring); color: var(--acc); }
.tag-mobile    { background: rgba(180, 157, 255, 0.08); border-color: rgba(180, 157, 255, 0.3); color: #b49dff; }
.tag-tollfree  { background: rgba(233, 196, 106, 0.08); border-color: rgba(233, 196, 106, 0.3); color: var(--warn); }

.dispo {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 10.5px;
  font-weight: 500; letter-spacing: 0.06em;
  border: 1px solid; text-transform: uppercase;
}
.dispo-ok    { background: var(--acc-soft); border-color: var(--acc-ring); color: var(--acc); }
.dispo-warn  { background: rgba(233, 196, 106, 0.08); border-color: rgba(233, 196, 106, 0.3); color: var(--warn); }
.dispo-err   { background: rgba(240, 113, 103, 0.08); border-color: rgba(240, 113, 103, 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(255, 255, 255, 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-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--text-mute);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.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-family: var(--f-mono); font-size: 10.5px; color: var(--text-mute); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; 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-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.prof-row strong { font-weight: 500; font-size: 14.5px; color: var(--text); }

/* Password form */
.pw-form label { display: block; margin-bottom: 18px; font-family: var(--f-mono); font-size: 10.5px; color: var(--text-mute); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; }
.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-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-mute);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.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: 10.5px; color: var(--text-dim); font-family: var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; }

/* Brand badge */
.brand-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--acc);
  background: var(--acc-soft);
  border: 1px solid var(--acc-ring);
  border-radius: 999px;
}

/* 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-family: var(--f-mono); font-size: 10.5px; color: var(--text-mute); letter-spacing: 0.1em; text-transform: uppercase; 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: 999px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-soft);
}
.code-block {
  background: #08080a;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 16px 18px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
  line-height: 1.7;
}
.code-block .k { color: var(--acc); }
.code-block .s { color: #e9b68a; }
.code-block .c { color: var(--text-dim); }

details summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--text-mute);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  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: var(--bg);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  transform: translateY(-200%);
  transition: transform 180ms var(--ease-out);
  z-index: 100;
}
.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: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  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: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-mute);
}
.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 (amber, matches our accent for "shown once" badges) ─── */
.pill-warn {
  background: var(--acc-soft);
  border: 1px solid var(--acc-line);
  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; }
}
