/* =====================================================================
   SpoofDial main.css — the single owner of all presentation.
   Dark telecom / SIP console identity: near-black surfaces, purple accent.
   Structure:
     0. Tokens
     1. Reset + base
     2. Scope helpers (svg icon discipline)
     3. App shell + sidebar + header
     4. Buttons
     5. Forms
     6. Panels / cards / tables / pills
     7. Page: dashboard
     8. Page: SIP
     9. Page: routes
    10. Page: CDR + pagination
    11. Page: deposit
    12. Page: settings
    13. Page: Press-1 (console + access gate + monitor)
    14. Auth pages
    15. Toast / modal / empty states
    16. Responsive
   ===================================================================== */

/* ================================================================
   0. TOKENS
   ================================================================ */
:root {
  /* surfaces */
  --bg: #121216;
  --bg-deep: #0e0e12;
  --surface: #1a1a20;
  --surface-raised: #212129;
  --surface-inset: #16161c;
  --border: #2b2b34;
  --border-soft: #232330;
  /* text */
  --text: #e8e8ee;
  --text-dim: #a2a2ae;
  --text-faint: #6f6f7c;
  /* purple accent system */
  --accent: #800787;
  --accent-strong: #68046e;
  --accent-deep: #5f0963;
  --accent-soft: rgba(128, 7, 135, 0.16);
  --accent-softer: rgba(128, 7, 135, 0.09);
  --accent-text: #c98fd4;
  --accent-grad: linear-gradient(135deg, #5f0963, #800787);
  /* status */
  --ok: #34b46f;
  --ok-soft: rgba(52, 180, 111, 0.14);
  --warn: #d9a03c;
  --warn-soft: rgba(217, 160, 60, 0.14);
  --bad: #e05252;
  --bad-soft: rgba(224, 82, 82, 0.14);
  /* geometry — 8px grid */
  --sidebar-w: 232px;
  --header-h: 60px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --ctl-h: 40px;
  --gap: 16px;
  --gap-lg: 24px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 24px rgba(0, 0, 0, 0.3);
  --shadow-accent: 0 4px 18px rgba(104, 4, 110, 0.35);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "SF Mono", Consolas, "Courier New", monospace;
  /* content rhythm */
  --content-max: 1440px;
}

/* ================================================================
   1. RESET + BASE
   ================================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body { margin: 0; padding: 0; }

html { min-height: 100%; }

body {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img { max-width: 100%; display: inline-block; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: #ddb5e5; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
code, pre { font-family: var(--mono); }
hr { border: 0; border-top: 1px solid var(--border); }
::selection { background: rgba(128, 7, 135, 0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #34343e; border-radius: 5px; border: 2px solid var(--bg-deep); }
::-webkit-scrollbar-thumb:hover { background: #454551; }

.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-faint); }
.spacer { flex: 1 1 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ================================================================
   2. SVG ICON DISCIPLINE — scoped, never global
   All UI icons pass through .sd-ico (server-rendered) or .i (JS-rendered).
   Decorative artwork (captcha png, qr svg, logo img) is exempt.
   ================================================================ */
svg.sd-ico,
svg.i,
.sidebar .icon svg,
.nav-tile .icon svg,
.panel-head svg,
.db-panel-h svg,
.sip-panel-h svg,
.rt-panel-h svg,
.set-panel-h svg,
.dep-panel-h svg,
.p1d-panel-head svg,
.card-head svg,
.field-label svg,
.filter-label svg,
.dtmf-btn svg,
.hdr-chip-ico svg,
.db-quick .ico svg,
.sd-hero h1 svg,
.sd-empty-ico svg,
.empty-icon svg,
.sd-pill-ico,
.toggle-copy svg,
.xfer-privacy svg,
.privacy-note svg,
.dep-warn svg,
.dep-alert svg,
.sip-alert svg,
.billing-note svg {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* explicit size carriers keep exact px control */
svg.sd-ico[width][height],
svg.i[width][height] { width: auto; height: auto; }

/* ================================================================
   3. APP SHELL + SIDEBAR + HEADER
   ================================================================ */
.app {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg);
}

/* ---- sidebar ---- */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #16161b 0%, #121217 100%);
  border-right: 1px solid var(--border-soft);
  z-index: 90;
}

.sidebar-brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-soft);
  flex: none;
}
.brand-link { display: inline-flex; align-items: center; gap: 10px; line-height: 0; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
  min-height: 0;
}
.sidebar-section { margin-bottom: 8px; }
.sidebar-section:last-child { margin-bottom: 0; }
.sidebar-rule { height: 1px; background: var(--border-soft); margin: 10px 10px 12px; }
.sidebar-section ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section li { min-width: 0; }

.nav-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: background 0.15s, color 0.15s;
  position: relative;
  white-space: nowrap;
}
.nav-tile .icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.nav-tile .icon svg { width: 20px; height: 20px; font-size: 20px; }
.nav-tile:hover { background: var(--accent-softer); color: var(--accent-text); text-decoration: none; }

.nav-tile.active {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.nav-tile.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* user card */
.sidebar-foot {
  flex: none;
  padding: 10px;
  border-top: 1px solid var(--border-soft);
}
.sidebar-usercard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  min-width: 0;
}
.sidebar-userphoto-wrap { position: relative; width: 40px; height: 40px; flex: none; }
.sidebar-userphoto {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-soft);
  transition: border-color 0.15s;
}
.sidebar-usercard:hover .sidebar-userphoto { border-color: var(--accent); }
.avatar-tile {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.sidebar-usermeta { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.sidebar-username {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-userrole {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.sidebar-usercard .logout-btn {
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.sidebar-usercard .logout-btn:hover { background: var(--bad-soft); color: var(--bad); }
.sidebar-usercard .logout-btn .icon,
.sidebar-usercard .logout-btn svg { width: 17px; height: 17px; font-size: 17px; }

/* neutralize any legacy collapse artifacts */
.collapse-toggle { display: none !important; }
.sidebar.collapsed { width: var(--sidebar-w); }
.app.sidebar-collapsed .main { margin-left: 0; }

/* ---- main column ---- */
.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.header {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--header-h);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: rgba(18, 18, 22, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-dim);
  align-items: center; justify-content: center;
}
.crumb-block { display: flex; flex-direction: column; min-width: 0; }
.crumb-kicker {
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--accent-text);
}
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-faint); min-width: 0; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent-text); }
.breadcrumb .sep { color: #3d3d48; }
.breadcrumb .current {
  color: var(--text); font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.header .right { display: flex; align-items: center; gap: 8px; flex: none; }
.hdr-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 700;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hdr-chip:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 0 0 3px var(--accent-softer); }
.hdr-chip-ico { display: inline-flex; color: var(--accent-text); }
.hdr-chip .balance { font-variant-numeric: tabular-nums; color: var(--text); }
.hdr-chip .currency { color: var(--accent-text); margin-right: 1px; }
.add-funds-btn {
  width: 22px; height: 22px;
  border: 0; border-radius: 5px;
  background: var(--accent-grad);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.add-funds-btn:hover { filter: brightness(1.15); }
.balance-wrap.is-broke { border-color: var(--bad); }
.balance-wrap.is-broke .balance { color: var(--bad); }
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(8, 8, 12, 0.6);
  backdrop-filter: blur(2px);
}
.sidebar-overlay[hidden] { display: none; }

.content {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--gap-lg);
  min-width: 0;
}

/* generic page head used by several pages */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: var(--gap-lg); flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px; color: var(--text); }
.page-desc { color: var(--text-faint); font-size: 13px; margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }


