@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&family=Orbitron:wght@600;700&display=swap");

:root {
  --bg0: #040506;
  --bg1: #080a0c;
  --bg2: #0c0f12;
  --panel: rgba(10, 14, 16, 0.82);
  --panel-hi: rgba(18, 24, 28, 0.9);
  --border: rgba(180, 255, 80, 0.08);
  --border-hi: rgba(180, 255, 80, 0.18);
  --text: #e8efe6;
  --muted: #8a9688;
  --dim: #5a6558;
  --lime: #b8ff3c;
  --lime-dim: #7ab82a;
  --lime-glow: rgba(184, 255, 60, 0.45);
  --cyan: #5eead4;
  --amber: #e8c47c;
  --good: #b8ff3c;
  --warn: #e8b84a;
  --bad: #ff5a5f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  --radius: 4px;
  --radius-lg: 8px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --display: "Orbitron", "Space Grotesk", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background: var(--bg0);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.015em;
}

/* tactical ambient */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(900px 520px at 6% -8%, rgba(184, 255, 60, 0.07), transparent 55%),
    radial-gradient(700px 400px at 96% 0%, rgba(94, 234, 212, 0.04), transparent 50%),
    radial-gradient(500px 360px at 50% 110%, rgba(184, 255, 60, 0.03), transparent 55%),
    linear-gradient(165deg, #050708 0%, #030405 50%, #020303 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(184, 255, 60, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 255, 60, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
}

.bg-scan {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.35) 2px,
    rgba(0, 0, 0, 0.35) 4px
  );
}

a { color: var(--lime); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
.hidden { display: none !important; }

/* ---------- Logo: fit clean, slight rounding, faint lime glow only ---------- */
.logo-wrap {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  /* no circular grey overlay / aura rings */
}
.brand-logo {
  position: relative;
  z-index: 1;
  opacity: 0.22; /* ~80% transparent */
  width: 100%;
  height: 100%;
  object-fit: contain; /* full logo, barely cropped */
  object-position: center;
  border-radius: 10px; /* slightly rounded edges */
  filter: drop-shadow(0 0 8px rgba(184, 255, 60, 0.28));
  user-select: none;
  pointer-events: none;
}
.logo-wrap-lg {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
}
.logo-wrap-sm {
  width: 42px;
  height: 42px;
}

/* ---------- Login ---------- */
#login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  animation: fadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-card {
  width: min(420px, 100%);
  padding: 40px 34px 30px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(14, 18, 16, 0.92), rgba(6, 8, 8, 0.95));
  border: 1px solid var(--border-hi);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(184, 255, 60, 0.06);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
  opacity: 0.7;
}
.login-card h1 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text);
  text-shadow: 0 0 24px rgba(184, 255, 60, 0.25);
}
.login-card .sub {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
  margin: 0 0 26px;
  line-height: 1.5;
  text-align: center;
  letter-spacing: 0.04em;
}
.login-hint {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 0.78rem;
  color: var(--dim);
  text-align: center;
}

