/* Design v4 (2026-09-16) — obsidian glass + WebGL water-caustics background,
   ported from design/index.html per Dan: "it is a marketing gig that will
   make the site interesting till I attract enough geeks to use it." Applied
   everywhere (landing AND the full authenticated dashboard), not just the
   hero — the whole app now sits on the same dark glass surface with the
   caustics canvas behind it (see caustics.js, wired in via render.ts).
   Component structure (cards, tables, sidebar) kept as-is on purpose: this
   app has no templating layer, so every real page already shares these
   same classes — re-tokenizing them here reskins all ~15 pages at once
   without touching their markup. */

* { box-sizing: border-box; }

:root {
  --bg-void: #030712;
  --surface-base: rgba(6, 15, 26, 0.90);
  --surface-card: rgba(8, 20, 36, 0.92);
  --surface-card-solid: #0A1524; /* for elements that can't use backdrop-filter (e.g. <select> popups) */
  --surface-modal: rgba(5, 13, 23, 0.96);
  --surface-input: rgba(255, 255, 255, 0.04);

  --border-subtle: rgba(255, 255, 255, 0.10);
  --border-medium: rgba(255, 255, 255, 0.18);
  --border-focus: rgba(56, 239, 125, 0.55);

  --fg-primary: #ffffff;
  --fg-secondary: #e2e8f0;
  --fg-muted: #94a3b8;
  --fg-subtle: #64748b;

  --wa-green: #25d366;
  --wa-green-glow: #38ef7d;
  --wa-green-dim: #1a9c4a;
  --wa-green-tint: rgba(37, 211, 102, 0.14);
  --caustic-cyan: #48d7eb;
  --accent-teal: #14b8a6;
  --warn-amber: #f59e0b;
  --warn-tint: rgba(245, 158, 11, 0.14);
  --danger-red: #ef4444;
  --danger-tint: rgba(239, 68, 68, 0.14);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-glass: 0 16px 36px rgba(0, 0, 0, 0.65), 0 1px 0 rgba(255, 255, 255, 0.08) inset;

  /* Back-compat aliases — old token names still referenced in a few
     inline styles across main.ts; point them at the new palette rather
     than hunting down every inline style="" individually. */
  --ink: var(--fg-primary);
  --ink-soft: var(--fg-secondary);
  --ink-mute: var(--fg-muted);
  --ink-faint: var(--fg-subtle);
  --bg: var(--bg-void);
  --bg-input: var(--surface-input);
  --bg-panel: rgba(255, 255, 255, 0.03);
  --surface: var(--surface-card);
  --border: var(--border-subtle);
  --border-soft: var(--border-subtle);
  --border-input: var(--border-medium);
  --primary: var(--wa-green);
  --primary-dark: var(--wa-green-dim);
  --primary-bright: var(--wa-green-glow);
  --primary-tint: var(--wa-green-tint);
  --primary-tint-text: var(--wa-green-glow);
  --amber: var(--warn-amber);
  --warn-bg: var(--warn-tint);
  --warn-border: rgba(245, 158, 11, 0.3);
  --warn-text: var(--warn-amber);
  --warn-text-soft: #fbbf6a;
  --danger: var(--danger-red);
  --danger-border: rgba(239, 68, 68, 0.3);
  --danger-bg: var(--danger-tint);
  --danger-text-soft: #fca5a5;
  --neutral-pill: rgba(255, 255, 255, 0.08);
  --ink-rev: var(--bg-void);
  --void: var(--bg-void);
  --void-2: var(--surface-card-solid);
  --volt: var(--wa-green-glow);
  --volt-dim: var(--wa-green-dim);
}

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-void);
  color: var(--fg-primary);
  font-size: 15px;
  line-height: 1.6;
  position: relative;
}

/* ---- WebGL water-caustics background (caustics.js) ------------------ */
/* Fixed behind everything; every page's content sits in normal flow on
   top of it via z-index, not a fixed full-page wrapper — this app has
   no single root container, so the canvas alone carries position:fixed. */
