/* ============================================================================
   AI Receptionist — "Switchboard" design system
   A warm-industrial operator's console. Cream canvas, warm ink, a vivid
   vermilion signal accent + deep teal. Fraunces (display) / Hanken Grotesk
   (UI) / IBM Plex Mono (data). Admin re-themes these tokens dark in admin.css.
   ========================================================================== */

:root {
  /* canvas + surfaces */
  --bg:            #FBF6EC;   /* warm cream */
  --bg-band:       #F3E8D6;   /* deeper cream for bands */
  --surface:       #FFFFFF;
  --surface-2:     #FFFDF7;
  --surface-sunk:  #F6EEDF;

  /* ink */
  --ink:           #1C1813;   /* warm near-black */
  --ink-soft:      #463E30;
  --muted:         #756B53;   /* AA on cream */

  /* lines */
  --line:          #E9DDC8;
  --line-strong:   #D8C7A6;

  /* signal accents */
  --primary:       #E6430C;   /* vermilion — the "live line" */
  --primary-press: #BE350A;
  --primary-tint:  #FCE7DB;
  --accent:        #0E7C66;   /* deep teal */
  --accent-tint:   #DBEFE8;
  --gold:          #B9831F;   /* warm highlight */

  /* status */
  --ok:      #0E7C66;  --ok-tint:   #DBEFE8;
  --warn:    #B9651F;  --warn-tint: #FBEBD6;
  --bad:     #C0341B;  --bad-tint:  #FBE2DC;
  --info:    #1F6F6B;  --info-tint: #DCEFEE;

  /* shape + depth */
  --r:    14px;
  --r-sm: 9px;
  --r-lg: 22px;
  --sh-sm: 0 1px 2px rgba(58,40,12,.05), 0 1px 1px rgba(58,40,12,.04);
  --sh:    0 8px 24px -10px rgba(72,46,14,.22), 0 2px 6px rgba(72,46,14,.07);
  --sh-lg: 0 30px 64px -22px rgba(72,46,14,.34), 0 6px 16px rgba(72,46,14,.10);
  --ring:  0 0 0 4px rgba(230,67,12,.18);

  /* type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --glow: rgba(230,67,12,.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background:
    radial-gradient(130% 90% at 102% -8%, var(--glow), transparent 55%),
    radial-gradient(90% 70% at -10% 0%, rgba(14,124,102,.06), transparent 50%),
    var(--bg);
  min-height: 100vh;
}

/* fine grain overlay for warmth/depth */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9998;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--primary); color: #fff; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 32px) 72px;
  position: relative; z-index: 1;
}
/* narrow contexts: wizard + auth cards */
.container:has(.wizard-progress),
.container:has(.auth-card) { max-width: 560px; }

/* ---- typography ---------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 900; font-variation-settings: "opsz" 110; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; letter-spacing: -.01em; }
h4 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 1rem; }

a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }

.muted { color: var(--muted); font-weight: 400; }
.small { font-size: .82rem; }
.mono, code, .code {
  font-family: var(--font-mono);
  font-feature-settings: "ss01";
  letter-spacing: -.02em;
}
.code, code {
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .1em .4em;
  font-size: .85em;
}

/* a "live line" indicator for phone numbers / status */
.live-dot {
  display: inline-block; width: .55em; height: .55em;
  border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 0 0 rgba(230,67,12,.5);
  animation: pulse 2.4s infinite;
  vertical-align: middle; margin-right: .35em;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(230,67,12,.45); }
  70%  { box-shadow: 0 0 0 8px rgba(230,67,12,0); }
  100% { box-shadow: 0 0 0 0 rgba(230,67,12,0); }
}

/* ---- buttons ------------------------------------------------------------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .72em 1.25em;
  font-family: var(--font-body);
  font-size: .95rem; font-weight: 700;
  letter-spacing: -.01em;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none; text-align: center;
  box-shadow: var(--sh-sm);
  transition: transform .14s cubic-bezier(.2,.8,.2,1), box-shadow .18s, background .18s, border-color .18s;
}
button:hover, .btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--sh);
  border-color: var(--line-strong);
}
button:active, .btn:active { transform: translateY(0); box-shadow: var(--sh-sm); }
.btn-primary {
  background: var(--primary); color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(230,67,12,.55), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { background: var(--primary-press); box-shadow: 0 12px 26px -8px rgba(230,67,12,.6); }
.btn-secondary { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--surface); border-color: var(--ink-soft); }
.btn:disabled, button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* small ghost/text button (used by calendar toolbar etc.) */
.ghost { background: transparent; border-color: transparent; color: var(--primary); box-shadow: none; }
.ghost:hover { background: var(--primary-tint); box-shadow: none; }

