/* ============================================================
   STATIC SHOCK DIALER — Shared Design System
   Palette: Dark Teal bg · Electric Cyan/Turquoise · Lightning Yellow
   ============================================================ */

:root {
  /* Backgrounds */
  --bg-0: #051a1a;          /* deepest */
  --bg-1: #07211f;          /* page bg */
  --bg-2: #0b2e2b;          /* panel */
  --bg-3: #103b38;          /* raised panel / hover */
  --bg-4: #16504b;          /* borders / dividers */

  /* Brand */
  --cyan: #1fe8d4;          /* electric cyan / turquoise */
  --cyan-soft: #79f3e6;
  --cyan-deep: #0fb9a8;
  --yellow: #ffe11f;        /* lightning yellow */
  --yellow-deep: #d9bd00;

  /* Status */
  --green: #38e08a;
  --red: #ff5c6c;
  --orange: #ffae42;
  --blue: #4ea8ff;

  /* Text */
  --text: #e8fbf8;
  --text-dim: #9fc6c1;
  --text-faint: #5e8480;

  /* FX */
  --glow-cyan: 0 0 0 1px rgba(31,232,212,.35), 0 0 22px rgba(31,232,212,.25);
  --glow-yellow: 0 0 0 1px rgba(255,225,31,.4), 0 0 22px rgba(255,225,31,.25);
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(31,232,212,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255,225,31,.06), transparent 55%),
    var(--bg-1);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Layout helpers ---------- */
.container { width: min(1180px, 92vw); margin-inline: auto; }
.section { padding: 72px 0; }
.grid { display: grid; gap: 22px; }
.row { display: flex; gap: 14px; }
.center { align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.tac { text-align: center; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------- Typography ---------- */
h1,h2,h3,h4 { line-height: 1.12; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cyan); padding: 6px 12px; border-radius: 999px;
  background: rgba(31,232,212,.08); border: 1px solid rgba(31,232,212,.25);
}
.lead { font-size: 1.12rem; color: var(--text-dim); max-width: 56ch; }

.grad-text {
  background: linear-gradient(100deg, var(--cyan), var(--yellow));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border-radius: 12px; font-weight: 700; font-size: .96rem;
  border: 1px solid transparent; transition: .18s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cyan); color: #04211e; box-shadow: var(--glow-cyan); }
.btn-primary:hover { background: var(--cyan-soft); }
.btn-yellow { background: var(--yellow); color: #2a2400; box-shadow: var(--glow-yellow); }
.btn-yellow:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--bg-4); color: var(--text); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-danger { background: rgba(255,92,108,.14); border-color: rgba(255,92,108,.4); color: #ffb3ba; }
.btn-danger:hover { background: rgba(255,92,108,.24); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; }
.btn-sm { padding: 8px 13px; font-size: .82rem; border-radius: 9px; }

/* ---------- Cards / panels ---------- */
.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--bg-4); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.panel {
  background: var(--bg-2); border: 1px solid var(--bg-4);
  border-radius: var(--radius); padding: 20px;
}
.panel-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.panel-head h3 { display:flex; align-items:center; gap:9px; }

/* ---------- Badges / chips ---------- */
.badge {
  display:inline-flex; align-items:center; gap:6px;
  font-size:.72rem; font-weight:700; letter-spacing:.04em;
  padding:4px 10px; border-radius:999px; text-transform:uppercase;
}
.badge-cyan { background: rgba(31,232,212,.12); color: var(--cyan); border:1px solid rgba(31,232,212,.3); }
.badge-yellow { background: rgba(255,225,31,.12); color: var(--yellow); border:1px solid rgba(255,225,31,.3); }
.badge-green { background: rgba(56,224,138,.12); color: var(--green); border:1px solid rgba(56,224,138,.3); }
.badge-red { background: rgba(255,92,108,.12); color: var(--red); border:1px solid rgba(255,92,108,.3); }
.badge-gray { background: rgba(255,255,255,.06); color: var(--text-dim); border:1px solid var(--bg-4); }

.dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.dot-live { background: var(--green); box-shadow:0 0 0 0 rgba(56,224,138,.6); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(56,224,138,.55)} 70%{box-shadow:0 0 0 9px rgba(56,224,138,0)} 100%{box-shadow:0 0 0 0 rgba(56,224,138,0)} }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display:block; font-size:.85rem; font-weight:600; color: var(--text-dim); margin-bottom:7px; }
.input, select, textarea {
  width:100%; padding:12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-0); border:1px solid var(--bg-4); color: var(--text);
  font-size:.96rem; transition:.16s; font-family: inherit;
}
.input:focus, select:focus, textarea:focus { outline:none; border-color: var(--cyan); box-shadow:0 0 0 3px rgba(31,232,212,.15); }
.input::placeholder { color: var(--text-faint); }
.input-group { position:relative; }
.input-group .icon { position:absolute; left:13px; top:50%; transform:translateY(-50%); color:var(--text-faint); }
.input-group .input { padding-left:40px; }
.hint { font-size:.78rem; color: var(--text-faint); margin-top:6px; }
.divider-or { display:flex; align-items:center; gap:14px; color:var(--text-faint); font-size:.82rem; margin:18px 0; }
.divider-or::before, .divider-or::after { content:""; height:1px; flex:1; background:var(--bg-4); }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(7,33,31,.78); border-bottom:1px solid var(--bg-4);
}
.nav-inner { display:flex; align-items:center; justify-content:space-between; height:66px; }
.brand { display:flex; align-items:center; gap:11px; font-weight:800; font-size:1.12rem; letter-spacing:-.02em; }
.brand .bolt {
  width:34px; height:34px; border-radius:10px; display:grid; place-items:center;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-deep));
  color:#03201d; box-shadow: var(--glow-cyan); font-size:1.1rem;
}
.brand small { color: var(--yellow); }
.nav-links { display:flex; align-items:center; gap:26px; }
.nav-links a { color: var(--text-dim); font-weight:600; font-size:.95rem; transition:.15s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta { display:flex; align-items:center; gap:12px; }
.hamburger { display:none; background:none; border:1px solid var(--bg-4); border-radius:9px; padding:8px 10px; color:var(--text); }

/* ---------- App shell (dashboard / admin) ---------- */
.app { display:grid; grid-template-columns: 248px 1fr; min-height:100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-0));
  border-right:1px solid var(--bg-4); padding:18px 14px;
  position:sticky; top:0; height:100vh; overflow-y:auto;
}
.side-brand { padding:6px 8px 18px; }
.side-section { font-size:.72rem; text-transform:uppercase; letter-spacing:.12em; color:var(--text-faint); margin:18px 8px 8px; }
.side-link {
  display:flex; align-items:center; gap:11px; padding:11px 12px; border-radius:11px;
  color:var(--text-dim); font-weight:600; font-size:.92rem; margin-bottom:3px; transition:.14s;
}
.side-link .ico { width:18px; text-align:center; opacity:.9; }
.side-link:hover { background: var(--bg-3); color: var(--text); }
.side-link.active { background: rgba(31,232,212,.12); color: var(--cyan); box-shadow: inset 3px 0 0 var(--cyan); }
.side-foot { margin-top:auto; padding:12px 8px; }

