/* ============================================================
   VALOUR.AI — PREMIUM DESIGN SYSTEM
   Dark navy + electric green, sidebar app shell, glassmorphism
   Manrope / Inter / JetBrains Mono
   ============================================================ */

/* ─── GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Colors */
  --bg:           #050D18;
  --bg-2:         #091422;
  --bg-3:         #0C1A2E;
  --sidebar-bg:   #060F1C;
  --card:         #0D1B2E;
  --card-2:       #101F34;
  --card-3:       #132540;

  --green:        #2FC94D;
  --green-hi:     #4EE16A;
  --green-dim:    rgba(47, 201, 77, 0.12);
  --green-glow:   rgba(47, 201, 77, 0.25);
  --green-border: rgba(47, 201, 77, 0.30);

  --cyan:         #38BDF8;
  --cyan-dim:     rgba(56, 189, 248, 0.10);
  --purple:       #A78BFA;
  --amber:        #FBB040;
  --red:          #F87171;
  --red-dim:      rgba(248, 113, 113, 0.12);
  --red-border:   rgba(248, 113, 113, 0.30);

  --text:         #F0F4FA;
  --text-2:       #B8C4D4;
  --muted:        #6B7A94;
  --line:         rgba(255, 255, 255, 0.08);
  --line-soft:    rgba(255, 255, 255, 0.05);

  /* Typography */
  --font-head:    'Manrope', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --sidebar-w:    248px;
  --topbar-h:     60px;
  --max-w:        1040px;

  /* Shape */
  --radius:       16px;
  --radius-sm:    10px;
  --radius-xs:    7px;

  /* Shadows */
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md:    0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-card:  0 8px 32px rgba(0, 0, 0, 0.50);
  --shadow-green: 0 0 24px rgba(47, 201, 77, 0.18);

  /* Transitions */
  --ease:         cubic-bezier(0.22, 0.68, 0, 1.2);
  --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── LIGHT THEME ─────────────────────────────────────────────
   Overrides the dark tokens above. Dark remains the default;
   [data-theme="light"] flips surfaces, text, lines and shadows.
   Accent hues are deepened slightly so they keep contrast on
   light surfaces. Component rules that assume dark are handled
   in the "LIGHT THEME OVERRIDES" section at the end of this file.
   ──────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:           #F4F6FB;
  --bg-2:         #FFFFFF;
  --bg-3:         #EDF1F8;
  --sidebar-bg:   #0C1A2E;
  --card:         #FFFFFF;
  --card-2:       #F7F9FD;
  --card-3:       #EEF2F9;

  --green:        #1FA83C;
  --green-hi:     #178A31;
  --green-dim:    rgba(31, 168, 60, 0.10);
  --green-glow:   rgba(31, 168, 60, 0.18);
  --green-border: rgba(31, 168, 60, 0.28);

  --cyan:         #0284C7;
  --cyan-dim:     rgba(2, 132, 199, 0.10);
  --purple:       #7C5CFC;
  --amber:        #D97706;
  --red:          #DC2626;
  --red-dim:      rgba(220, 38, 38, 0.08);
  --red-border:   rgba(220, 38, 38, 0.28);

  --text:         #0B1526;
  --text-2:       #3D4B63;
  --muted:        #6B7A94;
  --line:         rgba(11, 21, 38, 0.12);
  --line-soft:    rgba(11, 21, 38, 0.07);

  --shadow-sm:    0 1px 3px rgba(11, 21, 38, 0.08);
  --shadow-md:    0 4px 16px rgba(11, 21, 38, 0.10);
  --shadow-card:  0 6px 24px rgba(11, 21, 38, 0.08);
  --shadow-green: 0 0 20px rgba(31, 168, 60, 0.14);
}

/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}
::selection { background: var(--green-glow); color: #fff; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }

/* ─── KEYFRAMES ─────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1.0); opacity: 1;   }
}
@keyframes spin-ring {
  to { transform: rotate(360deg); }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 12px var(--green-glow); }
  50%       { box-shadow: 0 0 28px var(--green-glow); }
}
@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -30px) scale(1.08); }
  66%       { transform: translate(-25px, 20px) scale(0.95); }
}
@keyframes shimmer {
  from { background-position: -400px 0; }
  to   { background-position:  400px 0; }
}
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-5px); }
}

/* ─── APP SHELL — SIDEBAR LAYOUT ───────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: width 0.3s var(--ease-smooth);
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green-hi) 0%, var(--green) 100%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-green);
  animation: glow-pulse 3s ease-in-out infinite;
}
.logo-mark svg { width: 18px; height: 18px; color: #041009; }
.logo-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.025em;
  color: var(--text);
  white-space: nowrap;
}
.logo-text span { color: var(--green-hi); }

.sidebar-biz {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sidebar-biz-label {
  font-size: 10.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.sidebar-biz-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 8px 6px;
  margin-top: 6px;
}
.nav-section-label:first-child { margin-top: 0; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-xs);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-link .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.18s;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.sidebar-link:hover .nav-icon { opacity: 1; }
.sidebar-link.active {
  background: var(--green-dim);
  color: var(--green-hi);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--green);
}
.sidebar-link.active .nav-icon { opacity: 1; color: var(--green-hi); }

.sidebar-bottom {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

/* ── MAIN CONTENT AREA ── */
.app-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOP BAR ── */
.topbar {
  height: var(--topbar-h);
  background: rgba(5, 13, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}
.topbar-breadcrumb .sep { opacity: 0.4; }
.topbar-breadcrumb .current {
  color: var(--text);
  font-weight: 500;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple) 0%, var(--cyan) 100%);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font-head);
  color: #fff;
  flex-shrink: 0;
  border: 1.5px solid var(--line);
}

