/* voicebot-admin — v0.6 UI: light surface, emerald primary, soft tech feel. */

:root {
  /* ── canvas / surfaces ──────────────────────────────────────────── */
  --bg-page:        #f6f8fa;
  --bg-card:        #ffffff;
  --bg-input:       #f8fafc;
  --bg-muted:       #f1f5f9;
  --bg-tint:        #ecfdf5;        /* emerald-50 — soft accent wash */
  --bg-darken:      #eef2f7;        /* alt row, table head */

  /* ── ink ────────────────────────────────────────────────────────── */
  --fg:             #0f172a;        /* slate-900 — body */
  --fg-strong:      #020617;        /* slate-950 — headlines */
  --fg-dim:         #475569;        /* slate-600 — secondary */
  --fg-muted:       #94a3b8;        /* slate-400 — disabled / placeholder */

  /* ── primary: emerald ───────────────────────────────────────────── */
  --accent:         #059669;        /* emerald-600 */
  --accent-hover:   #047857;        /* emerald-700 */
  --accent-strong:  #064e3b;        /* emerald-800 — for text on light */
  --accent-soft:    #d1fae5;        /* emerald-100 — chip / tag bg */
  --accent-tint:    #ecfdf5;        /* emerald-50 — panel wash */
  --accent-glow:    rgba(5,150,105,0.18);

  /* ── status colours ─────────────────────────────────────────────── */
  --ok:             #059669;
  --ok-soft:        #d1fae5;
  --warn:           #d97706;        /* amber-600 */
  --warn-soft:      #fef3c7;
  --err:            #dc2626;        /* red-600 */
  --err-soft:       #fee2e2;
  --info:           #0284c7;        /* sky-600 */
  --info-soft:      #e0f2fe;

  /* ── lines ──────────────────────────────────────────────────────── */
  --border:         #e2e8f0;        /* slate-200 */
  --border-strong:  #cbd5e1;        /* slate-300 */
  --border-accent:  rgba(5,150,105,0.32);

  /* ── elevation ──────────────────────────────────────────────────── */
  --shadow-sm:  0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow:     0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow-md:  0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg:  0 10px 18px -3px rgba(15, 23, 42, 0.10), 0 4px 8px -4px rgba(15, 23, 42, 0.06);
  --ring:       0 0 0 3px var(--accent-glow);

  /* ── type ───────────────────────────────────────────────────────── */
  --font:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius:    8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  background-color: var(--bg-page);
  /* Subtle dot grid — adds quiet "tech surface" texture without noise. */
  background-image: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.04) 1px, transparent 0);
  background-size: 22px 22px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--fg-strong); letter-spacing: -0.012em; }
h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