.main { display:flex; flex-direction:column; min-height:100vh; }
.topbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 26px; border-bottom:1px solid var(--bg-4);
  background: rgba(7,33,31,.6); backdrop-filter: blur(8px); position:sticky; top:0; z-index:20;
}
.topbar .search { flex:1; max-width:420px; }
.content { padding:26px; flex:1; }

.avatar {
  width:38px; height:38px; border-radius:11px; display:grid; place-items:center;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-deep)); color:#2a2400; font-weight:800;
}

/* ---------- Stat cards ---------- */
.stat { display:flex; flex-direction:column; gap:6px; }
.stat .k { font-size:.82rem; color:var(--text-dim); display:flex; align-items:center; gap:7px; }
.stat .v { font-size:1.9rem; font-weight:800; letter-spacing:-.02em; }
.stat .delta { font-size:.78rem; font-weight:700; }
.up { color: var(--green); } .down { color: var(--red); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x:auto; border:1px solid var(--bg-4); border-radius:var(--radius); }
table.data { width:100%; border-collapse:collapse; font-size:.9rem; min-width:560px; }
table.data th {
  text-align:left; padding:13px 16px; font-size:.74rem; text-transform:uppercase; letter-spacing:.08em;
  color:var(--text-faint); background:var(--bg-2); border-bottom:1px solid var(--bg-4); position:sticky; top:0;
}
table.data td { padding:13px 16px; border-bottom:1px solid rgba(22,80,75,.5); }
table.data tr:hover td { background: rgba(31,232,212,.04); }
table.data tr:last-child td { border-bottom:none; }

/* ---------- Progress ---------- */
.bar { height:8px; border-radius:99px; background:var(--bg-4); overflow:hidden; }
.bar > span { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,var(--cyan),var(--cyan-deep)); }
.bar.yellow > span { background:linear-gradient(90deg,var(--yellow),var(--yellow-deep)); }