/* ================================================================
   4. BUTTONS
   Every button: flex-centered, icon+text aligned via gap.
   ================================================================ */
.btn,
.sip-btn,
.set-btn,
.dep-btn,
.rt-btn,
.p1-access-buy,
button.btn { /* belt + suspenders for JS-created buttons */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--ctl-h);
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s, filter 0.15s;
  user-select: none;
}
.btn svg, .sip-btn svg, .set-btn svg, .dep-btn svg, .rt-btn svg {
  width: 16px; height: 16px; font-size: 16px;
}

.btn:hover,
.sip-btn:hover,
.set-btn:hover,
.rt-btn:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-softer);
  text-decoration: none;
}

.btn-primary,
.sip-btn.primary,
.set-btn.primary,
.dep-btn.primary,
.rt-btn.primary,
.btn.btn-primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px rgba(104, 4, 110, 0.35);
}
.btn-primary:hover,
.sip-btn.primary:hover,
.set-btn.primary:hover,
.dep-btn.primary:hover,
.rt-btn.primary:hover {
  color: #fff;
  filter: brightness(1.12);
  box-shadow: 0 4px 18px rgba(104, 4, 110, 0.5);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(1px); filter: brightness(0.98); }

.btn-secondary { background: var(--surface-raised); border-color: var(--border); color: var(--text); }

.btn-danger, .btn.btn-danger {
  background: var(--bad-soft);
  border-color: rgba(224, 82, 82, 0.4);
  color: var(--bad);
}
.btn-danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-raised); color: var(--text); border-color: transparent; }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-sm svg { width: 14px; height: 14px; font-size: 14px; }

.btn:disabled, .sip-btn:disabled, .set-btn:disabled, .dep-btn:disabled, .rt-btn:disabled,
.btn[disabled], .sip-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
  pointer-events: none;
}
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* small utility icon buttons */
.icon-btn, .db-icon-btn, .captcha-reload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-dim);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.icon-btn:hover, .db-icon-btn:hover, .captcha-reload:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-softer);
}
.icon-btn svg, .db-icon-btn svg, .captcha-reload svg { width: 16px; height: 16px; font-size: 16px; }

/* copy buttons */
.sd-copy { gap: 6px; }
.sd-copy svg { width: 14px; height: 14px; font-size: 14px; }
.sd-copy.is-copied { border-color: var(--ok); color: var(--ok); }

/* ================================================================
   5. FORMS
   ================================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--gap);
  min-width: 0;
}
.field-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.field-label svg { color: var(--accent-text); }
.field-hint { font-size: 12px; color: var(--text-faint); line-height: 1.5; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--ctl-h);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input::placeholder { color: #55555f; }
.input:hover, .select:hover, .textarea:hover { border-color: #3d3d48; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
.input:disabled, .input[readonly] {
  background: var(--surface-inset);
  color: var(--text-faint);
  cursor: not-allowed;
  opacity: 0.75;
}
.input-mono, .set-input-lg.input-mono { font-family: var(--mono); letter-spacing: 0.3px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a2a2ae' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}
.select option { background: var(--surface-raised); color: var(--text); }
.textarea { min-height: 130px; resize: vertical; line-height: 1.55; }

/* input with inline icon (auth + settings) */
.input-ico { position: relative; }
.input-ico .ico,
.input-ico > svg.sd-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px; font-size: 15px;
  color: var(--text-faint);
  pointer-events: none;
}
.input-ico .input { padding-left: 36px; }

/* generic .wrap icon pattern (auth pages use this) */
.auth-shell .wrap,
.set-panel .wrap,
.captcha-field .wrap { position: relative; display: block; }
.auth-shell .wrap > svg.sd-ico,
.set-panel .wrap > svg.sd-ico,
.captcha-field .wrap > svg.sd-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px; font-size: 15px;
  color: var(--text-faint);
  pointer-events: none;
}
.auth-shell .wrap input,
.set-panel .wrap input,
.captcha-field .wrap input { padding-left: 36px; }

/* checkboxes / radios */
.check-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); cursor: pointer; user-select: none; }
.check-row input[type="checkbox"], .runmode-opt input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--accent-strong);
  cursor: pointer;
  flex: none;
}

/* ================================================================
   6. PANELS / CARDS / TABLES / PILLS
   ================================================================ */
.panel,
.db-panel,
.sip-panel,
.rt-panel,
.set-panel,
.dep-panel,
.p1d-panel,
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: var(--gap-lg);
  overflow: hidden;
  min-width: 0;
}

.panel-head,
.db-panel-h,
.sip-panel-h,
.rt-panel-h,
.set-panel-h,
.dep-panel-h,
.p1d-panel-head,
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-raised);
  min-height: 52px;
  flex-wrap: wrap;
}
.panel-head h2,
.db-panel-h h2,
.sip-panel-h h2,
.rt-panel-h h2,
.set-panel-h h2,
.dep-panel-h h2,
.p1d-panel-title,
.card-head h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.2px;
}
.panel-head h2 svg,
.db-panel-h h2 svg,
.sip-panel-h h2 svg,
.rt-panel-h h2 svg,
.set-panel-h h2 svg,
.dep-panel-h h2 svg,
.p1d-panel-head svg { color: var(--accent-text); }
.panel-head .meta,
.db-panel-h .meta,
.sip-panel-h .meta,
.rt-panel-h .meta,
.set-panel-h .meta,
.dep-panel-h .meta,
.p1d-panel-count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-faint);
  white-space: nowrap;
}
.panel-sub { margin: 0 0 var(--gap); font-size: 12.5px; color: var(--text-faint); line-height: 1.55; }

.panel-b,
.db-panel-b,
.sip-panel-b,
.rt-panel-b,
.set-panel-b,
.dep-panel-b { padding: 20px; min-width: 0; }

/* ---- tables ---- */
.db-table,
.dep-table,
.sip-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.db-table thead th,
.dep-table thead th,
.sip-table thead th {
  text-align: left;
  padding: 10px 16px;
  background: var(--surface-inset);
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.db-table tbody td,
.dep-table tbody td,
.sip-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
  vertical-align: middle;
  word-break: break-word;
}
.db-table tbody tr:nth-child(even),
.dep-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.db-table tbody tr:hover,
.dep-table tbody tr:hover,
.sip-table tbody tr:hover { background: var(--accent-softer); }
.db-table tbody tr:last-child td,
.dep-table tbody tr:last-child td { border-bottom: 0; }
.db-table-wrap,
.dep-table-wrap,
.sip-table-wrap,
.table-wrap,
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  min-width: 0;
}

/* ---- pills / chips / badges ---- */
.db-pill,
.sd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: var(--surface-raised);
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}
.sd-pill-ico { width: 12px; height: 12px; font-size: 12px; }
.db-pill.ok, .sd-pill.ok, .sd-pill.finished, .sd-pill.confirmed, .sd-pill.credited { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.db-pill.warn, .sd-pill.warn, .sd-pill.confirming, .sd-pill.sending, .sd-pill.partially_paid { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.db-pill.bad, .sd-pill.bad, .sd-pill.failed, .sd-pill.expired, .sd-pill.refunded { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

.sd-chip,
.set-chip,
.sip-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-raised);
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}
.set-chip.accent, .sip-chip.accent { background: var(--accent-grad); border-color: transparent; color: #fff; }
.set-chip.soft { background: var(--surface-inset); color: var(--text-faint); }
.sip-chip .dot, .set-chip .dot, .pref-status .dot, .tg-status .dot, .rt-meter-k .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #4b4b56; flex: none;
}
.sip-chip.warn .dot { background: var(--warn); }
.sip-chip.accent .dot { background: rgba(255, 255, 255, 0.85); }
.pref-status.on .dot, .tg-status.on .dot { background: var(--ok); box-shadow: 0 0 8px rgba(52, 180, 111, 0.6); }
.pref-status, .tg-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--text-faint);
  margin-left: auto;
}