code, .mono { font-family: var(--mono); font-size: 12.5px; }
code {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

/* ════════════════════════════════════════════════════════════════════
   App shell — sidebar + slim topbar + main + footer + right drawer
   ════════════════════════════════════════════════════════════════════ */
body.app-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
body.app-shell.sidebar-collapsed { grid-template-columns: 56px 1fr; }
body.auth-shell  { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 5;
}
.sidebar-brand {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-strong);
  text-decoration: none;
}
.sidebar-brand .brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: 0 0 10px;
}
.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  white-space: nowrap;
}
.sidebar-brand .brand-text strong { font-size: 15px; letter-spacing: -0.01em; }
.sidebar-brand .brand-text .dim   { font-size: 11px; color: var(--fg-dim); margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 14px 0; overflow-y: auto; }
.nav-section { margin: 0 0 6px; }
.nav-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 22px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.nav-section > summary::-webkit-details-marker { display: none; }
.nav-section > summary::after {
  content: '▾';
  font-size: 9px;
  margin-left: auto;
  color: var(--fg-muted);
  transition: transform 0.15s;
}
.nav-section:not([open]) > summary::after { transform: rotate(-90deg); }

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 22px 8px 38px;
  color: var(--fg);
  text-decoration: none;
  font-size: 13.5px;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover {
  background: var(--bg-tint);
  color: var(--accent-hover);
  text-decoration: none;
}
.nav-item.active {
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}
.nav-item .nav-ext {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-muted);
  background: var(--bg-muted);
  padding: 1px 6px;
  border-radius: 4px;
}
.sidebar-collapse {
  margin: 14px 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  cursor: pointer;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.sidebar-collapse:hover { background: var(--accent-tint); color: var(--accent); border-color: var(--border-accent); }

/* Collapsed state */
body.sidebar-collapsed .sidebar-brand .brand-text,
body.sidebar-collapsed .nav-section > summary,
body.sidebar-collapsed .nav-item span:not(.nav-ext),
body.sidebar-collapsed .nav-item .nav-ext { display: none; }
body.sidebar-collapsed .nav-item { padding: 10px 18px; justify-content: center; }
body.sidebar-collapsed .sidebar-brand { padding: 18px 12px; justify-content: center; }
body.sidebar-collapsed .sidebar-collapse { transform: rotate(180deg); }

/* ── Main region (right of sidebar) ─────────────────────────── */
.main-region {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar-slim {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: var(--shadow-sm);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-slim .who { color: var(--fg-dim); font-size: 12.5px; padding-left: 8px; border-left: 1px solid var(--border); margin-left: 4px; }
.topbar-slim .who .role {
  display: inline-block;
  padding: 1px 8px;
  background: var(--bg-tint);
  color: var(--accent-strong);
  border-radius: 4px;
  margin-left: 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--fg-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
}
.icon-btn:hover { background: var(--bg-tint); color: var(--accent-hover); border-color: var(--border); }
/* Override the generic `main { max-width: 1100px... }` rule below so the
   shell's main-region spans the full width left of the sidebar; the page
   `<section>` inside is what gets the comfortable 1100 px frame. */
.main-content   { flex: 1; max-width: none; margin: 0; padding: 0 0 24px; }
.main-content > section { max-width: 1100px; margin: 28px auto; padding: 0 28px; }

/* ── Footer ──────────────────────────────────────────────────── */
.app-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 16px 28px;
  text-align: center;
  font-size: 12px;
  color: var(--fg-dim);
}
.app-footer a {
  color: var(--fg-dim);
  margin: 0 4px;
  text-decoration: none;
}
.app-footer a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.app-footer .footer-sep { color: var(--fg-muted); margin: 0 4px; }

/* ── Right-side app drawer ───────────────────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 90;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.app-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: 460px;
  max-width: 92vw;
  background: var(--bg-card);
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.10);
  z-index: 100;
  transform: translateX(105%);
  transition: transform 0.24s ease;
  display: flex;
  flex-direction: column;
}
.app-drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h2 { margin: 0; font-size: 22px; }
.drawer-list {
  list-style: none;
  padding: 14px 12px;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}
.drawer-list li { margin: 0; }
.drawer-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg);
  transition: background 0.12s;
}
.drawer-list a:hover { background: var(--bg-tint); text-decoration: none; }
.drawer-list a.active { background: var(--accent-tint); }
.drawer-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 44px;
}
.drawer-meta { display: flex; flex-direction: column; min-width: 0; }
.drawer-meta strong { font-size: 14px; color: var(--fg-strong); }
.drawer-meta span   { font-size: 12px; color: var(--fg-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Auth (login) topbar ─────────────────────────────────────── */
.auth-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.auth-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-topbar .brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-topbar strong { color: var(--fg-strong); letter-spacing: -0.01em; }
.auth-topbar .dim   { color: var(--fg-dim); font-size: 13px; }

/* ── Legacy single-page topbar (old base) — keep for safety ──── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand a {
  color: var(--fg-strong);
  font-weight: 700;
  letter-spacing: -0.015em;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand a::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: var(--fg-dim); font-weight: 500; font-size: 13px; }
.topbar nav a:hover { color: var(--accent); text-decoration: none; }
.topbar nav .who { color: var(--fg-dim); font-size: 12.5px; }
.topbar nav .role {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--border);
  background: var(--bg-tint);
  color: var(--accent-strong);
  border-radius: 4px;
  margin-left: 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.lang-switch {
  margin-left: 6px;
  padding: 3px 8px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lang-switch .lang-opt {
  color: var(--fg-dim);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  padding: 1px 6px;
  border-radius: 10px;
}
.lang-switch .lang-opt:hover { color: var(--accent-hover); text-decoration: none; }
.lang-switch .lang-opt.active {
  background: var(--accent);
  color: white;
}
.lang-switch .lang-divider { color: var(--fg-muted); font-size: 11px; }

main { max-width: 1100px; margin: 32px auto; padding: 0 28px; }

/* ── Generic text helpers ────────────────────────────────────────── */
.dim    { color: var(--fg-dim); }
.muted  { color: var(--fg-muted); font-style: italic; }
.row    { display: flex; gap: 12px; align-items: center; }
.row.spread { justify-content: space-between; margin-top: 18px; }
.inline { display: inline; }
.narrow { max-width: 580px; }

/* ── Alerts ──────────────────────────────────────────────────────── */
.ok, .error {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin: 12px 0;
  border-width: 1px;
  border-style: solid;
}
.ok    { background: var(--ok-soft);  color: var(--accent-strong); border-color: var(--border-accent); }
.error { background: var(--err-soft); color: #991b1b;              border-color: rgba(220,38,38,0.25); }

.log {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  overflow-x: auto;
  color: var(--fg);
}

/* ── Cards / panels ──────────────────────────────────────────────── */
.card, .panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.card.narrow { max-width: 440px; margin: 64px auto; }
.panel        { margin-top: 20px; }
.panel-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.panel-header h2 { margin: 0; }
.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  margin-top: 20px;
}

/* ── Tables ──────────────────────────────────────────────────────── */
table.grid {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.grid th, table.grid td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
table.grid th {
  background: var(--bg-darken);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
}
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr:hover td { background: var(--bg-tint); }
table.kv input { width: 100%; }

/* ── Forms ───────────────────────────────────────────────────────── */
form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-dim);
  font-weight: 500;
}
form input, form select, form textarea {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
form textarea {
  font-family: var(--mono);
  font-size: 12.5px;
  resize: vertical;
  min-height: 140px;
}
form input::placeholder, form textarea::placeholder { color: var(--fg-muted); }
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

/* ── Buttons ─────────────────────────────────────────────────────── */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.12s ease;
}
button:hover, .button:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  text-decoration: none;
}
button.primary, .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}
button.primary:hover, .button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
  box-shadow: var(--shadow);
}
button.ghost, .button.ghost {
  background: transparent;
  border-color: var(--border);
}
button.ghost:hover, .button.ghost:hover { background: var(--bg-tint); }
button:disabled, .button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
button.link {
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
}
button.link:hover { color: var(--accent-hover); text-decoration: underline; }

