/* BotForce Lite · hoja única (sitio, cuentas, panel y superadmin). Mismo sistema visual que BotForce:
   tokens de color de Tailwind 4, Plus Jakarta Sans, barra lateral del color de marca, tarjetas y tema claro/oscuro.
   La paleta de marca (--brand-*, --accent-*) la fija el <style nonce> de cada layout desde BRAND_COLOR y
   BRAND_ACCENT (src/Brand.php, ya corregida para WCAG AA). El tema va en <html data-theme> (public/assets/theme.js). */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2"); /* OFL 1.1 · subconjunto latino, variable */
}

/* ---------- Tokens: claro (por defecto) ---------- */
:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --brand-primary: #102842;
  --brand-primary-strong: #344861;
  --brand-foreground: #FFFFFF;
  --brand-accent: #8B5CF6;
  --brand-ink-light: #102842;
  --brand-ink-dark: #A3ADB8;
  --accent-ink-light: #6D3FE0;
  --accent-ink-dark: #B597FF;

  --sidebar-w: 260px;
  --topbar-h: 72px;
  --tabbar-h: 60px;
  --footer-h: 44px;
  --gutter: 16px;

  color-scheme: light;
  --bg-base: #F1F5F9;
  --bg-elevated: #FFFFFF;
  --surface: #FFFFFF;
  --surface-hover: #F8FAFC;
  --fill: #F8FAFC;
  --fill-strong: #F1F5F9;
  --fill-stronger: #E2E8F0;
  --border: rgba(15, 23, 42, .10);
  --border-strong: rgba(15, 23, 42, .18);
  --text: #0F172A;
  --text-2: #1E293B;
  --text-3: #475569;
  --placeholder: #5B6779;
  --ink: var(--brand-ink-light);
  --accent-ink: var(--accent-ink-light);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .07);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .10);

  --ok-bg: #D1FAE5; --ok-fg: #047857; --ok-line: rgba(4, 120, 87, .22);
  --warn-bg: #FEF3C7; --warn-fg: #92400E; --warn-line: rgba(146, 64, 14, .22);
  --danger-bg: #FEE2E2; --danger-fg: #B91C1C; --danger-line: rgba(185, 28, 28, .22);
  --violet-bg: #EDE9FE; --violet-fg: #6D28D9;
  --info-bg: color-mix(in srgb, var(--brand-primary) 9%, #FFFFFF);
  --bubble-client: #F1F5F9;
  --bubble-bot: color-mix(in srgb, var(--brand-accent) 11%, #FFFFFF);
  --code-bg: #F1F5F9;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230F172A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
@media (min-width: 768px) { :root { --gutter: 5vw; } }

/* ---------- Tokens: oscuro ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-base: #000000;
  --bg-elevated: #0A0A0A;
  --surface: rgba(255, 255, 255, .04);
  --surface-hover: rgba(255, 255, 255, .07);
  --fill: rgba(255, 255, 255, .05);
  --fill-strong: rgba(255, 255, 255, .08);
  --fill-stronger: rgba(255, 255, 255, .12);
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .14);
  --text: #F8FAFC;
  --text-2: #A3ADBD;
  --text-3: #8B94A3;
  --placeholder: #8B94A3;
  --ink: var(--brand-ink-dark);
  --accent-ink: var(--accent-ink-dark);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .4);

  --ok-bg: rgba(16, 185, 129, .15); --ok-fg: #34D399; --ok-line: rgba(16, 185, 129, .3);
  --warn-bg: rgba(245, 158, 11, .15); --warn-fg: #FBBF24; --warn-line: rgba(245, 158, 11, .3);
  --danger-bg: rgba(239, 68, 68, .15); --danger-fg: #F87171; --danger-line: rgba(239, 68, 68, .3);
  --violet-bg: rgba(139, 92, 246, .15); --violet-fg: #B49CFF;
  --info-bg: color-mix(in srgb, var(--brand-primary-strong) 30%, transparent);
  --bubble-client: rgba(255, 255, 255, .08);
  --bubble-bot: color-mix(in srgb, var(--brand-primary-strong) 32%, #0A0A0A);
  --code-bg: rgba(0, 0, 0, .45);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A3ADBD' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg-base); color: var(--text); font: 400 .9375rem/1.6 var(--font); letter-spacing: -.011em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-wrap: anywhere; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; color: var(--text); }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--brand-primary) 25%, transparent); color: var(--text); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
code, pre, kbd { font-family: var(--mono); font-size: .8125rem; }
small { color: var(--text-3); font-size: .8125rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.icon { width: 1em; height: 1em; flex: none; }
@media (max-width: 639px) { .hide-sm { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--text); color: var(--bg-elevated); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 8px; }
.muted { color: var(--text-3); }
.container { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 860px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; font: 600 .875rem/1.25 var(--font); letter-spacing: -.005em; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .2s, border-color .2s, filter .2s, transform .15s; }
.btn .icon { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(to right, var(--brand-primary), var(--brand-primary-strong)); color: var(--brand-foreground); box-shadow: 0 10px 18px -8px color-mix(in srgb, var(--brand-primary) 45%, transparent); }
.btn--primary:hover { filter: brightness(1.12); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--fill-strong); }
.btn--light { background: #FFFFFF; color: #0F172A; }
.btn--danger { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-line); }
.btn--danger:hover { filter: saturate(1.3); }
.btn--small { min-height: 32px; padding: 5px 12px; font-size: .8125rem; }
.btn--big { min-height: 48px; padding: 12px 24px; font-size: .9375rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none; transition: background-color .2s, color .2s; }
.icon-btn:hover { background: var(--fill-strong); color: var(--text); }
.icon-btn .icon { width: 16px; height: 16px; }
.icon-btn--danger:hover { background: var(--danger-bg); color: var(--danger-fg); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--ink); font: 600 .875rem/1.4 var(--font); text-decoration: none; cursor: pointer; }
.link-btn .icon { width: 16px; height: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 16px; }
.field > label, .field__label { display: block; margin-bottom: 6px; font-size: .8125rem; font-weight: 500; color: var(--text-2); }
.field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .field select, .field textarea, .input {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--fill); color: var(--text); font: 400 .875rem/1.5 var(--font); transition: border-color .2s, box-shadow .2s, background-color .2s; }
.field textarea, textarea.input { min-height: 120px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: var(--placeholder); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 16%, transparent); }
select { appearance: none; background-image: var(--chevron) !important; background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 14px !important; padding-right: 36px !important; cursor: pointer; }
.field input[type=color] { width: 64px; height: 44px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--fill); cursor: pointer; }
.field input[type=file] { width: 100%; padding: 10px; border: 1px dashed var(--border-strong); border-radius: 8px; background: var(--fill); color: var(--text-2); font: 400 .875rem var(--font); }
.field input[type=file]::file-selector-button { margin-right: 12px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: 600 .8125rem var(--font); cursor: pointer; }
.field input[type=time], .field input[type=number] { font-variant-numeric: tabular-nums; }
.field--check label { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; font-weight: 400; color: var(--text-2); }
.field--check input, input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--brand-primary); }
[data-theme="dark"] input[type=checkbox] { accent-color: var(--ink); }
.field__hint { margin: 6px 0 0; font-size: .75rem; line-height: 1.5; color: var(--text-3); }
.field__hint--error { color: var(--danger-fg); font-weight: 600; }
[aria-invalid=true] { border-color: var(--danger-fg) !important; }
.form-row { display: grid; gap: 0 16px; }
@media (min-width: 700px) { .form-row { grid-template-columns: 1fr 1fr; } }
.card { container-type: inline-size; }
@container (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.form-narrow { max-width: 560px; }
.form-mid { max-width: 720px; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.field .input-icon input { padding-left: 40px !important; }

/* ---------- Avisos ---------- */
.flash, .notice, .draft-note { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 20px; padding: 12px 16px 12px 44px; border: 1px solid var(--ok-line); border-radius: 12px; background: var(--ok-bg); color: var(--text); font-size: .875rem; line-height: 1.5; }
.flash::before, .notice::before, .draft-note::before { content: ""; position: absolute; left: 16px; top: 14px; width: 18px; height: 18px; background: var(--ok-fg); -webkit-mask: var(--mask) center / contain no-repeat; mask: var(--mask) center / contain no-repeat;
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
.flash--error, .flash[role=alert] { border-color: var(--danger-line); background: var(--danger-bg); }
.flash--error::before, .flash[role=alert]::before { background: var(--danger-fg); --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E"); }
.notice, .draft-note { border-color: var(--warn-line); background: var(--warn-bg); justify-content: space-between; }
.notice::before, .draft-note::before { background: var(--warn-fg); --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.flash p, .notice p { margin: 0; }
.flash a, .notice a { color: inherit; font-weight: 600; }
mark.pendiente { background: var(--warn-bg); color: var(--warn-fg); padding: 0 4px; border-radius: 4px; }

/* ---------- Etiquetas ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px; font-size: .6875rem; font-weight: 600; line-height: 1.5; letter-spacing: 0; white-space: nowrap; background: var(--fill-strong); color: var(--text-2); }
.badge .icon { width: 12px; height: 12px; }
.badge--wa, .badge--ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge--web { background: var(--info-bg); color: var(--ink); }
.badge--human { background: var(--warn-bg); color: var(--warn-fg); }
.badge--alert { background: var(--danger-bg); color: var(--danger-fg); }
.badge--violet { background: var(--violet-bg); color: var(--violet-fg); }
.tag { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: .625rem; font-weight: 700; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; background: var(--violet-bg); color: var(--violet-fg); }
.dot { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; background: #10B981; }
.dot--off { background: #94A3B8; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; color: var(--ok-fg); }

/* ---------- Tarjetas ---------- */
.card, .box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--shadow-sm); }
.box { margin-bottom: 20px; }
.card > :last-child, .box > :last-child { margin-bottom: 0; }
.card__title, .box h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 1rem; font-weight: 650; letter-spacing: -.01em; }
.card__title .icon { width: 18px; height: 18px; color: var(--ink); }
.card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card__head h2 { margin: 0; font-size: 1.0625rem; font-weight: 650; }
.card__head p { margin: 2px 0 0; font-size: .8125rem; color: var(--text-3); }
.card__sub { font-size: .875rem; color: var(--text-2); }
.tile { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--info-bg); color: var(--ink); }
.tile .icon { width: 22px; height: 22px; }
.tile--ok { background: var(--ok-bg); color: var(--ok-fg); }
.tile--violet { background: var(--violet-bg); color: var(--violet-fg); }
.tile--sm { width: 40px; height: 40px; border-radius: 10px; }
.tile--sm .icon { width: 18px; height: 18px; }
.stack { display: grid; gap: 20px; align-content: start; }
.divider { margin: 20px 0; border-top: 1px solid var(--border); }

.snippet { position: relative; display: block; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--code-bg); color: var(--text); font: 400 .75rem/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; }
code:not(.snippet) { padding: 1px 5px; border-radius: 4px; background: var(--fill-strong); color: var(--text); }
pre { white-space: pre-wrap; }
.transcript { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; font: 400 .875rem/1.6 var(--font); }