/* ---- forms --------------------------------------------------------------- */
form label { display: block; margin: 1.1rem 0 .3rem; font-weight: 600; font-size: .92rem; color: var(--ink-soft); }
form input[type=text], form input[type=email], form input[type=tel],
form input[type=number], form input[type=time], form input[type=date],
form select, form textarea {
  display: block; width: 100%;
  padding: .7em .85em;
  margin-top: .35rem;
  font-family: inherit; font-size: 1rem;
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
form input::placeholder, form textarea::placeholder { color: #b8ad95; }
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: var(--surface-2);
}
form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%238C8169' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9em center;
  padding-right: 2.2em;
}

/* ---- settings / long config forms ---------------------------------------- */
.form-section {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-sm); padding: 1.2rem 1.4rem 1.4rem; margin: 1.1rem 0;
}
.form-section > h3:first-child { margin-top: 0; display: flex; align-items: center; gap: .55rem; }
.form-section > h3:first-child::before {
  content: ""; width: 3px; height: 1.05em; background: var(--primary); border-radius: 2px;
}
.form-section .hint { color: var(--muted); font-size: .84rem; margin: .15rem 0 .9rem; }
.form-section > label:first-of-type { margin-top: .4rem; }
.form-section .kvs { margin: .3rem 0; }

.form-table { margin: .5rem 0; }
.form-table th { border-bottom: 1px solid var(--line); padding: .3rem .45rem; }
.form-table td { border-bottom: 0; padding: .28rem .45rem; vertical-align: middle; }
.form-table tbody tr:hover { background: transparent; }
.form-table input { margin-top: 0 !important; }
.form-table input[type=time], .form-table input[type=number] { font-family: var(--font-mono); font-size: .92rem; }
.form-table label { display: inline-flex !important; align-items: center; gap: .4rem; margin: 0 !important; font-weight: 600; white-space: nowrap; }

.row-del {
  width: 34px; height: 34px; padding: 0; line-height: 1;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  box-shadow: none; border-radius: var(--r-sm);
}
.row-del:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-tint); transform: none; }

.faq-item {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .7rem .9rem .9rem; margin-bottom: .7rem; background: var(--surface-sunk);
}
.faq-item label:first-child { margin-top: .2rem; }

/* ---- alerts -------------------------------------------------------------- */
.alert {
  padding: .85rem 1rem .85rem 1.1rem;
  border-radius: var(--r-sm);
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}
.alert.info    { background: var(--info-tint); border-left-color: var(--info); }
.alert.success { background: var(--ok-tint);   border-left-color: var(--ok); }
.alert.error   { background: var(--bad-tint);  border-left-color: var(--bad); }