/* ── Status pills ────────────────────────────────────────────────── */
.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-family: var(--mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.state::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.state-active, .state-online, .state-answered, .state-running {
  background: var(--ok-soft); color: var(--accent-strong); border-color: var(--border-accent);
}
.state-online::before { animation: pulse 2.4s ease-in-out infinite; }
.state-stale, .state-paused, .state-pending, .state-voicemail, .state-activating, .state-deactivating {
  background: var(--warn-soft); color: #92400e; border-color: rgba(217,119,6,0.25);
}
.state-inactive, .state-failed, .state-unknown, .state-offline, .state-no_answer {
  background: var(--err-soft); color: #991b1b; border-color: rgba(220,38,38,0.22);
}
.state-calling {
  background: var(--info-soft); color: #075985; border-color: rgba(2,132,199,0.25);
}
.state-draft, .state-done {
  background: var(--bg-muted); color: var(--fg-dim); border-color: var(--border);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ── Chips / tags ────────────────────────────────────────────────── */
.chip {
  display: inline-block;
  padding: 1px 8px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  border-radius: 4px;
  margin-right: 4px;
  font-size: 11.5px;
  font-family: var(--mono);
}

details > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 500; }
details[open]     { margin-top: 8px; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; }
details[open] > summary { margin-bottom: 8px; }


/* ════════════════════════════════════════════════════════════════════
   Bot grid — card-based picker on the home page
   ════════════════════════════════════════════════════════════════════ */
.bot-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  margin-top: 22px;
}
.bot-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: var(--fg);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.bot-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #34d399);
  opacity: 0;
  transition: opacity 0.18s;
}
.bot-card:hover {
  text-decoration: none;
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.bot-card:hover::before { opacity: 1; }

.bot-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.bot-avatar {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
}
.bot-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg-strong);
  margin: 0;
  letter-spacing: -0.01em;
}
.bot-role {
  color: var(--accent-hover);
  font-size: 12.5px;
  font-weight: 600;
  margin: 3px 0 0;
  letter-spacing: 0.005em;
}
.bot-company {
  color: var(--fg-dim);
  font-size: 13px;
  margin: 2px 0 0;
}
.bot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
}
.bot-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-tint);
  color: var(--accent-strong);
  border: 1px solid var(--border-accent);
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.bot-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px dashed var(--border);
  color: var(--fg-muted);
  font-size: 11px;
  font-family: var(--mono);
}