/* ---------- Tablas ---------- */
.table-wrap { position: relative; overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; overflow-wrap: normal; }
td, tbody th { white-space: nowrap; }
td.td-wrap { min-width: 260px; white-space: normal; }
th, td { padding: 14px 20px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
thead th { padding-block: 13px; background: var(--bg-elevated); font-size: .75rem; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: var(--surface-hover); }
tbody th { font-weight: 600; }
td small { display: block; margin-top: 2px; }
.td-strong { font-weight: 600; color: var(--text); }
.td-actions { width: 1%; white-space: nowrap; text-align: right; }
.td-actions form { margin: 0; display: inline; }
.t-num { font-variant-numeric: tabular-nums; }

/* ---------- Estados vacíos ---------- */
.empty { padding: 48px 24px; text-align: center; }
.empty > .icon { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--text-3); }
.empty h2, .empty h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 650; }
.empty p { margin: 0 auto; max-width: 42ch; font-size: .875rem; color: var(--text-3); }
.empty .btn { margin-top: 20px; }

/* =====================================================================================
   Panel: barra lateral, cabecera, contenido, navegación móvil
   ===================================================================================== */
.app { min-height: 100vh; }
.app-main { display: flex; flex-direction: column; min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .app-main { margin-left: var(--sidebar-w); padding-bottom: 0; } }