#caustics-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* clicks pass through to real page content; ripples are driven by a document-level pointerdown listener instead, see caustics.js */
}
/* A muted static gradient fallback for prefers-reduced-motion and for the
   brief moment before WebGL2 initializes — never a flash of plain black. */
.caustics-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 211, 102, 0.10), transparent 60%),
              radial-gradient(ellipse 60% 50% at 90% 100%, rgba(72, 215, 235, 0.08), transparent 60%),
              var(--bg-void);
}
/* At full intensity the shader is too bright/busy to read text over — this
   sits between the canvas and every page's real content and dims it down
   to background ambiance. Heavier over the dashboard (denser real content,
   tables/forms need to stay legible) than the marketing hero, via a
   lighter override further down. */
.caustics-scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(3, 7, 18, 0.72);
  pointer-events: none;
}
body:has(.hero-wrap) .caustics-scrim {
  background: rgba(3, 7, 18, 0.62);
}
.sound-toggle {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 40;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sound-toggle:hover { color: var(--fg-primary); border-color: var(--border-medium); }

/* Every real page's own top-level element needs to sit above the canvas. */
.topbar, .container, .auth-wrap, .hero-wrap, .feature-strip, .footer, .app-shell {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .reveal.in { opacity: 1; transform: translateY(0); }
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; font-weight: 600; letter-spacing: -0.02em; color: var(--fg-primary); }

a { color: var(--wa-green-glow); text-decoration: none; }
a:hover { color: var(--wa-green); }

/* ---- Glass card — the one visual signature reused everywhere: the
   landing hero, every dashboard `.card`, the sidebar, modals. --------- */
.glass-card, .card, .login-box {
  background: var(--surface-card);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.glass-card:hover, .card:hover { border-color: var(--border-medium); }

/* ---- plain pre-connection page shell ------------------------------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-base);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 18px 28px;
}
.topbar .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 16px; font-family: var(--font-display); letter-spacing: -0.02em; }
.topbar nav a { color: var(--fg-muted); margin-left: 18px; font-weight: 500; font-size: 14px; }
.topbar nav a:hover { color: #fff; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px;
}

.login-box, .card {
  max-width: 420px;
  margin: 60px auto;
  padding: 32px;
}

/* ---- Auth pages (login/signup): same dark glass as the rest of the app,
   not a separate treatment — there's no more "leaving the dark theme" the
   moment you go from the landing page into a form. -------------------- */
.auth-wrap {
  background: var(--bg-void);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow: hidden;
}
.auth-brand {
  position: absolute;
  top: 28px;
  left: 28px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  z-index: 2;
}
.auth-brand:hover { color: var(--wa-green-glow); }
.auth-card {
  position: relative;
  background: var(--surface-card);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-glass);
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 239, 125, 0.6), rgba(72, 215, 235, 0.6), transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .auth-card { opacity: 0; animation: rise-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards; }
}
.auth-card h1 { color: #fff; font-size: 24px; margin-bottom: 22px; }
.auth-card label { color: var(--fg-muted); }
.auth-card input[type="text"], .auth-card input[type="password"], .auth-card input[type="email"] {
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  color: var(--fg-secondary);
}
.auth-card input:focus { outline: none; border-color: var(--wa-green-glow); }
.auth-card .button.secondary { background: transparent; color: #fff; border: 1px solid var(--border-medium); }
.auth-card .button.secondary:hover { background: rgba(255,255,255,0.06); }
.auth-card .oauth-divider { color: var(--fg-subtle); }
.auth-card .oauth-divider::before, .auth-card .oauth-divider::after { background: var(--border-subtle); }
.auth-card p, .auth-card a { color: var(--fg-muted); }
.auth-card a { color: var(--wa-green-glow); }
.auth-card a:hover { color: var(--wa-green); }
.auth-card p.error { color: #fca5a5; }

h1 { font-size: 26px; margin: 0 0 16px; font-weight: 600; }
h2 { font-size: 17px; margin: 20px 0 10px; font-weight: 600; }
p { margin: 0 0 14px; color: var(--fg-secondary); }

/* ---- Landing hero ---------------------------------------------------- */

.hero-wrap {
  background: transparent; /* the caustics canvas shows through everywhere now, not just a hero-local glow */
  position: relative;
  overflow: hidden;
}

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 108px 28px 120px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
  position: relative;
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 64px 20px 56px; gap: 48px; }
}
.hero-copy { color: #fff; text-align: left; }
/* The landing page renders with nav:false, so the layout's own brand link
   never appears here. Without this the product name existed only in the
   <title> — invisible on the page itself (caught live 2026-09-17). */
.hero-copy .hero-brand {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  margin-bottom: 24px;
}
.hero-copy .hero-brand:hover { color: var(--wa-green-glow); }

.hero-copy .eyebrow-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wa-green-glow);
  margin-bottom: 22px;
}
.hero-copy .eyebrow-mark svg { flex-shrink: 0; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: #fff;
  max-width: 13ch;
}
.hero h1 .accent { color: var(--wa-green-glow); }