/* ── Bot detail — keep .cards grid alive but in new theme ───────── */
.card h2 { margin-top: 0; }
.card h3 { margin: 0 0 6px; font-size: 14px; color: var(--fg-strong); }
.card p.dim { font-size: 12.5px; }

/* ════════════════════════════════════════════════════════════════════
   Bot detail — operations console hero, summary cards, advanced block
   ════════════════════════════════════════════════════════════════════ */
.bot-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow);
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}
.bot-hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #34d399);
}
.bot-hero-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}
.bot-hero-title .dim {
  font-size: 18px;
  font-weight: 500;
  color: var(--accent-hover);
  letter-spacing: -0.01em;
}
.bot-hero-sub {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--fg-dim);
}
.bot-hero-sep { color: var(--fg-muted); margin: 0 8px; }

/* One-line status readout for non-technical operators. */
.bot-hero-status-line {
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  border: 1px solid transparent;
}
.bot-hero-status-line.state-line-online {
  background: var(--ok-soft);
  color: var(--accent-strong);
  border-color: var(--border-accent);
}
.bot-hero-status-line.state-line-offline,
.bot-hero-status-line.state-line-stale,
.bot-hero-status-line.state-line-unknown {
  background: var(--err-soft);
  color: #991b1b;
  border-color: rgba(220,38,38,0.22);
}

.summary-value.muted {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-muted);
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}