/* ---- tabs (dashboard + admin top nav) ------------------------------------ */
.tabs {
  display: flex; gap: .25rem; flex-wrap: wrap;
  margin: 1.25rem 0 1.75rem;
  border-bottom: 1.5px solid var(--line);
}
.tabs a {
  position: relative;
  padding: .6rem .9rem;
  color: var(--muted); font-weight: 600; font-size: .94rem;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: color .16s;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- tables -------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
table th {
  text-align: left; padding: .6rem .7rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1.5px solid var(--line-strong);
}
table td {
  padding: .7rem .7rem; text-align: left;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
table tbody tr { transition: background .12s; }
table tbody tr:hover { background: var(--surface-sunk); }

/* ---- key/value lists ----------------------------------------------------- */
.kvs { list-style: none; padding: 0; margin: 1rem 0; }
.kvs li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .7rem .2rem; border-bottom: 1px solid var(--line);
}
.kvs li:last-child { border-bottom: 0; }
.kvs strong { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---- list rows (calls / bookings) ---------------------------------------- */
.call-row, .booking-row {
  padding: .95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  margin: .6rem 0;
  transition: transform .14s, box-shadow .18s, border-color .18s;
}
.call-row:hover, .booking-row:hover {
  transform: translateY(-1px); box-shadow: var(--sh); border-color: var(--line-strong);
}
.call-row audio, .booking-row audio { width: 100%; margin-top: .6rem; }

/* row internals — shared by call + booking rows */
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.row-name { font-weight: 700; letter-spacing: -.01em; }
.row-time { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); letter-spacing: -.02em; white-space: nowrap; }
.row-meta { color: var(--ink-soft); font-size: .86rem; margin-top: .3rem; display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.row-meta .dot { color: var(--line-strong); }

/* left accent stripe by call outcome */
.call-row.is-booked   { border-left: 3px solid var(--ok); }
.call-row.is-message  { border-left: 3px solid var(--info); }
.call-row.is-transfer { border-left: 3px solid var(--warn); }
.call-row.is-missed   { border-left: 3px solid var(--bad); }

/* outcome pill */
.outcome {
  display: inline-flex; align-items: center; gap: .3em;
  padding: .16em .6em; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .01em; text-transform: capitalize;
  border: 1px solid transparent;
}
.outcome.booked   { background: var(--ok-tint);   color: var(--ok); }
.outcome.message  { background: var(--info-tint); color: var(--info); }
.outcome.transfer { background: var(--warn-tint); color: var(--warn); }
.outcome.missed   { background: var(--bad-tint);  color: var(--bad); }
.outcome.unknown  { background: var(--surface-sunk); color: var(--muted); }

/* manual / non-AI booking source tag */
.src-tag {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: .08em .42em;
}

/* transcript disclosure */
.transcript { margin-top: .6rem; }
.transcript summary {
  cursor: pointer; font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--primary); font-weight: 600;
}
.transcript pre {
  white-space: pre-wrap; font-size: .82rem; line-height: 1.55;
  background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .8rem .9rem; margin-top: .55rem; font-family: var(--font-mono); color: var(--ink-soft);
}

/* ---- status pills -------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .2em .7em; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .01em;
  border: 1px solid transparent;
}
.pill.active     { background: var(--ok-tint);   color: var(--ok); }
.pill.trialing   { background: var(--info-tint);  color: var(--info); }
.pill.delinquent { background: var(--bad-tint);   color: var(--bad); }
.pill.paused, .pill.archived, .pill.canceled { background: var(--surface-sunk); color: var(--muted); }
.pill.booked, .pill.completed { background: var(--ok-tint); color: var(--ok); }
.pill.no_show, .pill.rescheduled { background: var(--surface-sunk); color: var(--muted); text-decoration: line-through; }

/* ---- cards (selectable: industry / voice / personality / sample) --------- */
.card, .sample-card, .industry-card, .voice-option, .personality-option {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
}
.industry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin: 1.25rem 0; }
.industry-card {
  padding: 1rem .8rem; text-align: center; cursor: pointer; font-size: .9rem; font-weight: 600;
  transition: transform .14s, box-shadow .18s, border-color .16s, background .16s;
}
.industry-card:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.industry-card .emoji { font-size: 30px; display: block; margin-bottom: .3rem; }
.industry-card.selected, .voice-option.selected, .personality-option.selected {
  border-color: var(--primary); background: var(--primary-tint);
  box-shadow: 0 8px 22px -10px rgba(230,67,12,.4);
}

.voice-list, .personality-list { display: grid; gap: .55rem; margin: 1.1rem 0; }
.voice-option, .personality-option { padding: .85rem 1.05rem; cursor: pointer; transition: transform .14s, border-color .16s, background .16s; }
.voice-option:hover, .personality-option:hover { transform: translateY(-1px); }

/* ---- wizard progress ----------------------------------------------------- */
.wizard-head { margin-bottom: 1.6rem; }
.wizard-head h2 { margin-top: .7rem; }
.wizard-progress { display: flex; gap: .4rem; margin: .2rem 0 0; }
.wizard-progress .step { flex: 1; height: 5px; background: var(--line); border-radius: 999px; transition: background .3s; }
.wizard-progress .step.done   { background: var(--ink); }
.wizard-progress .step.active { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.nav-row { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.75rem; }

/* phone callout — signup "you're live" + anywhere we surface the AI number */
.phone-callout {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono); font-weight: 600; font-size: clamp(1.3rem, 5vw, 1.75rem);
  letter-spacing: -.02em; color: var(--ink);
  background: var(--primary-tint); border: 1.5px solid var(--primary);
  border-radius: var(--r); padding: .6rem 1.05rem; margin: .6rem 0 1.1rem;
  text-decoration: none;
}
.phone-callout:hover { background: var(--surface); text-decoration: none; }