.sidebar { display: none; }
@media (min-width: 1024px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; width: var(--sidebar-w); background: var(--brand-primary); color: var(--brand-foreground); border-right: 1px solid color-mix(in srgb, var(--brand-foreground) 10%, transparent); }
}
.sidebar a { color: inherit; }
.sidebar__brand { display: flex; align-items: center; gap: 10px; min-height: var(--topbar-h); padding: 18px 20px; border-bottom: 1px solid color-mix(in srgb, var(--brand-foreground) 12%, transparent); font-weight: 800; font-size: 1.125rem; letter-spacing: -.025em; text-decoration: none; }
.sidebar__brand img { width: 36px; height: 36px; border-radius: 10px; }
.sidebar__brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 12px; }
.sidebar__foot { padding: 12px; border-top: 1px solid color-mix(in srgb, var(--brand-foreground) 12%, transparent); }
.nav-group { display: grid; gap: 2px; }
.nav-group form { margin: 0; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--brand-foreground); font: 500 .875rem/1.25 var(--font); letter-spacing: -.01em; text-align: left; text-decoration: none; cursor: pointer; transition: background-color .15s; }
.nav-item .icon { width: 16px; height: 16px; }
.nav-item:hover { background: color-mix(in srgb, var(--brand-foreground) 8%, transparent); }
.nav-item[aria-current=page] { background: color-mix(in srgb, var(--brand-foreground) 14%, transparent); font-weight: 600; }
.nav-item[aria-current=page]::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 20px; translate: 0 -50%; border-radius: 0 3px 3px 0; background: color-mix(in srgb, var(--brand-accent) 55%, var(--brand-foreground)); }
.nav-item:focus-visible { outline-color: var(--brand-foreground); }
.nav-item--out:hover { background: rgba(239, 68, 68, .14); }
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--brand-foreground) 18%, transparent); font-size: .6875rem; font-weight: 600; text-align: center; }
.nav-count--alert { background: #EF4444; color: #FFFFFF; }
.bot-chip { margin: 16px 0 10px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--brand-foreground) 8%, transparent); border: 1px solid color-mix(in srgb, var(--brand-foreground) 20%, transparent); }
.bot-chip__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.bot-chip .tag { background: color-mix(in srgb, var(--brand-foreground) 16%, transparent); color: var(--brand-foreground); }
.bot-chip__switch { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: color-mix(in srgb, var(--brand-foreground) 75%, transparent); }
.bot-chip__switch:hover { background: color-mix(in srgb, var(--brand-foreground) 12%, transparent); color: var(--brand-foreground); }
.bot-chip__switch .icon { width: 14px; height: 14px; }
.bot-chip__name { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 650; text-decoration: none; }
.bot-chip__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-chip__name:hover span { text-decoration: underline; text-underline-offset: 3px; }
.bot-chip .dot { box-shadow: 0 0 0 3px rgba(16, 185, 129, .25); }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--topbar-h); padding: 0 var(--gutter); background: color-mix(in srgb, var(--bg-base) 88%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
@media (min-width: 1024px) { .topbar { padding-inline: 32px; } }
.topbar__title { margin: 0; overflow: hidden; font-size: 1rem; font-weight: 650; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.topbar__end { display: flex; align-items: center; gap: 8px; flex: none; }
.operating { display: none; align-items: center; gap: 8px; min-width: 0; padding: 6px 10px 6px 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--brand-accent) 35%, transparent); background: color-mix(in srgb, var(--brand-accent) 8%, transparent); font-size: .75rem; }
@media (min-width: 900px) { .operating { display: flex; } }
.operating__label { font-size: .625rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.operating__name { max-width: 180px; overflow: hidden; font-weight: 650; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.operating .badge { background: var(--surface); color: var(--accent-ink); border: 1px solid var(--border); }
.operating__switch { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--text-3); }
.operating__switch:hover { background: var(--fill-strong); color: var(--text); }
.operating__switch .icon { width: 13px; height: 13px; }
.theme-toggle .icon--moon, [data-theme="dark"] .theme-toggle .icon--sun { display: none; }
[data-theme="dark"] .theme-toggle .icon--moon { display: block; }

.user-btn { display: flex; align-items: center; gap: 10px; max-width: 260px; padding: 4px 6px 4px 4px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.user-btn:hover { background: var(--fill-strong); }
.user-btn > .icon { width: 14px; height: 14px; color: var(--text-3); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-strong)); color: var(--brand-foreground); font-size: .75rem; font-weight: 700; letter-spacing: 0; }
.avatar--round { border-radius: 50%; }
.avatar--lg { width: 40px; height: 40px; font-size: .875rem; }
.user-btn__text { display: none; min-width: 0; line-height: 1.25; }
@media (min-width: 640px) { .user-btn__text { display: grid; } }
.user-btn__text strong { overflow: hidden; font-size: .75rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-btn__text small { overflow: hidden; font-size: .6875rem; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }

[popover] { color: var(--text); }
.menu { position: fixed; inset: calc(var(--topbar-h) - 6px) var(--gutter) auto auto; margin: 0; width: 220px; padding: 4px 0; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-elevated); box-shadow: var(--shadow-lg); }
@media (min-width: 1024px) { .menu { right: 32px; } }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border: 0; background: none; color: var(--text-2); font: 500 .875rem/1.3 var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--fill-strong); color: var(--text); }
.menu .icon { width: 16px; height: 16px; }
.menu form { margin: 0; }
.menu hr { margin: 4px 0; }
.menu__danger { color: var(--danger-fg) !important; }