.advanced-card .button,
.advanced-card form.inline { margin-right: 6px; }
.advanced-card form.inline { display: inline-flex; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-actions .button { padding: 9px 18px; font-size: 13.5px; font-weight: 600; }
.hero-actions form.inline { margin: 0; }

.bot-hero-status {
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px 18px;
  align-content: start;
  background: var(--bg-tint);
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 260px;
}
.bot-hero-status .status-row {
  display: contents;
}
.bot-hero-status .status-label {
  font-size: 11.5px;
  color: var(--fg-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: center;
}
.bot-hero-status .status-value {
  font-size: 13.5px;
  color: var(--fg-strong);
  font-weight: 500;
  text-align: right;
}
.bot-hero-status .state {
  font-size: 11px;
  padding: 1px 9px;
}

@media (max-width: 880px) {
  .bot-hero { grid-template-columns: 1fr; }
  .bot-hero-status { min-width: 0; }
}

/* ── Summary cards (today's ops at a glance) ─────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
}
.summary-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.summary-card .summary-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.summary-card .summary-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--fg-strong);
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

/* ── Advanced section — visually de-emphasised ──────────────── */
.advanced-card { opacity: 0.85; }
.advanced-card:hover { opacity: 1; }

.advanced-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px dashed var(--border-strong);
}
.advanced-header h2 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.advanced-header p.dim {
  margin: 0 0 16px;
  font-size: 12.5px;
}
.advanced-cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.advanced-cards .card {
  background: var(--bg-muted);
  border-style: dashed;
}

/* ── Billing month picker ──────────────────────────────────── */
.month-picker-bar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 22px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.month-picker-form { display: flex; align-items: end; gap: 12px; margin: 0; }
.month-picker-form select {
  min-width: 140px;
  font-family: var(--mono);
  font-size: 14px;
  padding: 7px 11px;
}
.month-picker-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.month-picker-nav .button { font-family: var(--mono); font-size: 13px; padding: 7px 14px; }

.summary-card.highlight {
  background: var(--bg-tint);
  border-color: var(--border-accent);
}
.summary-card.highlight .summary-value { color: var(--accent-strong); }

table.grid tfoot tr.grid-total th {
  background: var(--bg-tint);
  color: var(--fg-strong);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  border-top: 2px solid var(--border-accent);
}

details.month-history { margin-top: 28px; }
details.month-history > summary {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 600;
  color: var(--fg-strong);
}
details.month-history[open] > summary {
  background: var(--bg-tint);
  border-color: var(--border-accent);
}

/* ════════════════════════════════════════════════════════════════════
   Voice picker — accent tabs + per-voice cards
   ════════════════════════════════════════════════════════════════════ */
.accent-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 8px 0 18px;
  flex-wrap: wrap;
}
.accent-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 16px;
  color: var(--fg-dim);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.12s, border-color 0.12s;
}
.accent-tab:hover { color: var(--fg-strong); }
.accent-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.accent-tab.find-more {
  margin-left: auto;
  padding: 4px 12px;
  align-self: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 12px;
}
.accent-tab.find-more:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-tint);
}

.voice-cards {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.voice-cards.hidden { display: none; }
.voice-card-form { margin: 0; padding: 0; }
.voice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 13px;
  transition: border-color 0.1s, background 0.1s;
}
.voice-card:hover { border-color: var(--accent); background: var(--bg-tint); }
.voice-card.is-selected {
  border-color: var(--accent);
  background: var(--bg-tint);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.voice-radio {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--accent);
}
.voice-card.is-selected .voice-radio {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
.voice-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}
.voice-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.voice-meta strong { font-size: 13px; color: var(--fg-strong); }
.voice-meta .dim { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  flex: 0 0 30px;
  text-decoration: none;
  font-size: 14px;
}
.voice-play:hover { background: var(--accent-soft); color: var(--accent-hover); }
.voice-play.inline { margin-left: 8px; width: 24px; height: 24px; font-size: 12px; vertical-align: middle; }
.voice-table tr.is-current { background: var(--bg-tint); }
.voice-table audio        { vertical-align: middle; }

.lang-voice-form select {
  min-width: 280px;
  max-width: 100%;
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
}

/* ── Voice recorder + scripts ────────────────────────────────────── */
.recorder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  margin-top: 12px;
}
.script-box {
  background: var(--bg-tint);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 12px;
  line-height: 1.7;
}
.script-box p { margin: 0 0 10px; }
.script-box q { quotes: "“" "”"; color: var(--accent-hover); font-style: italic; }
.script-box q::before { content: open-quote; }
.script-box q::after  { content: close-quote; }
.script-lang-btn { padding: 4px 12px; font-size: 12px; }
.rec-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
#rec-status { font-size: 13px; }
#rec-btn, #rec-stop { min-width: 160px; }