/* ---- hero bands (gradient page headers) ---- */
.sd-hero,
.db-hero,
.sip-hero,
.rt-hero,
.set-hero,
.dep-hero,
.p1-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-lg);
  margin-bottom: var(--gap-lg);
  background:
    radial-gradient(560px 260px at 88% -30%, rgba(201, 143, 212, 0.22), transparent 62%),
    radial-gradient(420px 240px at -8% 130%, rgba(95, 9, 99, 0.35), transparent 58%),
    linear-gradient(135deg, #231026 0%, #3a0a40 55%, #521057 100%);
  border: 1px solid rgba(128, 7, 135, 0.35);
  color: #fff;
  box-shadow: var(--shadow);
}
.sd-hero-bg, .sip-hero-bg, .rt-hero-bg, .set-hero-bg, .dep-hero-bg, .p1-hero-bg { position: absolute; inset: 0; pointer-events: none; }
.sd-hero-grid, .sip-hero-grid, .rt-hero-grid { display: none; }
.sd-hero-main, .sip-hero-main, .rt-hero-main, .set-hero-main, .dep-hero-main, .p1-hero-main { position: relative; min-width: 0; }
.sd-brand,
.db-brand, .sip-brand, .rt-brand, .set-brand, .dep-brand, .p1-brand {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent-text);
}
.sd-hero h1, .sip-hero h1, .rt-hero h1, .set-hero h1, .dep-hero h1, .p1-hero h1, .db-hero h1 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sd-hero h1 svg, .sip-hero h1 svg, .rt-hero h1 svg, .set-hero h1 svg, .dep-hero h1 svg, .p1-hero h1 svg { font-size: 18px; width: 18px; height: 18px; opacity: 0.9; }
.sd-sub, .sd-hero .sub { margin-top: 5px; font-size: 12.5px; color: rgba(255, 255, 255, 0.72); max-width: 660px; line-height: 1.55; }