.content { flex: 1; width: 100%; padding: 24px var(--gutter) 40px; }
@media (min-width: 1024px) { .content { padding-block: 40px 48px; } }
.content--flush { padding: 0; }
.app-footer { display: flex; align-items: center; justify-content: center; min-height: var(--footer-h); padding: 0 var(--gutter); border-top: 1px solid var(--border); }
.app-footer .site-credit { padding: 0; border: 0; }

.tabbar { position: fixed; inset: auto 0 0 0; z-index: 40; display: flex; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--border-strong); background: var(--bg-elevated); }
@media (min-width: 1024px) { .tabbar { display: none; } }
.tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; height: var(--tabbar-h); padding: 6px 2px; border: 0; background: none; color: var(--text-2); font: 500 .6875rem/1.2 var(--font); text-decoration: none; cursor: pointer; }
.tabbar .icon { width: 20px; height: 20px; }
.tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar [aria-current=page] { color: var(--ink); font-weight: 650; }
.sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: 85vh; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; border: 0; border-top: 1px solid var(--border-strong); border-radius: 24px 24px 0 0; background: var(--bg-elevated); }
.sheet::backdrop { background: rgba(0, 0, 0, .5); }
.sheet__handle { width: 40px; height: 4px; margin: 12px auto 16px; border-radius: 2px; background: var(--border-strong); }
.sheet__label { margin: 0 0 4px; font-size: .625rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.sheet__bot { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-weight: 650; }
.sheet__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.sheet__grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: .75rem; font-weight: 550; text-align: center; text-decoration: none; }
.sheet__grid .icon { width: 20px; height: 20px; color: var(--text-2); }
.sheet__grid [aria-current=page] { border-color: var(--ink); color: var(--ink); }
.sheet__wide { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: 550 .875rem var(--font); text-decoration: none; cursor: pointer; }
.sheet__wide .icon { width: 16px; height: 16px; }
.sheet form { margin: 0; }