/* ---------- Shell ---------- */
#app-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 22px;
  background: rgba(4, 5, 6, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.topbar .tag {
  font-size: 0.62rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  font-family: var(--mono);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* SIP status: glowing dot only */
.status-dot {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.status-dot .dot-core {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 6px rgba(90, 101, 88, 0.5);
  z-index: 2;
  transition: background 0.3s, box-shadow 0.3s;
}
.status-dot .dot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  opacity: 0;
  z-index: 1;
}
.status-dot.ok .dot-core {
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime-glow), 0 0 22px rgba(184, 255, 60, 0.35);
  animation: coreBreathe 2.2s ease-in-out infinite;
}
.status-dot.ok .dot-ring {
  border-color: rgba(184, 255, 60, 0.45);
  animation: ringExpand 2.4s ease-out infinite;
  opacity: 1;
}
.status-dot.ok .dot-ring.r2 {
  animation-delay: 1.2s;
}
.status-dot.bad .dot-core {
  background: var(--bad);
  box-shadow: 0 0 10px rgba(255, 90, 95, 0.55);
  animation: coreBlink 1s step-end infinite;
}
.status-dot.warn .dot-core {
  background: var(--warn);
  box-shadow: 0 0 10px rgba(232, 184, 74, 0.45);
  animation: coreBreathe 1.4s ease-in-out infinite;
}
.status-dot.sm {
  width: 12px;
  height: 12px;
}
.status-dot.sm .dot-core { width: 7px; height: 7px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 2px;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.user-pill { color: var(--text); }

.nav-tabs {
  display: flex;
  gap: 2px;
  padding: 12px 22px 0;
  flex-wrap: wrap;
  border-bottom: 1px solid transparent;
}
.nav-tabs button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.nav-tabs button:hover {
  color: var(--text);
  background: rgba(184, 255, 60, 0.04);
}
.nav-tabs button.active {
  color: var(--lime);
  background: rgba(184, 255, 60, 0.07);
  border-color: rgba(184, 255, 60, 0.28);
  box-shadow: 0 0 20px rgba(184, 255, 60, 0.08), inset 0 -1px 0 var(--lime);
}

.main {
  flex: 1;
  padding: 20px 22px 56px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.panel { display: none; }
.panel.active {
  display: block;
  animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 880px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { padding: 10px 12px; }
  .main { padding: 14px 12px 40px; }
  .nav-tabs { padding: 10px 12px 0; }
}

.card {
  background: linear-gradient(165deg, rgba(16, 20, 18, 0.9), rgba(8, 10, 10, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  border-color: rgba(184, 255, 60, 0.16);
  box-shadow: var(--shadow), 0 0 40px rgba(184, 255, 60, 0.04);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 255, 60, 0.35), transparent);
}
.card-kicker {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lime-dim);
  margin-bottom: 6px;
}
.card h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card .hint {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 400;
  margin: 0 0 18px;
  line-height: 1.5;
}
.card .hint.tight { margin-bottom: 10px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.68rem;
  color: var(--dim);
  margin-bottom: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  font-family: var(--mono);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.45);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(184, 255, 60, 0.5);
  box-shadow: 0 0 0 2px rgba(184, 255, 60, 0.1), 0 0 20px rgba(184, 255, 60, 0.06);
}
.field textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
}
.field .preview {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--lime);
  min-height: 1.2em;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(184, 255, 60, 0.25);
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border-hi);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--mono);
  transition: transform 0.15s, background 0.18s, box-shadow 0.18s, border-color 0.18s, filter 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.btn:hover {
  background: rgba(184, 255, 60, 0.06);
  border-color: rgba(184, 255, 60, 0.35);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}
.btn-sm { padding: 8px 12px; font-size: 0.72rem; }
.btn-lg { padding: 14px 28px; font-size: 0.9rem; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-primary {
  border-color: rgba(184, 255, 60, 0.45);
  background: linear-gradient(135deg, rgba(184, 255, 60, 0.18) 0%, rgba(122, 184, 42, 0.12) 100%);
  color: var(--lime);
  box-shadow: 0 0 28px rgba(184, 255, 60, 0.12), inset 0 0 20px rgba(184, 255, 60, 0.04);
  text-shadow: 0 0 12px rgba(184, 255, 60, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(184, 255, 60, 0.28) 0%, rgba(122, 184, 42, 0.18) 100%);
  border-color: var(--lime);
  box-shadow: 0 0 36px rgba(184, 255, 60, 0.22), inset 0 0 24px rgba(184, 255, 60, 0.06);
  filter: brightness(1.05);
}
.btn-primary .btn-glow {
  display: none; /* was infinite sweep — felt laggy on click */
}
.btn-primary:active {
  transform: scale(0.98);
  transition: transform 0.08s ease;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); }
.btn-stop {
  border-color: rgba(255, 90, 95, 0.4);
  color: #ffb4b6;
  background: rgba(255, 90, 95, 0.06);
}
.btn-stop:hover:not(:disabled) {
  background: rgba(255, 90, 95, 0.14);
  box-shadow: 0 0 20px rgba(255, 90, 95, 0.15);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-of-type { border-bottom: none; }
.toggle-row .t-label { font-weight: 600; font-size: 0.92rem; }
.toggle-row .t-desc { font-size: 0.78rem; color: var(--dim); margin-top: 3px; line-height: 1.4; }

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.2s;
}
.switch span::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 1px;
  background: #c5d0c2;
  transition: 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.switch input:checked + span {
  background: rgba(184, 255, 60, 0.18);
  border-color: rgba(184, 255, 60, 0.5);
  box-shadow: inset 0 0 12px rgba(184, 255, 60, 0.1);
}
.switch input:checked + span::before {
  transform: translateX(20px);
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime-glow);
}