.sd-aside,
.db-ledger, .sip-hero-aside, .rt-meter, .set-hero-aside, .dep-ledger, .p1-hero-aside {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  max-width: 280px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}
.sd-aside-k, .db-ledger-k, .dep-ledger-k, .rt-meter-k {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  display: flex;
  align-items: center;
  gap: 7px;
}
.sd-aside-v, .db-ledger-v, .dep-ledger-v, .rt-meter-v {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.sd-aside-sub, .db-ledger-sub, .dep-ledger-sub { font-size: 11px; color: rgba(255, 255, 255, 0.65); }
.sd-aside-actions { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.sd-aside-actions .sip-btn {
  height: 34px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 12.5px;
}
.sd-aside-actions .sip-btn:hover { background: rgba(255, 255, 255, 0.2); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.sd-aside-chips { display: flex; flex-direction: column; gap: 6px; align-items: stretch; margin-top: 8px; }
.sd-aside .sip-chip { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.85); }
.sd-aside .sip-status { display: flex; flex-direction: column; gap: 6px; }
.set-jump { display: flex; flex-direction: column; gap: 6px; }
.set-jump-link {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px; font-weight: 700;
}
.set-jump-link:hover { background: rgba(255, 255, 255, 0.16); color: #fff; text-decoration: none; }
.set-jump-link svg { width: 13px; height: 13px; font-size: 13px; }


/* ================================================================
   7. DASHBOARD (index.php — db-*)
   ================================================================ */
.db-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap-lg);
}
.db-kpi {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-width: 0;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.db-kpi:hover { transform: translateY(-2px); border-color: rgba(128, 7, 135, 0.4); box-shadow: var(--shadow); }
.db-kpi .lab {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.db-kpi .lab svg { color: var(--accent-text); }
.db-kpi .val {
  font-size: 24px; font-weight: 800; line-height: 1.15;
  font-variant-numeric: tabular-nums; color: var(--text);
  word-break: break-word;
}
.db-kpi .val.sm { font-size: 15px; padding-top: 5px; color: var(--text-dim); }

.db-route {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap);
}
.db-route-item { min-width: 0; }
.db-route-item .k {
  font-size: 9.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-faint); margin-bottom: 3px;
}
.db-route-item .v { font-size: 13.5px; font-weight: 700; color: var(--text); word-break: break-word; }
.db-route-item .v.mono { font-family: var(--mono); }

.db-quick {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.db-quick a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 96px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s, color 0.16s;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.db-quick a::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity 0.16s;
}
.db-quick a:hover {
  transform: translateY(-3px);
  border-color: rgba(128, 7, 135, 0.55);
  box-shadow: 0 8px 26px rgba(104, 4, 110, 0.25);
  color: var(--accent-text);
  text-decoration: none;
}
.db-quick a:hover::before { opacity: 1; }
.db-quick .ico {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--accent-softer);
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.16s, color 0.16s;
}
.db-quick .ico svg { width: 20px; height: 20px; font-size: 20px; }
.db-quick a:hover .ico { background: var(--accent-grad); color: #fff; }
.db-quick .t { position: relative; line-height: 1.3; }

/* ================================================================
   8. SIP PAGE (sip-*)
   ================================================================ */
.sip-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-lg);
  align-items: start;
}
.sip-step {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.sip-reg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sip-reg-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  min-width: 0;
}
.sip-reg-item .k {
  font-size: 9.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-faint);
}
.sip-reg-item .v {
  font-size: 17px; font-weight: 800;
  color: var(--accent-text);
  font-family: var(--mono);
  word-break: break-all;
  line-height: 1.3;
}
.sip-reg-item .sd-copy { height: 28px; padding: 0 10px; font-size: 11.5px; align-self: flex-start; }
.sip-alert {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--gap);
  padding: 14px 16px;
  background: var(--accent-softer);
  border: 1px solid rgba(128, 7, 135, 0.3);
  border-left: 3px solid var(--accent-strong);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.55;
}
.sip-alert-h { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--accent-text); font-size: 13px; }
.sip-alert svg { color: var(--warn); }
.sip-alert strong { color: var(--text); }
.sip-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-text);
  padding: 10px 0 2px;
  user-select: none;
  font-size: 13px;
  display: flex; align-items: center; gap: 6px;
  list-style: none;
}
.sip-details summary::-webkit-details-marker { display: none; }
.sip-help {
  padding: 14px 16px;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
}
.sip-help-h { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--accent-text); font-size: 13px; margin-bottom: 6px; }
.sip-help ol { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.sip-help code {
  background: rgba(128, 7, 135, 0.18);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-text);
}
.sip-tool { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
/* compact Caller ID panel */
.sip-panel-compact .sip-panel-b { padding: 16px 20px; }
.sip-tool-row { flex-direction: row; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.sip-tool-row .sip-cli-field { flex: 1 1 220px; margin-bottom: 0; min-width: 0; }
.sip-cli-hint { margin: 8px 0 0; font-size: 11.5px; color: var(--text-faint); }

/* provision forms */
.sip-mode-row {
  display: inline-flex;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 3px;
  gap: 3px;
  margin-bottom: var(--gap);
  max-width: 100%;
}
.sip-seg {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s, color 0.15s;
}
.sip-seg svg { width: 13px; height: 13px; font-size: 13px; }
.sip-seg.on { background: var(--accent-strong); color: #fff; box-shadow: 0 1px 6px rgba(104, 4, 110, 0.4); }
.sip-create-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.sip-create-row .field { flex: 0 1 200px; margin-bottom: 0; }

/* IP-to-IP grid — port fully visible */
.sip-ip2ip-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(96px, 130px) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.sip-field-port .input-port,
#ip2ipPeerPort {
  width: 100%;
  min-width: 0;
  max-width: 130px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  font-family: var(--mono);
  letter-spacing: 1px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.sip-field-port .input-port::-webkit-outer-spin-button,
.sip-field-port .input-port::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sip-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }
.sip-check input { accent-color: var(--accent-strong); width: 15px; height: 15px; flex: none; }
.sip-ip2ip-help { margin: 12px 0; }

/* connect section */
.sip-connect-bar { display: flex; align-items: center; gap: 14px; margin-bottom: var(--gap); flex-wrap: wrap; }
.sip-connect-bar > select { max-width: 280px; flex: 0 1 280px; min-width: 180px; }
.sip-connect-tabs {
  display: inline-flex;
  gap: 3px;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 3px;
  flex-wrap: wrap;
}
.sip-tab {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.sip-tab.on { background: var(--accent-strong); color: #fff; }
.sip-cred {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  margin-bottom: var(--gap);
}
.sip-kv {
  padding: 10px 12px;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.sip-kv .k {
  font-size: 9px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-faint);
}
.sip-kv .v { font-size: 12.5px; font-weight: 700; color: var(--text); word-break: break-all; line-height: 1.4; }
.sip-connect-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.sip-msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  background: var(--accent-softer);
  color: var(--accent-text);
  border: 1px solid rgba(128, 7, 135, 0.3);
  line-height: 1.5;
  word-break: break-word;
}
.sip-msg.err { background: var(--bad-soft); color: var(--bad); border-color: rgba(224, 82, 82, 0.35); }
.sip-msg.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(52, 180, 111, 0.35); }
.sip-device-list { display: flex; flex-direction: column; gap: 8px; }
.sip-table-wrap .sip-table td .sip-btn { height: 30px; padding: 0 10px; font-size: 11.5px; }

/* ================================================================
   9. ROUTES PAGE (rt-*) — status badge only, ZERO pseudo-element checkmarks
   ================================================================ */
.rt-lane::after,
.rt-lane.is-on::after,
.rt-lane.is-pick::after,
.rt-lane .rt-tag::after,
.rt-lane .rt-tag::before,
.rt-tag::after,
.rt-tag::before { content: none !important; display: none !important; }

.rt-toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: var(--gap); }
.rt-search-row { display: flex; }
.rt-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: var(--ctl-h);
  width: 100%;
  max-width: 460px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rt-search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rt-search-wrap svg { color: var(--text-faint); width: 15px; height: 15px; font-size: 15px; }
.rt-search {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--text);
  height: 100%;
}
.rt-search::placeholder { color: #55555f; }
.rt-filters {
  display: inline-flex;
  gap: 3px;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 3px;
  flex-wrap: wrap;
  align-self: flex-start;
  max-width: 100%;
}
.rt-filter {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.rt-filter.on { background: var(--accent-strong); color: #fff; }

.rt-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}
.rt-lane {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
  min-width: 0;
}
.rt-lane.is-pick { cursor: pointer; }
.rt-lane.is-pick:hover { border-color: rgba(128, 7, 135, 0.5); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(104, 4, 110, 0.18); }
.rt-lane.is-on {
  border-color: var(--accent-strong);
  border-width: 2px;
  padding: 17px;
  box-shadow: 0 6px 24px rgba(104, 4, 110, 0.3);
  background: linear-gradient(180deg, rgba(104, 4, 110, 0.08), transparent 40%), var(--surface);
}
.rt-lane.is-off { opacity: 0.5; filter: grayscale(0.5); }
.rt-lane.is-off .rt-lane-name { color: var(--text-faint); }

.rt-lane-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rt-lane-top > div { min-width: 0; }
.rt-lane-name { font-size: 16px; font-weight: 800; color: var(--text); }
.rt-lane-region { font-size: 12px; color: var(--text-faint); font-weight: 600; margin-top: 2px; }

.rt-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  white-space: nowrap;
}
.rt-tag.is-on { background: var(--accent-grad); color: #fff; box-shadow: 0 2px 8px rgba(104, 4, 110, 0.4); }
.rt-tag.is-ready { background: var(--ok-soft); color: var(--ok); }
.rt-tag.is-off { background: var(--surface-raised); color: var(--text-faint); border: 1px solid var(--border-soft); }

.rt-lane-facts { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-fact {
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--mono);
}
.rt-lane-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.rt-metric { min-width: 0; }
.rt-metric .k {
  font-size: 9px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-faint); margin-bottom: 2px;
}
.rt-metric .v { font-size: 13.5px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.rt-metric.rate .v { color: var(--accent-text); }
.rt-lane-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.rt-lane-hint { font-size: 11.5px; color: var(--text-faint); line-height: 1.45; min-width: 0; }
.rt-btn { flex: none; min-width: 104px; height: 36px; padding: 0 14px; font-size: 12.5px; }
.rt-btn:not(.primary) { background: var(--accent-softer); border-color: rgba(128, 7, 135, 0.4); color: var(--accent-text); font-weight: 800; }
.rt-empty { padding: 48px 24px; text-align: center; color: var(--text-faint); font-size: 13.5px; }
.rt-search-row .sd-search { flex: 1 1 auto; display: flex; }

/* ================================================================
   10. CDR PAGE + PAGINATION
   ================================================================ */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap-lg);
}
.kpi-item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-width: 0;
}
.kpi-item .label {
  font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-faint); margin-bottom: 6px;
}
.kpi-item .value { font-size: 23px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-item .value.ok { color: var(--ok); }
.kpi-item .value.bad { color: var(--bad); }
.kpi-item .value.accent { color: var(--accent-text); }

.filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 250px)) auto;
  gap: var(--gap);
  align-items: end;
}
.filter-row .field { margin-bottom: 0; }
.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.filter-label svg { color: var(--accent-text); width: 13px; height: 13px; font-size: 13px; }
.filter-actions { display: flex; gap: 8px; }
.actions-field .filter-label { visibility: hidden; height: 19px; }

/* pagination — centered, purple active */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--gap) 0 4px;
  flex-wrap: wrap;
}
.pager .meta { font-size: 12px; color: var(--text-faint); font-weight: 700; margin-right: 8px; }
.pager button {
  height: 32px;
  min-width: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pager button:hover:not(:disabled):not(.active) { border-color: var(--accent); color: var(--accent-text); background: var(--accent-softer); }
.pager button.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px rgba(104, 4, 110, 0.4);
}
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager[hidden] { display: none; }

/* CDR table row structure rendered by JS */
#cdrRoot table { width: 100%; border-collapse: collapse; font-size: 13px; }
#cdrRoot thead th {
  text-align: left; padding: 10px 16px;
  background: var(--surface-inset); color: var(--text-faint);
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
#cdrRoot tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
  word-break: break-word;
}
#cdrRoot tbody tr:hover { background: var(--accent-softer); }
#cdrRoot .pill, #cdrRoot .db-pill { margin: 0; }


/* ================================================================
   11. DEPOSIT PAGE (dep-*)
   ================================================================ */