/* ---------- Toggle ---------- */
.switch { position:relative; width:46px; height:26px; }
.switch input { display:none; }
.switch .track { position:absolute; inset:0; background:var(--bg-4); border-radius:99px; transition:.2s; }
.switch .track::after { content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:var(--text); transition:.2s; }
.switch input:checked + .track { background:var(--cyan); }
.switch input:checked + .track::after { transform:translateX(20px); background:#03201d; }

/* ---------- Footer ---------- */
.footer { border-top:1px solid var(--bg-4); padding:42px 0; color:var(--text-dim); }
.footer-grid { display:grid; grid-template-columns:1.4fr repeat(3,1fr); gap:28px; }
.footer a { display:block; color:var(--text-dim); padding:5px 0; font-size:.92rem; }
.footer a:hover { color:var(--cyan); }

/* ---------- App overlay scrim (must stay OUT of grid flow at all sizes) ---------- */
.scrim { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:55; }
.scrim.show { display:block; }

/* ---------- Utility ---------- */
.hr { height:1px; background:var(--bg-4); border:none; margin:20px 0; }
.pill-tabs { display:inline-flex; background:var(--bg-0); border:1px solid var(--bg-4); border-radius:12px; padding:4px; gap:4px; }
.pill-tabs button { background:none; border:none; color:var(--text-dim); padding:8px 16px; border-radius:9px; font-weight:700; font-size:.86rem; }
.pill-tabs button.active { background:var(--cyan); color:#03201d; }
.scrolly { max-height:340px; overflow-y:auto; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:var(--bg-4); border-radius:99px; }
::-webkit-scrollbar-track { background:transparent; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav-links, .nav-cta .btn-ghost { display:none; }
  .hamburger { display:inline-flex; }
  .footer-grid { grid-template-columns:1fr 1fr; }
  .app { grid-template-columns:1fr; }
  .sidebar {
    position:fixed; left:0; top:0; width:260px; z-index:60;
    transform:translateX(-110%); transition:.25s; height:100vh;
  }
  .sidebar.open { transform:none; box-shadow:var(--shadow); }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns:1fr; }
  .section { padding:48px 0; }
  .content { padding:16px; }
  .topbar { padding:12px 14px; }
  .topbar .search { display:none; }
  h1 { font-size:2.1rem; }
}

/* mobile nav drawer for marketing pages */
.mnav { display:none; position:fixed; inset:0 0 0 auto; width:80vw; max-width:320px; z-index:80;
  background:var(--bg-2); border-left:1px solid var(--bg-4); padding:22px; transform:translateX(110%); transition:.25s; }
.mnav.open { transform:none; display:block; }
.mnav a { display:block; padding:13px 6px; border-bottom:1px solid var(--bg-4); color:var(--text); font-weight:600; }

/* Branded dialogs (UI.alert / confirm / prompt / form / reveal) */
.ui-dialog-overlay { position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:200; display:flex; align-items:center; justify-content:center; padding:20px; animation:uiFade .12s ease; }
@keyframes uiFade { from{opacity:0} to{opacity:1} }
.ui-dialog { background:var(--bg-2); border:1px solid var(--bg-4); border-radius:16px; width:min(440px,100%); max-height:90vh; overflow-y:auto; padding:22px; box-shadow:var(--shadow); animation:uiPop .14s ease; }
@keyframes uiPop { from{transform:translateY(8px) scale(.985);opacity:0} to{transform:none;opacity:1} }
.ui-dialog-title { font-size:1.15rem; margin:0 0 8px; }
.ui-dialog-msg { color:var(--text-dim); font-size:.93rem; margin:0 0 16px; line-height:1.5; }
.ui-dialog-field { margin-bottom:12px; }
.ui-dialog-field label { display:block; font-size:.8rem; color:var(--text-dim); font-weight:600; margin-bottom:6px; }
.ui-dialog-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:18px; }
.ui-dialog-actions .btn { min-width:92px; }

/* Mobile: turn wide data tables into stacked cards (opt-in via .stack-mobile).
   Each <td> needs a data-label="…" for its row label. Desktop is untouched. */
@media (max-width: 600px) {
  table.stack-mobile { min-width:0 !important; }
  table.stack-mobile thead { display:none; }
  table.stack-mobile, table.stack-mobile tbody, table.stack-mobile tr, table.stack-mobile td { display:block; width:auto; }
  table.stack-mobile tr {
    border:1px solid var(--bg-4); border-radius:12px; margin-bottom:10px; padding:4px 13px; background:var(--bg-2);
  }
  table.stack-mobile td {
    border:none; padding:9px 0; display:flex; justify-content:space-between; align-items:center; gap:14px; text-align:right; min-height:0;
  }
  table.stack-mobile td + td { border-top:1px solid var(--bg-4); }
  table.stack-mobile td::before {
    content: attr(data-label); flex:0 0 auto; text-align:left;
    font-size:.7rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-faint); font-weight:700;
  }
  /* cells with no label (actions/checkbox) center their content full-width */
  table.stack-mobile td[data-label=""] { justify-content:center; }
  table.stack-mobile td[data-label=""]::before { content:none; }
  table.stack-mobile td .stage-select { max-width:60%; }
  /* empty-state / message rows (colspan) stay full-width and centered */
  table.stack-mobile td[colspan] { display:block; text-align:center; border:none; }
  table.stack-mobile td[colspan]::before { content:none; }
  table.stack-mobile tr:has(td[colspan]) { background:none; border:none; padding:0; }
}