/* ── Library card on /voice/library ──────────────────────────────── */
.library-card { transition: border-color 0.12s; background: var(--bg-card); }
.library-card:hover { border-color: var(--accent); }
.library-card input[type="text"] {
  background: var(--bg-input);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 9px;
  font-size: 12.5px;
}

/* ── Outbound: structured Call Brief form ─────────────────────── */
.outbound-page { max-width: 920px; }
.outbound-page .panel { margin-top: 18px; }

.call-brief-form .call-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px 8px;
  margin: 14px 0 0;
  background: var(--bg-card);
}
.call-brief-form .call-section > legend {
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.call-brief-form .call-section.call-brief {
  background: var(--bg-tint);
  border-color: var(--border-accent);
}
.call-brief-form .section-helper {
  margin: -4px 0 14px;
  font-size: 12.5px;
}
.call-brief-form label .helper {
  display: block;
  font-size: 12px;
  font-weight: 400;
  margin: 2px 0 4px;
  font-style: italic;
}
.call-brief-form .req { color: #b91c1c; font-weight: 700; margin-left: 2px; }
.call-brief-form .advanced-toggle {
  margin-top: 12px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
}
.call-brief-form .advanced-toggle > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-dim);
  padding: 6px 0;
}
.call-brief-form .advanced-toggle > summary:hover { color: var(--accent); }
.call-brief-form .form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
.call-brief-form .form-actions .button.primary {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .call-brief-form .call-section { padding: 14px 12px 6px; }
  .call-brief-form .row { flex-direction: column; }
  .call-brief-form .row > label { min-width: 0 !important; }
  .call-brief-form .form-actions { justify-content: stretch; }
  .call-brief-form .form-actions .button.primary { width: 100%; }
}

/* ════════════════════════════════════════════════════════════════════
   Mobile responsive layout
   - <960px: sidebar slides out, drawer-style; content goes full width.
   - <600px: single-column rows/cards everywhere; tighter padding;
            tables become horizontally scrollable; topbar email hidden.
   ════════════════════════════════════════════════════════════════════ */

/* Topbar brand chip + hamburger — desktop hides them; mobile shows them. */
.topbar-brand {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--fg-strong);
  text-decoration: none;
  font-size: 15px;
  margin-right: auto;
}
.topbar-brand .brand-mark {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.topbar-menu { display: none; }
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.30);
  z-index: 80;
}

@media (max-width: 960px) {
  /* Collapse the shell into a single column; sidebar overlays. */
  body.app-shell,
  body.app-shell.sidebar-collapsed { grid-template-columns: 1fr; }

  /* Sidebar: off-canvas slide-in from the left, toggled by body.mobile-nav-open */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 260px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.10);
    z-index: 100;
  }
  body.mobile-nav-open .sidebar { transform: translateX(0); }
  body.mobile-nav-open .mobile-nav-backdrop { display: block; }

  /* Show the hamburger + brand chip in the topbar; tuck the right side. */
  .topbar-menu { display: inline-flex; }
  .topbar-brand { display: inline-flex; }
  .topbar-slim {
    padding: 10px 14px;
    justify-content: flex-start;
    gap: 10px;
  }
  .topbar-slim .topbar-actions { margin-left: auto; }

  /* The 3-dot drawer button stays usable but the hamburger is the main entry. */
  .topbar-slim .who {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar-collapse { display: none; }

  /* Tighter section padding so the content uses the viewport. */
  .main-content > section { margin: 18px auto; padding: 0 16px; }
  main { padding: 0 16px; }
}