/* ---------- Cabecera de página ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: clamp(1.375rem, 1.2rem + .6vw, 1.625rem); font-weight: 700; letter-spacing: -.025em; }
.page-head p { margin: 4px 0 0; max-width: 70ch; font-size: .875rem; color: var(--text-2); }
.page-head .actions { flex: none; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--text-3); font-size: .8125rem; font-weight: 550; text-decoration: none; }
.back:hover { color: var(--text); }
.back .icon { width: 14px; height: 14px; }
.content > h1 { font-size: clamp(1.375rem, 1.2rem + .6vw, 1.625rem); font-weight: 700; letter-spacing: -.025em; }
.content > h2 { margin-top: 28px; font-size: 1.0625rem; font-weight: 650; }
.content > ul { padding-left: 20px; color: var(--text-2); }
.content > ul li { margin-bottom: 4px; }

.grid-2 { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1100px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.grid-side { display: grid; gap: 24px; align-items: start; }
@media (min-width: 1100px) { .grid-side { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); } }

/* ---------- Asistentes (tarjetas) ---------- */
.bot-grid { display: grid; gap: 20px; }
@media (min-width: 768px) { .bot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .bot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bot-card { display: flex; flex-direction: column; height: 100%; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s, border-color .25s; }
.bot-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ink) 30%, transparent); box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--brand-primary) 30%, transparent); }
.bot-card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.bot-card__name { margin: 0; overflow: hidden; font-size: 1.0625rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.bot-card__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bot-card .status { margin-left: auto; }
.bot-card__foot { display: flex; align-items: center; gap: 16px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); font-size: .8125rem; color: var(--text-2); }
.bot-card__foot span { display: inline-flex; align-items: center; gap: 6px; }
.bot-card__foot .icon { width: 15px; height: 15px; }
.bot-card__body { margin: 14px 0 18px; font-size: .875rem; color: var(--text-2); }
.bot-new { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 180px; padding: 24px; border: 1.5px dashed var(--border-strong); border-radius: 16px; background: none; color: var(--text-2); font: 600 .875rem var(--font); cursor: pointer; }
.bot-new:hover { border-color: var(--ink); color: var(--ink); }
.bot-new .icon { width: 22px; height: 22px; }

/* ---------- Bandeja ---------- */
.inbox-split { display: flex; height: calc(100dvh - var(--topbar-h) - var(--footer-h) - var(--tabbar-h) - env(safe-area-inset-bottom)); min-height: 420px; }
@media (min-width: 1024px) { .inbox-split { height: calc(100dvh - var(--topbar-h) - var(--footer-h)); } }
.inbox-list { display: flex; flex-direction: column; width: 100%; min-width: 0; border-right: 1px solid var(--border); }
@media (min-width: 1024px) { .inbox-list { width: 360px; flex: none; } }
@media (min-width: 1280px) { .inbox-list { width: 400px; } }
.inbox-pane { display: none; flex: 1; min-width: 0; flex-direction: column; background: var(--bg-elevated); }
@media (min-width: 1024px) { .inbox-pane { display: flex; } }
.inbox-split--open .inbox-list { display: none; }
.inbox-split--open .inbox-pane { display: flex; }
@media (min-width: 1024px) { .inbox-split--open .inbox-list { display: flex; } }
.inbox-tools { display: grid; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.inbox-tools p { margin: 0; font-size: .75rem; color: var(--text-3); }
.inbox-tools strong { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid transparent; border-radius: 6px; color: var(--text-2); font-size: .75rem; font-weight: 550; text-decoration: none; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-current=page] { background: var(--info-bg); border-color: color-mix(in srgb, var(--ink) 30%, transparent); color: var(--ink); }
.chip .nav-count { background: var(--danger-bg); color: var(--danger-fg); }
.inbox { flex: 1; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.inbox a { position: relative; display: flex; gap: 12px; align-items: flex-start; min-height: 72px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.inbox a:hover { background: var(--surface-hover); }
.inbox a[aria-current=page] { background: var(--fill-strong); }
.inbox a[aria-current=page]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--brand-accent); }
.inbox .avatar { margin-top: 2px; }
.inbox__main { flex: 1; min-width: 0; }
.inbox__top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.inbox__who { overflow: hidden; font-size: .875rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.inbox__last { display: block; margin-top: 2px; overflow: hidden; font-size: .8125rem; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
.inbox__side { flex: none; display: grid; justify-items: end; gap: 4px; font-size: .6875rem; color: var(--text-3); }
.inbox__state { font-weight: 600; color: var(--ok-fg); }
.inbox__state--human { color: var(--warn-fg); }
.inbox__state--alert { color: var(--danger-fg); }
.inbox-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; color: var(--text-3); }
.inbox-empty .icon { width: 44px; height: 44px; margin-bottom: 12px; }
.inbox-empty p { margin: 0; max-width: 36ch; font-size: .875rem; }

.conv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.conv-head__who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.conv-head__who > div { min-width: 0; }
.conv-head h1 { margin: 0; overflow: hidden; font-size: 1rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.conv-head p { margin: 2px 0 0; overflow: hidden; font-size: .75rem; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
.conv-head form { margin: 0; flex: none; }
.conv-back { flex: none; }
@media (min-width: 1024px) { .conv-back { display: none; } }
@media (max-width: 639px) { .conv-head { padding: 12px 16px; } .conv-head .btn span { display: none; } }
.conv-pane-flash { padding: 12px 24px 0; }
.conv-pane-flash .flash, .conv-pane-flash .notice { margin: 0; }

.thread { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 0; padding: 24px; overflow-y: auto; }
@media (max-width: 639px) { .thread { padding: 16px 12px; } }
.msg { max-width: min(78%, 680px); margin: 0; padding: 10px 16px; border-radius: 16px; font-size: .875rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--user { align-self: flex-start; background: var(--bubble-client); color: var(--text); border-top-left-radius: 4px; }
.msg--bot { align-self: flex-end; background: var(--bubble-bot); color: var(--text); border-top-right-radius: 4px; }
.msg--agent { align-self: flex-end; background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-strong)); color: var(--brand-foreground); border-top-right-radius: 4px; }
.msg__meta { display: block; margin-top: 4px; font-size: .6875rem; color: var(--text-3); white-space: normal; }
.msg--agent .msg__meta { color: inherit; opacity: .85; }
.composer { display: grid; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom) * 0); border-top: 1px solid var(--border); background: var(--bg-elevated); }
.composer__row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 160px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--fill); color: var(--text); font: 400 .875rem/1.5 var(--font); resize: vertical; }
.composer textarea::placeholder { color: var(--placeholder); }
.composer textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 16%, transparent); }
.composer .btn { min-height: 44px; }
.composer__hint { margin: 0; font-size: .75rem; color: var(--text-3); }
.composer-closed { margin: 12px 16px; }