.hero p.lede { font-size: 18px; color: var(--fg-muted); max-width: 44ch; margin: 26px 0 32px; line-height: 1.55; }
.hero .actions { display: flex; gap: 14px; justify-content: flex-start; flex-wrap: wrap; }
.hero-foot { margin-top: 30px; font-size: 13px; color: var(--fg-subtle); }
.hero-foot a { color: var(--fg-muted); }
.hero-foot a:hover { color: #fff; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { opacity: 0; animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
  .hero-copy > *:nth-child(1) { animation-delay: 0.05s; }
  .hero-copy > *:nth-child(2) { animation-delay: 0.15s; }
  .hero-copy > *:nth-child(3) { animation-delay: 0.25s; }
  .hero-copy > *:nth-child(4) { animation-delay: 0.35s; }
  .hero-copy > *:nth-child(5) { animation-delay: 0.45s; }
  .thread { opacity: 0; animation: rise-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.thread {
  background: var(--surface-card);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 24px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-glass), 0 0 60px -20px rgba(37, 211, 102, 0.18);
}
@media (prefers-reduced-motion: no-preference) {
  .thread { animation: rise-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards, float 6s ease-in-out 1.2s infinite; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
}
.bubble.in { align-self: flex-start; background: rgba(255,255,255,0.06); color: var(--fg-secondary); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--wa-green-dim); color: #04120A; border-bottom-right-radius: 4px; font-weight: 500; }
.bubble .meta { display: block; margin-top: 5px; font-family: var(--font-mono); font-size: 10.5px; opacity: 0.65; }
.bubble.out .meta { color: #04120A; opacity: 0.55; }
.bubble.in .meta { color: var(--fg-muted); }

/* ---- "Add from WhatsApp" demo card (Chats page) — reuses the same
   .thread/.bubble hero mockup, scaled down into a normal dashboard card,
   with two example flows side by side and a real one-tap wa.me deep link
   so watching the demo and actually trying it are one motion. --------- */
.wa-demo-card { padding: 26px 28px; }
.wa-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}
@media (max-width: 700px) {
  .wa-demo-grid { grid-template-columns: 1fr; }
}
.wa-demo-col { display: flex; flex-direction: column; gap: 12px; }
.wa-demo-label { font-size: 12px; font-weight: 700; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.wa-demo-thread {
  padding: 16px 14px;
  gap: 8px;
  /* Own entrance only — .thread's own infinite float would otherwise
     apply here too, and two independently-bobbing cards side by side
     reads as jittery rather than alive. Also overrides the base
     ".thread { opacity: 0; ... }" rule (style.css ~line 338, part of the
     hero's own entrance) which "animation: none" alone doesn't undo —
     without this the container itself stays invisible forever. */
  animation: none !important;
  opacity: 1 !important;
}
.wa-demo-bubble { font-size: 13.5px; }
.wa-demo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}
.wa-demo-header .avatar { flex-shrink: 0; font-size: 10px; }
.wa-demo-header-name { font-size: 13px; font-weight: 700; color: var(--fg-primary); }
.wa-demo-header-sub { font-size: 11px; color: var(--fg-muted); }
@media (prefers-reduced-motion: no-preference) {
  .wa-demo-bubble { opacity: 0; animation: rise-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
}
.wa-demo-replay {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 0;
  width: fit-content;
}
.wa-demo-replay:hover { color: var(--fg-primary); }

/* ---- Metrics / value-pillar strip below the hero (glass cards now,
   not a plain light "feature strip" — the whole page stays on the same
   dark glass surface). ------------------------------------------------ */
.feature-strip {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 28px 96px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature {
  padding: 24px 26px;
  background: var(--surface-card);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.feature h3 { font-size: 17px; margin-bottom: 10px; color: #fff; }
.feature p { font-size: 14.5px; color: var(--fg-muted); margin: 0; line-height: 1.55; }
@media (max-width: 860px) {
  .feature-strip { grid-template-columns: 1fr; gap: 16px; padding: 56px 20px 64px; }
}

/* ROI calculator — two sliders + a live-recomputed savings figure. */
.roi-card { padding: 28px 30px; }
.roi-card h3 { margin-bottom: 4px; }
.roi-card .roi-sub { color: var(--fg-muted); font-size: 13.5px; margin-bottom: 22px; }
.roi-row { margin-bottom: 20px; }
.roi-row label { display: flex; flex-direction: row; justify-content: space-between; font-size: 13.5px; color: var(--fg-secondary); font-weight: 500; margin-bottom: 8px; }
.roi-row label span { color: var(--wa-green-glow); font-family: var(--font-mono); font-weight: 600; }
.roi-row input[type="range"] {
  width: 100%;
  accent-color: var(--wa-green);
  height: 4px;
  background: var(--border-subtle);
}
.roi-result {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.roi-result .roi-figure { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--wa-green-glow); }
.roi-result .roi-label { font-size: 13px; color: var(--fg-muted); }

form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--fg-secondary); }
label.checkbox-label {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--fg-primary);
}
label.checkbox-label input { margin-top: 3px; }

input[type="text"], input[type="password"], input[type="email"], input[type="number"], textarea, select {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  background: var(--surface-input);
  color: var(--fg-primary);
}
input::placeholder, textarea::placeholder { color: var(--fg-subtle); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(56, 239, 125, 0.12); }
textarea { font-family: var(--font-mono); font-size: 13px; }

button, .button {
  display: inline-block;
  background: var(--wa-green);
  color: #04120A;
  border: none;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  width: fit-content;
  font-family: var(--font-sans);
}
button:hover, .button:hover { background: var(--wa-green-glow); }
.button.secondary { background: transparent; color: var(--fg-primary); border: 1px solid var(--border-medium); }
.button.secondary:hover { background: rgba(255,255,255,0.08); }
.hero .button.secondary { background: transparent; color: #fff; border: 1px solid var(--border-medium); }
.hero .button.secondary:hover { background: rgba(255,255,255,0.08); }
button:disabled, .button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  background: var(--surface-card);
  color: var(--fg-muted);
}
button:disabled:hover, .button:disabled:hover { background: var(--surface-card); }

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--fg-muted);
  font-size: 13px;
}
.oauth-divider::before, .oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.error { color: #fca5a5; }
.success { color: var(--wa-green-glow); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }

button.danger, .button.danger { background: transparent; color: #fca5a5; border: 1px solid var(--danger-border); }
button.danger:hover, .button.danger:hover { background: var(--danger-tint); }

.inline-form { flex-direction: row; gap: 6px; max-width: none; margin: 0; }
.inline-form input[type="text"] { flex: 1; min-width: 0; padding: 7px 10px; font-size: 13px; }
.inline-form button { padding: 7px 12px; font-size: 13px; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
th { background: rgba(255,255,255,0.03); font-weight: 600; font-size: 11.5px; color: var(--fg-muted); text-transform: none; }
td { font-size: 13.5px; color: var(--fg-secondary); }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-full); padding: 5px 12px; font-size: 12.5px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-full); padding: 5px 12px; font-size: 12.5px; font-weight: 600; }
.badge.active { background: var(--wa-green-tint); color: var(--wa-green-glow); }
.badge.pending { background: var(--warn-tint); color: var(--warn-amber); }

.consent-box {
  background: var(--warn-tint);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #fbbf6a;
}
.consent-box ul { margin: 8px 0; padding-left: 20px; }

pre {
  background: rgba(0,0,0,0.35);
  color: #b8f5cf;
  padding: 16px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  border: 1px solid var(--border-subtle);
}
pre.error { color: #f0b0a4; }
pre.ready { color: var(--wa-green-glow); font-weight: 700; }

code { background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 4px; font-family: var(--font-mono); color: var(--fg-secondary); }
hr { border: none; border-top: 1px solid var(--border-subtle); margin: 8px 0; }

.footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 13px;
  color: var(--fg-subtle);
}
.footer a { color: var(--fg-subtle); }

/* ---- sidebar app shell (customer dashboard) ------------------------ */

.app-body { margin: 0; background: var(--bg-void); }

.app-shell {
  display: flex;
  min-height: 100vh;
  background: transparent;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface-base);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--border-subtle);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--wa-green), var(--caustic-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: #fff; }

.navlink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fg-muted);
}
.navlink:hover { background: rgba(255,255,255,0.06); color: #fff; }
.navlink.active { background: var(--wa-green-tint); color: var(--wa-green-glow); }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 10px 4px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wa-green), var(--caustic-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #04120A;
  flex-shrink: 0;
}
.sidebar-email {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-base);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  gap: 16px;
  flex-wrap: wrap;
}
.app-header h1 { font-size: 21px; color: #fff; }
.app-header-subtitle { margin: 2px 0 0; font-size: 13.5px; color: var(--fg-muted); }

.app-content {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}
.app-content .card { margin: 0; max-width: none; padding: 20px 22px; }

.stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 160px; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--fg-muted); display: block; }
.stat-value { font-size: 24px; font-weight: 600; font-family: var(--font-display); display: block; margin-top: 4px; color: #fff; }

.callout {
  background: var(--warn-tint);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
  color: #fbbf6a;
}

.progress-track { height: 14px; background: rgba(255,255,255,0.08); border-radius: 7px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--wa-green), var(--wa-green-glow)); }