/* ---- header (dashboard + admin) ------------------------------------------ */
header { margin-bottom: .5rem; }
header h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: .15rem; }
header .small strong { font-family: var(--font-mono); font-weight: 600; color: var(--ink); letter-spacing: -.02em; }

/* ---- auth card ----------------------------------------------------------- */
.auth-card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  margin: 2.5rem auto;
}
.auth-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), #ff7a3d);
}
.auth-card h2 { margin-top: .2rem; }

/* ---- landing ------------------------------------------------------------- */
.landing { padding-top: 1rem; }
.landing > header {
  padding: 2.5rem 0 1rem; margin-bottom: 1.5rem; border-bottom: none;
}
.landing > header h1 { max-width: 16ch; line-height: 1.0; }
.landing > header h1 em { font-style: italic; color: var(--primary); font-weight: 900; }
.landing > header h1::after {
  content: ""; display: block; width: 64px; height: 5px; margin-top: 1rem;
  background: var(--primary); border-radius: 999px;
}
.tagline { color: var(--ink-soft); font-size: clamp(1.05rem, 2.4vw, 1.3rem); max-width: 40ch; }
.cta-row { display: flex; gap: .8rem; margin: 1.75rem 0; flex-wrap: wrap; }
.cta-row .btn { padding: .85em 1.5em; font-size: 1rem; }
.price { color: var(--ink-soft); margin: .5rem 0 .25rem; font-size: 1.05rem; }
.price strong { font-family: var(--font-display); font-weight: 900; font-size: 1.3em; color: var(--primary); }
.landing section { margin-top: 2.75rem; }
.landing section > h3 {
  font-size: 1.4rem; display: inline-flex; align-items: center; gap: .5rem;
}
.landing .trust { background: var(--bg-band); border: 1px solid var(--line); padding: 1.5rem 1.6rem; border-radius: var(--r-lg); }
.landing .trust ul { padding-left: 1.1rem; }
.landing .trust li { margin: .6rem 0; }
.sample-card { padding: 1.1rem; }
.sample-card audio { width: 100%; margin-top: .5rem; }

/* ---- page-load reveal ---------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .container > * { animation: rise .55s cubic-bezier(.2,.7,.2,1) backwards; }
  .container > *:nth-child(1) { animation-delay: .02s; }
  .container > *:nth-child(2) { animation-delay: .07s; }
  .container > *:nth-child(3) { animation-delay: .12s; }
  .container > *:nth-child(4) { animation-delay: .17s; }
  .container > *:nth-child(5) { animation-delay: .22s; }
  .container > *:nth-child(n+6) { animation-delay: .26s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- a11y: visible focus rings ------------------------------------------- */
:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
a:focus-visible, .btn:focus-visible, button:focus-visible { outline-offset: 3px; }
.tabs a:focus-visible { outline-offset: -3px; }

/* ---- operator tag (mono eyebrow) ----------------------------------------- */
.op-tag {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--primary);
  margin-bottom: .7rem;
}
.op-tag::before { content: ""; width: 22px; height: 2px; background: var(--primary); display: inline-block; }

/* numbered landing sections — operator console numbering */
.landing { counter-reset: sec; }
.landing section { counter-increment: sec; }
.landing section > h3::before {
  content: counter(sec, decimal-leading-zero) "  ";
  font-family: var(--font-mono); font-size: .62em; font-weight: 600;
  color: var(--primary); vertical-align: .18em; letter-spacing: -.02em;
}