.dep-stage {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: var(--gap-lg);
  align-items: start;
}
.dep-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 12.5px;
  margin-bottom: var(--gap);
  line-height: 1.5;
}
.dep-alert svg { width: 15px; height: 15px; font-size: 15px; flex: none; }
.dep-alert.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(217, 160, 60, 0.3); }
.dep-alert.err { background: var(--bad-soft); color: var(--bad); border: 1px solid rgba(224, 82, 82, 0.3); }
.dep-alert.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(52, 180, 111, 0.3); }

.dep-amt-kicker {
  font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-faint);
  margin-bottom: 8px;
  display: block;
}
.dep-vault {
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
}
.dep-amt-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dep-amt-display:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dep-amt-display .cur { font-size: 22px; font-weight: 800; color: var(--accent-text); }
.dep-amt-display input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  padding: 4px 0;
}
.dep-talk { margin: 8px 0 0; font-size: 11.5px; color: var(--text-faint); }
.dep-field-err { color: var(--bad); font-size: 12px; margin: 6px 0 0; }
.dep-chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dep-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.dep-chip .chip-a { font-size: 13.5px; font-weight: 800; color: var(--text); }
.dep-chip .chip-n { font-size: 10px; color: var(--text-faint); font-weight: 700; }
.dep-chip:hover { border-color: var(--accent); }
.dep-chip.on { background: var(--accent-grad); border-color: transparent; }
.dep-chip.on .chip-a, .dep-chip.on .chip-n { color: #fff; }
.dep-chip:disabled { opacity: 0.45; cursor: not-allowed; }

.dep-assets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.dep-asset {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
  min-width: 0;
}
.dep-asset .tk { font-size: 13.5px; font-weight: 800; color: var(--text); }
.dep-asset .net { font-size: 9.5px; font-weight: 800; color: var(--text-faint); letter-spacing: 0.6px; }
.dep-asset:hover { border-color: var(--accent); }
.dep-asset.on { background: var(--accent-grad); border-color: transparent; }
.dep-asset.on .tk, .dep-asset.on .net { color: #fff; }
.dep-asset:disabled { opacity: 0.45; cursor: not-allowed; }
.dep-best {
  position: absolute;
  top: -8px;
  right: 8px;
  background: var(--ok);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.dep-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dep-btn { flex: 1 1 200px; }
.dep-trust { margin: 8px 0 0; font-size: 11.5px; color: var(--text-faint); line-height: 1.55; }

/* pay console */
.dep-pay .dep-panel-b { display: flex; flex-direction: column; gap: var(--gap); }
.dep-pay.is-ok { border-color: rgba(52, 180, 111, 0.45); }
.dep-pay.is-bad { border-color: rgba(224, 82, 82, 0.45); }
.dep-honest { font-size: 13.5px; font-weight: 700; color: var(--accent-text); }
.dep-invoice-go { display: flex; }
.dep-invoice-go .dep-btn { width: 100%; }
.dep-hint { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }
.dep-hint.warn { color: var(--warn); }
.dep-warn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  background: var(--warn-soft);
  border: 1px solid rgba(217, 160, 60, 0.3);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--warn);
  line-height: 1.5;
}
.dep-warn svg { color: var(--warn); margin-top: 1px; }
.dep-warn strong { color: var(--text); }
.dep-qr-stage { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.dep-qr-wrap {
  position: relative;
  width: 164px;
  height: 164px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dep-qr-ring {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: conic-gradient(from 0deg, var(--accent), var(--accent-deep), var(--accent));
  padding: 2px;
}
.dep-qr {
  position: relative;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.dep-qr svg { width: 136px; height: 136px; display: block; }
.dep-qr-cap {
  position: absolute;
  bottom: -22px;
  left: 0; right: 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-faint);
  font-weight: 700;
}
.dep-qr-missing { color: var(--text-faint); font-size: 11.5px; text-align: center; padding: 12px; }
.dep-send { flex: 1 1 220px; min-width: 0; }
.dep-label {
  font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.dep-crypto {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--mono);
  word-break: break-all;
  margin-bottom: 8px;
  line-height: 1.35;
}
.dep-crypto .u { font-size: 11.5px; color: var(--text-faint); margin-left: 4px; }
.dep-copy { display: flex; gap: 8px; align-items: stretch; }
.dep-copy .val {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px;
  font-family: var(--mono);
  word-break: break-all;
  display: flex;
  align-items: center;
  min-height: var(--ctl-h);
  color: var(--text-dim);
}
.dep-copy .dep-btn { flex: none; width: var(--ctl-h); padding: 0; }
.dep-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: var(--surface-inset);
  border-radius: var(--radius);
}
.dep-meta .l {
  font-size: 9.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-faint); margin-bottom: 2px;
}
.dep-meta .v { font-size: 12.5px; font-weight: 700; color: var(--text); word-break: break-all; }
.dep-poll {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--accent-softer);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--accent-text);
  font-weight: 700;
}
.dep-poll .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: sdPulse 1.6s infinite;
  flex: none;
}
.dep-poll #pollLast { margin-left: auto; font-size: 11px; color: var(--text-faint); }
@keyframes sdPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}
.dep-pay-empty { text-align: center; padding: 36px 24px; }
.dep-pay-empty-title { font-weight: 800; font-size: 14.5px; color: var(--text); margin-bottom: 6px; }
.dep-pay-empty-desc { font-size: 12.5px; color: var(--text-faint); }
.dep-pay-empty-steps {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: step;
  align-items: center;
}
.dep-pay-empty-steps li {
  counter-increment: step;
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}
.dep-pay-empty-steps li::before {
  content: counter(step);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-softer);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.dep-table .tk { font-weight: 800; }
.dep-table .net { display: block; font-size: 9.5px; color: var(--text-faint); font-weight: 800; letter-spacing: 0.5px; }
.dep-opencell { text-align: right; }
.dep-open { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--accent-text); }
.dep-open:hover { color: #ddb5e5; }
.dep-open svg { width: 13px; height: 13px; font-size: 13px; }

/* ================================================================
   12. SETTINGS PAGE (set-*)
   ================================================================ */
.set-desc { margin: 0 0 var(--gap); font-size: 12.5px; color: var(--text-faint); line-height: 1.55; }
.set-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.profile-card {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: var(--gap);
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: var(--gap);
}
.profile-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  user-select: none;
}
.profile-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-name { font-size: 15px; font-weight: 800; color: var(--text); }
.chip-row { display: flex; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.set-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.set-input-lg { max-width: 340px; }
.set-field-lead .field-hint { max-width: 500px; }
.set-h-ico { display: inline-flex; color: var(--accent-text); }
.msg-box {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  background: var(--accent-softer);
  color: var(--accent-text);
  border: 1px solid rgba(128, 7, 135, 0.3);
  line-height: 1.5;
}
.msg-box.err { background: var(--bad-soft); color: var(--bad); border-color: rgba(224, 82, 82, 0.35); }
.msg-box.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(52, 180, 111, 0.35); }
.msg-box[hidden] { display: none; }
.privacy-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: var(--gap);
  padding: 12px 16px;
  background: var(--surface-inset);
  border-left: 3px solid var(--accent-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.55;
}
.privacy-note svg { color: var(--accent-text); margin-top: 1px; }
.privacy-note strong { color: var(--text-dim); }
.settings-stack { display: flex; flex-direction: column; }

/* ================================================================
   13. PRESS-1 PAGE
   ================================================================ */
