/* SpoofDial Dashboard — clean ops home (index.php) */

.db-page {
  --db-ff: "Inter", ui-sans-serif, system-ui, sans-serif;
  --db-fm: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --db-ink: #f3f1ea;
  --db-mute: #9a968c;
  --db-line: rgba(255, 255, 255, 0.08);
  --db-accent: var(--accent);
  --db-ok: #6ee7a8;
  --db-warn: #fcd34d;
  --db-bad: #fca5a5;
  --db-surface: #1a1d21;
  --db-raised: #23272c;
  --db-deep: #0d0f11;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Hero */
.db-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 26px 26px 24px;
  border-radius: 18px;
  border: 1px solid var(--db-line);
  background: linear-gradient(155deg, #23272c 0%, #121416 55%, #1a1d21 100%);
}
.db-hero-bg {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 70% at 0% 0%, rgba(167, 139, 250, 0.18), transparent 55%),
    radial-gradient(50% 45% at 100% 100%, rgba(167, 139, 250, 0.08), transparent 50%);
}
.db-hero-main { position: relative; min-width: 0; flex: 1; }
.db-brand {
  margin: 0 0 8px;
  font-family: var(--db-ff);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
  color: var(--db-ink);
}
.db-hero h1 {
  margin: 0;
  font-family: var(--db-ff);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--db-accent);
}
.db-hero .sub {
  margin: 10px 0 0;
  max-width: 28rem;
  font-size: 14px;
  line-height: 1.5;
  color: var(--db-mute);
}
.db-ledger {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 140px;
}
.db-ledger-k {
  font-family: var(--db-fm);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--db-mute);
}
.db-ledger-v {
  font-family: var(--db-fm);
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--db-ink);
  line-height: 1;
}
.db-ledger-sub {
  font-family: var(--db-fm);
  font-size: 11px;
  color: var(--db-mute);
}
.db-top { display: contents; }

/* KPIs — 4 clean tiles */
.db-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.db-kpi {
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid var(--db-line);
  background: var(--db-surface);
  min-width: 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
.db-kpi .lab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--db-fm);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--db-mute);
  margin-bottom: 8px;
}
.db-kpi .lab .sd-ico,
.db-kpi .lab svg {
  width: 13px;
  height: 13px;
  color: var(--db-accent);
}
.db-kpi .val {
  font-family: var(--db-fm);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--db-ink);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.db-kpi .val.sm { font-size: 16px; letter-spacing: -0.02em; }
.db-kpi .hint { display: none; }

/* Panels */
.db-panel {
  border: 1px solid var(--db-line);
  background: var(--db-surface);
  border-radius: 16px;
  overflow: visible;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
}
.db-panel-h {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--db-line);
  background: var(--db-raised);
  border-radius: 16px 16px 0 0;
}
.db-panel-h h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--db-ff);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #c8c5bc;
}
.db-panel-h h2 .sd-ico { color: var(--db-accent); }
.db-panel-h .meta {
  margin-left: auto;
  font-family: var(--db-fm);
  font-size: 11px;
  color: var(--db-mute);
}
.db-panel-h a.meta {
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
  font-family: var(--db-ff);
}
.db-panel-h a.meta:hover { color: #fff; }
.db-panel-b { padding: 16px; }

/* Route — region / route / host / billing */
.db-route {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.db-sip-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.db-route-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--db-line);
  background: var(--db-deep);
  min-width: 0;
}
.db-route-item .k {
  font-family: var(--db-fm);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--db-mute);
  margin-bottom: 5px;
}
.db-route-item .v {
  font-family: var(--db-fm);
  font-size: 13px;
  font-weight: 650;
  color: var(--db-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* CID is a real field: full 10/11-digit number, never ellipsized */
.db-cid-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--db-line);
  background: var(--db-deep);
}
.db-cid-row .k {
  font-family: var(--db-fm);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--db-mute);
  margin: 0;
  min-width: 5.5rem;
}
.db-cid-input {
  flex: 1 1 12rem;
  min-width: 12rem;
  max-width: 18rem;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--db-line);
  background: var(--db-surface);
  color: var(--db-ink);
  font-family: var(--db-fm);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.db-cid-input:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.16);
}
.db-cid-save {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.16);
  color: var(--db-ink);
  font-family: var(--db-ff);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.db-cid-save:hover { background: rgba(167, 139, 250, 0.28); }