/* ---------- Tables (mobile-friendly) ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.4);
}
.activity-table { margin-top: 12px; max-height: 480px; overflow: auto; }
.p1-table { max-height: 560px; overflow: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 0;
  table-layout: auto;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--dim);
  font-weight: 600;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: rgba(184, 255, 60, 0.03);
  position: sticky;
  top: 0;
  font-family: var(--mono);
  z-index: 1;
  white-space: nowrap;
}
td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
td.mono { font-family: var(--mono); font-size: 0.8rem; word-break: break-all; }
td.cell-detail {
  color: var(--dim);
  max-width: 220px;
  font-size: 0.8rem;
}
td.cell-actions {
  white-space: nowrap;
  width: 1%;
  text-align: right;
}
tr:last-child td { border-bottom: none; }
tr { transition: background 0.12s; }
tr:hover td { background: rgba(184, 255, 60, 0.03); }

/* Card-stack tables on narrow screens */
@media (max-width: 720px) {
  .table-wrap { border: none; background: transparent; overflow: visible; }
  .activity-table, .p1-table { max-height: none; }
  table.data-table,
  table.data-table thead,
  table.data-table tbody,
  table.data-table th,
  table.data-table td,
  table.data-table tr {
    display: block;
    width: 100%;
  }
  table.data-table thead { display: none; }
  table.data-table tr {
    margin-bottom: 10px;
    padding: 12px 12px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.35);
  }
  table.data-table tr:hover td { background: transparent; }
  table.data-table td {
    border: none;
    padding: 4px 0;
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 8px;
    align-items: start;
  }
  table.data-table td::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dim);
    padding-top: 3px;
  }
  table.data-table td.cell-actions {
    display: flex;
    justify-content: flex-end;
    grid-template-columns: none;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  table.data-table td.cell-actions::before { display: none; }
  table.data-table td.cell-detail { max-width: none; }
  .stat .l { font-size: 0.58rem; line-height: 1.35; }
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 2px;
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  text-transform: uppercase;
  font-family: var(--mono);
}
.badge-yes {
  background: rgba(184, 255, 60, 0.1);
  color: var(--lime);
  border-color: rgba(184, 255, 60, 0.3);
  box-shadow: 0 0 12px rgba(184, 255, 60, 0.1);
}
.badge-vm { background: rgba(232, 184, 74, 0.1); color: #fcd34d; border-color: rgba(232, 184, 74, 0.25); }
.badge-hang { background: rgba(255, 90, 95, 0.1); color: #fca5a5; border-color: rgba(255, 90, 95, 0.25); }
.badge-no { background: rgba(148, 163, 184, 0.08); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.18); }
.badge-ok { background: rgba(94, 234, 212, 0.08); color: #99f6e4; border-color: rgba(94, 234, 212, 0.2); }
.badge-fail { background: rgba(255, 90, 95, 0.12); color: #fecaca; }
.badge-live {
  background: rgba(184, 255, 60, 0.12);
  color: var(--lime);
  border-color: rgba(184, 255, 60, 0.35);
  animation: badgePulse 1.4s ease-in-out infinite;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--mono);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  max-width: min(400px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 2px;
  background: rgba(6, 8, 8, 0.96);
  border: 1px solid var(--border-hi);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  font-size: 0.86rem;
  font-family: var(--mono);
  letter-spacing: 0.03em;
  transform: translateY(120%) scale(0.96);
  opacity: 0;
  transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.toast.err { border-color: rgba(255, 90, 95, 0.5); color: #fecaca; }
.toast.ok { border-color: rgba(184, 255, 60, 0.45); color: var(--lime); }

/* ---------- SIP edit panel ---------- */
.sip-edit-panel {
  margin-top: 14px;
  padding: 14px 12px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(184, 255, 60, 0.22);
  background: rgba(184, 255, 60, 0.04);
}
.sip-edit-panel.hidden { display: none; }
.sip-edit-panel .card-kicker { margin-bottom: 10px; }

/* ---------- Workers section (above live logs) ---------- */
.workers-section {
  margin: 10px 0 14px;
  padding: 12px 12px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
}
.workers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.workers-kicker {
  font-family: var(--display);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.workers-cap {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
}
.workers-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.worker-idle-hint {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
  padding: 10px 4px 6px;
  letter-spacing: 0.04em;
}
.worker-idle-hint.hidden { display: none; }
.logs-section-label {
  margin: 4px 0 6px;
}
.workers-section .job-bar {
  margin: 0;
}

/* ---------- Job / status animations ---------- */
.job-bar {
  margin: 8px 0 4px;
  padding: 16px 16px 14px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 16px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.job-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(184, 255, 60, 0.03), transparent);
  transform: translateX(-100%);
  pointer-events: none;
}
.job-bar.running::after {
  display: none; /* drop continuous scan sweep — smoother UI */
}
.job-bar.running {
  border-color: rgba(184, 255, 60, 0.3);
  box-shadow: 0 0 20px rgba(184, 255, 60, 0.06);
}
.job-bar.done {
  border-color: rgba(184, 255, 60, 0.25);
  color: var(--lime);
}
.job-bar.error, .job-bar.stopped {
  border-color: rgba(255, 90, 95, 0.35);
}

.job-anim {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  width: 36px;
  flex-shrink: 0;
}
.job-anim .wave {
  display: block;
  width: 4px;
  height: 8px;
  border-radius: 1px;
  background: var(--dim);
  transition: background 0.2s;
}
.job-bar.running .wave {
  background: var(--lime);
  box-shadow: 0 0 6px var(--lime-glow);
  /* single cheap pulse instead of 5 desynced height anims */
  animation: coreBreathe 1.4s ease-in-out infinite;
  height: 14px;
}
.job-bar.running .wave:nth-child(odd) { opacity: 0.7; }
.job-bar.done .wave { background: var(--lime); height: 12px; opacity: 0.7; }
.job-bar.error .wave, .job-bar.stopped .wave { background: var(--bad); height: 6px; }

.job-copy { min-width: 0; grid-column: 2; }
.job-status {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.job-bar.running .job-status {
  color: var(--lime);
  text-shadow: 0 0 14px rgba(184, 255, 60, 0.4);
  animation: statusFlicker 2.8s ease-in-out infinite;
}
.job-bar.done .job-status { color: var(--lime); }
.job-bar.error .job-status, .job-bar.stopped .job-status { color: var(--bad); }
.job-msg {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  word-break: break-word;
}
.job-bar.running .job-msg { color: var(--text); }
.job-meta {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--lime-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.job-meta:empty { display: none; }
.job-meta .job-phone {
  color: var(--text);
  font-weight: 600;
}
.job-meta .job-time {
  color: var(--muted);
}
.activity-head {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.activity-head h2 { margin: 0; }

.job-progress {
  grid-column: 1 / -1;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
  overflow: hidden;
  margin-top: 2px;
}
.job-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--lime-dim), var(--lime));
  box-shadow: 0 0 10px var(--lime-glow);
  transition: width 0.4s ease;
}
.job-bar.running .job-progress-fill {
  animation: progressPulse 1.6s ease-in-out infinite;
}

.file-drop {
  border: 1px dashed rgba(184, 255, 60, 0.2);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s;
  margin-bottom: 14px;
  font-size: 0.86rem;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.file-drop-icon {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: var(--lime-dim);
  opacity: 0.7;
}
.file-drop:hover, .file-drop.drag {
  border-color: rgba(184, 255, 60, 0.55);
  background: rgba(184, 255, 60, 0.05);
  color: var(--text);
  box-shadow: 0 0 24px rgba(184, 255, 60, 0.08);
}
.file-drop input { display: none; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .stat-row { grid-template-columns: 1fr; }
}
.stat {
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(16, 20, 18, 0.9), rgba(0, 0, 0, 0.35));
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 255, 60, 0.4), transparent);
}
.stat .n {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--lime);
  text-shadow: 0 0 20px rgba(184, 255, 60, 0.3);
}
.stat .n.accent {
  background: linear-gradient(100deg, #fff, var(--lime));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .n.muted-n {
  font-size: 1rem;
  padding-top: 8px;
  color: var(--muted);
  text-shadow: none;
}
.stat .l {
  font-size: 0.64rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 4px;
  font-weight: 500;
  font-family: var(--mono);
}

.err-text {
  color: var(--bad);
  font-size: 0.82rem;
  margin-top: 10px;
  min-height: 1.2em;
  font-family: var(--mono);
}

/* Settings layout */
.settings-stack { display: flex; flex-direction: column; gap: 16px; }
.activity-card { margin-top: 16px; }
.activity-head { justify-content: space-between; margin-bottom: 4px; }
.activity-head h2 { margin: 0; }
.account-grid { margin-top: 16px; }

.save-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(184, 255, 60, 0.22);
  background: linear-gradient(120deg, rgba(184, 255, 60, 0.07), rgba(0, 0, 0, 0.4));
  box-shadow: 0 0 40px rgba(184, 255, 60, 0.06);
}
.save-bar-compact { justify-content: center; }
.account-grid.single-account {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 480px;
  margin-top: 16px;
}

/* P1 glow text in job status */
.p1-flare {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #7ef0d4;
  text-shadow:
    0 0 8px rgba(126, 240, 212, 0.85),
    0 0 18px rgba(184, 255, 60, 0.45),
    0 0 32px rgba(94, 234, 212, 0.35);
  animation: p1Flare 1.8s ease-in-out infinite;
}
@keyframes p1Flare {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.88; filter: brightness(1.2); }
}

/* Audio library */
.audio-card { overflow: visible; }
.audio-roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 720px) {
  .audio-roles { grid-template-columns: 1fr; }
}
.audio-role {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
}
.audio-role-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.audio-upload-btn { cursor: pointer; margin: 0; }
.audio-active {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--lime);
  letter-spacing: 0.03em;
  padding: 8px 10px;
  border-radius: 2px;
  background: rgba(184, 255, 60, 0.05);
  border: 1px solid rgba(184, 255, 60, 0.12);
  word-break: break-word;
}
.audio-lib-head { margin: 4px 0 10px; }
.audio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}
.audio-empty {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 20px;
}
.audio-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s;
}
.audio-row:hover { border-color: rgba(184, 255, 60, 0.2); }
.audio-row.active-role {
  border-color: rgba(184, 255, 60, 0.35);
  box-shadow: inset 0 0 20px rgba(184, 255, 60, 0.04);
}
.audio-meta { min-width: 0; }
.audio-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-sub {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--dim);
  letter-spacing: 0.06em;
  margin-top: 3px;
  text-transform: uppercase;
}
.audio-tags {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.audio-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid rgba(184, 255, 60, 0.25);
  color: var(--lime);
  background: rgba(184, 255, 60, 0.08);
}
.audio-tag.dim {
  border-color: var(--border);
  color: var(--dim);
  background: transparent;
}
.audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* SIP vault */
.vault-card { border-color: rgba(184, 255, 60, 0.12); }
.vault-lock {
  max-width: 420px;
  padding: 8px 0 4px;
}
.vault-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
}
.vault-shield {
  width: 36px;
  height: 40px;
  background:
    linear-gradient(160deg, rgba(184, 255, 60, 0.2), rgba(184, 255, 60, 0.04));
  clip-path: polygon(50% 0%, 100% 18%, 100% 58%, 50% 100%, 0% 58%, 0% 18%);
  border: 1px solid rgba(184, 255, 60, 0.35);
  box-shadow: 0 0 20px rgba(184, 255, 60, 0.15);
  animation: auraPulse 3s ease-in-out infinite;
}
.vault-unlocked-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(184, 255, 60, 0.2);
  background: rgba(184, 255, 60, 0.05);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lime);
}
.sip-grid { margin-bottom: 8px; }

