:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-2: #F5F1EA;
  --surface-3: #EDE7DC;
  --border: #E4DCCC;
  --border-strong: #CDC1A9;
  --ink: #1C1A17;
  --ink-2: #4A453C;
  --ink-3: #7C7565;
  --ink-4: #A69D8A;

  --teal: #0E8A7A;
  --teal-2: #0A6B5E;
  --teal-soft: #D6EEE9;
  --orange: #F25C2A;
  --orange-2: #D94A1B;
  --orange-soft: #FDE2D5;
  --green: #2E9E5F;
  --green-soft: #D6EFDF;
  --red: #D64545;
  --red-soft: #FAD9D9;
  --yellow: #D4A017;
  --yellow-soft: #F6E9C6;
  --purple: #7C4FD9;
  --purple-soft: #E5DAFA;
  --blue: #2E6DD9;
  --blue-soft: #D9E4FA;

  --accent: var(--orange);
  --accent-2: var(--orange-2);
  --accent-soft: var(--orange-soft);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(28,26,23,.05);
  --shadow: 0 2px 8px rgba(28,26,23,.06), 0 1px 2px rgba(28,26,23,.04);
  --shadow-lg: 0 12px 32px rgba(28,26,23,.12), 0 2px 8px rgba(28,26,23,.06);

  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  /* === IDENTIDAD FUEGO — TribuScale 2.0 === */
  --color-primary: #5B21B6;
  --color-primary-dark: #2D1B69;
  --color-primary-light: #F5F3FF;
  --color-action: #F97316;
  --color-action-dark: #EA580C;
  --color-action-light: #FFF7ED;
  --color-highlight: #FFD60A;
  --color-success: #10B981;
  --color-danger: #EF4444;
  --gradient-hero: linear-gradient(135deg, #2D1B69 0%, #5B21B6 35%, #BE185D 68%, #F97316 100%);
  --gradient-accent: linear-gradient(135deg, #5B21B6, #F97316);
  /* === FIN IDENTIDAD FUEGO === */

  /* === IDENTIDAD TRIBUSCALE — sistema de design tokens público === */
  /* Layer paralelo a Fuego: Fuego sigue activo en componentes legacy.
     Los componentes nuevos usan --ts-* directamente. La migración
     progresiva reemplaza Fuego cuando sea oportuno. */

  /* Paleta TribuScale */
  --ts-blue:        #1E88E5;
  --ts-orange:      #FF6D00;
  --ts-dark:        #1F2937;
  --ts-gray:        #6B7280;
  --ts-white:       #F2F2F2;

  /* Superficies */
  --ts-bg:          #FFFFFF;
  --ts-bg-soft:     #F7F7F5;
  --ts-border:      #E8E8E4;

  /* Texto */
  --ts-text:        #1A1A1A;
  --ts-text-muted:  #6B6B6B;

  /* Acento principal (Stripe purple) */
  --ts-accent:      #635BFF;

  /* Semánticos */
  --ts-success:     #0A9D6E;
  --ts-alert:       #FF6D00;
  --ts-danger:      #E53E3E;

  /* Gradiente hero */
  --ts-gradient: linear-gradient(135deg, #2D1B69, #5B21B6, #BE185D, #F97316);

  /* Tipografía */
  --ts-font: 'Inter', -apple-system, sans-serif;
  --ts-font-heading-weight: 700;
  --ts-font-body-size: 15px;
  --ts-line-height: 1.6;

  /* Espaciado y sombras */
  --ts-radius: 8px;
  --ts-radius-lg: 12px;
  --ts-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --ts-shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  /* === FIN IDENTIDAD TRIBUSCALE === */

}

[data-accent="teal"] {
  --accent: var(--teal);
  --accent-2: var(--teal-2);
  --accent-soft: var(--teal-soft);
}
[data-accent="purple"] {
  --accent: var(--purple);
  --accent-2: #5B36A8;
  --accent-soft: var(--purple-soft);
}

[data-theme="dark"] {
  --bg: #15130F;
  --surface: #1D1B17;
  --surface-2: #26231E;
  --surface-3: #302C26;
  --border: #3A3529;
  --border-strong: #4E4635;
  --ink: #F5F1EA;
  --ink-2: #C9C1B0;
  --ink-3: #928A77;
  --ink-4: #645E50;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 2px 8px rgba(0,0,0,.3);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.45);
}

[data-theme="mono"] {
  --teal: #1C1A17;
  --orange: #1C1A17;
  --accent: #1C1A17;
  --accent-2: #000;
  --accent-soft: #EDE7DC;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  background: var(--bg);
}
.app[data-density="compact"] { grid-template-columns: 200px 1fr; font-size: 13px; }

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.sb-brand img { width: 24px; height: 24px; border-radius: 6px; }
.sb-brand .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.sb-brand .badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--accent-soft);
  color: var(--accent-2);
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.sb-tenant {
  margin: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.sb-tenant:hover { border-color: var(--border-strong); }
.sb-tenant .t-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: white;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.sb-tenant .t-info { flex: 1; min-width: 0; }
.sb-tenant .t-name {
  font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-tenant .t-plan { font-size: 11px; color: var(--ink-3); }
.sb-tenant .t-chev { color: var(--ink-3); }

.sb-section {
  padding: 10px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sb-nav { display: flex; flex-direction: column; padding: 0 8px; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, color .12s;
  position: relative;
}
.sb-item:hover { background: var(--surface-2); color: var(--ink); }
.sb-item.active {
  background: var(--accent-soft);
  color: var(--accent-2);
}
[data-theme="dark"] .sb-item.active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.sb-item .icon { flex-shrink: 0; }
.sb-item .label { flex: 1; }
.sb-item .count {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
}
.sb-item.active .count { background: var(--accent); color: white; }
.sb-item.locked { opacity: 0.55; cursor: pointer; }
.sb-item.locked:hover { background: var(--surface-2); opacity: 0.75; }

.sb-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sb-foot .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--orange));
  color: white;
  display: grid; place-items: center;
  font-weight: 600; font-size: 11px;
}
.sb-foot .who { flex: 1; min-width: 0; }
.sb-foot .n { font-weight: 600; font-size: 12px; }
.sb-foot .r { font-size: 10px; color: var(--ink-3); }

/* Main */
.main {
  display: flex; flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  min-height: 58px;
}
.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
}
.crumbs .now { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .search {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-3);
  font-size: 12px;
  min-width: 220px;
}
.topbar .kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink-3);
  margin-left: auto;
}
.topbar .btn-ghost {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.topbar .btn-ghost:hover { border-color: var(--border-strong); color: var(--ink); }

.page { flex: 1; overflow: auto; }

/* Shared */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all .12s;
}
.btn:hover { border-color: var(--border-strong); }
.btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.teal { background: var(--teal); color: white; border-color: var(--teal); }
.btn.teal:hover { background: var(--teal-2); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--ink-2);
}
.chip.teal { background: var(--teal-soft); color: var(--teal-2); }
.chip.orange { background: var(--orange-soft); color: var(--orange-2); }
.chip.green { background: var(--green-soft); color: #1D6B40; }
.chip.red { background: var(--red-soft); color: #9B2B2B; }
.chip.yellow { background: var(--yellow-soft); color: #8F6B0F; }
.chip.purple { background: var(--purple-soft); color: #4E2A9E; }
.chip.blue { background: var(--blue-soft); color: #1D4A9C; }

.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

h1,h2,h3,h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

/* Inbox */
.inbox {
  display: grid;
  grid-template-columns: 300px minmax(420px, 1fr) 320px;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-x: auto;
}
@media (max-width: 1100px) {
  .inbox { grid-template-columns: 280px minmax(360px, 1fr); }
  .inbox > .inbox-context { display: none; }
}
@media (max-width: 820px) {
  .inbox { grid-template-columns: minmax(360px, 1fr); }
  .inbox > .inbox-list { display: none; }
}
.inbox-list {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
  min-height: 0;
}
.inbox-list-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.inbox-list-head .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}
.inbox-tabs { display: flex; gap: 2px; }
.inbox-tab {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-3);
}
.inbox-tab.active { background: var(--ink); color: var(--surface); }
[data-theme="dark"] .inbox-tab.active { background: var(--ink); color: var(--bg); }
.inbox-items { overflow: auto; flex: 1; }
.inbox-item {
  display: flex; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.active { background: var(--accent-soft); }
[data-theme="dark"] .inbox-item.active { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.inbox-item .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-3); color: var(--ink-2);
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
  flex-shrink: 0;
  position: relative;
}
.inbox-item .avatar .ch {
  position: absolute; bottom: -2px; right: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #25D366; color: white;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
}
.inbox-item .body { flex: 1; min-width: 0; }
.inbox-item .row1 { display: flex; align-items: center; gap: 6px; }
.inbox-item .name { font-weight: 600; font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item .time { font-size: 10px; color: var(--ink-3); flex-shrink: 0; }
.inbox-item .preview {
  font-size: 12px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.inbox-item .meta { display: flex; gap: 4px; margin-top: 6px; align-items: center; }
.inbox-item .unread {
  position: absolute; right: 14px; bottom: 14px;
  background: var(--accent); color: white;
  font-size: 10px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
}

.inbox-convo {
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--surface-2);
}
.convo-head {
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.convo-head .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-3); color: var(--ink-2);
  display: grid; place-items: center; font-weight: 600;
}
.convo-head .info { flex: 1; }
.convo-head .n { font-weight: 600; font-size: 14px; }
.convo-head .p { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.convo-head .actions { display: flex; gap: 8px; }

.convo-banner {
  margin: 12px 18px 0;
  padding: 10px 12px;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
}
.convo-banner .b-ai {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent); color: white;
  display: grid; place-items: center;
  font-weight: 700; font-size: 10px;
}
.convo-banner .b-info { flex: 1; }
.convo-banner strong { font-weight: 600; }

.convo-messages {
  flex: 1;
  overflow: auto;
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg-day {
  text-align: center;
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 8px 0;
}
.msg-event {
  align-self: center;
  padding: 4px 10px;
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 11px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
}
.msg {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  position: relative;
}
.msg .time { display: block; font-size: 10px; opacity: .6; margin-top: 3px; }
.msg.in {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg.out {
  align-self: flex-end;
  background: #DCF8C6;
  color: #1C1A17;
  border-bottom-right-radius: 4px;
}
.msg.ai {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}
.msg.ai .time { color: rgba(255,255,255,.8); }
.msg.ai .label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,.2);
  padding: 1px 6px; border-radius: 4px;
  margin-bottom: 4px;
}
.msg.agent {
  align-self: flex-end;
  background: var(--teal); color: white;
  border-bottom-right-radius: 4px;
}
.msg.agent .time { color: rgba(255,255,255,.8); }
.msg.agent .label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,.2);
  padding: 1px 6px; border-radius: 4px;
  margin-bottom: 4px;
}

.composer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 18px;
}
.composer .mode-switch {
  display: flex; gap: 2px;
  margin-bottom: 8px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  width: fit-content;
}
.composer .mode-switch .m {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  border-radius: 4px;
  cursor: pointer;
}
.composer .mode-switch .m.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.composer .input-wrap {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.composer textarea {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  min-height: 22px;
  max-height: 120px;
}

/* Inbox right panel */
.inbox-context {
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow: auto;
}
.ctx-block {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.ctx-block .lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.ctx-kv { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.ctx-kv .k { color: var(--ink-3); }
.ctx-kv .v { color: var(--ink); font-weight: 500; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  padding: 6px 0;
  position: relative;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 10px; top: 22px; bottom: -6px;
  width: 1px; background: var(--border);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 10px;
  position: relative; z-index: 1;
}
.tl-dot.teal { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-2); }
.tl-dot.orange { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.tl-dot.green { background: var(--green-soft); border-color: var(--green); color: #1D6B40; }
.tl-body .t { font-size: 12px; font-weight: 500; }
.tl-body .s { font-size: 10px; color: var(--ink-3); }

/* Pipeline */
.pipe-head {
  padding: 20px 24px 14px;
  display: flex; align-items: flex-end; gap: 16px;
}
.pipe-head .title { flex: 1; }
.pipe-head h1 { font-size: 24px; }
.pipe-head p { color: var(--ink-3); margin: 2px 0 0; font-size: 13px; }
.pipe-stats {
  display: flex; gap: 6px;
  padding: 0 24px 14px;
}
.pipe-stat {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 120px;
}
.pipe-stat .l { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.pipe-stat .v { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-top: 2px; letter-spacing: -0.02em; }
.pipe-stat .d { font-size: 11px; color: var(--green); font-weight: 600; }

.pipe-board {
  padding: 0 24px 24px;
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.pipe-col {
  background: var(--surface-2);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  min-height: 400px;
}
.pipe-col-head {
  padding: 12px 14px 10px;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--border);
}
.pipe-col-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.pipe-col-head .n { font-weight: 600; font-size: 12px; }
.pipe-col-head .c { font-size: 11px; color: var(--ink-3); }
.pipe-col-head .v { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--ink-2); font-family: var(--font-mono); }

.pipe-cards { display: flex; flex-direction: column; gap: 8px; padding: 10px; flex: 1; }
.pipe-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow .12s, transform .12s;
}
.pipe-card:hover { box-shadow: var(--shadow); }
.pipe-card .title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.pipe-card .who { font-size: 11px; color: var(--ink-3); }
.pipe-card .row {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  padding-top: 8px; border-top: 1px dashed var(--border);
}
.pipe-card .amount { font-family: var(--font-mono); font-weight: 600; font-size: 12px; }
.pipe-card .source { margin-left: auto; }
.pipe-card .ai-flag {
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  display: inline-flex; align-items: center; gap: 3px;
  letter-spacing: 0.04em;
}

/* Dashboard */
.dash {
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.dash h1 { font-size: 26px; margin-bottom: 2px; }
.dash .sub { color: var(--ink-3); font-size: 13px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kpi {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.kpi .lbl { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.kpi .val { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
.kpi .delta { font-size: 11px; font-weight: 600; margin-top: 2px; }
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.kpi .spark {
  position: absolute; right: 12px; bottom: 12px;
  opacity: .7;
}

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.funnel { padding: 16px; }
.funnel h3 { font-size: 14px; margin-bottom: 12px; }
.funnel-row {
  display: grid;
  grid-template-columns: 130px 1fr 60px 50px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.funnel-row:last-child { border: 0; }
.funnel-row .label { font-size: 12px; font-weight: 500; }
.funnel-bar {
  height: 20px;
  background: var(--surface-2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.funnel-bar .fill {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  border-radius: 4px;
}
.funnel-row .n { font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-align: right; }
.funnel-row .pct { font-size: 11px; color: var(--ink-3); text-align: right; }

.activity { padding: 16px; }
.activity h3 { font-size: 14px; margin-bottom: 12px; }
.act-row {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
}
.act-row:last-child { border: 0; }
.act-row .dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0; font-size: 10px;
  background: var(--surface-2);
}
.act-row .t { color: var(--ink-3); font-size: 10px; }
.act-row .m { color: var(--ink); margin-top: 1px; }
.act-row strong { font-weight: 600; }

.hero-flow {
  padding: 18px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.hero-flow::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero-flow h3 { font-size: 15px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.hero-flow .sub { font-size: 12px; color: var(--ink-3); margin-bottom: 16px; }
.hero-steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  position: relative;
}
.hero-step {
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  position: relative;
}
.hero-step .n {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); color: white;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700;
  margin-bottom: 4px;
}
.hero-step .t { font-weight: 600; font-size: 11px; color: var(--ink); }
.hero-step .d { font-size: 10px; color: var(--ink-3); margin-top: 2px; line-height: 1.3; }
.hero-step + .hero-step::before {
  content: '→';
  position: absolute;
  left: -10px; top: 14px;
  color: var(--ink-4);
  font-size: 10px;
}

/* Agents */
.agents-layout {
  display: grid;
  grid-template-columns: 260px minmax(440px, 1fr) 360px;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-x: auto;
}
@media (max-width: 1100px) {
  .agents-layout { grid-template-columns: 240px minmax(400px, 1fr); }
  .agents-layout > .playground { display: none; }
}
@media (max-width: 820px) {
  .agents-layout { grid-template-columns: minmax(360px, 1fr); }
  .agents-layout > .agents-list { display: none; }
}
.agents-list {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: auto;
}
.agents-list-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.agents-list-head .title { font-family: var(--font-display); font-size: 14px; font-weight: 600; flex: 1; }
.agent-item {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px;
  align-items: center;
}
.agent-item:hover { background: var(--surface-2); }
.agent-item.active { background: var(--accent-soft); }
.agent-item .av {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 16px;
  background: var(--surface-3);
  flex-shrink: 0;
}
.agent-item .n { font-weight: 600; font-size: 13px; }
.agent-item .r { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.agent-item .s { margin-left: auto; }

.agent-cfg {
  overflow: auto;
  padding: 22px 28px;
  background: var(--bg);
}
.agent-cfg h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.agent-cfg h2 .ico {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 18px;
}
.agent-cfg .sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; margin-bottom: 20px; }
.cfg-section { margin-bottom: 18px; }
.cfg-section .lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.cfg-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.cfg-prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 260px;
  overflow: auto;
}
.cfg-prompt .k { color: var(--accent-2); font-weight: 600; }
.cfg-prompt .c { color: var(--ink-3); }

.cfg-tools {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.tool-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex; gap: 10px;
  align-items: center;
}
.tool-card .ico {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--surface-2); display: grid; place-items: center;
  flex-shrink: 0;
}
.tool-card .n { font-weight: 600; font-size: 12px; }
.tool-card .d { font-size: 10px; color: var(--ink-3); }
.tool-card .sw {
  margin-left: auto;
  width: 26px; height: 14px;
  background: var(--teal); border-radius: 999px; position: relative;
}
.tool-card .sw::after {
  content: ''; position: absolute;
  right: 2px; top: 2px; width: 10px; height: 10px;
  border-radius: 50%; background: white;
}
.tool-card.off .sw { background: var(--border); }
.tool-card.off .sw::after { left: 2px; right: auto; }

.cfg-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.cfg-stat {
  padding: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cfg-stat .l { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.cfg-stat .v { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }

/* Playground */
.playground {
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
}
.pg-head {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.pg-head .t { flex: 1; font-family: var(--font-display); font-weight: 600; font-size: 13px; }
.pg-head .live {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600;
  color: var(--green);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.pg-head .live .ld {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.pg-body {
  flex: 1; overflow: auto;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.pg-turn {
  display: flex; flex-direction: column; gap: 4px;
}
.pg-turn .who {
  font-size: 10px; font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 4px;
}
.pg-bubble {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.pg-turn.u .pg-bubble { background: var(--surface); border: 1px solid var(--border); }
.pg-turn.a .pg-bubble { background: var(--accent); color: white; }

.pg-trace {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  display: flex; flex-direction: column; gap: 2px;
}
.pg-trace .row { display: flex; gap: 6px; }
.pg-trace .row .tag {
  color: var(--teal-2); font-weight: 600;
  flex-shrink: 0;
}
.pg-trace .row .v { color: var(--ink-2); }

.pg-input {
  padding: 10px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.pg-input .wrap {
  display: flex; gap: 6px;
  padding: 6px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pg-input input {
  flex: 1; border: 0; background: transparent; outline: 0;
  font-family: var(--font-body); font-size: 12px; color: var(--ink);
}
.pg-input .sugg { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.pg-input .sugg .s {
  padding: 3px 8px;
  font-size: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-2);
}
.pg-input .sugg .s:hover { background: var(--surface-3); }

/* Workflows */
.wf {
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.wf h1 { font-size: 22px; }
.wf .sub { color: var(--ink-3); font-size: 13px; }
.wf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.wf-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.wf-card .h {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.wf-card .ico {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-2);
  display: grid; place-items: center;
  font-size: 14px;
}
.wf-card .n { font-weight: 600; font-size: 13px; flex: 1; }
.wf-card .sw {
  width: 28px; height: 16px;
  background: var(--teal); border-radius: 999px; position: relative;
}
.wf-card .sw::after {
  content: ''; position: absolute;
  right: 2px; top: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: white;
}
.wf-card.off .sw { background: var(--border); }
.wf-card.off .sw::after { left: 2px; right: auto; }
.wf-card .d { font-size: 11px; color: var(--ink-3); line-height: 1.4; margin-bottom: 10px; }
.wf-card .stats {
  display: flex; gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 10px; color: var(--ink-3);
}
.wf-card .stats strong { color: var(--ink); font-weight: 600; }

.wf-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 240px;
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 16px 16px;
  position: relative;
}
.wf-canvas .node {
  position: absolute;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 140px;
  font-size: 12px;
}
.wf-canvas .node .typ { font-size: 9px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.wf-canvas .node .lbl { font-weight: 600; margin-top: 2px; }

/* Architecture */
.arch {
  padding: 24px;
  max-width: 1100px;
}
.arch h1 { font-size: 26px; margin-bottom: 4px; }
.arch .lede { font-size: 14px; color: var(--ink-3); margin-bottom: 18px; max-width: 720px; line-height: 1.5; }

.arch-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.arch-tab {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.arch-tab:hover { color: var(--ink); }
.arch-tab.active { color: var(--accent-2); border-bottom-color: var(--accent); font-weight: 600; }

.code-block {
  background: #1C1A17;
  color: #F5F1EA;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  position: relative;
  margin: 10px 0 18px;
  overflow: hidden;
  border: 1px solid #3A3529;
}
.code-block .head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #26231E;
  border-bottom: 1px solid #3A3529;
  font-size: 11px;
  color: #928A77;
  font-family: var(--font-mono);
}
.code-block .head .lang {
  background: rgba(242,92,42,.15);
  color: #F25C2A;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
}
.code-block .head .file { flex: 1; }
.code-block .head .copy {
  background: transparent;
  border: 1px solid #3A3529;
  color: #C9C1B0;
  padding: 2px 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  border-radius: 4px;
  cursor: pointer;
}
.code-block .head .copy:hover { background: #302C26; }
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  max-height: 480px;
}
.code-block .kw { color: #F25C2A; }
.code-block .str { color: #0E8A7A; }
.code-block .num { color: #D4A017; }
.code-block .com { color: #645E50; font-style: italic; }

.arch h2 { font-size: 18px; margin-top: 18px; margin-bottom: 6px; }
.arch h3 { font-size: 14px; margin-top: 14px; margin-bottom: 4px; }
.arch p { color: var(--ink-2); font-size: 13px; line-height: 1.6; margin: 6px 0; }
.arch ul { font-size: 13px; color: var(--ink-2); padding-left: 20px; line-height: 1.7; }
.arch ul li { margin: 2px 0; }
.arch code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent-2);
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 10px 0 18px;
}
.arch-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.arch-card .h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.arch-card .ico {
  width: 26px; height: 26px; border-radius: 6px;
  display: grid; place-items: center; font-size: 13px;
  background: var(--surface-2);
}
.arch-card .n { font-weight: 600; font-size: 13px; }
.arch-card .d { font-size: 11px; color: var(--ink-3); line-height: 1.5; }
.arch-card .port {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--teal-2); margin-top: 6px;
}

.schema-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 10px 0;
}
.schema-table .head {
  background: var(--surface-2);
  padding: 8px 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.schema-table .head .pk {
  font-size: 9px; background: var(--accent); color: white;
  padding: 1px 5px; border-radius: 3px;
  font-family: var(--font-body); font-weight: 700;
}
.schema-table .cols { padding: 4px 0; }
.schema-col {
  display: grid;
  grid-template-columns: 200px 120px 1fr;
  padding: 5px 12px;
  font-size: 11px;
  border-bottom: 1px dashed var(--border);
}
.schema-col:last-child { border: 0; }
.schema-col .name { font-family: var(--font-mono); font-weight: 500; }
.schema-col .typ { font-family: var(--font-mono); color: var(--teal-2); font-size: 10px; }
.schema-col .desc { font-size: 11px; color: var(--ink-3); }
.schema-col .fk { color: var(--accent-2); font-size: 9px; font-weight: 700; margin-left: 4px; }

.roadmap { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.rm-phase {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.rm-phase .lbl {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--accent-2);
}
.rm-phase .lbl .wk { display: block; font-size: 10px; color: var(--ink-3); margin-top: 2px; font-family: var(--font-body); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.rm-phase .items ul { margin: 0; padding-left: 16px; }
.rm-phase .items h4 { font-size: 13px; margin-bottom: 4px; }

/* Contacts/Tenants (light) */
.simple-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 14px;
}
.simple-table .tr {
  display: grid;
  grid-template-columns: 1fr 180px 140px 120px 100px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  align-items: center;
}
.simple-table .tr.head {
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.simple-table .tr:last-child { border: 0; }
.simple-table .cell-name { display: flex; align-items: center; gap: 10px; }
.simple-table .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}

/* Tenant switcher modal */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(20,18,15,.4);
  display: grid; place-items: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 420px;
  max-width: 90vw;
  overflow: hidden;
}
.modal .head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.modal .head .t { font-family: var(--font-display); font-weight: 600; font-size: 15px; flex: 1; }
.modal .body { max-height: 50vh; overflow: auto; }
.modal .tenant-row {
  padding: 12px 18px;
  display: flex; gap: 12px; align-items: center;
  cursor: pointer; border-bottom: 1px solid var(--border);
}
.modal .tenant-row:hover { background: var(--surface-2); }
.modal .tenant-row.active { background: var(--accent-soft); }
.modal .tenant-row:last-child { border: 0; }
.modal .tenant-row .av {
  width: 36px; height: 36px; border-radius: 10px;
  color: white;
  display: grid; place-items: center;
  font-weight: 700; font-family: var(--font-display);
}
.modal .tenant-row .info { flex: 1; }
.modal .tenant-row .n { font-weight: 600; font-size: 13px; }
.modal .tenant-row .d { font-size: 11px; color: var(--ink-3); }

/* Tweaks */
.tweaks {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}
.tweaks .head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.tweaks .head .t { flex: 1; font-family: var(--font-display); font-weight: 600; font-size: 13px; }
.tweaks .body { padding: 12px 16px; display: flex; flex-direction: column; gap: 14px; }
.tweak-row .lbl {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.tweak-row .opts { display: flex; gap: 4px; }
.tweak-row .opt {
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-2);
}
.tweak-row .opt.on {
  background: var(--accent); color: white; border-color: var(--accent);
}
.tweak-swatches { display: flex; gap: 6px; }
.tweak-swatch {
  width: 26px; height: 26px; border-radius: 8px;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: transform .1s;
}
.tweak-swatch.on { border-color: var(--ink); transform: scale(1.1); }

.x {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  cursor: pointer; border-radius: 6px;
  color: var(--ink-3);
}
.x:hover { background: var(--surface-2); color: var(--ink); }

/* utility */
.hstack { display: flex; align-items: center; gap: 8px; }
.vstack { display: flex; flex-direction: column; gap: 8px; }
.flex1 { flex: 1; }


/* ============================================================ */
/* === NUEVAS PANTALLAS (Login, Legal, Onboarding, Channels,  === */
/* === Account, Payment, Campaigns, Reports, Admin, Empty)    === */
/* ============================================================ */

/* === Login === */
.login-page {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(14,138,122,0.06), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(242,92,42,0.06), transparent 40%);
  padding: 40px 20px;
}
.login-box {
  width: 100%; max-width: 420px; padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.login-logo img { width: 32px; height: 32px; }
.login-logo .wm {
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--ink);
}
.login-logo .wm .s { color: var(--accent); }
.login-head h1 {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em; margin: 0 0 4px 0;
}
.login-head .sub {
  color: var(--ink-3); font-size: 13px; margin-bottom: 20px;
}
.login-oauth {
  width: 100%; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: var(--ink); cursor: pointer; margin-bottom: 14px;
  transition: background .12s;
}
.login-oauth:hover { background: var(--surface-2); }
.login-divider {
  display: flex; align-items: center; gap: 12px; margin: 14px 0;
  color: var(--ink-3); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.login-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-body); font-size: 13px;
  color: var(--ink);
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: border-color .12s;
}
.login-input:focus { outline: none; border-color: var(--accent); }
.login-error {
  background: #FEF2EE; color: var(--orange-2);
  border: 1px solid #FBD4C4;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 12px; margin-bottom: 12px;
}
.login-submit {
  width: 100%; padding: 11px 16px;
  background: var(--ink); color: white;
  border: 0; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .12s;
}
.login-submit:hover { background: var(--teal-2); }
.login-help {
  margin-top: 18px; font-size: 12px; color: var(--ink-3);
  text-align: center;
}
.login-help a { color: var(--teal); text-decoration: none; font-weight: 500; }
.login-help a:hover { text-decoration: underline; }
.login-demo {
  margin-top: 16px; padding: 12px;
  background: var(--teal-soft); border-radius: var(--radius-sm);
  font-size: 11px; color: var(--teal-2);
  font-family: var(--font-mono);
  line-height: 1.7;
}
.login-demo b { color: var(--teal-2); font-family: var(--font-display); }
.login-demo-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.login-demo-row button {
  background: var(--surface); border: 1px solid var(--teal);
  color: var(--teal-2); padding: 3px 8px;
  border-radius: 4px; font-size: 10px; font-weight: 600;
  cursor: pointer; font-family: var(--font-display);
}
.login-demo-row button:hover { background: var(--teal); color: white; }

/* === Legal === */
.legal-page {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--bg); padding: 40px 20px;
}
.legal-box {
  width: 100%; max-width: 680px; padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.legal-box h1 {
  font-family: var(--font-display); font-size: 24px; font-weight: 600;
  letter-spacing: -0.02em; margin: 0 0 6px 0;
}
.legal-box .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 20px; }
.legal-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.legal-tab {
  padding: 10px 14px;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font-display);
  transition: color .12s;
}
.legal-tab:hover { color: var(--ink-2); }
.legal-tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }
.legal-content {
  max-height: 320px; overflow-y: auto;
  font-size: 13px; line-height: 1.7; color: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px; margin-bottom: 16px;
  background: var(--surface-2);
}
.legal-content h3 {
  font-family: var(--font-display); font-size: 14px;
  margin: 12px 0 6px 0; color: var(--ink);
}
.legal-content h3:first-child { margin-top: 0; }
.legal-content .placeholder {
  display: inline-block;
  background: var(--yellow-soft); color: #8B6500;
  padding: 1px 6px; border-radius: 4px;
  font-size: 11px; font-family: var(--font-mono);
}
.legal-check {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 16px;
  cursor: pointer; user-select: none;
}
.legal-check input { margin-top: 2px; accent-color: var(--teal); }
.legal-check label { flex: 1; font-size: 12px; color: var(--ink-2); line-height: 1.5; cursor: pointer; }
.legal-actions { display: flex; gap: 10px; align-items: center; }
.legal-actions .btn { flex: 1; justify-content: center; }
.legal-actions .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.legal-actions .help { font-size: 11px; color: var(--ink-3); }

/* === Support button in sidebar === */
.sb-support {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin: 0 10px 8px;
  border-radius: var(--radius-sm);
  background: #E6F4EB; color: #1D6B40;
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  transition: background .12s;
}
.sb-support:hover { background: var(--teal-soft); color: var(--teal-2); }

/* === Role toggle in sidebar === */
.sb-role {
  display: flex; margin: 0 10px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  font-size: 10px;
}
.sb-role > div {
  flex: 1; padding: 4px 6px; text-align: center;
  font-weight: 600; cursor: pointer;
  border-radius: 4px;
  color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.sb-role > div.on { background: var(--ink); color: white; }

/* === Empty state (dashboard cliente) === */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 70vh; text-align: center;
  padding: 40px 24px;
}
.empty-state .ill {
  width: 140px; height: 140px;
  display: grid; place-items: center;
  margin-bottom: 20px;
  position: relative;
}
.empty-state .ill .circle {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--teal-soft), var(--surface-2));
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}
.empty-state .ill svg { position: relative; z-index: 1; }
.empty-state h2 {
  font-family: var(--font-display); font-size: 28px;
  letter-spacing: -0.02em; margin: 0 0 10px 0; max-width: 540px;
}
.empty-state .sub {
  color: var(--ink-3); font-size: 15px;
  margin-bottom: 26px; max-width: 500px; line-height: 1.55;
}
.empty-state .empty-progress-wrap {
  width: 100%; max-width: 420px; margin-bottom: 22px;
}
.empty-state .empty-progress-wrap .lbl {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--ink-3); margin-bottom: 6px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.empty-progress {
  width: 100%; height: 8px;
  background: var(--surface-3);
  border-radius: 999px; overflow: hidden;
}
.empty-progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  border-radius: 999px;
  transition: width .4s;
}
.empty-state .cta-row { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.empty-state .chips {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  font-size: 11px; color: var(--ink-3);
}
.empty-state .chips .c {
  padding: 4px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; font-weight: 500;
}

/* === Onboarding === */
.onb {
  padding: 32px 24px; max-width: 820px; margin: 0 auto;
}
.onb-head { margin-bottom: 24px; }
.onb-head h1 {
  font-family: var(--font-display); font-size: 28px;
  letter-spacing: -0.02em; margin: 0 0 6px 0;
}
.onb-head .sub { color: var(--ink-3); font-size: 14px; margin-bottom: 16px; }
.onb-progress-wrap { display: flex; gap: 14px; align-items: center; }
.onb-progress {
  flex: 1; height: 6px; background: var(--surface-3);
  border-radius: 999px; overflow: hidden;
}
.onb-progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  border-radius: 999px; transition: width .4s;
}
.onb-progress-lbl {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-2); font-weight: 600;
}
.onb-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.onb-step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px; transition: border-color .15s;
}
.onb-step.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.onb-step.done { background: var(--surface-2); }
.onb-step .row {
  display: flex; align-items: center; gap: 14px;
}
.onb-step .status {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 12px; font-weight: 700;
}
.onb-step.done .status { background: var(--teal); color: white; }
.onb-step.active .status { background: var(--accent); color: white; }
.onb-step.pending .status { background: var(--surface-3); color: var(--ink-3); }
.onb-step .body { flex: 1; min-width: 0; }
.onb-step .label {
  font-family: var(--font-display); font-size: 14px;
  font-weight: 600; color: var(--ink);
}
.onb-step.done .label { color: var(--ink-2); }
.onb-step .impact {
  font-size: 11px; color: var(--teal-2); font-weight: 600;
  margin-top: 2px;
}
.onb-step .req-badge {
  display: inline-block; margin-left: 6px;
  font-size: 9px; color: var(--orange-2);
  background: var(--orange-soft);
  padding: 1px 5px; border-radius: 3px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.onb-step .extra {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--ink-2); line-height: 1.5;
}
.onb-step .extra .btn { margin-top: 10px; }
.onb-summary {
  background: linear-gradient(135deg, var(--teal-soft), var(--accent-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
}
.onb-summary .t {
  flex: 1;
}
.onb-summary .t h3 {
  font-family: var(--font-display); font-size: 15px;
  margin: 0 0 4px 0; color: var(--ink);
}
.onb-summary .t .d { font-size: 12px; color: var(--ink-2); }

/* === Channels === */
.ch-page { padding: 24px; }
.ch-head { margin-bottom: 20px; display: flex; align-items: flex-end; gap: 16px; }
.ch-head .info { flex: 1; }
.ch-head h1 {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: -0.02em; margin: 0 0 4px 0;
}
.ch-head .sub { color: var(--ink-3); font-size: 13px; }
.ch-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: #E6F4EB; color: #1D6B40;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  margin-top: 6px;
}
.ch-status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #2AC469;
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.ch-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  transition: transform .12s, box-shadow .12s;
}
.ch-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.ch-card.pending { background: var(--surface-2); }
.ch-card-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.ch-card-ico {
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center;
  color: white; flex-shrink: 0;
}
.ch-card .n {
  font-family: var(--font-display); font-size: 14px;
  font-weight: 600; color: var(--ink);
}
.ch-card .d { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.ch-card .status-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-2); margin-bottom: 8px;
}
.ch-card .status-row .dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.ch-card .status-row .dot.on { background: #2AC469; }
.ch-card .status-row .dot.off { background: #D0CBBF; }
.ch-card .meta {
  font-size: 11px; color: var(--ink-3);
  font-family: var(--font-mono);
  margin-bottom: 10px;
  padding: 8px 10px; background: var(--surface-2);
  border-radius: 6px;
}
.ch-card .leads-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; background: var(--teal-soft);
  color: var(--teal-2);
  border-radius: 4px; font-size: 10px; font-weight: 700;
  margin-bottom: 10px;
}
.ch-card .actions { display: flex; gap: 6px; }

/* === Account === */
.acc-page {
  padding: 24px; max-width: 1000px; margin: 0 auto;
}
.acc-head { margin-bottom: 20px; }
.acc-head h1 {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: -0.02em; margin: 0 0 4px 0;
}
.acc-head .sub { color: var(--ink-3); font-size: 13px; }
.acc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 900px) {
  .acc-grid { grid-template-columns: 1fr; }
}
.acc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
}
.acc-card h3 {
  font-family: var(--font-display); font-size: 14px;
  margin: 0 0 14px 0; display: flex; align-items: center; gap: 8px;
}
.acc-field { margin-bottom: 12px; }
.acc-field .lbl {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.acc-field .ctrl {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-body); font-size: 13px;
  color: var(--ink);
  box-sizing: border-box;
}
.acc-plan-row {
  display: flex; justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.acc-plan-row:last-child { border-bottom: 0; }
.acc-plan-row .k { color: var(--ink-3); }
.acc-plan-row .v { font-weight: 600; color: var(--ink); font-family: var(--font-mono); }
.acc-invoices {
  margin-top: 16px;
  font-size: 12px;
}
.acc-invoices .row {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.acc-invoices .row.head {
  font-size: 10px; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.acc-invoices .row:last-child { border-bottom: 0; }
.acc-invoices .amt { font-family: var(--font-mono); font-weight: 600; }

/* === Payment / Plans === */
.pay-page {
  padding: 32px 24px; max-width: 1080px; margin: 0 auto;
}
.pay-head { text-align: center; margin-bottom: 28px; }
.pay-head h1 {
  font-family: var(--font-display); font-size: 32px;
  letter-spacing: -0.02em; margin: 0 0 8px 0;
}
.pay-head .sub { color: var(--ink-3); font-size: 15px; }
.pay-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
@media (max-width: 900px) { .pay-grid { grid-template-columns: 1fr; } }
.pay-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 20px;
  position: relative;
  display: flex; flex-direction: column;
}
.pay-card.highlight {
  border-color: var(--teal);
  background: linear-gradient(180deg, var(--teal-soft), var(--surface) 60%);
  box-shadow: 0 8px 24px rgba(14,138,122,0.12);
}
.pay-badge {
  position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--teal); color: white;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--font-display);
}
.pay-badge.orange { background: var(--accent); }
.pay-card .name {
  font-family: var(--font-display); font-size: 16px;
  font-weight: 600; color: var(--ink);
}
.pay-card .price {
  font-family: var(--font-display); font-size: 26px;
  font-weight: 700; letter-spacing: -0.02em;
  margin: 8px 0 6px; color: var(--ink);
}
.pay-card .desc {
  font-size: 12px; color: var(--ink-3);
  margin-bottom: 14px; line-height: 1.5;
}
.pay-card .features {
  list-style: none; padding: 0; margin: 0 0 20px;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
}
.pay-card .features li {
  font-size: 12px; color: var(--ink-2);
  display: flex; align-items: flex-start; gap: 8px;
  line-height: 1.4;
}
.pay-card .features li::before {
  content: '✓'; color: var(--teal);
  font-weight: 700; flex-shrink: 0;
}
.pay-card .cta { width: 100%; justify-content: center; }
.pay-note {
  text-align: center; margin-top: 20px;
  font-size: 11px; color: var(--ink-3);
  font-family: var(--font-mono);
}

/* === Campaigns === */
.cp-page { padding: 24px; }
.cp-head { margin-bottom: 18px; display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.cp-head .info { flex: 1; }
.cp-head h1 {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: -0.02em; margin: 0 0 4px 0;
}
.cp-head .sub { color: var(--ink-3); font-size: 13px; }
.cp-tenant-select {
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  font-family: var(--font-body); font-size: 12px; color: var(--ink);
}
.cp-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .cp-kpis { grid-template-columns: repeat(2, 1fr); } }
.cp-table { margin-bottom: 16px; }
.channel-chip {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.04em;
  font-family: var(--font-display);
}
.channel-chip.meta { background: #1877F2; color: white; }
.channel-chip.tiktok { background: #1C1C1C; color: white; }
.channel-chip.google { background: #4285F4; color: white; }
.roas-badge {
  font-family: var(--font-mono); font-weight: 700;
  color: var(--teal-2);
}
.roas-before {
  font-size: 10px; color: var(--ink-3);
  display: block; margin-top: 2px;
}
.cp-attribution {
  background: var(--teal-soft);
  border: 1px solid #A9D9CF;
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex; gap: 14px; align-items: center;
}
.cp-attribution .ico {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--teal); color: white;
  display: grid; place-items: center; flex-shrink: 0;
}
.cp-attribution .t {
  font-family: var(--font-display); font-size: 13px;
  font-weight: 600; color: var(--teal-2);
  margin-bottom: 4px;
}
.cp-attribution .d { font-size: 12px; color: var(--ink-2); line-height: 1.5; }

/* === Reports === */
.rep-page { padding: 24px; max-width: 1080px; margin: 0 auto; }
.rep-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.rep-head .info { flex: 1; }
.rep-head h1 {
  font-family: var(--font-display); font-size: 24px;
  letter-spacing: -0.02em; margin: 0 0 4px 0;
}
.rep-head .sub { color: var(--ink-3); font-size: 13px; }
.rep-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; background: var(--accent-soft);
  color: var(--orange-2);
  border-radius: 999px; font-size: 11px; font-weight: 600;
  margin-top: 6px;
}
.rep-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px; margin-bottom: 16px;
}
.rep-section h3 {
  font-family: var(--font-display); font-size: 14px;
  margin: 0 0 14px 0;
}
.rep-reco {
  background: var(--teal-soft);
  border: 1px solid #A9D9CF;
  border-radius: var(--radius-md);
  padding: 20px 22px; margin-bottom: 16px;
}
.rep-reco h3 {
  font-family: var(--font-display); font-size: 15px;
  margin: 0 0 14px 0; display: flex; align-items: center; gap: 8px;
  color: var(--teal-2);
}
.rep-reco-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 10px;
  display: flex; gap: 12px; align-items: flex-start;
}
.rep-reco-item:last-child { margin-bottom: 0; }
.rep-reco-pri {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 3px 7px; border-radius: 4px;
  flex-shrink: 0; font-family: var(--font-display);
}
.rep-reco-pri.alta { background: #FEE4E4; color: #B42020; }
.rep-reco-pri.media { background: #FEF4D6; color: #8B6500; }
.rep-reco-item .body { flex: 1; }
.rep-reco-item .action {
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--ink);
}
.rep-reco-item .reason {
  font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.5;
}

/* === Admin Panel === */
.admin-page { padding: 24px; }
.admin-head { margin-bottom: 16px; }
.admin-head h1 {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: -0.02em; margin: 0 0 4px 0;
}
.admin-head .sub { color: var(--ink-3); font-size: 13px; }
.admin-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.admin-tab {
  padding: 10px 16px;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font-display);
  transition: color .12s;
  display: flex; align-items: center; gap: 6px;
}
.admin-tab:hover { color: var(--ink-2); }
.admin-tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }

/* Health bar */
.health-bar {
  display: flex; align-items: center; gap: 8px;
}
.health-track {
  flex: 1; min-width: 60px; max-width: 100px;
  height: 6px; background: var(--surface-3);
  border-radius: 999px; overflow: hidden;
}
.health-fill { height: 100%; border-radius: 999px; }
.health-fill.ok { background: #2AC469; }
.health-fill.warn { background: #F5B700; }
.health-fill.bad { background: #E5484D; }
.health-val {
  font-family: var(--font-mono); font-size: 11px;
  font-weight: 700; min-width: 24px;
}

/* Agenda */
.agenda-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 900px) { .agenda-grid { grid-template-columns: 1fr; } }
.agenda-day {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px;
  min-height: 140px;
}
.agenda-day .day {
  font-family: var(--font-display); font-size: 11px;
  font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.agenda-event {
  padding: 8px 10px; border-radius: 6px;
  margin-bottom: 6px; font-size: 11px;
  background: var(--surface-2);
  border-left: 2px solid var(--border);
}
.agenda-event.kickoff { border-left-color: var(--teal); background: var(--teal-soft); }
.agenda-event.report { border-left-color: #1877F2; background: #E7F0FE; }
.agenda-event.renewal { border-left-color: #2AC469; background: #E6F4EB; }
.agenda-event.demo { border-left-color: var(--accent); background: var(--accent-soft); }
.agenda-event.cobranza { border-left-color: #E5484D; background: #FEE4E4; }
.agenda-event .time {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 10px; color: var(--ink-2);
}
.agenda-event .client { font-weight: 600; color: var(--ink); margin: 2px 0; }
.agenda-event .desc { color: var(--ink-2); line-height: 1.4; }

/* Chip statuses */
.chip.red { background: #FEE4E4; color: #B42020; }

/* === Create tenant modal === */
.modal-form { display: flex; flex-direction: column; gap: 12px; padding: 6px 0; }
.modal-form .field .lbl {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.modal-form .field .ctrl {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-body); font-size: 13px;
  box-sizing: border-box;
}
.modal-form .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.modal .msg-success {
  padding: 10px 12px; background: var(--teal-soft);
  color: var(--teal-2); border-radius: var(--radius-sm);
  font-size: 12px; font-family: var(--font-mono);
}


/* ==========================================================
   PHASE 2 — login, legal, onboarding, channels, account,
   payment, campaigns, reports, admin, empty-state, support
   ========================================================== */

/* ----- Sidebar scrollable + support button ----- */
.sidebar { display: flex; flex-direction: column; }
.sidebar .sb-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.sidebar .sb-support {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 12px 4px; padding: 9px 12px;
  border-radius: 10px; border: 1px dashed var(--border);
  background: transparent; color: var(--ink-2);
  font-family: inherit; font-size: 12px; cursor: pointer;
  transition: all .15s ease;
}
.sidebar .sb-support:hover { background: var(--surface-2); color: var(--ink); border-color: var(--accent); }

/* ----- Common form fields + small buttons ----- */
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 12px; color: var(--ink-2); }
.fld span { font-weight: 500; color: var(--ink-2); }
.fld input, .fld select, .fld textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px;
  transition: border-color .15s ease;
}
.fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-ghost.danger { color: #C0392B; }
.btn-ghost.danger:hover { background: rgba(192,57,43,.08); }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.row-head h3 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

/* Simple data table (shared) */
.simple-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.simple-table .tr { display: grid; align-items: center; padding: 11px 14px; gap: 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--ink); }
.simple-table .tr:last-child { border-bottom: none; }
.simple-table .tr.head { background: var(--surface-2); color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding: 9px 14px; }
.simple-table .tr:not(.head):hover { background: var(--surface-2); }

/* ==========================================================
   LOGIN
   ========================================================== */
.lg-root { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.lg-left {
  background: linear-gradient(160deg, var(--accent) 0%, color-mix(in oklch, var(--accent) 70%, #1C1C1C) 100%);
  color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.lg-left::before {
  content: ''; position: absolute; inset: -40%;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.15), transparent 40%),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,.08), transparent 40%);
  pointer-events: none;
}
.lg-left > * { position: relative; z-index: 1; }
.lg-brand img { height: 72px; filter: none; }
.lg-h { font-family: var(--font-display); font-size: 44px; line-height: 1.08; letter-spacing: -0.03em; font-weight: 600; margin: 0 0 20px; max-width: 520px; }
.lg-sub { font-size: 16px; line-height: 1.5; opacity: .9; max-width: 480px; margin: 0 0 32px; }
.lg-metrics { display: flex; gap: 40px; margin-bottom: 24px; }
.lg-metrics .m { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.lg-metrics .l { font-size: 11px; opacity: .8; margin-top: 2px; }
.lg-clients { display: flex; align-items: center; gap: 14px; font-size: 12px; opacity: .85; }
.lg-clients .row { display: flex; gap: 6px; }
.logo-chip { width: 28px; height: 28px; border-radius: 8px; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; border: 2px solid rgba(255,255,255,.3); }

.lg-right { display: flex; align-items: center; justify-content: center; padding: 40px; }
.lg-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.lg-card-h { margin-bottom: 20px; }
.lg-card-h h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.lg-card-h .s { font-size: 13px; color: var(--ink-2); }
.lg-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.lg-field input { padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.lg-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lg-err { padding: 10px 12px; background: rgba(192,57,43,.08); color: #C0392B; border-radius: 8px; font-size: 12px; margin-bottom: 12px; }
.lg-submit { width: 100%; justify-content: center; padding: 12px !important; font-size: 13px !important; font-weight: 600; }
.lg-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--ink-3); font-size: 11px; }
.lg-divider::before, .lg-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.lg-demo-row { display: flex; flex-direction: column; gap: 8px; }
.lg-demo { text-align: left; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; transition: all .15s ease; font-family: inherit; }
.lg-demo:hover { border-color: var(--accent); background: var(--accent-soft); }
.lg-demo .d1 { font-weight: 600; font-size: 12.5px; color: var(--ink); }
.lg-demo .d2 { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.lg-foot { margin-top: 20px; display: flex; justify-content: center; gap: 10px; font-size: 11px; color: var(--ink-3); }
.lg-foot a { color: var(--ink-2); text-decoration: none; }
.lg-foot a:hover { color: var(--accent); }

@media (max-width: 900px) {
  .lg-root { grid-template-columns: 1fr; }
  .lg-left { display: none; }
}

/* ==========================================================
   LEGAL
   ========================================================== */
.lgl-root { min-height: 100vh; background: var(--bg); }
.lgl-top {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 32px; border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.lgl-body { display: grid; grid-template-columns: 260px 1fr; max-width: 1200px; margin: 0 auto; padding: 32px; gap: 40px; }
.lgl-nav { position: sticky; top: 80px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.lgl-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: none; background: transparent; color: var(--ink-2);
  border-radius: 8px; cursor: pointer; font: inherit; font-size: 12.5px; text-align: left;
}
.lgl-nav-item:hover { background: var(--surface-2); color: var(--ink); }
.lgl-nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.lgl-nav-foot { margin-top: 20px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: 11px; color: var(--ink-2); }
.lgl-nav-foot .t { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.lgl-nav-foot a { color: var(--accent); text-decoration: none; }
.lgl-content { max-width: 720px; }
.lgl-h h1 { margin: 0 0 6px; font-family: var(--font-display); font-size: 34px; letter-spacing: -0.025em; font-weight: 600; }
.lgl-h .s { color: var(--ink-3); font-size: 12px; margin-bottom: 28px; }
.lgl-sec { margin-bottom: 22px; }
.lgl-sec h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.lgl-sec p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.lgl-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 11px; color: var(--ink-3); line-height: 1.6; }

/* ==========================================================
   ONBOARDING
   ========================================================== */
.onb-page { max-width: 900px; margin: 0 auto; }
.onb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; margin-bottom: 24px; }
.onb-head h1 { margin: 4px 0 6px; font-family: var(--font-display); font-size: 34px; letter-spacing: -0.025em; font-weight: 600; }
.onb-head .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 600; }
.onb-head .sub { color: var(--ink-2); font-size: 14px; max-width: 520px; }
.onb-progress { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.onb-progress .ring { position: relative; width: 72px; height: 72px; }
.onb-progress .ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.onb-progress .lbl { font-size: 11px; color: var(--ink-3); line-height: 1.4; }
.onb-progress .lbl strong { font-family: var(--font-display); font-size: 18px; color: var(--ink); font-weight: 600; }

.onb-focus {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 24px; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 60%);
  border: 1px solid var(--accent); border-radius: 14px;
}
.onb-focus .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.onb-focus .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 600; }
.onb-focus .title { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.015em; margin: 2px 0; }
.onb-focus .desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

.onb-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.onb-step {
  display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition: all .15s ease;
}
.onb-step:hover { border-color: var(--accent); }
.onb-step.done { opacity: .7; }
.onb-step.active { border-color: var(--accent); background: var(--accent-soft); }
.onb-step .num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 13px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border);
}
.onb-step.done .num { background: var(--teal-2); color: #fff; border-color: var(--teal-2); }
.onb-step.active .num { background: var(--accent); color: #fff; border-color: var(--accent); }
.onb-step .body { flex: 1; min-width: 0; }
.onb-step .row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.onb-step .label { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.onb-step .desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 6px; }
.onb-step .impact { font-size: 11px; color: var(--teal-2); display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }

.chip-tiny { font-size: 9.5px; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.chip-tiny.required { background: var(--accent-soft); color: var(--accent); }
.chip-tiny.done { background: var(--teal-soft); color: var(--teal-2); }
.chip-tiny.active { background: var(--accent); color: #fff; }
.chip-tiny.pending { background: var(--surface-2); color: var(--ink-3); }

.onb-help { display: flex; align-items: center; gap: 16px; padding: 18px 24px; background: var(--surface-2); border-radius: 12px; }
.onb-help .ico { font-size: 28px; }
.onb-help > div:nth-child(2) { flex: 1; }
.onb-help .t { font-weight: 600; font-family: var(--font-display); margin-bottom: 2px; }
.onb-help .d { font-size: 12.5px; color: var(--ink-2); }

/* ==========================================================
   CHANNELS
   ========================================================== */
.ch-page { max-width: 1180px; margin: 0 auto; }
.ch-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.ch-head h1 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.ch-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.ch-filters { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.ch-filter { padding: 9px 14px; border: none; background: transparent; color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ch-filter:hover { color: var(--ink); }
.ch-filter.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ch-card { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; gap: 10px; transition: all .15s ease; }
.ch-card.connected { border-color: var(--border); }
.ch-card:hover { border-color: var(--accent); box-shadow: 0 4px 20px rgba(0,0,0,.04); }
.ch-top { display: flex; align-items: center; justify-content: space-between; }
.ch-top .logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.ch-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ch-desc { font-size: 12px; color: var(--ink-2); line-height: 1.5; min-height: 36px; }
.ch-meta { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ch-meta .kv { display: flex; justify-content: space-between; font-size: 11.5px; }
.ch-meta .kv span { color: var(--ink-3); }
.ch-meta .kv strong { font-weight: 600; }
.ch-actions { display: flex; gap: 8px; margin-top: 4px; }
.ch-actions .btn { flex: 1; justify-content: center; }

/* ==========================================================
   ACCOUNT
   ========================================================== */
.ac-page { max-width: 1100px; margin: 0 auto; }
.ac-head { margin-bottom: 20px; }
.ac-head h1 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.ac-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.ac-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.ac-tab { padding: 10px 16px; border: none; background: transparent; color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; text-transform: capitalize; }
.ac-tab:hover { color: var(--ink); }
.ac-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.ac-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }
.ac-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.ac-card h3 { margin: 0 0 16px; font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ac-avatar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.ac-avatar .av { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.ac-avatar .hint { font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }

.sec-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.sec-row:last-child { border-bottom: none; }
.sec-row .t { font-weight: 600; font-size: 13px; }
.sec-row .d { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.notif-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); gap: 16px; }
.notif-row:last-child { border-bottom: none; }
.notif-row .body { flex: 1; }
.notif-row .t { font-weight: 600; font-size: 13px; }
.notif-row .d { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.notif-row .chans { display: flex; gap: 6px; }
.notif-chk { display: flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 6px; background: var(--surface-2); font-size: 10.5px; color: var(--ink-3); cursor: pointer; text-transform: uppercase; letter-spacing: .06em; }
.notif-chk.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.notif-chk input { display: none; }

/* ==========================================================
   PAYMENT
   ========================================================== */
.pay-page { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pay-head { grid-column: 1 / -1; }
.pay-head h1 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.pay-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }

.pay-plan {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 32px; padding: 28px 32px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 100%);
  border: 1px solid var(--accent); border-radius: 16px;
}
.pay-plan-left { flex: 1; }
.plan-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-bottom: 10px; }
.pay-plan .plan-name { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 2px; }
.pay-plan .plan-price { font-family: var(--font-display); font-size: 32px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.pay-plan .plan-price span { font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.pay-plan .plan-next { font-size: 12.5px; color: var(--ink-2); margin: 10px 0 14px; }
.plan-feats-inline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.plan-feats-inline li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.plan-feats-inline li svg { color: var(--teal-2); flex-shrink: 0; }
.pay-plan-right { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 180px; }

.pay-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.pay-card h3 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.card-preview {
  margin-top: 14px; padding: 20px; border-radius: 12px;
  background: linear-gradient(135deg, #1C1C1C 0%, #3a3a3a 100%);
  color: #fff; font-family: var(--font-mono);
}
.card-preview .logo { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 24px; letter-spacing: 0.1em; }
.card-preview .num { font-size: 18px; letter-spacing: 0.18em; margin-bottom: 14px; }
.card-preview .holder { font-size: 10.5px; opacity: .75; letter-spacing: 0.1em; }
.pay-secondary { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.pay-secondary .sec strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; }
.pay-secondary .sec div { font-size: 12.5px; color: var(--ink-2); }

.usage { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.u-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 14px; align-items: center; font-size: 12px; }
.u-row .t { color: var(--ink-2); }
.u-row .bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.u-row .bar .fill { height: 100%; background: var(--accent); border-radius: 3px; }
.u-row .v { font-family: var(--font-mono); font-weight: 600; font-size: 11.5px; white-space: nowrap; }
.u-row .v span { color: var(--ink-3); font-weight: 400; }

/* ==========================================================
   CAMPAIGNS
   ========================================================== */
.cp-page { max-width: 1280px; margin: 0 auto; }
.cp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.cp-head .info { flex: 1; }
.cp-head h1 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.cp-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.cp-tenant-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink); }
.cp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.cp-kpis .kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.cp-kpis .lbl { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.cp-kpis .val { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 2px; }
.cp-kpis .delta { font-size: 11px; font-weight: 500; }
.cp-kpis .delta.up { color: var(--teal-2); }
.cp-kpis .delta.down { color: #C0392B; }

.channel-chip { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.channel-chip.meta { background: rgba(24,119,242,.1); color: #1877F2; }
.channel-chip.tiktok { background: rgba(28,28,28,.08); color: #1C1C1C; }
.channel-chip.google { background: rgba(66,133,244,.1); color: #4285F4; }

.roas-badge { font-family: var(--font-mono); font-weight: 600; color: var(--teal-2); padding: 2px 8px; background: var(--teal-soft); border-radius: 4px; font-size: 11px; }
.roas-before { display: block; font-size: 9.5px; color: var(--ink-3); margin-top: 2px; font-style: italic; }

.cp-attribution {
  margin-top: 20px; padding: 18px 22px;
  display: flex; align-items: center; gap: 16px;
  background: #25D366; color: #fff; border-radius: 14px;
}
.cp-attribution .ico { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.cp-attribution .t { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.cp-attribution .d { font-size: 12.5px; opacity: .95; line-height: 1.5; }

/* ==========================================================
   REPORTS
   ========================================================== */
.rep-page { max-width: 1100px; margin: 0 auto; }
.rep-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.rep-head .info { flex: 1; }
.rep-head h1 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.rep-head .sub { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.rep-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; padding: 4px 10px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-size: 11px; font-weight: 500; }

.rep-reco { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; margin-bottom: 20px; }
.rep-reco h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.rep-reco h3 svg { color: var(--accent); }
.rep-reco-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.rep-reco-item:last-child { border-bottom: none; }
.rep-reco-pri { font-size: 9.5px; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; height: fit-content; }
.rep-reco-pri.alta { background: rgba(242,92,42,.12); color: #F25C2A; }
.rep-reco-pri.media { background: rgba(230,178,66,.2); color: #A37B15; }
.rep-reco-item .action { font-family: var(--font-display); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.rep-reco-item .reason { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

.rep-section { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; margin-bottom: 20px; }
.rep-section h3 { margin: 0 0 16px; font-family: var(--font-display); font-size: 15px; font-weight: 600; }

/* ==========================================================
   ADMIN
   ========================================================== */
.adm-page { max-width: 1280px; margin: 0 auto; }
.adm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.adm-head .info { flex: 1; }
.adm-head h1 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.adm-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.adm-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.adm-tab { padding: 10px 16px; border: none; background: transparent; color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; text-transform: capitalize; }
.adm-tab:hover { color: var(--ink); }
.adm-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.adm-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.adm-summary > div { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.adm-summary .n { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.adm-summary .l { display: block; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-top: 2px; }

.tenant-dot { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 13px; flex-shrink: 0; }

.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan-card { padding: 24px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; position: relative; }
.plan-card.featured { border: 2px solid var(--accent); transform: translateY(-4px); }
.plan-badge { position: absolute; top: -10px; right: 16px; padding: 4px 10px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.plan-card .plan-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.plan-card .plan-price { font-family: var(--font-display); font-size: 36px; font-weight: 600; letter-spacing: -0.025em; margin: 8px 0; }
.plan-card .plan-price span { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.plan-card .plan-tagline { font-size: 13px; color: var(--ink-2); margin-bottom: 16px; }
.plan-feats { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.plan-feats li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.plan-feats li svg { color: var(--teal-2); flex-shrink: 0; }
.plan-tenants { font-size: 11px; color: var(--ink-3); padding-top: 14px; border-top: 1px solid var(--border); }

.sys-log { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); font-family: var(--font-mono); }
.sys-row { display: grid; grid-template-columns: 60px 70px 160px 1fr; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12px; align-items: center; }
.sys-row:last-child { border-bottom: none; }
.sys-row .t { color: var(--ink-3); font-size: 11px; }
.sys-row .lvl { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; text-align: center; }
.sys-row .lvl.info { background: var(--surface-2); color: var(--ink-2); }
.sys-row .lvl.warn { background: rgba(230,178,66,.2); color: #A37B15; }
.sys-row .lvl.error { background: rgba(192,57,43,.12); color: #C0392B; }
.sys-row .src { color: var(--accent); font-size: 11.5px; }
.sys-row .msg { color: var(--ink); font-family: var(--font-body); }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.team-card { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; text-align: center; }
.team-card .avatar { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.team-card .name { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.team-card .role { font-size: 11.5px; color: var(--ink-3); margin: 2px 0 10px; }
.team-card .stat { font-size: 11.5px; color: var(--ink-2); padding-top: 10px; border-top: 1px solid var(--border); }

/* ==========================================================
   EMPTY STATE (Aura dashboard)
   ========================================================== */
.empty-hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px;
  padding: 40px; margin: 20px 0 24px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 100%);
  border: 1px solid var(--accent); border-radius: 18px;
}
.empty-hero .left .eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-bottom: 14px; }
.empty-hero .left h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 14px; line-height: 1.2; text-wrap: pretty; }
.empty-hero .left p { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; margin: 0 0 20px; }
.empty-hero .actions { display: flex; gap: 10px; }
.empty-progress { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; text-align: center; }
.empty-progress .t { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; margin-bottom: 14px; }
.empty-progress .ring-big { position: relative; width: 140px; height: 140px; margin: 0 auto; }
.empty-progress .pct-big { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 30px; letter-spacing: -0.02em; }
.steps-tiny { margin-top: 18px; text-align: left; display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.steps-tiny .row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 2px 0; }
.steps-tiny .row.done { color: var(--teal-2); }
.steps-tiny .row.done svg { flex-shrink: 0; }
.steps-tiny .row.active { color: var(--accent); font-weight: 600; }
.steps-tiny .row.pending { color: var(--ink-3); }

.empty-preview h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 12px; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.prev-card { padding: 22px; background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; }
.prev-ico { font-size: 28px; margin-bottom: 10px; }
.prev-t { font-family: var(--font-display); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.prev-d { font-size: 12px; color: var(--ink-2); line-height: 1.5; }

/* ==========================================================
   SUPPORT MODAL
   ========================================================== */
.sup-modal { width: 540px; max-width: 92vw; }
.sup-options { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.sup-opt { padding: 16px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; transition: all .15s ease; }
.sup-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.sup-opt .ico { font-size: 22px; margin-bottom: 8px; }
.sup-opt .l { font-weight: 600; font-size: 12.5px; margin-bottom: 2px; }
.sup-opt .d { font-size: 10.5px; color: var(--ink-3); line-height: 1.4; }
.sup-form .tit { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; margin-bottom: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.sup-form textarea { font-family: inherit; resize: vertical; min-height: 80px; }
.sup-sent { text-align: center; padding: 20px; }
.sup-sent .ico { color: var(--teal-2); margin-bottom: 12px; }
.sup-sent .t { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.sup-sent .d { color: var(--ink-2); font-size: 13px; margin-bottom: 20px; }



/* ===== ADDENDUM: ECOSYSTEM (SIDEN + SuperVisor) ===== */

/* Channels — ecosystem cards */
.ch-card.eco {
  border: 1.5px solid var(--teal);
  position: relative;
}
.ch-card .ch-badge {
  position: absolute;
  top: -10px; left: 16px;
  background: var(--orange-soft);
  color: var(--orange-2);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid var(--orange);
}

/* Reports — SIDEN bridge card */
.rep-siden {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 12px;
  margin-top: 24px;
  border: 1px solid var(--line);
}
.rep-siden.has {
  background: linear-gradient(135deg, rgba(14, 138, 122, 0.06), rgba(14, 138, 122, 0.02));
  border-color: var(--teal);
}
.rep-siden.no {
  background: linear-gradient(135deg, var(--orange-soft), rgba(242, 92, 42, 0.04));
  border-color: var(--orange);
}
.rep-siden .ico {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--bg-1);
  color: var(--teal-2);
  border: 1px solid var(--line);
}
.rep-siden.no .ico { color: var(--orange-2); }
.rep-siden .body { flex: 1; }
.rep-siden .body .t {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-1);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.rep-siden .body .d {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ===== DIAGNOSIS PAGE ===== */
.diag-page {
  padding: 24px 32px 48px;
  max-width: 980px;
  margin: 0 auto;
}

/* Empty state */
.diag-empty {
  text-align: center;
  padding: 56px 32px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.diag-empty .ico-wrap {
  width: 96px; height: 96px;
  margin: 0 auto 24px;
  display: grid; place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(14, 138, 122, 0.12), rgba(14, 138, 122, 0.04));
  color: var(--teal-2);
}
.diag-empty h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.diag-empty .lead {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 540px;
  margin: 0 auto 24px;
  text-wrap: pretty;
}
.diag-chips {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.diag-chips .chip {
  background: var(--bg-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  font-size: 12px;
  padding: 6px 12px;
}
.diag-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 720px;
  margin: 0 auto 32px;
}
.diag-tier {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  position: relative;
}
.diag-tier.selected {
  border-color: var(--accent, #D96518) !important;
  background: rgba(217, 101, 24, 0.06);
  box-shadow: 0 0 0 3px rgba(217, 101, 24, 0.12);
}

.diag-tier.featured {
  border-color: var(--teal);
  background: var(--bg-1);
  box-shadow: 0 0 0 3px rgba(14, 138, 122, 0.08);
}
.diag-tier .tier-tag {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--teal);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.diag-tier .tier-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.diag-tier .tier-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-1);
  font-family: var(--font-mono);
}
.diag-tier .tier-price span {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  font-family: var(--font-sans);
}
.diag-tier .tier-d {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 8px;
  line-height: 1.4;
}
.btn.primary.big {
  font-size: 14px;
  padding: 14px 24px;
}
.diag-note {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 16px;
}

/* Diagnosis with report */
.diag-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
}
.diag-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 12px 0 4px;
}
.diag-header .sub {
  font-size: 13px;
  color: var(--ink-2);
}
.diag-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.diag-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  align-items: center;
}
.diag-score {
  display: flex;
  align-items: center;
  gap: 16px;
}
.diag-score .score-label .t {
  font-size: 13px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 6px;
}
.diag-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
  border-left: 1px solid var(--line);
  padding-left: 32px;
}
.diag-metrics .metric .lbl {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 4px;
}
.diag-metrics .metric .val {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-1);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}
.diag-metrics .metric .d {
  font-size: 11px;
  color: var(--ink-2);
}

.diag-reco {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.diag-reco h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-1);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.diag-reco h3 svg { color: var(--teal-2); }
.diag-reco-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.diag-reco-item:first-of-type { border-top: none; }
.diag-reco-item .num {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(14, 138, 122, 0.1);
  color: var(--teal-2);
  font-weight: 700;
  font-size: 12px;
  font-family: var(--font-mono);
}
.diag-reco-item .body {
  font-size: 13px;
  color: var(--ink-1);
  line-height: 1.55;
  padding-top: 4px;
}

.diag-bridge {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--orange-soft), rgba(242, 92, 42, 0.04));
  border: 1px solid var(--orange);
  margin-bottom: 16px;
}
.diag-bridge .ico {
  flex: 0 0 40px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: white;
  color: var(--orange-2);
  border: 1px solid var(--orange);
}
.diag-bridge .body { flex: 1; }
.diag-bridge .body .t {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-1);
  margin-bottom: 2px;
}
.diag-bridge .body .d {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}

.diag-eco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-3);
  padding: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* Logo sidebar — texto oculto porque el logo ya incluye el nombre */
.sb-brand .name,
.sb-brand .badge { display: none; }


/* SIDEN — card hover */
.siden-card {
  position: relative;
  user-select: none;
}
.siden-card:hover {
  border-color: rgba(58,87,112,0.6) !important;
  background: rgba(58,87,112,0.06) !important;
}
.siden-card:active {
  transform: scale(0.995);
}

/* ═══════════════════════════════════════════════════════════════
   VISOR DE AGENTES — estilos completos
   ═══════════════════════════════════════════════════════════════ */

/* ── Página contenedor */
.ag-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Header */
.ag-hdr {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ag-hdr-left { flex: 1; }
.ag-ttl {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.ag-sub-ttl { display: flex; align-items: center; gap: 8px; }

.ag-view-tabs { display: flex; gap: 4px; }
.ag-vtab {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.ag-vtab:hover { color: var(--ink); border-color: var(--border-strong); }
.ag-vtab.on {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ── Map layout */
.ag-map-wrap {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  grid-template-columns: 1fr;
  overflow: hidden;
  position: relative;
}
.ag-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  overflow: hidden;
  transition: all 0.3s;
}
.ag-canvas.has-sel { /* shrinks slightly when panel open — handled by grid below */ }

/* When panel is open, reorganize as two-column */
.ag-map-wrap:has(.ag-det-panel) {
  grid-template-columns: 1fr 320px;
  grid-template-rows: 1fr auto;
}
.ag-map-wrap:has(.ag-det-panel) .ag-canvas { grid-row: 1; grid-column: 1; }
.ag-map-wrap:has(.ag-det-panel) .ag-legend { grid-row: 2; grid-column: 1 / 3; }

.ag-svg {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 160px);
  overflow: visible;
}

/* ── SVG animations */
@keyframes agGlow {
  0%, 100% { opacity: 0.5; r: 40px; }
  50%       { opacity: 0.2; r: 44px; }
}
.ag-glow { animation: agGlow 2.4s ease-in-out infinite; }

@keyframes agSelRing {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -16; }
}
.ag-sel-ring { animation: agSelRing 1.5s linear infinite; }

@keyframes dashFlowAnim {
  to { stroke-dashoffset: -9; }
}
.ag-edge-flow { stroke-dasharray: 5 4; animation: dashFlowAnim 0.9s linear infinite; }

/* ── Legend */
.ag-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  color: var(--ink-3);
  flex-shrink: 0;
}
.ag-leg-item { display: flex; align-items: center; gap: 5px; }
.ag-leg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ag-leg-line { display: inline-block; width: 20px; height: 2px; }
.ag-leg-line.solid { background: var(--border-strong); }
.ag-leg-line.dash {
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px);
}
.ag-leg-hint { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--ink-4); font-style: italic; }

/* ── Detail panel */
.ag-det-panel {
  grid-row: 1;
  grid-column: 2;
  border-left: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInRight 0.2s ease;
}
@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.ag-dp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ag-dp-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.ag-dp-name { font-weight: 700; font-size: 14px; }
.ag-dp-sub  { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ag-dp-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ag-dp-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.ag-dp-tab:hover { background: var(--surface-2); color: var(--ink); }
.ag-dp-tab.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.ag-dp-badge {
  position: absolute; top: 0; right: 0;
  background: var(--accent); color: white;
  border-radius: 99px; font-size: 8px; font-weight: 700;
  padding: 1px 4px; min-width: 14px; text-align: center;
}

.ag-dp-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

.ag-dp-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ag-dp-stat {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.ag-dp-stat .l { font-size: 10px; color: var(--ink-4); margin-bottom: 3px; }
.ag-dp-stat .v { font-size: 16px; font-weight: 700; font-family: var(--font-display); }

/* ── Chips de conexión */
.ag-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.ag-conn-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 500;
  background: var(--surface);
}
.ag-cc-lbl { color: var(--ink-4); font-size: 9px; font-weight: 400; }

/* ── Tabs en vista lista */
.ag-cfg-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 0 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.ag-cfg-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  border: none; border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-3); font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  margin-bottom: -1px;
}
.ag-cfg-tab:hover { color: var(--ink); }
.ag-cfg-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── Instruction panel */
.inst-desc {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 12px;
  line-height: 1.6;
}
.inst-term {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.inst-term-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
}
.inst-prompt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}
.inst-model {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-4);
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
}
.inst-area {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
  min-height: 100px;
}
.inst-area::placeholder { color: var(--ink-4); font-family: var(--font-body); font-size: 11px; }
.inst-term-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface-3);
  border-top: 1px solid var(--border);
}
.inst-hint { font-size: 10px; color: var(--ink-4); display: flex; align-items: center; gap: 3px; }
.inst-hint kbd {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 9px;
  font-family: var(--font-mono);
}

/* ── Quick instructions */
.inst-quick { margin-bottom: 14px; }
.inst-quick-lbl { font-size: 10px; font-weight: 600; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.inst-quick-list { display: flex; flex-direction: column; gap: 4px; }
.inst-quick-item {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
}
.inst-quick-item:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }

/* ── Instruction log */
.inst-log { margin-top: 4px; }
.inst-log-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600;
  color: var(--green);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.inst-log-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 10px;
  background: var(--green-soft);
  border: 1px solid #b6dfca;
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
}
.inst-ok { color: var(--green); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.inst-log-txt  { font-size: 11px; color: var(--ink); line-height: 1.4; }
.inst-log-meta { font-size: 9px; color: var(--ink-4); margin-top: 2px; }

/* ── Spin animation for loading */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; }

[data-theme="dark"] .ag-det-panel { background: var(--surface); }
[data-theme="dark"] .inst-term { background: var(--surface-3); border-color: var(--border); }
[data-theme="dark"] .inst-term-head,
[data-theme="dark"] .inst-term-foot { background: var(--surface-2); }
[data-theme="dark"] .inst-log-row { background: #1a2e22; border-color: #2a4a34; }

.lg-google-btn { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; padding:11px 16px; border:1.5px solid var(--border); border-radius:10px; background:var(--surface); color:var(--ink-1); font-size:13px; font-weight:600; text-decoration:none; cursor:pointer; transition:border-color .15s,box-shadow .15s; }
.lg-google-btn:hover { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-a10); }

/* ── Setup / Onboarding ──────────────────────────────────────────────────── */
.lg-brand { margin-bottom: 32px; }
.lg-logo-ts { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; }
.lg-tagline { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.lg-title { font-size: 26px; font-weight: 800; color: var(--ink-1); margin: 0 0 8px; letter-spacing: -0.02em; }
.lg-form { display: flex; flex-direction: column; gap: 0; }
.lg-field textarea { padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); color: var(--ink-1); font: inherit; font-size: 13px; }
.lg-field textarea:focus { outline: none; border-color: #D96518; box-shadow: 0 0 0 3px rgba(217,101,24,0.12); }
.lg-error { color: #C62828; font-size: 13px; margin: 8px 0; padding: 10px 14px; background: rgba(198,40,40,0.08); border-radius: 8px; }
.lg-btn { padding: 14px 24px; background: #D96518; color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%; margin-top: 16px; transition: opacity 0.15s; }
.lg-btn:hover:not(:disabled) { opacity: 0.9; }
.lg-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.lg-btn-ghost { padding: 14px 24px; background: transparent; color: var(--ink-2); border: 2px solid var(--border); border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 16px; transition: all 0.15s; }
.lg-btn-ghost:hover { border-color: var(--ink-2); color: var(--ink-1); }
.lg-right-inner { background: linear-gradient(135deg, #3D5868 0%, #2a3d4a 100%); border-radius: 20px; padding: 48px 40px; max-width: 400px; }

/* ============================================
   RESPONSIVE — Mobile First
   breakpoint: 768px
   ============================================ */

@media (max-width: 768px) {

  /* Layout raíz — de grid 2 columnas a 1 columna */
  .lg-root {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  /* Ocultar panel izquierdo en móvil */
  .lg-left {
    display: none;
  }

  /* Panel derecho ocupa todo el ancho */
  .lg-right {
    padding: 24px 16px;
    align-items: flex-start;
  }

  /* Card ocupa ancho completo */
  .lg-card {
    max-width: 100%;
    padding: 24px 20px;
    border-radius: 12px;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  /* Tipografía */
  .lg-card-h h2 { font-size: 20px; }
  .lg-h { font-size: 28px; }
  .lg-sub { font-size: 14px; }

  /* Formulario */
  .lg-form { gap: 12px; }
  .lg-field input,
  .lg-field select,
  .lg-field textarea {
    font-size: 16px; /* evita zoom en iOS */
    padding: 12px 14px;
  }

  /* Botón primario full width */
  .lg-btn,
  .lg-btn-primary,
  button[type=submit] {
    width: 100%;
    padding: 14px;
    font-size: 15px;
  }

  /* Steps / progress bar */
  .lg-steps { gap: 8px; }
  .lg-step-label { font-size: 10px; }

  /* Checkout — resumen de orden */
  .checkout-summary,
  .order-summary {
    padding: 16px;
    border-radius: 10px;
  }

  /* Contract — texto legal */
  .contract-body {
    font-size: 13px;
    line-height: 1.6;
    padding: 16px;
  }

  /* Diagnosis — cards de problemas */
  .problem-card,
  .diagnosis-card {
    padding: 16px;
    border-radius: 10px;
  }

  /* Score / Executive Snapshot */
  .score-ring { transform: scale(0.85); }
  .exec-snapshot { padding: 16px; }

  /* Botones de acción sticky en móvil */
  .sticky-bar,
  .action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
  }

  /* Modales full screen en móvil */
  .modal-overlay { align-items: flex-end; }
  .modal-content {
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Navigation / sidebar */
  .sidebar { display: none; }
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 200;
  }

}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
  .lg-root { grid-template-columns: 1fr 1fr; }
  .lg-left { padding: 32px; }
  .lg-h { font-size: 36px; }
}

/* ── Diagnosis responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .diag-page { padding: 16px 14px 48px; }

  /* Header: stack vertically */
  .diag-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .diag-header h1 { font-size: 20px; }
  .diag-actions { width: 100%; }
  .diag-actions .btn, .diag-actions button { flex: 1; }

  /* Hero: single column */
  .diag-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }
  .diag-score { justify-content: center; }

  /* Metrics: remove left border, 2 cols */
  .diag-metrics {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 16px;
    grid-template-columns: repeat(2, 1fr);
  }

  /* Empty state tiers: stack to 1 col */
  .diag-tiers {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .diag-empty h1 { font-size: 22px; }
  .diag-empty { padding: 32px 16px; }

  /* Reco section: smaller padding */
  .diag-reco { padding: 16px 14px; }

  /* Bridge: stack */
  .diag-bridge { flex-direction: column; gap: 10px; }

  /* Eco: tighter */
  .diag-eco { padding: 16px; }

  /* Sticky CTA bar for diagnosis */
  .diag-cta-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
  }
  .diag-cta-bar .btn { width: 100%; }

  /* Workflow cards: single column */
  .wf-grid { grid-template-columns: 1fr; }
  .wf-canvas { min-height: 320px; overflow-x: auto; }

  /* Reports */
  .rep-page { padding: 16px 14px 48px; }
  .rep-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .rep-head > div:last-child { width: 100%; justify-content: space-between; }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
  .diag-page { padding: 20px 24px; }
  .diag-hero { gap: 20px; padding: 20px; }
  .diag-tiers { grid-template-columns: repeat(2, 1fr); }
}

.mobile-nav { display: none; }

/* ============================================
   MOBILE — App shell collapse + bottom nav
   ============================================ */
@media (max-width: 768px) {
  .app, .app[data-density='compact'] {
    grid-template-columns: 1fr;
  }
  .main { padding-bottom: 60px; }
  .page { overflow-y: auto; }

  .mobile-nav {
    justify-content: space-around;
    padding: 0;
    height: 56px;
  }
  .mob-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    cursor: pointer;
    color: var(--ink-3);
    font-size: 10px;
    font-weight: 600;
    transition: color 0.15s;
    padding: 0 4px;
    user-select: none;
  }
  .mob-item.active { color: var(--accent); }

  /* Responsive grid helpers */
  .agents-benefit-grid { grid-template-columns: 1fr !important; }
  .agents-metrics-grid { grid-template-columns: 1fr !important; }
  .mob-1col { grid-template-columns: 1fr !important; }
  .mob-stack { flex-direction: column !important; }
  .mob-pad { padding: 16px !important; }
}

/* === FASE 5 PASO 2 — Sidebar Notion-style ================================ */
/* Override del sidebar para usar tokens --ts-*.
   Va al final del archivo: gana en cascada sin tocar el bloque legacy.
   No afecta otros componentes. */

.sidebar {
  background: var(--ts-bg-soft);
  border-right: 1px solid var(--ts-border);
  width: 220px;
  flex-shrink: 0;
  box-shadow: none;
}

.sb-brand {
  border-bottom: 1px solid var(--ts-border);
}

.sb-section {
  color: var(--ts-text-muted);
}

.sb-item {
  color: var(--ts-text-muted);
  border-left: 2px solid transparent;
  border-radius: 0 var(--ts-radius) var(--ts-radius) 0;
  padding: 8px 12px 8px 14px;
}

.sb-item:hover {
  background: rgba(99, 91, 255, 0.04);
  color: var(--ts-text);
}

.sb-item.active {
  background: rgba(99, 91, 255, 0.08);
  color: var(--ts-accent);
  border-left: 2px solid var(--ts-accent);
}

.sb-item.active .count {
  background: var(--ts-accent);
  color: #fff;
}

.sb-item.locked:hover {
  background: rgba(99, 91, 255, 0.04);
}

.sb-foot {
  border-top: 1px solid var(--ts-border);
}
/* === FIN PASO 2 ========================================================== */

/* === FASE 5 PASO 3 — Header del portal cliente ========================== */
.topbar {
  background: var(--ts-bg);
  border-bottom: 1px solid var(--ts-border);
  box-shadow: none;
}

.topbar .crumbs {
  color: var(--ts-text-muted);
}

.topbar .crumbs .now {
  color: var(--ts-text);
  font-weight: 700;  /* nombre del negocio en bold */
}

.topbar .search {
  background: var(--ts-bg-soft);
  border: 1px solid var(--ts-border);
  border-radius: var(--ts-radius);
  color: var(--ts-text-muted);
}

.topbar .kbd {
  background: var(--ts-bg);
  border: 1px solid var(--ts-border);
  color: var(--ts-text-muted);
}

.topbar .btn-ghost {
  background: transparent;
  border: 1px solid var(--ts-border);
  border-radius: var(--ts-radius);
  color: var(--ts-text);
  box-shadow: none;
}

.topbar .btn-ghost:hover {
  border-color: var(--ts-text-muted);
  background: var(--ts-bg-soft);
}
/* === FIN PASO 3 ========================================================== */

/* === FASE 5 PASO 4 — Cards uniformes ===================================== */
/* Override del componente .card para usar tokens --ts-*.
   Estilo Notion/Stripe: borde fino + sombra suave + fondo blanco.
   Las excepciones (estado verde/naranja/rojo) se aplican vía
   modifier classes en JSX cuando hagan falta. */
.card {
  background: var(--ts-bg);
  border: 1px solid var(--ts-border);
  border-radius: var(--ts-radius-lg);
  box-shadow: var(--ts-shadow);
  padding: 20px 24px;
}
/* Variants de estado: borde-izquierdo de color sin invadir el cuerpo */
.card.card-ok      { border-left: 3px solid var(--ts-success); }
.card.card-alert   { border-left: 3px solid var(--ts-alert); }
.card.card-danger  { border-left: 3px solid var(--ts-danger); }
/* === FIN PASO 4 ========================================================== */

/* === FASE 5 PASO 5 — Métricas KPI estilo Databox ======================== */
/* Helper classes para que cualquier card pueda mostrar un KPI.
   Estilo: número grande+bold + label uppercase pequeño. */
.kpi-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--ts-text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.kpi-label {
  font-size: 12px;
  color: var(--ts-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.kpi-delta {
  font-size: 13px;
  font-weight: 600;
}
.kpi-delta.up    { color: var(--ts-success); }
.kpi-delta.down  { color: var(--ts-danger); }
.kpi-delta.flat  { color: var(--ts-text-muted); }
/* === FIN PASO 5 ========================================================== */

/* === FASE 5 PASO 7 — Botones (primario, secundario, naranja venta) ====== */
/* Override del componente .btn legacy + nuevas variants .ts-* sin pisar
   las clases existentes. */

/* Botón primario (default): accent #635BFF */
.btn.primary {
  background: var(--ts-accent);
  border-color: var(--ts-accent);
  color: #fff;
  border-radius: var(--ts-radius);
  padding: 10px 20px;
  font-weight: 600;
  box-shadow: none;
  transition: opacity 0.15s, background 0.15s;
}
.btn.primary:hover {
  background: var(--ts-accent);
  border-color: var(--ts-accent);
  opacity: 0.92;
}

/* Variants utility para JSX nuevo (sin clase .btn requerida) */
.ts-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--ts-radius);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
  text-decoration: none;
  font-family: var(--ts-font);
}
.ts-btn-primary {
  background: var(--ts-accent);
  color: #fff;
  border-color: var(--ts-accent);
}
.ts-btn-primary:hover { opacity: 0.92; }

.ts-btn-secondary {
  background: transparent;
  color: var(--ts-text);
  border: 1px solid var(--ts-border);
}
.ts-btn-secondary:hover {
  background: var(--ts-bg-soft);
  border-color: var(--ts-text-muted);
}

/* Naranja: solo Booster, CTAs de venta. Visualmente distinto. */
.ts-btn-orange {
  background: var(--ts-orange);
  color: #fff;
  border-color: var(--ts-orange);
}
.ts-btn-orange:hover { opacity: 0.92; }
/* === FIN PASO 7 ========================================================== */

/* === FASE 5 PASO 8 — Tipografía global Inter ============================ */
/* Body global: Inter, 15px, line-height 1.6.
   Override del body legacy. Componentes que pisen font-family inline
   o usen --font-body legacy mantienen su comportamiento (Instrument
   Sans queda como fallback en --ts-font).
   Headings h1-h3: weight 700, color var(--ts-text). */
body {
  font-family: var(--ts-font);
  font-size: var(--ts-font-body-size);
  line-height: var(--ts-line-height);
  color: var(--ts-text);
}
h1, h2, h3 {
  font-weight: var(--ts-font-heading-weight);
  color: var(--ts-text);
}
/* === FIN PASO 8 ========================================================== */

/* === MIGRACIÓN: Fuego → TribuScale (override agresivo) ================== */
/* Redefine las variables legacy Fuego con valores TribuScale.
   Como CIENTOS de componentes (page-panel.jsx tiene 173 estilos inline,
   page-account, page-cotizacion, etc.) usan var(--surface), var(--accent),
   var(--border)..., redefinirlas aquí migra el portal completo de un golpe
   sin tener que tocar 1000 líneas de JSX inline.

   Si en algún punto hay regresión visual en algún componente, se puede
   volver atrás solo eliminando este bloque (el bloque IDENTIDAD FUEGO de
   :root sigue intacto arriba). */

:root {
  --bg:            #FFFFFF;
  --surface:       #FFFFFF;
  --surface-2:     #F7F7F5;
  --surface-3:     #EFEFEC;
  --border:        #E8E8E4;
  --border-strong: #C8C8C4;
  --ink:           #1A1A1A;
  --ink-2:         #4A4A4A;
  --ink-3:         #6B6B6B;
  --ink-4:         #9A9A9A;
  /* Acento principal: morado Stripe en lugar de naranja Fuego */
  --accent:        #635BFF;
  --accent-2:      #4F46E5;
  --accent-soft:   #EEF2FF;
  --accent-faint:  #F5F4FF;
  /* Sombras más suaves estilo TribuScale */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.04);
}

/* --orange y --teal legacy se mantienen sin cambios para CTAs específicos
   (Booster, alertas) y para el logo TribuScale que usa Tribu+Scale bicolor. */
/* === FIN MIGRACIÓN ======================================================= */