.db-cid-save:disabled { opacity: 0.55; cursor: default; }
.db-cid-msg {
  font-family: var(--db-fm);
  font-size: 12px;
  color: var(--db-mute);
  min-height: 1em;
}

/* Quick — simple 4-up tiles (no broken Jump-in list) */
.db-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.db-quick a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--db-line);
  background: var(--db-deep);
  color: #c8c5bc;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.db-quick a:hover {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.1);
  color: var(--db-ink);
}
.db-quick .ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--db-accent);
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.28);
}
.db-quick .ico svg,
.db-quick .ico .sd-ico {
  width: 16px;
  height: 16px;
}
.db-quick .t {
  font-family: var(--db-ff);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--db-ink);
}
.db-quick .copy,
.db-quick .d,
.db-quick .chev { display: none !important; }

/* Calls */
.db-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--db-line);
  background: transparent;
  color: var(--db-mute);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.db-icon-btn:hover {
  color: var(--db-ink);
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.1);
}
.db-icon-btn svg,
.db-icon-btn .sd-ico {
  width: 16px;
  height: 16px;
}

.db-table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--db-line);
}
.db-table-wrap.is-empty {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.db-table-wrap.is-empty table {
  display: none;
}
.db-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  width: 100%;
  padding: 36px 20px;
}
.db-empty-state .sd-empty-title {
  font-family: var(--db-ff);
  font-weight: 650;
  color: #c8c5bc;
}
.db-empty-state .sd-empty-sub {
  max-width: 22rem;
  margin: 0 auto;
  font-size: 13px;
  line-height: 1.5;
  color: var(--db-mute);
}
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.db-table th {
  text-align: left;
  padding: 10px 12px;
  font-family: var(--db-fm);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--db-mute);
  background: var(--db-raised);
  border-bottom: 1px solid var(--db-line);
  white-space: nowrap;
}
.db-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #c8c5bc;
  vertical-align: middle;
}
.db-table tr:last-child td { border-bottom: 0; }
.db-table tr:hover td { background: rgba(167, 139, 250, 0.05); }
.db-table .mono {
  font-family: var(--db-fm);
  color: var(--db-ink);
  font-weight: 550;
}
.db-table .mono.muted { color: var(--db-mute); font-weight: 500; }
.db-table .db-cid-cell {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.db-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--db-ff);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #c8c5bc;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.db-pill .sd-ico,
.db-pill svg { width: 11px; height: 11px; flex-shrink: 0; }
.db-pill.ok {
  color: var(--db-ok);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
}
.db-pill.warn {
  color: var(--db-warn);
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
}
.db-pill.bad {
  color: var(--db-bad);
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
}

.db-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--db-mute);
  font-size: 13px;
  line-height: 1.5;
}
.db-empty .sd-empty-title {
  font-family: var(--db-ff);
  font-weight: 650;
  color: #c8c5bc;
  margin-bottom: 4px;
}
.db-empty .sd-empty-sub {
  max-width: 28rem;
  margin: 0 auto;
}

.db-hero-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: 160px;
}
.db-sip-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.db-sip-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--db-line);
  background: var(--db-deep);
  font-family: var(--db-ff);
  font-size: 12px;
  font-weight: 650;
  color: var(--db-mute);
}
.db-sip-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--db-mute);
  flex-shrink: 0;
}
.db-sip-chip.ok {
  color: var(--db-ok);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
}
.db-sip-chip.ok .dot { background: var(--db-ok); }
.db-sip-chip.warn {
  color: var(--db-warn);
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
}
.db-sip-chip.warn .dot { background: var(--db-warn); }
.db-sip-host {
  font-family: var(--db-fm);
  font-size: 11px;
  color: var(--db-mute);
}
.db-sip-hint {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--db-mute);
}
.db-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: var(--db-warn);
  font-size: 13px;
  line-height: 1.4;
}
.db-note .sd-ico,
.db-note svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.db-note-a {
  margin-left: auto;
  color: var(--db-ink);
  font-weight: 650;
  text-decoration: none;
}
.db-note.is-error,
.db-note.is-error {
  border-color: rgba(252, 165, 165, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: var(--db-bad, #fca5a5);
}
.db-note.is-error .db-note-a,
.db-note.is-error .db-note-a {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}

@media (max-width: 900px) {
  .db-route,
  .db-sip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-cid-input { max-width: none; }
}
@media (max-width: 560px) {
  .db-hero { padding: 22px 18px 20px; }
  .db-hero-aside,
  .db-ledger,
  .db-sip-status { align-items: flex-start; width: 100%; }
}