/* ── PAGE CONTENT ── */
.page-content {
  flex: 1;
  padding: 32px 28px 48px;
  max-width: 1100px;
  width: 100%;
  animation: fadeSlideUp 0.4s var(--ease-smooth) both;
}

/* ─── FLASH MESSAGES ────────────────────────────────────────── */
.flash-bar {
  padding: 0 28px;
  margin-top: 16px;
}
.flash-list { display: flex; flex-direction: column; gap: 8px; }
.flash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  animation: fadeSlideUp 0.3s var(--ease-smooth) both;
}
.flash-item.success {
  background: var(--green-dim);
  border: 1px solid var(--green-border);
  color: var(--green-hi);
}
.flash-item.error {
  background: var(--red-dim);
  border: 1px solid var(--red-border);
  color: var(--red);
}
.flash-item.info {
  background: var(--cyan-dim);
  border: 1px solid rgba(56,189,248,0.25);
  color: var(--cyan);
}

/* ─── PAGE HEADER ───────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-header-left {}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 6px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1.5px;
  background: linear-gradient(90deg, var(--green), transparent);
  border-radius: 2px;
}
.page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 30%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* ─── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 20px; }

.glass-card {
  background: rgba(13, 27, 46, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
}

/* ─── STAT CARDS ────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, transform 0.2s;
  animation: fadeSlideUp 0.4s var(--ease-smooth) both;
}
.stat-card:hover { border-color: var(--green-border); transform: translateY(-2px); }
.stat-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.stat-icon.green  { background: var(--green-dim);  color: var(--green-hi); }
.stat-icon.cyan   { background: var(--cyan-dim);   color: var(--cyan); }
.stat-icon.purple { background: rgba(167,139,250,.12); color: var(--purple); }
.stat-icon.amber  { background: rgba(251,176,64,.12);  color: var(--amber); }
.stat-icon svg    { width: 18px; height: 18px; }
.stat-value {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* ─── QUICK ACTION TILES ────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.action-tile {
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease);
  cursor: pointer;
  animation: fadeSlideUp 0.4s var(--ease-smooth) both;
}
.action-tile:nth-child(1) { animation-delay: 0.05s; }
.action-tile:nth-child(2) { animation-delay: 0.10s; }
.action-tile:nth-child(3) { animation-delay: 0.15s; }
.action-tile:nth-child(4) { animation-delay: 0.20s; }
.action-tile:hover {
  border-color: var(--green-border);
  background: rgba(47, 201, 77, 0.05);
  transform: translateY(-3px);
}
.action-tile-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--green-dim);
  display: grid;
  place-items: center;
  color: var(--green-hi);
}
.action-tile-icon svg { width: 20px; height: 20px; }
.action-tile h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.action-tile p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.action-tile.danger:hover {
  border-color: var(--red-border);
  background: var(--red-dim);
}
.action-tile.danger .action-tile-icon {
  background: var(--red-dim);
  color: var(--red);
}

/* ─── ENTITY GRID (AGENT CARDS) ─────────────────────────────── */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.entity-card {
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s;
  animation: fadeSlideUp 0.4s var(--ease-smooth) both;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.entity-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--green-dim), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
}
.entity-card:hover {
  border-color: var(--green-border);
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.5), var(--shadow-green);
}
.entity-card:hover::before { opacity: 1; }