/* run / schedule — segmented control + launch */
.runmode-row { margin-bottom: var(--gap); max-width: 100%; }
.runmode-seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 3px;
}
.runmode-seg .runmode-opt { position: relative; margin: 0; padding: 0; display: block; min-width: 0; }
.runmode-seg .runmode-opt input { position: absolute; opacity: 0; pointer-events: none; }
.runmode-seg .runmode-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-faint);
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
  user-select: none;
  white-space: nowrap;
}
.runmode-seg .runmode-opt span svg { width: 14px; height: 14px; font-size: 14px; }
.runmode-seg .runmode-opt input:checked + span {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 2px 10px rgba(104, 4, 110, 0.4);
}
.runmode-seg .runmode-opt:hover span { color: var(--accent-text); }
.runmode-seg .runmode-opt input:checked + span:hover { color: #fff; }
.p1-launch-row { margin-top: 4px; }
.btn-launch {
  width: 100%;
  height: 46px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  border-radius: var(--radius);
  background: var(--accent-grad);
  border: 0;
  color: #fff;
  box-shadow: 0 4px 18px rgba(104, 4, 110, 0.4);
}
.btn-launch:hover { filter: brightness(1.12); box-shadow: 0 6px 26px rgba(104, 4, 110, 0.55); transform: translateY(-1px); }
.btn-launch:active { transform: translateY(1px); }
.p1-run-panel { position: relative; overflow: hidden; }
.p1-run-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-grad);
}

/* P1 layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: var(--gap-lg);
  align-items: start;
}
.setup { display: flex; flex-direction: column; min-width: 0; }
.setup .panel { min-width: 0; }
.monitor {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  position: sticky;
  top: calc(var(--header-h) + 16px);
  min-width: 0;
}
.monitor .panel, .monitor .p1d-panel { margin-bottom: 0; }

/* access gate (locked state) */
.p1-access-gate { margin-bottom: var(--gap-lg); }
.p1-access-shell {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(480px 240px at 85% -10%, rgba(128, 7, 135, 0.3), transparent 60%),
    linear-gradient(155deg, #201022 0%, #2c0a30 50%, #151518 100%);
  border-radius: var(--radius-lg);
  padding: 30px;
  color: #fff;
  border: 1px solid rgba(128, 7, 135, 0.35);
  box-shadow: var(--shadow);
}
.p1-access-atmosphere { position: absolute; inset: 0; pointer-events: none; }
.p1-access-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.3; }
.p1-access-orb-a { width: 300px; height: 300px; background: var(--accent); top: -110px; right: -70px; }
.p1-access-orb-b { width: 240px; height: 240px; background: var(--accent-deep); bottom: -90px; left: -50px; }
.p1-access-grid, .p1-access-noise, .p1-access-wave { display: none; }
.p1-access-notify { display: flex; gap: 14px; margin-bottom: 20px; position: relative; }
.p1-access-notify-rail {
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  flex: none;
  overflow: hidden;
}
.p1-access-pulse { display: block; width: 3px; height: 22px; background: rgba(255, 255, 255, 0.8); animation: sdRail 2.6s infinite; }
@keyframes sdRail {
  0% { transform: translateY(-24px); opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(70px); opacity: 0; }
}
.p1-access-notify-body { min-width: 0; }
.p1-access-kicker {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--accent-text);
}
.p1-access-lock { display: inline-flex; }
.p1-access-lock svg { width: 13px; height: 13px; font-size: 13px; }
.p1-access-title { margin: 8px 0 4px; font-size: 21px; font-weight: 800; color: #fff; }
.p1-access-copy { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, 0.72); max-width: 540px; line-height: 1.55; }
.p1-access-bal {
  display: inline-flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  padding: 8px 16px;
  position: relative;
}
.p1-access-bal-l {
  font-size: 9.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
}
.p1-access-bal-v { font-size: 16px; font-weight: 800; color: #fff; }
.p1-access-bal-v .cur { color: var(--accent-text); margin-right: 2px; }

.p1-access-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin: 22px 0;
  position: relative;
}
.p1-access-plan {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: transform 0.16s, border-color 0.16s, background 0.16s;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.p1-access-plan:hover { transform: translateY(-3px); border-color: rgba(201, 143, 212, 0.45); background: rgba(255, 255, 255, 0.08); }
.p1-access-plan.featured { border-color: var(--accent); box-shadow: 0 10px 34px rgba(128, 7, 135, 0.35); }
.p1-access-plan-tag {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 999px;
}
.p1-access-plan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.p1-access-plan-label { font-size: 14.5px; font-weight: 800; color: #fff; }
.p1-access-plan-chip {
  font-size: 9.5px; font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.09);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.p1-access-plan-price { font-size: 29px; font-weight: 800; color: #fff; line-height: 1; margin-bottom: 4px; }
.p1-access-plan-price .cur { font-size: 15px; color: var(--accent-text); margin-right: 2px; }
.p1-access-plan-period { font-size: 10.5px; color: rgba(255, 255, 255, 0.58); margin-bottom: 12px; }
.p1-access-plan-perks { margin: 0 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.p1-access-plan-perks li { font-size: 12px; color: rgba(255, 255, 255, 0.78); padding-left: 18px; position: relative; line-height: 1.45; }
.p1-access-plan-perks li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent-text); font-weight: 800; }
.p1-access-buy {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
  margin-top: auto;
}
.p1-access-buy:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); }
.p1-access-buy-main { font-size: 12.5px; font-weight: 800; }
.p1-access-buy-sub { font-size: 10.5px; color: rgba(255, 255, 255, 0.65); }
.p1-access-buy-primary { background: var(--accent-grad); border-color: transparent; }
.p1-access-buy-primary:hover { filter: brightness(1.15); background: var(--accent-grad); }