/* ---------- Keyframes ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auraPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
@keyframes coreBreathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}
@keyframes coreBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
@keyframes ringExpand {
  0% { transform: scale(0.55); opacity: 0.7; }
  100% { transform: scale(1.8); opacity: 0; }
}
@keyframes waveBar {
  0%, 100% { height: 8px; }
  50% { height: 26px; }
}
@keyframes scanSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes statusFlicker {
  0%, 100% { opacity: 1; }
  48% { opacity: 1; }
  50% { opacity: 0.55; }
  52% { opacity: 1; }
  90% { opacity: 0.85; }
}
@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes btnSweep {
  0%, 60% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(184, 255, 60, 0.15); }
  50% { box-shadow: 0 0 16px rgba(184, 255, 60, 0.35); }
}

/* Caller ID: single vs rotate list */
.cid-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 10px 0 14px;
}
.cid-source-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text);
  margin: 0;
}
.cid-panel {
  margin-top: 2px;
}
.cid-panel.hidden {
  display: none;
}
.cid-randomize-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  margin: 0 0 6px;
}
.cid-randomize-row .t-desc {
  color: var(--muted);
  font-size: 0.84rem;
}
.cid-route-hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #1f6b3a;
  font-style: italic;
}
.cid-route-hint[hidden] {
  display: none !important;
}

/* Balance pill (settings tab only) */
.balance-pill {
  color: var(--lime);
  border-color: rgba(184, 255, 60, 0.28);
  background: rgba(184, 255, 60, 0.06);
  letter-spacing: 0.04em;
}

/* Login register */
.login-register-btn {
  margin-top: 10px;
}

/* Register modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
.modal-backdrop.hidden {
  display: none;
}
.modal-card {
  width: min(440px, 100%);
  padding: 28px 24px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(14, 18, 16, 0.97), rgba(6, 8, 8, 0.98));
  border: 1px solid var(--border-hi);
  box-shadow: var(--shadow);
}
.modal-card h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.register-paid-disabled {
  margin-top: 16px;
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: none;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: normal;
  height: auto;
  min-height: 44px;
  padding: 10px 12px;
}