.agent-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.agent-avatar {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.08);
  color: #fff;
}
.agent-avatar.color-0 { background: linear-gradient(135deg, #2FC94D, #1A8C34); }
.agent-avatar.color-1 { background: linear-gradient(135deg, #38BDF8, #0E78B8); }
.agent-avatar.color-2 { background: linear-gradient(135deg, #A78BFA, #6D45D5); }
.agent-avatar.color-3 { background: linear-gradient(135deg, #FBB040, #C07800); }
.agent-avatar.color-4 { background: linear-gradient(135deg, #F87171, #C0303A); }
.agent-avatar.color-5 { background: linear-gradient(135deg, #34D399, #0D8F5B); }

.agent-card-info { flex: 1; min-width: 0; }
.agent-card-info h3 {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-card-stats {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
.agent-card-stat {
  display: flex;
  align-items: center;
  gap: 5px;
}
.agent-card-stat svg { width: 13px; height: 13px; opacity: 0.6; }

/* ─── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1;
}
.badge-green  { background: var(--green-dim);  color: var(--green-hi);  border: 1px solid var(--green-border); }
.badge-muted  { background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid var(--line); }
.badge-red    { background: var(--red-dim);    color: var(--red);       border: 1px solid var(--red-border); }
.badge-cyan   { background: var(--cyan-dim);   color: var(--cyan);      border: 1px solid rgba(56,189,248,.3); }
.badge-purple { background: rgba(167,139,250,.12); color: var(--purple); border: 1px solid rgba(167,139,250,.3); }
.badge-amber  { background: rgba(251,176,64,.12);  color: var(--amber);  border: 1px solid rgba(251,176,64,.3); }

/* pulsing dot for processing state */
.badge-muted.processing { animation: none; }
.badge-muted.processing::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 var(--amber);
  animation: ping 1.2s ease-in-out infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(251,176,64,.6); }
  70%  { box-shadow: 0 0 0 6px rgba(251,176,64,0); }
  100% { box-shadow: 0 0 0 0 rgba(251,176,64,0); }
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  min-height: 40px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  opacity: 0;
  transition: opacity 0.15s;
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--green-hi) 0%, var(--green) 100%);
  color: #041009;
  box-shadow: 0 4px 16px var(--green-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--green-glow); }
.btn-primary svg { color: #041009; }

.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: rgba(47,201,77,0.4); color: var(--text); background: rgba(47,201,77,0.05); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-border);
}
.btn-danger:hover { background: rgba(248,113,113,0.2); }

.btn-sm { font-size: 12px; padding: 7px 14px; min-height: 32px; }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-xs);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Legacy submit — keep working */
button[type="submit"]:not(.btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  min-height: 40px;
  background: linear-gradient(135deg, var(--green-hi) 0%, var(--green) 100%);
  color: #041009;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--green-glow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
button[type="submit"]:not(.btn):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--green-glow);
}

/* ─── FORMS ──────────────────────────────────────────────────── */
.form-section {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  letter-spacing: -0.01em;
}

.field {
  position: relative;
  margin-bottom: 20px;
}
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}
.field input,
.field select,
.field textarea,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  min-height: 42px;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: block;
}
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}
select option { background: var(--card-2); }

form ul.errorlist {
  list-style: none;
  color: var(--red);
  font-size: 12px;
  margin: -10px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* file input */
input[type="file"] {
  background: var(--bg-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s;
}
input[type="file"]:hover { border-color: var(--green-border); }

/* checkbox */
input[type="checkbox"] {
  width: 16px; height: 16px;
  border-radius: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  cursor: pointer;
  accent-color: var(--green);
  min-height: auto;
}

/* ─── UPLOAD ZONE ────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  position: relative;
}
.upload-zone:hover { border-color: var(--green-border); background: var(--green-dim); }
.upload-zone-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--green-dim);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  color: var(--green-hi);
}
.upload-zone-icon svg { width: 24px; height: 24px; }
.upload-zone h3 { font-size: 15px; margin-bottom: 6px; }
.upload-zone p { font-size: 13px; color: var(--muted); }
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  border: none;
  border-radius: 0;
  background: transparent;
  width: 100%;
  height: 100%;
  padding: 0;
}

/* ─── TOGGLE SWITCHES ────────────────────────────────────────── */
.tool-list { display: flex; flex-direction: column; gap: 12px; }
.tool-toggle-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: border-color 0.2s;
}
.tool-toggle-card:has(input:checked) {
  border-color: var(--green-border);
  background: rgba(47,201,77,0.04);
}
.tool-toggle-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--green-dim);
  display: grid;
  place-items: center;
  color: var(--green-hi);
  flex-shrink: 0;
}
.tool-toggle-icon svg { width: 19px; height: 19px; }
.tool-toggle-body { flex: 1; }
.tool-toggle-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.tool-toggle-desc { font-size: 12.5px; color: var(--muted); }

/* CSS-only toggle switch */
.toggle-switch {
  position: relative;
  width: 42px; height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.toggle-track::after {
  content: "";
  position: absolute;
  left: 3px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: left 0.2s var(--ease), background 0.2s;
}
.toggle-switch input:checked + .toggle-track {
  background: var(--green);
  border-color: var(--green);
}
.toggle-switch input:checked + .toggle-track::after {
  left: calc(100% - 19px);
  background: #041009;
}

/* ─── DATA TABLE ─────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  font-size: 13.5px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.data-table .row-actions { display: flex; gap: 8px; align-items: center; }

/* ─── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  animation: fadeIn 0.4s ease both;
}
.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  color: var(--muted);
}
.empty-state-icon svg { width: 26px; height: 26px; }
.empty-state h3 { font-size: 17px; margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }

/* ─── FIELD STATIC (READ-ONLY DISPLAY) ──────────────────────── */
.field-static { margin-bottom: 18px; }
.field-static label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field-static .value {
  color: var(--text-2);
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
  min-height: 42px;
  display: flex;
  align-items: center;
}

/* ─── DETAIL LAYOUT ──────────────────────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.detail-panel {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 28px;
}
.detail-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  cursor: pointer;
  text-decoration: none;
}
.detail-action-btn svg { width: 17px; height: 17px; opacity: 0.7; flex-shrink: 0; }
.detail-action-btn:hover { border-color: var(--green-border); background: var(--green-dim); color: var(--green-hi); }
.detail-action-btn:hover svg { opacity: 1; color: var(--green-hi); }
.detail-action-btn.danger:hover { border-color: var(--red-border); background: var(--red-dim); color: var(--red); }
.detail-action-btn.danger:hover svg { color: var(--red); }

/* ─── CHAT PLAYGROUND ────────────────────────────────────────── */
.playground-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 80px);
  min-height: 520px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.playground-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
  background: var(--card-2);
}
.playground-agent-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.playground-agent-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  animation: glow-pulse 2s ease-in-out infinite;
}
.playground-agent-name { font-weight: 700; font-size: 14.5px; }
.playground-agent-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}
.playground-agent-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.playground-agent-avatar-sm {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: #fff;
  font-size: 11px;
}
.playground-live-badge { font-size: 10px; }
.playground-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.playground-transcript::-webkit-scrollbar { width: 4px; }
.playground-transcript::-webkit-scrollbar-track { background: transparent; }
.playground-transcript::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.chat-bubble {
  display: flex;
  gap: 10px;
  animation: fadeSlideUp 0.3s var(--ease-smooth) both;
  max-width: 80%;
}
.chat-bubble.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-bubble-avatar {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 2px;
}
.chat-bubble.user .chat-bubble-avatar {
  background: linear-gradient(135deg, var(--green-hi), var(--green));
  color: #041009;
}
.chat-bubble.assistant .chat-bubble-avatar {
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: #fff;
}
.chat-bubble-content {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
}
.chat-bubble.user .chat-bubble-content {
  background: linear-gradient(135deg, var(--green-hi), var(--green));
  color: #041009;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.chat-bubble.assistant .chat-bubble-content {
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}
.typing-indicator.visible { opacity: 1; }
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.typing-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(1) { animation-delay: 0s;    }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.30s; }