.checklist { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: paso; }
.checklist li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--fill); font-size: .875rem; color: var(--text-2); }
.checklist__n { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--info-bg); color: var(--ink); font-size: .8125rem; font-weight: 700; }
.checklist__n--done { background: var(--ok-bg); color: var(--ok-fg); }
.checklist__n .icon { width: 16px; height: 16px; }
.checklist strong { display: block; color: var(--text); }

/* ---------- Conocimiento ---------- */
.kb-add h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: .875rem; font-weight: 650; }
.kb-add h3 .icon { width: 16px; height: 16px; color: var(--ink); }
.kb-add form { margin: 0; }
.kb-add .divider { margin: 22px 0; }
.kb-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.kb-list__title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; font-size: .9375rem; font-weight: 650; }
.kb-list__title small { font-weight: 500; }
.doc { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.doc__body { flex: 1; min-width: 0; }
.doc__title { margin: 0; font-size: .9375rem; font-weight: 550; color: var(--text); }
.doc__url { display: block; margin-top: 2px; overflow: hidden; font-size: .75rem; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
.doc__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: .75rem; color: var(--text-3); }
.doc form { margin: 0; }
progress.meter { display: block; width: 100%; height: 6px; margin-top: 10px; overflow: hidden; border: 0; border-radius: 3px; background: var(--fill-stronger); -webkit-appearance: none; appearance: none; }
progress.meter::-webkit-progress-bar { background: var(--fill-stronger); border-radius: 3px; }
progress.meter::-webkit-progress-value { background: linear-gradient(to right, var(--brand-primary-strong), var(--brand-accent)); border-radius: 3px; }
progress.meter::-moz-progress-bar { background: linear-gradient(to right, var(--brand-primary-strong), var(--brand-accent)); border-radius: 3px; }

/* ---------- Ayuda ---------- */
.help-hero { margin: 8px auto 28px; max-width: 720px; text-align: center; }
.help-hero .tile { margin: 0 auto 16px; width: 52px; height: 52px; }
.help-hero h1 { margin: 0 0 8px; font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem); font-weight: 750; letter-spacing: -.03em; }
.help-hero p { margin: 0; font-size: .9375rem; color: var(--text-2); }
.help-wrap { display: grid; gap: 20px; max-width: 860px; margin: 0 auto; }
.help-chat { padding: 0; overflow: hidden; }
.help-thread { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; padding: 20px 24px; overflow-y: auto; border-bottom: 1px solid var(--border); }
.help-thread .msg--user { align-self: flex-end; background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-strong)); color: var(--brand-foreground); border-radius: 16px; border-top-right-radius: 4px; }
.help-thread .msg--bot { align-self: flex-start; background: var(--bubble-client); border-radius: 16px; border-top-left-radius: 4px; }
.help-chat .composer { border-top: 0; background: none; padding: 16px 20px; }
.help-chat__intro { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.help-chat__intro p { margin: 0; font-size: .8125rem; color: var(--text-3); }
.help-chat__intro strong { display: block; font-size: .9375rem; color: var(--text); }

/* ---------- Cuenta ---------- */
.kv { display: grid; margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.plans-line { margin: 16px 0 0; font-size: .8125rem; color: var(--text-3); }

/* ---------- Reservas ---------- */
.hours-table td { white-space: nowrap; }
.hours-table input[type=time] { width: auto !important; min-height: 38px !important; padding: 6px 8px !important; }
.hours-table td span { margin: 0 6px; color: var(--text-3); }
.service-row { display: grid; gap: 0 12px; align-items: end; padding: 16px 0; border-bottom: 1px solid var(--border); }
.service-row:first-of-type { padding-top: 0; }
@media (min-width: 900px) { .service-row { grid-template-columns: minmax(0, 2fr) 120px 140px auto; } }
.service-row .field { margin-bottom: 12px; }
.service-row__end { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 44px; }
.service-row + .card__title { margin-top: 20px; }
.hours-table { max-width: 720px; }
.service-row__end label { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--text-2); }

/* =====================================================================================
   Cuentas (layout mínimo: entrar, alta, contraseña, superadmin, errores)
   ===================================================================================== */
.layout-minimal { position: relative; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
.layout-minimal::before, .layout-minimal::after { content: ""; position: fixed; z-index: 0; border-radius: 50%; pointer-events: none; filter: blur(110px); }
.layout-minimal::before { top: -12%; left: -10%; width: 520px; height: 520px; background: radial-gradient(circle, color-mix(in srgb, var(--brand-primary-strong) 70%, #3B82F6) 0%, transparent 70%); opacity: .22; }
.layout-minimal::after { right: -6%; bottom: -8%; width: 420px; height: 420px; background: radial-gradient(circle, var(--brand-accent) 0%, transparent 70%); opacity: .16; }
.minimal { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 460px; margin: 0 auto; padding: 40px 16px; }
.minimal__card { padding: 28px 24px; border-radius: 16px; box-shadow: 0 25px 50px -12px color-mix(in srgb, var(--brand-primary) 18%, transparent); }
@media (min-width: 560px) { .minimal__card { padding: 32px; } }
.minimal__brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 28px; color: var(--text); text-decoration: none; }
.minimal__brand span { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.minimal__brand img { width: 40px; height: 40px; border-radius: 10px; }
.minimal__brand small { font-size: .875rem; color: var(--text-3); }
.minimal__card h1 { margin-bottom: 6px; font-size: 1.375rem; font-weight: 700; text-align: center; }
.minimal__card h1 + p, .minimal__card .lead { margin-bottom: 20px; font-size: .875rem; color: var(--text-2); text-align: center; }
.minimal__card form { margin-top: 16px; }
.minimal__card .btn--block { min-height: 48px; margin-top: 4px; font-size: .9375rem; }
.minimal__alt, .minimal__links { margin: 20px 0 0; font-size: .875rem; color: var(--text-2); text-align: center; }
.minimal__links p { margin: 0 0 6px; }
.minimal__links a, .minimal__alt a { font-weight: 600; }
.minimal__footer { position: relative; z-index: 1; padding: 16px 0 24px; }
.note { margin-top: 16px; font-size: .8125rem; color: var(--text-3); }
.qr img { margin: 0 auto 12px; border-radius: 8px; background: #FFFFFF; padding: 8px; }

/* =====================================================================================
   Sitio público (siempre en claro)
   ===================================================================================== */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg-elevated) 86%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.125rem; letter-spacing: -.025em; }
.brand img { border-radius: 9px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav__link { display: none; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-size: .875rem; font-weight: 550; text-decoration: none; }
.site-nav__link:hover { background: var(--fill-strong); color: var(--text); }
.site-nav__link--login { display: inline-flex; }
@media (min-width: 900px) { .site-nav__link { display: inline-flex; } }
@media (max-width: 420px) { .site-header .brand span { font-size: 1rem; } .site-header .btn--small { padding-inline: 10px; } }

.hero { position: relative; overflow: hidden; padding: 56px 0 64px; background: radial-gradient(55% 70% at 88% 8%, color-mix(in srgb, var(--brand-accent) 16%, transparent), transparent 70%), radial-gradient(50% 60% at 0% 100%, color-mix(in srgb, var(--brand-primary-strong) 16%, transparent), transparent 70%); }
.hero__grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 1024px) { .hero { padding: 96px 0 104px; } .hero__grid { grid-template-columns: 1.1fr .9fr; gap: 64px; } }
.eyebrow, .kicker { display: inline-block; margin: 0 0 14px; padding: 4px 10px; border-radius: 999px; background: var(--violet-bg); color: var(--violet-fg); font-size: .8125rem; font-weight: 650; }
.hero h1 { font-size: clamp(2.2rem, 1.3rem + 4vw, 4.2rem); line-height: 1.04; letter-spacing: -.04em; font-weight: 800; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--brand-ink-light), var(--accent-ink-light)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { max-width: 36em; font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); color: var(--text-2); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__note { margin-top: 16px; font-size: .875rem; color: var(--text-3); }
.chatmock { width: min(400px, 100%); margin-inline: auto; overflow: hidden; border-radius: 16px; background: #FFFFFF; box-shadow: 0 8px 32px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .05); }
.chatmock__head { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 16px; background: linear-gradient(135deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 60%, var(--brand-accent))); color: var(--brand-foreground); }
.chatmock__head small { display: flex; align-items: center; gap: 6px; color: inherit; opacity: .85; font-size: .75rem; }
.chatmock__head small::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #10B981; }
.chatmock__dot { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--brand-foreground) 20%, transparent); }
.chatmock__body { display: flex; flex-direction: column; gap: 8px; min-height: 280px; padding: 16px; background: #F8FAFC; }
.chatmock .msg { max-width: 82%; padding: 10px 14px; color: #1E293B; }
.chatmock .msg--user { align-self: flex-end; background: linear-gradient(135deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 60%, var(--brand-accent))); color: var(--brand-foreground); border-radius: 16px 16px 4px 16px; }
.chatmock .msg--bot { align-self: flex-start; background: #FFFFFF; border-radius: 16px 16px 16px 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.chatmock__foot { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 12px 0 16px; border-top: 1px solid #E2E8F0; color: #64748B; font-size: .875rem; }
.chatmock__foot b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 60%, var(--brand-accent))); color: var(--brand-foreground); }

.section { padding: 72px 0; }
.section--tint { background: var(--bg-elevated); border-block: 1px solid var(--border); }
.section__title { max-width: 22em; font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); font-weight: 750; letter-spacing: -.035em; }
.section__lead { max-width: 44em; font-size: 1.0625rem; color: var(--text-2); }
.section__note { margin-top: 20px; font-size: .875rem; color: var(--text-3); }
.steps { display: grid; gap: 16px; margin: 32px 0 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.steps li, .bento__item, .plan { padding: 26px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.steps__n { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-strong)); color: var(--brand-foreground); font-weight: 800; }
.steps h3, .bento h3 { font-size: 1.1875rem; font-weight: 700; }
.steps p, .bento p { margin: 0; color: var(--text-2); }
.bento { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 900px) { .bento { grid-template-columns: repeat(3, 1fr); } .bento__item--wide { grid-column: span 2; } }
.section--tint .bento__item, .section--tint .faq details { background: var(--bg-base); box-shadow: none; }
.bento__item--wide { background: linear-gradient(135deg, var(--info-bg), var(--surface)) !important; }
.plans { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.plan { display: flex; flex-direction: column; }
.plan--featured { border: 2px solid var(--brand-accent); box-shadow: 0 20px 40px -20px color-mix(in srgb, var(--brand-accent) 45%, transparent); }
.plan__name { margin-bottom: 4px; font-size: 1.1875rem; font-weight: 700; }
.plan__price { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.plan .btn { margin-top: auto; }
.ticks { display: grid; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.ticks li { position: relative; padding-left: 26px; color: var(--text-2); font-size: .9375rem; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok-fg); font-weight: 800; }
.faq { display: grid; gap: 10px; margin-top: 24px; }
.faq details { padding: 0 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.faq summary { min-height: 44px; padding: 16px 0; font-weight: 600; cursor: pointer; }
.faq details p { color: var(--text-2); }
.cta { padding: 72px 0; background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-strong)); color: var(--brand-foreground); text-align: center; }
.cta h2 { max-width: 22em; margin: 0 auto 24px; color: inherit; font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); font-weight: 750; }
.page-hero { padding: 48px 0 24px; }
.page-hero h1, .page-legal .page-head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); font-weight: 800; }
.page-legal .page-head { display: block; padding: 48px 0 16px; margin: 0; }
.prose { max-width: 860px; padding-bottom: 64px; }
.prose h2 { margin-top: 1.8em; font-size: 1.3125rem; font-weight: 700; }
.prose li { margin-bottom: .35em; }
.prose p, .prose li { color: var(--text-2); }

.site-footer { padding: 48px 0 20px; background: var(--brand-primary); color: color-mix(in srgb, var(--brand-foreground) 82%, transparent); }
.site-footer a { color: var(--brand-foreground); }
.footer-grid { display: grid; gap: 28px; padding-bottom: 28px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-foreground); }
.site-footer ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.footer-brand .brand { margin-bottom: 10px; color: var(--brand-foreground); }
.site-credit { margin: 0; padding: 16px var(--gutter) 0; font-size: .8125rem; color: var(--text-3); text-align: center; border-top: 1px solid var(--border); }
.site-footer .site-credit { color: color-mix(in srgb, var(--brand-foreground) 82%, transparent); border-top-color: color-mix(in srgb, var(--brand-foreground) 15%, transparent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