.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border-subtle); background: transparent; padding: 0 32px; }
.tab {
  padding: 12px 16px;
  border-radius: 9px 9px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--fg-muted);
  border-bottom: 2px solid transparent;
}
.tab.active { background: rgba(255,255,255,0.04); color: var(--wa-green-glow); border-bottom: 2px solid var(--wa-green); }

/* Visible focus ring against the dark background — relying on browser
   defaults here is low-contrast on near-black, worth being explicit. */
a:focus-visible, button:focus-visible, .button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .navlink:focus-visible {
  outline: 2px solid var(--wa-green-glow);
  outline-offset: 2px;
}

/* Responsive: stack the sidebar above content below ~860px, and add a
   second breakpoint for small phones (~400px) so nothing overflows. */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .sidebar-brand { padding: 4px 8px; }
  .sidebar-footer { margin-top: 0; margin-left: auto; border-top: none; padding: 4px; }
  .app-header { padding: 16px 20px; }
  .app-content { padding: 16px 20px; }
}
@media (max-width: 480px) {
  .app-header { padding: 14px 16px; }
  .app-content { padding: 14px 16px; gap: 16px; }
  .app-content .card { padding: 16px; }
  .hero { padding: 48px 16px 40px; }
  .container { padding: 28px 16px; }
}