.playground-input-area {
  border-top: 1px solid var(--line-soft);
  padding: 14px 16px;
  flex-shrink: 0;
  background: var(--card-2);
}
.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input-row input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  min-height: 44px;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: auto;
}
.chat-input-row input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request.htmx-indicator { display: block; }

/* Debug panel */
.debug-panel {
  border-top: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.debug-panel summary {
  padding: 10px 20px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.debug-panel summary::-webkit-details-marker { display: none; }
.debug-panel-content { padding: 12px 20px 16px; }
.debug-call {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}
.debug-call-name { color: var(--cyan); font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.debug-call-name svg { flex-shrink: 0; }
.debug-call-row { color: var(--muted); }
.debug-call-row span { color: var(--text-2); }

/* ─── DANGER ZONE ────────────────────────────────────────────── */
.danger-card {
  background: var(--red-dim);
  border: 1px solid var(--red-border);
  border-radius: var(--radius);
  padding: 28px;
}
.danger-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(248,113,113,0.2);
  display: grid;
  place-items: center;
  color: var(--red);
  margin-bottom: 16px;
}
.danger-icon svg { width: 24px; height: 24px; }
.danger-card h1 { color: var(--red); }
.danger-card p { color: var(--text-2); font-size: 14px; margin-bottom: 20px; }

/* ─── AUTH PAGES ─────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}
.auth-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: blob-drift 12s ease-in-out infinite;
}
.auth-blob-1 {
  width: 500px; height: 500px;
  background: var(--green);
  top: -150px; left: -100px;
  animation-delay: 0s;
}
.auth-blob-2 {
  width: 400px; height: 400px;
  background: var(--cyan);
  bottom: -100px; right: -80px;
  animation-delay: -4s;
}
.auth-blob-3 {
  width: 300px; height: 300px;
  background: var(--purple);
  top: 40%; left: 40%;
  animation-delay: -8s;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.025em;
  margin-bottom: 28px;
}
.auth-logo .logo-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
}
.auth-form-card {
  background: rgba(13, 27, 46, 0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-card);
}
.auth-form-card h2 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 6px;
}
.auth-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}
.auth-footer {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 18px;
}
.auth-footer a { color: var(--green-hi); font-weight: 600; }

/* ─── SETTINGS PAGE ──────────────────────────────────────────── */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}
.settings-nav {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px;
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
}
.settings-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-xs);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.settings-nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.settings-nav-link.active { background: var(--green-dim); color: var(--green-hi); }
.settings-nav-link svg { width: 16px; height: 16px; opacity: 0.7; }

.settings-panel {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 28px;
}
.settings-panel-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.settings-panel-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