@media (max-width: 600px) {
  /* Hide the email entirely; keep just the role chip and logout. */
  .topbar-slim .who { display: none; }
  .topbar-drawer { display: none; }
  .topbar-slim { padding: 8px 10px; gap: 6px; }
  .topbar-brand strong { font-size: 14px; }

  /* Hero: stack title + status panel; tighten typography. */
  .bot-hero { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .bot-hero-title { font-size: 22px; line-height: 1.2; }
  .bot-hero-sub { font-size: 13px; }
  .bot-hero-status {
    grid-template-columns: 1fr 1fr;
    padding: 12px 14px;
    min-width: 0;
  }
  .bot-hero-status .status-row { display: contents; }
  .bot-hero-status .status-value { font-size: 13px; }
  .bot-hero-status-line { font-size: 13px; padding: 8px 10px; }

  /* Hero action buttons go full width and stack. */
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button,
  .hero-actions form.inline,
  .hero-actions form.inline button { width: 100%; text-align: center; }

  /* Summary cards: 2 columns on phones (instead of squeezing all 6). */
  .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .summary-card .summary-value { font-size: 18px; }

  /* Operations cards: single column. */
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 14px 16px; }
  .card h2, .card h3 { font-size: 16px; }

  /* Top-of-page `.row.spread` (title + Manage Playbooks etc): stack it. */
  .row.spread { flex-direction: column; align-items: stretch; gap: 10px; }

  /* Generic `.row` (Quick Dial Customer Name / Phone / Lang line, etc.) */
  .row { flex-direction: column; align-items: stretch; gap: 10px; }
  .row > label { min-width: 0 !important; flex: 1 1 auto !important; }

  /* Tables: let them scroll horizontally rather than overflow the viewport. */
  table.grid {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Login + auth shell: tighten padding, full-width card. */
  .card.narrow { margin: 24px 12px; max-width: none; }
  .auth-topbar { padding: 12px 14px; }

  /* Footer: reflow the link row. */
  .app-footer { padding: 14px 16px; font-size: 11.5px; }

  /* Form inputs: full width text inputs / textareas. */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="tel"], input[type="number"], select, textarea {
    width: 100%;
    box-sizing: border-box;
  }

  /* Billing month picker should stack rather than spread. */
  .month-picker-bar { flex-direction: column; align-items: stretch; }
  .month-picker-nav { display: flex; gap: 8px; justify-content: space-between; }

  /* Voice library grid: single column. */
  .library-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 380px) {
  .summary-grid { grid-template-columns: 1fr; }
  .bot-hero-status { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════
   Login page — UniFi-inspired dark hero
   Scoped to body.auth-shell so logged-in pages are untouched.
   ════════════════════════════════════════════════════════════════════ */
body.auth-shell {
  background: linear-gradient(180deg, #0c1f3c 0%, #050c1a 100%);
  color: #cfd8e6;
  min-height: 100vh;
}
body.auth-shell .auth-topbar {
  background: transparent;
  border-bottom: none;
  padding: 16px 24px;
  justify-content: flex-end;  /* hide the company brand chip; only the lang switch shows */
}
body.auth-shell .auth-topbar .brand { display: none; }
body.auth-shell .auth-topbar .lang-opt { color: #6f86a6; text-decoration: none; }
body.auth-shell .auth-topbar .lang-opt:hover { color: #cfd8e6; }
body.auth-shell .auth-topbar .lang-opt.active { color: #cfd8e6; font-weight: 600; }
body.auth-shell .auth-topbar .lang-divider { color: #2a3f5e; }
body.auth-shell main.main-content { padding: 0; max-width: none; }

.login-wrap {
  width: 100%;
  max-width: 340px;
  margin: 12vh auto 0;
  padding: 0 20px;
  text-align: center;
}
.login-brand {
  font-size: 56px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: #d6dee9;
  margin: 0;
  line-height: 1;
}
.login-version {
  font-size: 12px;
  color: #5a6e8a;
  margin: 6px 0 38px;
  letter-spacing: 0.04em;
}
.login-form { text-align: left; }
.login-field { display: block; margin-bottom: 16px; }
.login-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #8aa0bd;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.login-field input {
  width: 100%;
  background: #0e2138;
  border: 1px solid #1a2c47;
  color: #e8edf5;
  padding: 11px 13px;
  border-radius: 3px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.login-field input:hover { border-color: #25395a; }
.login-field input:focus {
  outline: none;
  border-color: #2d8eff;
  background: #112740;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cfd8e6;
  font-size: 13px;
  margin: 20px 0 22px;
  cursor: pointer;
  justify-content: center;
}
.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2d8eff;
  margin: 0;
  cursor: pointer;
}
.login-submit {
  width: 100%;
  background: #2d8eff;
  color: white;
  border: none;
  padding: 13px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s;
}
.login-submit:hover { background: #1f7fef; }
.login-submit:active { background: #1668d6; }
.login-error {
  background: rgba(220, 38, 38, 0.10);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.28);
  padding: 10px 12px;
  border-radius: 3px;
  margin: 0 0 18px;
  font-size: 13px;
  text-align: left;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 14px;
  color: #5a6e8a;
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #1a2c47;
}
.login-slack {
  display: block;
  text-align: center;
  background: transparent;
  border: 1px solid #1a2c47;
  color: #cfd8e6;
  padding: 11px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s;
}
.login-slack:hover {
  background: rgba(45, 142, 255, 0.08);
  border-color: #2d8eff;
  color: #e8edf5;
}
@media (max-width: 600px) {
  .login-wrap { margin-top: 8vh; max-width: none; padding: 0 24px; }
  .login-brand { font-size: 44px; }
}

/* ── New Voice Agent — collapsible create form on the bot list ──── */
.new-agent-toggle { position: relative; }
.new-agent-toggle > summary {
  display: inline-flex;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.new-agent-toggle > summary::-webkit-details-marker { display: none; }
.new-agent-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 460px;
}
.new-agent-form h3 { margin: 0 0 4px; font-size: 16px; }
.new-agent-form .helper {
  display: block;
  font-size: 12px;
  font-weight: 400;
  margin: 2px 0 4px;
  font-style: italic;
}
.new-agent-form .req { color: #b91c1c; font-weight: 700; margin-left: 2px; }
.new-agent-form .form-actions { display: flex; justify-content: flex-end; }

/* On phones, let the panel use the full width and dock the toggle below
   the heading instead of side-by-side with it. */
@media (max-width: 600px) {
  .new-agent-toggle { width: 100%; }
  .new-agent-toggle > summary { width: 100%; justify-content: center; }
  .new-agent-form { max-width: none; padding: 14px 14px; }
}

/* ── Phone Connection — friendly PBX form ─────────────────────── */
.phone-connection-page { max-width: 880px; }
.phone-form .phone-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px 8px;
  margin: 14px 0 0;
  background: var(--bg-card);
}
.phone-form .phone-section > legend {
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.phone-form .section-helper { margin: -4px 0 14px; font-size: 12.5px; }
.phone-form label .helper {
  display: block;
  font-size: 12px;
  font-weight: 400;
  margin: 2px 0 4px;
  font-style: italic;
}
.phone-form .req { color: #b91c1c; font-weight: 700; margin-left: 2px; }
.phone-form .advanced-toggle {
  margin-top: 14px;
  padding: 10px 0 0;
  border-top: 1px dashed var(--border);
}
.phone-form .advanced-toggle > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-dim);
  padding: 6px 0;
}
.phone-form .advanced-toggle > summary:hover { color: var(--accent); }
.phone-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
@media (max-width: 720px) {
  .phone-form .phone-section { padding: 14px 12px 6px; }
  .phone-form .row { flex-direction: column; }
  .phone-form .row > label { min-width: 0 !important; }
  .phone-form .form-actions { justify-content: stretch; }
  .phone-form .form-actions .button.primary { flex: 1; }
}