.p1-access-cta-row { margin-top: 6px; position: relative; }
.p1-access-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(201, 143, 212, 0.45);
  border-radius: var(--radius);
  padding: 13px 18px;
  color: #fff;
  transition: background 0.15s;
  min-width: 0;
}
.p1-access-cta:hover { background: rgba(255, 255, 255, 0.12); text-decoration: none; color: #fff; }
.p1-access-cta-ico {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.p1-access-cta-ico svg { width: 17px; height: 17px; font-size: 17px; }
.p1-access-cta-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.p1-access-cta-txt strong { font-size: 13.5px; font-weight: 800; }
.p1-access-cta-txt small { font-size: 11px; color: rgba(255, 255, 255, 0.6); }
.p1-access-cta-arrow { margin-left: auto; font-size: 17px; flex: none; }
.p1-access-foot { margin: 12px 0 0; font-size: 11.5px; color: rgba(255, 255, 255, 0.58); text-align: center; position: relative; }
.p1-access-foot-ok { color: var(--ok); }
.p1-access-live {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 12px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 800;
}
.running-pill { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.85); }
.running-pill strong { color: #fff; }

/* P1 monitor (right rail) */
.p1d-hero {
  background:
    radial-gradient(400px 200px at 90% -20%, rgba(201, 143, 212, 0.2), transparent 60%),
    linear-gradient(135deg, #2c0a30, #4a0d50 60%, #630b6a);
  border-radius: var(--radius-lg);
  padding: 18px;
  color: #fff;
  border: 1px solid rgba(128, 7, 135, 0.35);
  box-shadow: var(--shadow);
}
.p1d-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.p1d-hero-title {
  font-size: 10px; font-weight: 800;
  letter-spacing: 1.1px; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  display: block;
  margin-bottom: 6px;
}
.p1d-hero-counts { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.p1d-hero-counts .big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.p1d-hero-counts .sep, .p1d-hero-counts #p1STotal { font-size: 12.5px; color: rgba(255, 255, 255, 0.68); }
.p1d-hero-counts .pct { font-size: 12.5px; font-weight: 800; color: var(--accent-text); margin-left: 4px; }
.p1d-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  white-space: nowrap;
  flex: none;
}
.p1d-status-ico svg { width: 11px; height: 11px; font-size: 11px; }
.p1d-status.idle { background: rgba(255, 255, 255, 0.1); }
.p1d-status.running { background: var(--ok); color: #fff; }
.p1d-status.stopped { background: var(--bad); color: #fff; }
.p1d-cid-row { margin-top: 10px; font-size: 12px; color: rgba(255, 255, 255, 0.72); }
.p1d-cid-row strong { color: #fff; }
.p1d-bar-wrap { margin-top: 14px; }
.progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-text), #fff);
  transition: width 0.4s;
}
.p1d-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.p1d-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 11px;
  min-width: 0;
}
.p1d-tile-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex: none;
  background: var(--surface-raised);
  color: var(--text-dim);
}
.p1d-tile-icon svg { width: 15px; height: 15px; font-size: 15px; }
.p1d-tile-val { font-size: 17px; font-weight: 800; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.p1d-tile-lbl {
  font-size: 9.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-faint);
  margin-top: 2px;
}
.p1d-tile.connected .p1d-tile-icon { background: var(--ok-soft); color: var(--ok); }
.p1d-tile.pressed .p1d-tile-icon { background: var(--accent-softer); color: var(--accent-text); }
.p1d-tile.failed .p1d-tile-icon { background: var(--bad-soft); color: var(--bad); }
.p1d-tile.other .p1d-tile-icon { background: var(--warn-soft); color: var(--warn); }
.p1d-panel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 6px;
  animation: sdPulse 1.6s infinite;
}
.p1d-live-list, .p1d-fails-list, .p1d-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 270px;
  overflow-y: auto;
  padding: 14px;
}
.p1d-live-row, .p1d-log-row, .p1d-fail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-dim);
  min-width: 0;
  word-break: break-word;
}