/* ─── MISC UTILITIES ─────────────────────────────────────────── */
.meta { color: var(--muted); font-size: 13px; }
.divider { border: none; border-top: 1px solid var(--line-soft); margin: 20px 0; }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.messages { margin-bottom: 16px; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-actions-grid { flex-direction: row; flex-wrap: wrap; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; }
}
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar .logo-text,
  .sidebar .sidebar-biz,
  .sidebar .sidebar-link span,
  .sidebar .nav-section-label { display: none; }
  .sidebar-link { justify-content: center; padding: 10px; }
  .sidebar-link .nav-icon { width: 20px; height: 20px; }
  .app-content { margin-left: 60px; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 20px 16px 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .playground-shell { height: calc(100vh - var(--topbar-h) - 56px); }
}
@media (max-width: 480px) {
  .sidebar { width: 0; border: none; }
  .app-content { margin-left: 0; }
  .entity-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   SAAS UPGRADE — ANALYTICS, INBOX, CHANNELS, APPOINTMENTS
   ═══════════════════════════════════════════════════════════════ */

/* ─── METRIC HEADER ROW ──────────────────────────────────────── */
.metrics-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 28px; }
.metric-card {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 20px 22px; display: flex; align-items: flex-start; gap: 14px;
  transition: border-color .2s, transform .2s; animation: fadeSlideUp .4s var(--ease-smooth) both;
  position: relative; overflow: hidden;
}
.metric-card::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--ac-s, var(--green)), var(--ac-e, var(--green-hi)));
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-smooth);
}
.metric-card:hover { border-color: rgba(255,255,255,.12); transform: translateY(-2px); }
.metric-card:hover::after { transform: scaleX(1); }
.metric-card.green  { --ac-s: var(--green);  --ac-e: var(--green-hi); }
.metric-card.cyan   { --ac-s: var(--cyan);   --ac-e: #7DD3FC; }
.metric-card.purple { --ac-s: var(--purple); --ac-e: #C4B5FD; }
.metric-card.amber  { --ac-s: var(--amber);  --ac-e: #FCD34D; }
.metric-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.metric-icon svg { width: 20px; height: 20px; }
.metric-card.green  .metric-icon { background: var(--green-dim);       color: var(--green-hi); }
.metric-card.cyan   .metric-icon { background: var(--cyan-dim);        color: var(--cyan); }
.metric-card.purple .metric-icon { background: rgba(167,139,250,.14);  color: var(--purple); }
.metric-card.amber  .metric-icon { background: rgba(251,176,64,.14);   color: var(--amber); }
.metric-body { flex: 1; min-width: 0; }
.metric-value { font-family: var(--font-head); font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--text); margin-bottom: 4px; }
.metric-label { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.metric-delta { font-size: 11.5px; font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 3px; }
.metric-delta.up { color: var(--green-hi); } .metric-delta.down { color: var(--red); }
.metric-delta.neutral { color: var(--muted); }

/* ─── CHARTS LAYOUT ──────────────────────────────────────────── */
.charts-row { display: grid; grid-template-columns: 1fr 300px; gap: 20px; margin-bottom: 24px; }
.chart-panel { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px; animation: fadeSlideUp .4s var(--ease-smooth) .1s both; }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.chart-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.chart-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chart-period-pills { display: flex; gap: 4px; }
.chart-pill { font-size: 11.5px; font-family: var(--font-mono); padding: 4px 10px; border-radius: 999px; background: transparent; border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.chart-pill.active, .chart-pill:hover { background: var(--green-dim); border-color: var(--green-border); color: var(--green-hi); }
.line-chart-wrap { position: relative; padding-bottom: 28px; }
.line-chart-svg { width: 100%; height: 130px; overflow: visible; }
.chart-area { fill: url(#chart-gradient); opacity: .2; }
.chart-line { fill: none; stroke: var(--green-hi); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px var(--green-glow)); }
.chart-dot { fill: var(--green-hi); stroke: var(--bg); stroke-width: 2; }
.chart-x-labels { display: flex; justify-content: space-between; margin-top: 8px; }
.chart-x-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); text-align: center; flex: 1; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 130px; color: var(--muted); font-size: 13px; }

/* Donut */
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.donut-ring { width: 140px; height: 140px; border-radius: 50%; position: relative; }
.donut-ring::after { content: ""; position: absolute; inset: 24px; background: var(--card); border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; gap: 2px; }
.donut-center-value { font-family: var(--font-head); font-size: 22px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.donut-center-label { font-size: 10px; color: var(--muted); }
.donut-legend { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.donut-legend-item { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.donut-legend-left { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.donut-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-pct { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text); }

/* Panel card */
.panel-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; animation: fadeSlideUp .4s var(--ease-smooth) .15s both; margin-bottom: 24px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-title { font-size: 14px; font-weight: 700; }
.panel-action { font-size: 12.5px; color: var(--green-hi); font-weight: 600; transition: color .15s; }
.panel-action:hover { color: var(--green); }

/* ─── INBOX ──────────────────────────────────────────────────── */
.inbox-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.inbox-search-wrap { position: relative; flex: 1; min-width: 200px; }
.inbox-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.inbox-search { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 14px 9px 38px; color: var(--text); font: inherit; font-size: 13.5px; min-height: 38px; transition: border-color .2s, box-shadow .2s; }
.inbox-search:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.channel-tabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 4px; }
.channel-tab { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; white-space: nowrap; }
.channel-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.channel-tab.active { background: var(--green-dim); color: var(--green-hi); }
.channel-tab svg { width: 14px; height: 14px; }
.tab-count { font-family: var(--font-mono); font-size: 10.5px; background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 999px; }
.channel-tab.active .tab-count { background: rgba(47,201,77,.2); }
.inbox-list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.inbox-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); transition: background .15s; color: inherit; text-decoration: none; }
.inbox-row:last-child { border-bottom: none; }
.inbox-row:hover { background: rgba(255,255,255,.025); }
.inbox-channel-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.inbox-channel-icon.web      { background: var(--green-dim);      color: var(--green-hi); }
.inbox-channel-icon.whatsapp { background: rgba(37,211,102,.12);  color: #25D366; }
.inbox-channel-icon.phone    { background: var(--cyan-dim);       color: var(--cyan); }
.inbox-channel-icon svg { width: 18px; height: 18px; }
.inbox-body { flex: 1; min-width: 0; }
.inbox-row-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.inbox-agent-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.inbox-time { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; }
.inbox-preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.inbox-count { font-family: var(--font-mono); font-size: 10.5px; background: rgba(255,255,255,.06); padding: 2px 7px; border-radius: 999px; color: var(--muted); }

/* ─── CHANNELS HUB ───────────────────────────────────────────── */
.channels-hero { text-align: center; padding: 0 0 36px; }
.channels-hero h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; background: linear-gradient(135deg, var(--text) 30%, var(--text-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.channels-hero p { color: var(--muted); font-size: 15px; }
.channels-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 32px; }
.channel-hub-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; transition: border-color .2s, transform .25s var(--ease); animation: fadeSlideUp .4s var(--ease-smooth) both; position: relative; overflow: hidden; }
.channel-hub-card:nth-child(1) { animation-delay: 0s; }
.channel-hub-card:nth-child(2) { animation-delay: .07s; }
.channel-hub-card:nth-child(3) { animation-delay: .14s; }
.channel-hub-card:hover { border-color: rgba(255,255,255,.14); transform: translateY(-4px); }
.channel-hub-card.connected { border-color: var(--green-border); }
.channel-hub-card.connected::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, var(--green-dim) 0%, transparent 60%); pointer-events: none; }
.channel-hub-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.channel-hub-icon svg { width: 26px; height: 26px; }
.channel-hub-icon.web      { background: var(--green-dim);      color: var(--green-hi); }
.channel-hub-icon.whatsapp { background: rgba(37,211,102,.14);  color: #25D366; }
.channel-hub-icon.phone    { background: var(--cyan-dim);       color: var(--cyan); }
.channel-hub-title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.channel-hub-desc  { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.channel-hub-stats { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.channel-hub-stat { text-align: center; flex: 1; }
.channel-hub-stat-value { font-family: var(--font-head); font-size: 20px; font-weight: 800; }
.channel-hub-stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.channel-status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.channel-status-badge.connected     { background: var(--green-dim); color: var(--green-hi); border: 1px solid var(--green-border); }
.channel-status-badge.not-connected { background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid var(--line); }
.channel-status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.embed-block { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); overflow: hidden; margin-top: 8px; }
.embed-block-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 11.5px; font-family: var(--font-mono); color: var(--muted); }
.embed-block pre { padding: 14px 16px; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--text-2); overflow-x: auto; margin: 0; white-space: pre-wrap; word-break: break-all; }
.setup-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.setup-step { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius-xs); }
.setup-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--green-dim); border: 1px solid var(--green-border); color: var(--green-hi); font-size: 11px; font-weight: 700; font-family: var(--font-mono); display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.setup-step-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* ─── APPOINTMENTS ───────────────────────────────────────────── */
.appt-section-title { font-size: 13px; font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.appt-list { display: flex; flex-direction: column; gap: 10px; }
.appt-card { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 16px 18px; transition: border-color .18s; animation: fadeSlideUp .35s var(--ease-smooth) both; }
.appt-card:hover { border-color: rgba(255,255,255,.12); }
.appt-time-block { text-align: center; min-width: 60px; flex-shrink: 0; }
.appt-day { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.appt-month { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.appt-hour { font-family: var(--font-mono); font-size: 12px; color: var(--green-hi); font-weight: 600; margin-top: 4px; }
.appt-divider { width: 1px; height: 48px; background: var(--line); flex-shrink: 0; }
.appt-body { flex: 1; min-width: 0; }
.appt-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.appt-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appt-upcoming-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-family: var(--font-mono); font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--green-dim); color: var(--green-hi); border: 1px solid var(--green-border); }

/* ─── AGENT CHANNEL SECTION ──────────────────────────────────── */
.agent-channel-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.agent-channel-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); transition: border-color .18s; }
.agent-channel-row.active { border-color: var(--green-border); background: rgba(47,201,77,.04); }
.agent-channel-row .ch-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.agent-channel-row .ch-icon svg { width: 17px; height: 17px; }
.agent-channel-row .ch-icon.web      { background: var(--green-dim);     color: var(--green-hi); }
.agent-channel-row .ch-icon.whatsapp { background: rgba(37,211,102,.12); color: #25D366; }
.agent-channel-row .ch-icon.phone    { background: var(--cyan-dim);      color: var(--cyan); }
.agent-channel-row .ch-name { font-size: 13.5px; font-weight: 600; flex: 1; }
.agent-channel-row .ch-status { font-size: 12px; color: var(--muted); }
.agent-channel-icons { display: flex; gap: 5px; flex-wrap: wrap; }
.agent-ch-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; font-family: var(--font-mono); padding: 2px 8px; border-radius: 999px; }
.agent-ch-pill.web      { background: var(--green-dim);     color: var(--green-hi); border: 1px solid var(--green-border); }
.agent-ch-pill.whatsapp { background: rgba(37,211,102,.12); color: #25D366;          border: 1px solid rgba(37,211,102,.3); }
.agent-ch-pill.phone    { background: var(--cyan-dim);      color: var(--cyan);      border: 1px solid rgba(56,189,248,.3); }
.agent-ch-pill svg { width: 10px; height: 10px; }

/* Bottom split row + page tabs */
.bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.page-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line-soft); margin-bottom: 24px; }
.page-tab { padding: 10px 18px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.page-tab:hover { color: var(--text); }
.page-tab.active { color: var(--green-hi); border-bottom-color: var(--green); }

@media (max-width: 1100px) {
  .metrics-row  { grid-template-columns: repeat(2,1fr); }
  .charts-row   { grid-template-columns: 1fr; }
  .channels-grid{ grid-template-columns: 1fr 1fr; }
  .bottom-row   { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .metrics-row  { grid-template-columns: 1fr 1fr; }
  .channels-grid{ grid-template-columns: 1fr; }
}

/* ─── LIVE PULSE & HIGH CONTRAST POLISH ─── */
@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.status-banner {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
}

.card:hover, .metric-card:hover, .entity-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 1px rgba(255, 255, 255, 0.15);
}

.badge-green {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34D399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.btn-primary {
  background: linear-gradient(135deg, #10B981, #059669) !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25) !important;
  transition: all 0.2s ease !important;
}

.btn-primary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME — COMPONENT OVERRIDES
   Rules below assume a dark surface somewhere (glassmorphism,
   hard-coded rgba(255,255,255,…) overlays, dark text on accent).
   Only the rules that a token swap alone can't fix are overridden.
   ═══════════════════════════════════════════════════════════════ */
[data-theme="light"] ::selection { background: rgba(31,168,60,.22); color: #0B1526; }

/* Sidebar stays dark in light mode for brand contrast, but its
   hover/active states reference white overlays — keep them working. */
[data-theme="light"] .sidebar-link:hover { background: rgba(255,255,255,0.06); }
[data-theme="light"] .sidebar-link.active {
  background: rgba(78,225,106,0.14);
  color: #4EE16A;
  box-shadow: inset 3px 0 0 #2FC94D;
}
[data-theme="light"] .sidebar-link.active .nav-icon { color: #4EE16A; }
[data-theme="light"] .logo-text { color: #F0F4FA; }
[data-theme="light"] .logo-text span { color: #4EE16A; }
[data-theme="light"] .sidebar-biz-name { color: #B8C4D4; }

/* Topbar glass */
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: var(--line);
}

/* Page title gradient reads on light */
[data-theme="light"] .page-title {
  background: linear-gradient(135deg, var(--text) 40%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Cards & generic hovers: softer shadow, no white inner glow */
[data-theme="light"] .card:hover,
[data-theme="light"] .metric-card:hover,
[data-theme="light"] .entity-card:hover {
  box-shadow: 0 10px 28px rgba(11,21,38,0.12);
}
[data-theme="light"] .entity-card:hover { box-shadow: 0 12px 30px rgba(11,21,38,0.12), var(--shadow-green); }

/* Buttons */
[data-theme="light"] .btn-ghost { background: rgba(11,21,38,0.03); }
[data-theme="light"] .btn-ghost:hover { background: rgba(31,168,60,0.06); }
[data-theme="light"] .btn::after { background: rgba(255,255,255,0.25); }
[data-theme="light"] .btn-primary,
[data-theme="light"] button[type="submit"]:not(.btn) {
  color: #FFFFFF !important;
}
[data-theme="light"] .btn-primary svg { color: #FFFFFF; }

/* Badges that used white/translucent bg */
[data-theme="light"] .badge-muted { background: rgba(11,21,38,0.05); }
[data-theme="light"] .tab-count { background: rgba(11,21,38,0.07); }
[data-theme="light"] .inbox-count { background: rgba(11,21,38,0.06); }

/* Toggle switch */
[data-theme="light"] .toggle-track { background: rgba(11,21,38,0.12); }
[data-theme="light"] .toggle-switch input:checked + .toggle-track::after { background: #FFFFFF; }

/* Tables & rows that hover with a white wash */
[data-theme="light"] .data-table tbody tr:hover { background: rgba(11,21,38,0.02); }
[data-theme="light"] .inbox-row:hover { background: rgba(11,21,38,0.02); }
[data-theme="light"] .channel-tab:hover { background: rgba(11,21,38,0.04); }
[data-theme="light"] .settings-nav-link:hover { background: rgba(11,21,38,0.04); }
[data-theme="light"] .metric-card:hover,
[data-theme="light"] .channel-hub-card:hover,
[data-theme="light"] .appt-card:hover { border-color: rgba(11,21,38,0.18); }

/* Select dropdown options */
[data-theme="light"] select option { background: #FFFFFF; color: var(--text); }

/* Chat playground — assistant bubble & input on light */
[data-theme="light"] .chat-bubble.assistant .chat-bubble-content {
  background: var(--bg-3);
  border-color: var(--line-soft);
}
[data-theme="light"] .typing-dots { background: var(--bg-3); }
[data-theme="light"] .playground-header,
[data-theme="light"] .playground-input-area { background: var(--card-2); }

/* Auth pages: soften blobs, light card */
[data-theme="light"] .auth-blob { opacity: 0.12; }
[data-theme="light"] .auth-form-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}
[data-theme="light"] .auth-footer a { color: var(--green-hi); }

/* Chart line/dot stroke referenced dark bg */
[data-theme="light"] .chart-dot { stroke: var(--bg-2); }

/* Status banner shadow tint */
[data-theme="light"] .status-banner { box-shadow: 0 4px 20px rgba(31,168,60,0.10); }

/* ═══════════════════════════════════════════════════════════════
   SHARED COMPONENTS — template cards, detail grid, theme toggle
   ═══════════════════════════════════════════════════════════════ */

/* Template launcher cards (agents list + create form) */
.template-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.template-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s, background 0.2s;
  position: relative;
}
.template-card:hover {
  border-color: var(--tc, var(--green-border));
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.template-card.selected {
  border-color: var(--tc, var(--green));
  background: var(--green-dim);
  box-shadow: 0 0 0 1px var(--tc, var(--green)) inset;
}
.template-card-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--tc, var(--green)) 12%, transparent);
  color: var(--tc, var(--green-hi));
  flex-shrink: 0;
}
.template-card-icon svg { width: 19px; height: 19px; }
.template-card-name { font-size: 13.5px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.template-card-desc { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.template-card-cta {
  margin-top: auto;
  padding-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tc, var(--green-hi));
}
@media (max-width: 900px) { .template-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .template-grid { grid-template-columns: 1fr; } }

/* Agent detail two-column layout */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.action-panel { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1024px) { .detail-grid { grid-template-columns: 1fr; } }

/* Danger-outline button (delete actions) */
.btn-danger-outline {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-border);
  border-radius: 9px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  transition: background 0.18s, border-color 0.18s;
}
.btn-danger-outline:hover { background: rgba(248,113,113,0.18); }
[data-theme="light"] .btn-danger-outline:hover { background: rgba(220,38,38,0.12); }

/* Theme toggle button (topbar + auth) */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s, transform 0.2s var(--ease);
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--green-border); color: var(--green-hi); transform: translateY(-1px); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle { background: rgba(11,21,38,0.04); }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Auth pages: pin the toggle to the top-right corner */
.auth-theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════
   LANDING / MARKETING PAGE
   Standalone public page (does not use the app shell). Reuses the
   design tokens; light/dark safe via [data-theme].
   ═══════════════════════════════════════════════════════════════ */
.landing {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
.landing a { text-decoration: none; }
.landing-container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.landing-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.025em;
  color: var(--text);
}
.landing-brand .logo-mark { width: 32px; height: 32px; border-radius: 9px; animation: none; }
.landing-brand span.accent { color: var(--green-hi); }
.landing-nav-actions { display: flex; align-items: center; gap: 10px; }

/* Hero */
.landing-hero {
  position: relative;
  padding: 84px 0 72px;
}
.landing-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-hi);
  background: var(--green-dim);
  border: 1px solid var(--green-border);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.landing-h1 {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 18px;
}
.landing-h1 .grad {
  background: linear-gradient(120deg, var(--green-hi), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-sub {
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 520px;
  margin-bottom: 30px;
}
.landing-ctas { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.landing-ctas .btn { padding: 13px 26px; font-size: 14.5px; min-height: 48px; }
.landing-note { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* Hero visual — mock chat widget */
.landing-hero-visual { position: relative; }
.landing-chat {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: fadeSlideUp 0.5s var(--ease-smooth) both;
}
.landing-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card-2);
  border-bottom: 1px solid var(--line-soft);
}
.landing-chat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.landing-chat-title { font-size: 13.5px; font-weight: 700; }
.landing-chat-sub { font-size: 11px; color: var(--muted); }
.landing-chat-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.landing-chat-body .chat-bubble { max-width: 88%; }
.landing-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--card-2);
}
.landing-chat-input .fake-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Sections */
.landing-section { padding: 72px 0; }
.landing-section.alt { background: var(--bg-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.landing-section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.landing-section-title { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 12px; }
.landing-section-sub { font-size: 15.5px; color: var(--muted); line-height: 1.6; }

/* Steps */
.landing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.landing-step {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color 0.2s, transform 0.25s var(--ease);
}
.landing-step:hover { border-color: var(--green-border); transform: translateY(-3px); }
.landing-step-num {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--green-dim);
  border: 1px solid var(--green-border);
  color: var(--green-hi);
  font-family: var(--font-mono);
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.landing-step h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.landing-step p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

/* Channels strip */
.landing-channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.landing-channel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px;
}
.landing-channel-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.landing-channel-icon svg { width: 22px; height: 22px; }
.landing-channel-icon.web { background: var(--green-dim); color: var(--green-hi); }
.landing-channel-icon.phone { background: var(--cyan-dim); color: var(--cyan); }
.landing-channel-icon.whatsapp { background: rgba(37,211,102,.12); color: #25D366; }
.landing-channel h3 { font-size: 16px; font-weight: 700; }
.landing-channel p { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* Feature grid */
.landing-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.landing-feature {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}
.landing-feature:hover { border-color: var(--green-border); }
.landing-feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--green-dim);
  color: var(--green-hi);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.landing-feature-icon svg { width: 20px; height: 20px; }
.landing-feature h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 6px; }
.landing-feature p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

/* CTA band */
.landing-cta {
  background: linear-gradient(135deg, var(--green-dim), var(--cyan-dim));
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 56px 40px;
  text-align: center;
}
.landing-cta h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 12px; }
.landing-cta p { color: var(--text-2); font-size: 15px; margin-bottom: 26px; }

/* Footer */
.landing-footer {
  border-top: 1px solid var(--line-soft);
  padding: 32px 0;
  margin-top: 24px;
}
.landing-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.landing-footer-links { display: flex; gap: 18px; }
.landing-footer-links a { color: var(--muted); transition: color 0.15s; }
.landing-footer-links a:hover { color: var(--text); }

/* Landing responsive */
@media (max-width: 900px) {
  .landing-hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .landing-steps, .landing-channels, .landing-features { grid-template-columns: 1fr; }
  .landing-hero { padding: 56px 0 48px; }
}