/* ---- switchboard hero motif (concentric signal rings) -------------------- */
.landing > header { position: relative; overflow: clip; }
.landing > header > * { position: relative; z-index: 1; }
.switchboard {
  position: absolute; top: -50px; right: -70px; width: 380px; height: 380px;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 76% 30%, var(--primary) 0 5px, transparent 6px),
    repeating-radial-gradient(circle at 76% 30%, transparent 0 25px, rgba(230,67,12,.18) 25px 26.5px);
  -webkit-mask-image: radial-gradient(circle at 76% 30%, #000 0 165px, transparent 195px);
          mask-image: radial-gradient(circle at 76% 30%, #000 0 165px, transparent 195px);
  animation: ring 6s ease-out infinite;
}
@keyframes ring { 0%,100% { opacity: .40; } 50% { opacity: .62; } }
@media (prefers-reduced-motion: no-preference) {
  .landing > header h1::after { width: 0; animation: draw .7s .4s cubic-bezier(.2,.8,.2,1) forwards; }
}
@keyframes draw { to { width: 72px; } }

/* ---- card hover: accent edge ---------------------------------------------- */
.industry-card:hover, .voice-option:hover, .personality-option:hover,
.call-row:hover, .booking-row:hover, .card:hover { border-color: var(--primary); }

/* ---- empty state --------------------------------------------------------- */
.empty {
  text-align: center; color: var(--muted);
  padding: 2.75rem 1rem; border: 1.5px dashed var(--line-strong);
  border-radius: var(--r); background: var(--surface-2);
}
.empty .big { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .65; }

/* ---- stat cards (usage / admin metrics) ---------------------------------- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: .8rem; margin: 1rem 0 1.5rem; }
.statcard { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); padding: 1.05rem 1.15rem; box-shadow: var(--sh-sm); }
.statcard .n { font-family: var(--font-display); font-weight: 900; font-size: 1.95rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.statcard .l { color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .02em; margin-top: .4rem; }
.statcard.accent { border-color: var(--primary); }
.statcard.accent .n { color: var(--primary); }
.statcard.bad { border-color: var(--bad); }
.statcard.bad .n { color: var(--bad); }
.statcard.warn { border-color: var(--warn); }
.statcard.warn .n { color: var(--warn); }

/* small button + danger button */
.btn-sm { padding: .42em .85em; font-size: .82rem; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }

/* stacked ops action buttons (admin tenant detail) */
.ops-actions { display: grid; gap: .5rem; max-width: 460px; margin: .6rem 0; }
.ops-actions form { margin: 0; }
.ops-actions .btn { width: 100%; }

/* generic bordered panel (admin referrals / disclosures) */
.panel { border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem 1.25rem; background: var(--surface); box-shadow: var(--sh-sm); margin-bottom: 1.25rem; }
.panel > :first-child { margin-top: 0; }

/* compact JSON / metadata cell (admin audit) */
.meta-pre { font-family: var(--font-mono); font-size: .72rem; max-width: 340px; overflow: auto; margin: 0; white-space: pre-wrap; word-break: break-all; color: var(--ink-soft); }

/* inline search form (admin tenants) */
.search-row { display: flex; gap: .5rem; margin-bottom: 1rem; max-width: 520px; }
.search-row input { margin-top: 0 !important; }
.search-row .btn { flex-shrink: 0; }

/* fieldset sub-groups (wizard) + inline radio rows */
form fieldset { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 1rem 1.1rem; margin-top: 1.5rem; }
form legend { padding: 0 .5rem; font-weight: 700; font-size: .92rem; color: var(--ink); }
.radio-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: .5rem; }
.radio-row label { display: inline-flex !important; align-items: center; gap: .4rem; margin: 0 !important; font-weight: 600; }

/* ---- usage meter --------------------------------------------------------- */
.meter { height: 12px; border-radius: 999px; background: var(--surface-sunk); overflow: hidden; border: 1px solid var(--line); }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #ff7a3d); border-radius: 999px; }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 680px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; flex: 0 0 auto; }
}
@media (max-width: 560px) {
  .industry-grid { grid-template-columns: repeat(2, 1fr); gap: .55rem; }
  .tabs a { padding: .55rem .72rem; font-size: .9rem; }
  .nav-row { flex-direction: column-reverse; }
  .nav-row .btn { width: 100%; min-height: 46px; }
  .cta-row { flex-direction: column; }
  .cta-row .btn { width: 100%; }
  .switchboard { width: 250px; height: 250px; top: -24px; right: -54px; }
  .btn, button { min-height: 44px; }
  header h2 { font-size: 1.65rem; }
}