/* P1 form controls */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 13px 16px;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: var(--gap);
}
.toggle-copy { min-width: 0; }
.toggle-copy .field-label { margin-bottom: 2px; }
.toggle {
  position: relative;
  width: 46px;
  height: 25px;
  border-radius: 999px;
  background: #3a3a44;
  border: 0;
  flex: none;
  padding: 0;
  transition: background 0.18s;
}
.toggle .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s;
}
.toggle.active { background: var(--accent-strong); }
.toggle.active .knob { transform: translateX(21px); }
.slider-field { display: flex; align-items: center; gap: 12px; min-width: 0; }
.slider-field input[type="range"] { flex: 1 1 auto; min-width: 0; accent-color: var(--accent-strong); height: 4px; cursor: pointer; }
.slider-field .val {
  min-width: 42px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-softer);
  border: 1px solid rgba(128, 7, 135, 0.35);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  padding: 0 8px;
  flex: none;
}
.dtmf-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.dtmf-btn {
  height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 800;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.dtmf-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.dtmf-btn.selected {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px rgba(104, 4, 110, 0.4);
}
.xfer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 8px;
  margin-bottom: var(--gap);
}
.xfer-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.xfer-card .title { font-size: 12.5px; font-weight: 800; color: var(--text); }
.xfer-card .desc { font-size: 10.5px; color: var(--text-faint); line-height: 1.5; }
.xfer-card:hover { border-color: var(--accent); }
.xfer-card.active {
  border-color: var(--accent-strong);
  border-width: 2px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(104, 4, 110, 0.1), transparent 50%), var(--surface);
  box-shadow: 0 2px 14px rgba(104, 4, 110, 0.22);
}
.xfer-card.active .title { color: var(--accent-text); }
.xfer-panels { min-width: 0; }
.xfer-panels .xfer-panel { display: none; }
.xfer-panels .xfer-panel.active { display: block; }
.xfer-privacy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  background: var(--surface-inset);
  border-left: 3px solid var(--accent-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.55;
}
.xfer-privacy svg { color: var(--accent-text); margin-top: 1px; }
.xfer-num-row { display: flex; gap: 8px; }
.xfer-num-row .input { flex: 1 1 auto; min-width: 0; }
.xfer-num-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.xfer-num-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--accent-softer);
  border: 1px solid rgba(128, 7, 135, 0.35);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent-text);
  font-family: var(--mono);
  align-self: flex-start;
}
.audio-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.audio-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.audio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  min-width: 0;
}
.audio-item .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-raised);
  overflow: hidden;
  margin-bottom: 12px;
}
.upload-progress .bar {
  height: 100%;
  width: 0;
  background: var(--accent-grad);
  transition: width 0.3s;
}
.lead-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.lead-count { font-size: 12.5px; color: var(--text-faint); }
.lead-count strong { color: var(--accent-text); font-size: 15px; font-weight: 800; }
.caller-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.caller-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: var(--mono);
  min-width: 0;
}
.cid-live { margin-top: 8px; font-size: 11.5px; color: var(--text-faint); }
.amd-hint { margin-top: 8px; font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }
.billing-note {
  margin-top: var(--gap);
  padding: 12px 16px;
  background: var(--accent-softer);
  border-left: 3px solid var(--accent-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 11.5px;
  color: var(--accent-text);
  font-weight: 700;
  line-height: 1.55;
}
.lang-select { max-width: 280px; }
.campaign-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 8px;
  min-width: 0;
}
.campaign-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.campaign-title { font-size: 13px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-meta { margin-left: auto; font-size: 11.5px; color: var(--text-faint); font-weight: 700; flex: none; }

/* ================================================================
   CAPTCHA WIDGET (auth pages)
   ================================================================ */
.captcha-field { position: relative; }
.captcha-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.captcha-head label {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-dim);
}
.captcha-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
}
.captcha-badge.is-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.captcha-box { display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.captcha-frame {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}
.captcha-img {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: pointer;
}
.captcha-wait { position: absolute; font-size: 11.5px; color: #777; }
.captcha-fail {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: #a33;
  font-size: 12px;
  font-weight: 700;
}
.captcha-lock {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 26, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
}
.captcha-frame .captcha-wait[hidden],
.captcha-frame .captcha-fail[hidden],
.captcha-frame .captcha-lock[hidden] { display: none; }
.captcha-reload { flex: none; width: var(--ctl-h); height: auto; align-self: stretch; }
.captcha-hint { font-size: 11px; color: var(--text-faint); }
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}


/* ================================================================
   14. AUTH PAGES (signin / signup / reset)
   ================================================================ */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  background:
    radial-gradient(900px 460px at 72% -12%, rgba(128, 7, 135, 0.22), transparent 60%),
    radial-gradient(600px 340px at 8% 110%, rgba(95, 9, 99, 0.25), transparent 58%),
    linear-gradient(160deg, #101014 0%, #16161b 55%, #1d0f20 100%);
}
.auth-shell .brand { text-align: center; }
.auth-shell .logo {
  font-size: 25px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.4px;
}
.auth-shell .tag {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent-text);
}
.auth-shell .card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  min-width: 0;
}
.card-head h1 { margin: 0 0 4px; font-size: 19px; font-weight: 800; color: var(--text); }
.card-head p { margin: 0 0 20px; font-size: 12.5px; color: var(--text-faint); line-height: 1.5; }
.auth-shell .field { margin-bottom: 14px; }
.auth-shell .field > label,
.auth-shell .captcha-head label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.auth-shell .wrap input,
.auth-shell .captcha-field .wrap input {
  width: 100%;
  height: var(--ctl-h);
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.auth-shell .wrap input::placeholder { color: #55555f; }
.auth-shell .wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-shell .captcha-box { max-width: 100%; }
.auth-shell .btn {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-grad);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  transition: filter 0.15s, transform 0.1s;
}
.auth-shell .btn svg { width: 15px; height: 15px; font-size: 15px; }
.auth-shell .btn:hover { filter: brightness(1.12); }
.auth-shell .btn:active { transform: translateY(1px); }
.auth-shell .btn.is-busy { opacity: 0.7; cursor: wait; }
.auth-shell .msg { min-height: 20px; margin-top: 12px; font-size: 12.5px; text-align: center; color: var(--text-faint); }
.auth-shell .msg.err { color: var(--bad); }
.auth-shell .msg.ok { color: var(--ok); }
.auth-shell .rule { height: 1px; background: var(--border-soft); margin: 18px 0 14px; }
.auth-shell .links { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; flex-wrap: wrap; }
.auth-shell .links a { color: var(--accent-text); font-weight: 700; }
.auth-shell .links a:hover { color: #ddb5e5; text-decoration: underline; }

/* settings page reuses .wrap pattern inside set-panels */
.set-panel .wrap input { padding-left: 36px; }
.set-panel .tg-status { margin-left: 0; }

/* 404 / error page (err-*) */
.err-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.err-panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 460px;
  width: 100%;
}
.err-code { font-size: 52px; font-weight: 800; color: var(--accent-text); line-height: 1; margin-bottom: 10px; }
.err-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.err-desc { font-size: 13px; color: var(--text-faint); margin-bottom: 20px; }
.err-home { display: inline-flex; }

/* ================================================================
   15. TOAST / MODAL / EMPTY STATES
   ================================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  background: #26262e;
  color: var(--text);
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
  max-width: min(92vw, 560px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: #12351f; border-color: rgba(52, 180, 111, 0.4); color: #7fe0a8; }
.toast.error { background: #3a1515; border-color: rgba(224, 82, 82, 0.4); color: #f0a0a0; }

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.62);
  backdrop-filter: blur(3px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.confirm-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  max-width: 420px;
  width: 100%;
  padding: 24px;
  animation: sdPop 0.18s ease-out;
}
@keyframes sdPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}

.sd-empty, .db-empty, .empty-state, .sip-empty, .dep-empty, .rt-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 8px;
  width: 100%;
  color: var(--text-faint);
}
.sd-empty-ico, .db-empty-ico, .empty-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-softer);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.sd-empty-ico svg, .empty-icon svg { width: 22px; height: 22px; font-size: 22px; }
.sd-empty-title, .db-empty-title, .empty-title { font-size: 14.5px; font-weight: 800; color: var(--text-dim); }
.sd-empty-sub, .db-empty-sub, .empty-desc { font-size: 12.5px; color: var(--text-faint); max-width: 440px; line-height: 1.55; }
td .sd-empty { padding: 32px 16px; }

/* generic JS-rendered leftovers kept safe */
.empty-row, .empty-desc, .bar-bg, .fill, .knob-v { /* no-op guards */ }
.pct { color: var(--accent-text); }

/* ================================================================
   16. RESPONSIVE
   ================================================================ */
@media (max-width: 1280px) {
  .layout { grid-template-columns: 1fr; }
  .monitor { position: static; }
  .db-route { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .dep-stage, .sip-stage { grid-template-columns: 1fr; }
  .db-kpis, .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-route { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .p1d-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions-field .filter-label { display: none; }
  .filter-row .actions-field { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.5);
    height: 100dvh;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; width: 100%; }
  .menu-toggle { display: inline-flex; }
}

@media (max-width: 768px) {
  .content { padding: 16px; padding-bottom: 96px; }
  .header { padding: 0 16px; }
  .hdr-chip.rate-chip { display: none; }
  .sd-hero, .db-hero, .sip-hero, .rt-hero, .set-hero, .dep-hero, .p1-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .sd-aside, .db-ledger, .sip-hero-aside, .rt-meter, .set-hero-aside, .dep-ledger, .p1-hero-aside {
    max-width: none;
    min-width: 0;
  }
  .db-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-route, .dep-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sip-reg { grid-template-columns: 1fr; }
  .sip-ip2ip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sip-connect-bar { align-items: stretch; flex-direction: column; }
  .sip-connect-bar > select { max-width: none; flex: 1 1 auto; }
  .set-row { grid-template-columns: 1fr; }
  .p1-access-plans { grid-template-columns: 1fr; }
  .dtmf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-strip, .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-row { grid-template-columns: 1fr; }
  .rt-lanes { grid-template-columns: 1fr; }
  .dep-qr-stage { justify-content: center; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .actions { justify-content: flex-start; }

  /* mobile bottom tab bar */
  .mbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    background: rgba(16, 16, 20, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-soft);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .mbar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-faint);
    font-size: 9.5px;
    font-weight: 700;
    text-decoration: none;
    padding: 4px 0;
    min-width: 0;
  }
  .mbar a svg { width: 19px; height: 19px; font-size: 19px; }
  .mbar a.on { color: var(--accent-text); }
  .mbar a.on .mbar-ico { color: var(--accent); }
}

@media (max-width: 480px) {
  .db-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-kpis, .kpi-strip { grid-template-columns: 1fr 1fr; }
  .db-kpi .val, .kpi-item .value { font-size: 19px; }
  .sip-ip2ip-grid { grid-template-columns: 1fr; }
  .dep-meta { grid-template-columns: 1fr 1fr; }
  .rt-lane-metrics { gap: 8px; }
  .content { padding: 12px; padding-bottom: 96px; }
  .auth-shell .card { padding: 22px; }
  .p1-access-shell { padding: 20px; }
}

/* mobile bar hidden on desktop */
.mbar { display: none; }

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

/* print: keep it sane */
@media print {
  .sidebar, .header, .mbar, .toast { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; color: #000; }
}

/* ================================================================
   17. JS-RENDERED HELPERS (state classes from page scripts)
   ================================================================ */
.sd-ico-txt { line-height: 1; white-space: nowrap; }
.sd-spin { animation: sdSpin 0.9s linear infinite; transform-origin: center; }
@keyframes sdSpin { to { transform: rotate(360deg); } }
.input.cid-ok { border-color: rgba(52, 180, 111, 0.55); }
.input.cid-bad { border-color: rgba(224, 82, 82, 0.55); }
.cid-live.ok { color: var(--ok); }
.cid-live.bad { color: var(--bad); }
.p1-access-buy.is-short { opacity: 0.55; }
.p1-access-buy.is-short .p1-access-buy-main::after { content: " — low balance"; font-weight: 700; color: var(--warn); }
.add-funds-btn.needs-funds { animation: sdNudge 0.5s ease 2; box-shadow: 0 0 0 3px var(--warn-soft); }
@keyframes sdNudge { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
.p1-page.p1-locked .layout { opacity: 0.35; pointer-events: none; user-select: none; filter: blur(1px); }
.sip-mode-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--accent-softer);
  color: var(--accent-text);
  border: 1px solid rgba(128, 7, 135, 0.3);
  white-space: nowrap;
}
.sip-mode-badge.ip { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.sip-authid { font-size: 11px; color: var(--text-faint); font-family: var(--mono); margin-top: 2px; }
.name-input { max-width: 240px; height: 30px; font-size: 12.5px; padding: 4px 10px; }
.search-field { position: relative; min-width: 0; }
.search-field .input { padding-left: 36px; }
