/* ==========================================================================
   Hollys Chats — hoja de estilos base
   Familia visual de Hollys Loyalty (/root/hostinger/proyectos/loyalty/docs/DESIGN.md):
   mismos nombres de tokens, misma fuente (Geist local), botones pill, cajas sin borde
   separadas por tono, chips pill, nav inferior flotante, barra lateral tipo admin.
   Propio de esta app: chips de estado del contacto, lista de contactos, "Revisar ahora",
   conversación (burbujas), recordatorios y pantalla de QR.
   Sistema completo en docs/DESIGN.md. CSS vanilla, sin CDNs.
   Tema: automático (prefers-color-scheme) o forzado con <html data-theme="light|dark">.
   Íconos: sprite Phosphor en /assets/icons.svg  →  <svg class="ico"><use href="/assets/icons.svg#i-bell"/></svg>
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../vendor/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../vendor/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ---------- 1. Tokens (claro) ---------- */
:root {
  /* Marca de Hollys Chats: verde sobrio (recuerda a WhatsApp sin copiar #25D366) */
  --brand:       #1C7350;
  --brand-ink:   #FFFFFF;
  --surface:     #FFFFFF;
  --brand-soft:  color-mix(in oklab, var(--brand) 10%, var(--surface));
  --brand-deep:  color-mix(in oklab, var(--brand) 86%, #000);
  --brand-text:  #155C40;   /* texto verde sobre --surface o --brand-soft (AA) */

  /* Neutros: idénticos a Loyalty */
  --canvas:     #F7F6F3;
  --canvas-2:   #FAFAFA;
  --surface-2:  #F2F1EE;
  --surface-3:  #E9E8E4;
  --ink:        #111111;
  --ink-2:      #4D4C48;
  --muted:      #787774;   /* solo metadatos no esenciales (4.2:1 sobre canvas) */
  --line:       #EBEBEB;
  --line-strong:#D6D5D1;
  --primary:    #171717;
  --primary-ink:#FFFFFF;
  --primary-hover: #333333;
  --focus:      color-mix(in oklab, var(--brand) 55%, #2F6FEB);

  --ok: #1E7E3B;     --ok-soft: #EDF3EC;
  --warn: #956400;   --warn-soft: #FBF3DB;
  --danger: #C62828; --danger-soft: #FDEBEC;
  --info: #1F6C9F;   --info-soft: #E1F3FE;

  /* Estados del contacto (propio de esta app): fondo · texto · punto */
  --st-prospecto-bg: #E4EEFB;  --st-prospecto-tx: #1F5FA8;  --st-prospecto-pt: #3A7BD5;
  --st-caliente-bg:  #FCE7E1;  --st-caliente-tx:  #A3361C;  --st-caliente-pt:  #E0552F;
  --st-tibio-bg:     #FBF3DB;  --st-tibio-tx:     #835400;  --st-tibio-pt:     #D99A1E;
  --st-frio-bg:      #E5EEF1;  --st-frio-tx:      #38606F;  --st-frio-pt:      #6E9AAB;
  --st-cliente-bg:   #EDF3EC;  --st-cliente-tx:   #1E6B37;  --st-cliente-pt:   #2E9A55;
  --st-nopros-bg:    #F2F1EE;  --st-nopros-tx:    #4D4C48;  --st-nopros-pt:    #9A9893;
  --st-perdido-bg:   #F4E5EB;  --st-perdido-tx:   #87314F;  --st-perdido-pt:   #C25A80;
  --st-sindef-bg:    transparent; --st-sindef-tx: #4D4C48;  --st-sindef-pt:    #A8A6A0;

  /* Conversación */
  --bubble-them: var(--surface);
  --bubble-me:   #E3F0E8;
  --chat-bg:     var(--surface-2);

  /* Tipografía (Loyalty) */
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fs-hero: clamp(2.25rem, 1.6rem + 3.2vw, 3.5rem);
  --fs-xl: 2rem; --fs-lg: 1.5rem; --fs-md: 1.0625rem; --fs-sm: .875rem; --fs-xs: .75rem;
  --lh-tight: 1.05; --lh-head: 1.15; --lh-body: 1.5;
  --track-hero: -.04em; --track-head: -.025em; --track-body: -.011em;

  /* Espacio */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-24: 96px;
  --gutter: 16px; --maxw-app: 440px; --maxw-admin: 1120px;

  /* Radios */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-card: 20px; --r-pill: 999px;
  --r-bubble: 16px;

  /* Sombras: solo lo que flota */
  --sh-card:  0 1px 1px rgba(0,0,0,.04), 0 8px 24px -6px rgba(0,0,0,.18), 0 24px 48px -24px rgba(0,0,0,.22);
  --sh-float: 0 0 6px rgba(0,0,0,.10), 0 8px 12px rgba(0,0,0,.08);
  --sh-sheet: 0 -8px 32px rgba(0,0,0,.12);
  --sh-bubble: 0 1px 1px rgba(0,0,0,.05);

  /* Movimiento */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-press: cubic-bezier(.32, .72, 0, 1);
  --t-fast: 140ms; --t-base: 240ms; --t-slow: 480ms;
  --z-nav: 10; --z-sheet: 20; --z-toast: 30;

  /* Layout de esta app */
  --side-w: 240px;
  --list-w: 400px;
  --tabbar-space: calc(88px + env(safe-area-inset-bottom));

  color-scheme: light;
}

/* ---------- 1b. Tokens (oscuro) — valores de Loyalty + estados propios ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas:#0E0E0D; --canvas-2:#0A0A0A; --surface:#171716; --surface-2:#1F1F1D; --surface-3:#2A2A27;
    --ink:#EDEDEC; --ink-2:#B5B4AF; --muted:#8A8984; --line:#2A2A28; --line-strong:#3A3A37;
    --primary:#EDEDEC; --primary-ink:#111111; --primary-hover:#FFFFFF;
    --ok:#6BC28A; --warn:#E0B25A; --danger:#F07A72; --info:#73B6E6;
    --ok-soft:#14261A; --warn-soft:#2A2210; --danger-soft:#2E1414; --info-soft:#10202C;
    --sh-card: 0 0 0 1px rgba(255,255,255,.06), 0 16px 40px -12px rgba(0,0,0,.7);
    --sh-float: 0 0 0 1px rgba(255,255,255,.06), 0 8px 20px rgba(0,0,0,.5);
    --sh-bubble: none;
    --brand-soft: #13291E; --brand-text: #7FD3A8;
    --st-prospecto-bg:#17263A; --st-prospecto-tx:#8DB8F0; --st-prospecto-pt:#5E97E4;
    --st-caliente-bg:#3A1E17;  --st-caliente-tx:#F2A28C;  --st-caliente-pt:#EE7452;
    --st-tibio-bg:#2A2210;     --st-tibio-tx:#E0B25A;     --st-tibio-pt:#D9A93A;
    --st-frio-bg:#1B2A30;      --st-frio-tx:#9EC0CD;      --st-frio-pt:#6E9AAB;
    --st-cliente-bg:#14261A;   --st-cliente-tx:#6BC28A;   --st-cliente-pt:#4CB572;
    --st-nopros-bg:#1F1F1D;    --st-nopros-tx:#B5B4AF;    --st-nopros-pt:#6E6D69;
    --st-perdido-bg:#36192A;   --st-perdido-tx:#E59AB6;   --st-perdido-pt:#CF6C92;
    --st-sindef-tx:#B5B4AF;    --st-sindef-pt:#5C5B57;
    --bubble-me:#173226; --chat-bg:#121211;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas:#0E0E0D; --canvas-2:#0A0A0A; --surface:#171716; --surface-2:#1F1F1D; --surface-3:#2A2A27;
  --ink:#EDEDEC; --ink-2:#B5B4AF; --muted:#8A8984; --line:#2A2A28; --line-strong:#3A3A37;
  --primary:#EDEDEC; --primary-ink:#111111; --primary-hover:#FFFFFF;
  --ok:#6BC28A; --warn:#E0B25A; --danger:#F07A72; --info:#73B6E6;
  --ok-soft:#14261A; --warn-soft:#2A2210; --danger-soft:#2E1414; --info-soft:#10202C;
  --sh-card: 0 0 0 1px rgba(255,255,255,.06), 0 16px 40px -12px rgba(0,0,0,.7);
  --sh-float: 0 0 0 1px rgba(255,255,255,.06), 0 8px 20px rgba(0,0,0,.5);
  --sh-bubble: none;
  --brand-soft: #13291E; --brand-text: #7FD3A8;
  --st-prospecto-bg:#17263A; --st-prospecto-tx:#8DB8F0; --st-prospecto-pt:#5E97E4;
  --st-caliente-bg:#3A1E17;  --st-caliente-tx:#F2A28C;  --st-caliente-pt:#EE7452;
  --st-tibio-bg:#2A2210;     --st-tibio-tx:#E0B25A;     --st-tibio-pt:#D9A93A;
  --st-frio-bg:#1B2A30;      --st-frio-tx:#9EC0CD;      --st-frio-pt:#6E9AAB;
  --st-cliente-bg:#14261A;   --st-cliente-tx:#6BC28A;   --st-cliente-pt:#4CB572;
  --st-nopros-bg:#1F1F1D;    --st-nopros-tx:#B5B4AF;    --st-nopros-pt:#6E6D69;
  --st-perdido-bg:#36192A;   --st-perdido-tx:#E59AB6;   --st-perdido-pt:#CF6C92;
  --st-sindef-tx:#B5B4AF;    --st-sindef-pt:#5C5B57;
  --bubble-me:#173226; --chat-bg:#121211;
  color-scheme: dark;
}

/* ---------- 2. Base (igual que Loyalty) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--canvas); color: var(--ink);
  font: 400 var(--fs-md)/var(--lh-body) var(--font); letter-spacing: var(--track-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-weight: 600; line-height: var(--lh-head); letter-spacing: var(--track-head); margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
input, textarea { caret-color: var(--brand); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--surface); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .02em; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.sm { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 20px; height: 20px; flex: none; fill: currentColor; }
.ico--sm { width: 16px; height: 16px; }
.ico--lg { width: 24px; height: 24px; }
.ico--xl { width: 32px; height: 32px; }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- 3. Botones (Loyalty: pill en toda la app) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border: 0; border-radius: var(--r-pill);
  font: 560 var(--fs-md)/1 var(--font); letter-spacing: -.01em; cursor: pointer;
  text-decoration: none; white-space: nowrap; user-select: none;
  transition: transform var(--t-fast) var(--ease-press), background-color var(--t-fast) var(--ease-out), color var(--t-fast);
}
.btn:active { transform: scale(.96); }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--brand { background: var(--brand); color: var(--brand-ink); }
.btn--brand:hover { background: var(--brand-deep); }
.btn--secondary { background: var(--surface-3); color: var(--ink); }
.btn--secondary:hover { background: color-mix(in oklab, var(--surface-3) 85%, var(--ink)); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { height: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.btn--lg { height: 56px; font-size: 1.125rem; padding: 0 28px; }
.btn--icon { width: 44px; padding: 0; }
.btn--icon.btn--sm { width: 36px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
@media (pointer: coarse) { .btn--sm { height: 44px; } .btn--icon.btn--sm { width: 44px; } }

/* ---------- 4. Campos (Loyalty) ---------- */
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.field__label { font: 500 var(--fs-sm)/1.3 var(--font); color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.field__label span { color: var(--muted); font-weight: 400; }
.field__hint { font-size: var(--fs-sm); color: var(--ink-2); }
.field__error { color: var(--danger); font-size: var(--fs-sm); }
.input, .select, .textarea {
  height: 52px; padding: 0 16px; width: 100%;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font: 400 1.0625rem/1.2 var(--font);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  appearance: none; -webkit-appearance: none;
}
.textarea { height: auto; min-height: 112px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ink) 8%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input--sm { height: 40px; font-size: var(--fs-sm); padding: 0 12px; border-radius: 10px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group__pre { position: absolute; left: 14px; color: var(--muted); pointer-events: none; display: flex; align-items: center; }
.input-group--icon .input { padding-left: 44px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; margin: 0; border-radius: var(--r-pill); background: var(--surface-3); position: relative; cursor: pointer; transition: background var(--t-base) var(--ease-out); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--t-base) var(--ease-spring); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- 5. Control segmentado (Loyalty) — vistas de Recordatorios ---------- */
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg--block { display: flex; }
.seg--block > * { flex: 1; }
.seg a, .seg button { height: 34px; padding: 0 14px; border: 0; background: transparent; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 500 var(--fs-sm)/1 var(--font); color: var(--ink-2); text-decoration: none; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); white-space: nowrap; }
.seg [aria-selected="true"], .seg [aria-current="page"], .seg [aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.05); }
@media (pointer: coarse) { .seg a, .seg button { height: 40px; } }

/* ---------- 6. Chips (Loyalty) + estados del contacto ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font: 500 var(--fs-xs)/1 var(--font); letter-spacing: 0; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--danger { background: var(--danger-soft); color: var(--danger); }
.chip--info { background: var(--info-soft); color: var(--info); }
.chip--new { background: var(--brand); color: var(--brand-ink); }
.chip .ico { width: 14px; height: 14px; }

/* Chip de estado: <span class="chip st" data-st="prospecto">Prospecto</span> */
.st { --bg: var(--st-sindef-bg); --tx: var(--st-sindef-tx); --pt: var(--st-sindef-pt); background: var(--bg); color: var(--tx); padding-left: 8px; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pt); flex: none; }
.st[data-st="prospecto"]    { --bg: var(--st-prospecto-bg); --tx: var(--st-prospecto-tx); --pt: var(--st-prospecto-pt); }
.st[data-st="caliente"]     { --bg: var(--st-caliente-bg);  --tx: var(--st-caliente-tx);  --pt: var(--st-caliente-pt); }
.st[data-st="tibio"]        { --bg: var(--st-tibio-bg);     --tx: var(--st-tibio-tx);     --pt: var(--st-tibio-pt); }
.st[data-st="frio"]         { --bg: var(--st-frio-bg);      --tx: var(--st-frio-tx);      --pt: var(--st-frio-pt); }
.st[data-st="cliente"]      { --bg: var(--st-cliente-bg);   --tx: var(--st-cliente-tx);   --pt: var(--st-cliente-pt); }
.st[data-st="no_prospecto"] { --bg: var(--st-nopros-bg);    --tx: var(--st-nopros-tx);    --pt: var(--st-nopros-pt); }
.st[data-st="perdido"]      { --bg: var(--st-perdido-bg);   --tx: var(--st-perdido-tx);   --pt: var(--st-perdido-pt); }
.st[data-st="sin_definir"]  { box-shadow: inset 0 0 0 1px var(--line-strong); }
.st[data-st="sin_definir"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--pt); }

/* Selector de estado/temperatura en el detalle (radio visual) */
.pick { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pick button {
  --bg: var(--surface-3); --tx: var(--ink); --pt: var(--muted);
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px;
  border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2);
  font: 500 var(--fs-sm)/1 var(--font); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-press);
}
.pick button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pt); }
.pick button:hover { color: var(--ink); background: var(--surface-3); }
.pick button:active { transform: scale(.96); }
.pick button[aria-checked="true"] { background: var(--bg); color: var(--tx); font-weight: 560; box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--tx) 40%, transparent); }
.pick button[data-st] { --bg: var(--st-sindef-bg); --tx: var(--st-sindef-tx); --pt: var(--st-sindef-pt); }
.pick button[data-st="prospecto"]    { --bg: var(--st-prospecto-bg); --tx: var(--st-prospecto-tx); --pt: var(--st-prospecto-pt); }
.pick button[data-st="caliente"]     { --bg: var(--st-caliente-bg);  --tx: var(--st-caliente-tx);  --pt: var(--st-caliente-pt); }
.pick button[data-st="tibio"]        { --bg: var(--st-tibio-bg);     --tx: var(--st-tibio-tx);     --pt: var(--st-tibio-pt); }
.pick button[data-st="frio"]         { --bg: var(--st-frio-bg);      --tx: var(--st-frio-tx);      --pt: var(--st-frio-pt); }
.pick button[data-st="cliente"]      { --bg: var(--st-cliente-bg);   --tx: var(--st-cliente-tx);   --pt: var(--st-cliente-pt); }
.pick button[data-st="no_prospecto"] { --bg: var(--st-nopros-bg);    --tx: var(--st-nopros-tx);    --pt: var(--st-nopros-pt); }
.pick button[data-st="perdido"]      { --bg: var(--st-perdido-bg);   --tx: var(--st-perdido-tx);   --pt: var(--st-perdido-pt); }
@media (pointer: coarse) { .pick button { height: 44px; } }

/* Filtros rápidos: píldoras con scroll horizontal */
.filters { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); scroll-padding-inline: var(--gutter); }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-2); font: 500 var(--fs-sm)/1 var(--font); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.filters .n { font-variant-numeric: tabular-nums; opacity: .7; }
@media (pointer: coarse) { .filters button { height: 40px; } }

/* ---------- 7. Cajas, KPIs, avisos, vacío (Loyalty) ---------- */
.box { background: var(--surface); border-radius: var(--r-lg); padding: 20px; }
.box--flush { padding: 0; overflow: hidden; }
.box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.box--flush .box__head { padding: 16px 20px 8px; margin: 0; }
.box__head h2, .box__head h3 { font-size: 1rem; letter-spacing: -.01em; }
.box__head .xs, .box__head .sm { color: var(--muted); font-weight: 400; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.kpi { display: block; background: var(--surface); border-radius: var(--r-lg); padding: 14px 14px 12px; color: inherit; text-decoration: none; transition: background var(--t-fast); }
a.kpi:hover { background: color-mix(in oklab, var(--surface) 92%, var(--ink)); }
.kpi__label { font-size: var(--fs-sm); color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi__label i { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pt, var(--muted)); }
.kpi__value { margin-top: 4px; font: 600 var(--fs-xl)/1.05 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi__sub { margin-top: 4px; font-size: var(--fs-xs); color: var(--muted); }
.kpi__sub--danger { color: var(--danger); font-weight: 500; }
@media (min-width: 640px) { .kpis { gap: var(--s-3); } .kpi { padding: 20px; } .kpi__sub { font-size: var(--fs-sm); } }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.45; background: var(--surface-2); color: var(--ink); }
.notice .ico { margin-top: 1px; }
.notice--ok { background: var(--ok-soft); color: var(--ok); }
.notice--error { background: var(--danger-soft); color: var(--danger); }
.notice--warn { background: var(--warn-soft); color: var(--warn); }
.notice--info { background: var(--info-soft); color: var(--info); }
.notice .btn { margin-left: auto; flex: none; }

.empty { background: var(--surface-2); border-radius: var(--r-lg); padding: 40px 24px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.empty .ico { width: 32px; height: 32px; color: var(--muted); margin-bottom: 4px; }
.empty__t { font-weight: 560; }
.empty__d { font-size: var(--fs-sm); color: var(--ink-2); max-width: 36ch; }
.empty .btn { margin-top: 12px; }

/* Esqueletos de carga */
.skel { background: var(--surface-3); border-radius: 6px; height: 12px; }
.skel--circle { width: 44px; height: 44px; border-radius: 50%; }

/* ---------- 8. "Revisar ahora" (propio) ---------- */
.review { background: var(--surface); border-radius: var(--r-lg); padding: 16px 16px 16px 20px; display: flex; align-items: center; gap: var(--s-4); }
.review__txt { flex: 1; min-width: 0; }
.review__t { font-weight: 560; }
.review__s { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.review__btn { position: relative; overflow: hidden; isolation: isolate; min-width: 156px; }
.review__btn .ico { transition: transform var(--t-base) var(--ease-out); }
/* Corriendo: el propio botón es la barra. JS fija style="--p:.42" (0–1) */
.review[data-state="running"] .review__btn { background: var(--brand-soft); color: var(--brand-text); cursor: progress; }
.review[data-state="running"] .review__btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in oklab, var(--brand) 22%, transparent);
  transform-origin: left center; transform: scaleX(var(--p, 0));
  transition: transform var(--t-slow) var(--ease-out);
}
.review[data-state="running"] .review__btn .ico { animation: spin 1.1s linear infinite; }
.review[data-state="error"] .review__s { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 420px) { .review { flex-wrap: wrap; padding: 16px; } .review__btn { width: 100%; } }

/* ---------- 9. Lista de contactos (propio; filas como tabla Loyalty móvil) ---------- */
.clist { list-style: none; margin: 0; padding: 0; }
.clist > li + li .contact { border-top: 1px solid var(--line); }
.contact {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px;
  padding: 14px 20px; color: inherit; text-decoration: none; position: relative;
  transition: background var(--t-fast);
}
.contact:hover { background: var(--surface-2); }
.contact:focus-visible { outline-offset: -2px; border-radius: var(--r-md); }
.contact[aria-current="true"] { background: var(--brand-soft); }
.contact .avatar { grid-row: span 3; }
.contact__name { font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; min-width: 0; }
.contact__name span { overflow: hidden; text-overflow: ellipsis; }
.contact__time { font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; align-self: center; font-variant-numeric: tabular-nums; }
.contact--new .contact__time { color: var(--brand-text); font-weight: 600; }
.contact__tags { grid-column: 2 / 4; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.contact__int { font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.contact__sum { grid-column: 2 / 4; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dot-new { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }

.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); color: var(--ink); display: grid; place-items: center; font: 600 .875rem/1 var(--font); letter-spacing: 0; flex: none; }
.avatar--xl { width: 56px; height: 56px; font-size: 1.125rem; }
.avatar[data-st="prospecto"] { background: var(--st-prospecto-bg); color: var(--st-prospecto-tx); }
.avatar[data-st="cliente"]   { background: var(--st-cliente-bg);   color: var(--st-cliente-tx); }
.avatar[data-st="perdido"]   { background: var(--st-perdido-bg);   color: var(--st-perdido-tx); }

/* ---------- 10. Detalle (propio) ---------- */
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); align-items: center; }
.profile__name { font-size: var(--fs-lg); display: flex; align-items: center; gap: 4px; }
.profile__tel { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 4px; }
.profile__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.prose { font-size: var(--fs-md); line-height: 1.55; max-width: 66ch; }
.next { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--brand-soft); color: var(--ink); font-size: var(--fs-sm); line-height: 1.45; }
.next .ico { color: var(--brand-text); margin-top: 1px; }
.next b { font-weight: 600; }
/* Sugerencia de la IA (estado o recordatorio propuesto, no aplicado) */
.suggest { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 12px 12px 16px; border-radius: var(--r-md); border: 1.5px dashed var(--line-strong); font-size: var(--fs-sm); color: var(--ink-2); }
.suggest > span { flex: 1; min-width: 12rem; }
.suggest b { color: var(--ink); font-weight: 560; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.timeline time { color: var(--muted); font-size: var(--fs-xs); margin-left: 2px; }

/* Recordatorio (detalle y pantalla Recordatorios) */
.rem { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; }
.rem + .rem { border-top: 1px solid var(--line); }
.rem__date { width: 44px; height: 48px; border-radius: var(--r-md); background: var(--surface-2); display: grid; place-content: center; text-align: center; line-height: 1; }
.rem__d { font: 600 1.125rem/1 var(--font); font-variant-numeric: tabular-nums; }
.rem__m { font-size: 11px; color: var(--ink-2); margin-top: 3px; }
.rem__note { font-size: var(--fs-sm); font-weight: 500; }
.rem__meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.rem__acts { display: flex; gap: 6px; }
.rem--late .rem__date { background: var(--danger-soft); color: var(--danger); }
.rem--late .rem__m { color: var(--danger); }
.rem--done { opacity: .55; }
.rem--done .rem__note { text-decoration: line-through; }

/* ---------- 11. Conversación (propio, solo lectura) ---------- */
.chat { display: flex; flex-direction: column; gap: 3px; padding: 16px 12px; background: var(--chat-bg); border-radius: var(--r-lg); }
.chat__day { align-self: center; margin: 12px 0 8px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 500; display: inline-flex; align-items: center; }
.chat__more { align-self: center; margin-bottom: 4px; }
.bubble { max-width: min(80%, 34rem); align-self: flex-start; padding: 8px 12px 6px; border-radius: var(--r-bubble); background: var(--bubble-them); color: var(--ink); font-size: .9375rem; line-height: 1.45; box-shadow: var(--sh-bubble); overflow-wrap: anywhere; }
.bubble--me { align-self: flex-end; background: var(--bubble-me); }
.bubble--first { margin-top: 8px; border-top-left-radius: 6px; }
.bubble--me.bubble--first { border-top-left-radius: var(--r-bubble); border-top-right-radius: 6px; }
.bubble time { float: right; margin: 6px 0 -2px 10px; font-size: 11px; color: var(--muted); line-height: 1; font-variant-numeric: tabular-nums; }
.bubble__media { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }

/* ---------- 12. Hoja inferior / modal (Loyalty: <dialog class="sheet">) ---------- */
dialog.sheet { border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; max-height: 92dvh; inset: auto 0 0 0; background: var(--surface); color: var(--ink); border-radius: 20px 20px 0 0; box-shadow: var(--sh-sheet); overflow: auto; overscroll-behavior: contain; }
dialog.sheet::backdrop { background: rgba(0,0,0,.4); }
dialog.sheet[open] { animation: sheet-in 360ms var(--ease-out) both; }
dialog.sheet[open]::backdrop { animation: fade-in 240ms ease both; }
.sheet__in { padding: 12px 20px max(24px, env(safe-area-inset-bottom)); }
.sheet__grip { width: 36px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 16px; }
.sheet__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.sheet__head h2 { font-size: 1.25rem; flex: 1; }
.sheet__head p { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 4px; }
.sheet__actions { display: flex; gap: 12px; margin-top: 24px; }
.sheet__actions .btn { flex: 1; }
.sheet__body > * + * { margin-top: var(--s-5); }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* Atajos de fecha en "Recordar" */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.quick button { height: 56px; border: 0; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink); display: grid; place-content: center; gap: 3px; font: 560 var(--fs-sm)/1 var(--font); cursor: pointer; transition: background var(--t-fast), transform var(--t-fast) var(--ease-press); }
.quick button small { font-size: var(--fs-xs); font-weight: 400; color: var(--ink-2); }
.quick button:active { transform: scale(.96); }
.quick button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.quick button[aria-pressed="true"] small { color: inherit; opacity: .75; }

/* ---------- 13. Toasts (Loyalty) ---------- */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.has-tabbar .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--surface); box-shadow: var(--sh-float); font-size: var(--fs-sm); font-weight: 500; animation: toast-in 320ms var(--ease-spring) both; }
.toast .ico { width: 18px; height: 18px; }
.toast--error { background: var(--danger); color: #fff; }
.toast__act { margin-left: auto; background: none; border: 0; color: inherit; font: 600 var(--fs-sm)/1 var(--font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 4px; }
.toast.is-out { animation: toast-out 180ms ease both; }
@keyframes toast-in { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { opacity: 0; } }

/* ---------- 14. Conexión / QR (propio; QR siempre sobre blanco como en Loyalty) ---------- */
.connect { max-width: var(--maxw-app); margin: 0 auto; display: grid; justify-items: center; gap: var(--s-5); text-align: center; padding: var(--s-6) 0; }
.wa-state { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface-2); font: 500 var(--fs-sm)/1 var(--font); color: var(--ink-2); }
.wa-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.wa-state[data-state="conectado"] { background: var(--ok-soft); color: var(--ok); }
.wa-state[data-state="conectado"] i { background: var(--ok); }
.wa-state[data-state="esperando_qr"] i, .wa-state[data-state="conectando"] i { background: var(--warn); animation: pulse 1.6s ease-in-out infinite; }
.wa-state[data-state="sesion_cerrada"] { background: var(--danger-soft); color: var(--danger); }
.wa-state[data-state="sesion_cerrada"] i { background: var(--danger); }
.qr { position: relative; width: min(280px, 76vw); aspect-ratio: 1; padding: 16px; background: #FFFFFF; border-radius: var(--r-card); box-shadow: var(--sh-card); }
.qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.qr__ttl { position: absolute; left: 24px; right: 24px; bottom: 8px; height: 3px; border-radius: 2px; background: #E9E8E4; overflow: hidden; }
.qr__ttl::after { content: ""; position: absolute; inset: 0; background: #1C7350; transform-origin: left; animation: ttl 20s linear infinite; }
.qr--loading { display: grid; place-items: center; color: #787774; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 10px; text-align: left; width: 100%; font-size: var(--fs-sm); color: var(--ink-2); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); color: var(--ink); display: grid; place-items: center; font: 600 var(--fs-xs)/1 var(--font); }
.steps b { color: var(--ink); font-weight: 560; }
.pair-code { font: 600 2rem/1 var(--font-mono); letter-spacing: .16em; padding: 16px 20px; background: var(--surface); border-radius: var(--r-md); }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes ttl { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- 15. Estructura: móvil ---------- */
.app { min-height: 100dvh; }
.main { padding-bottom: var(--tabbar-space); }
.topbar { position: sticky; top: 0; z-index: var(--z-nav); display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 var(--gutter); padding-top: env(safe-area-inset-top); box-sizing: content-box; background: var(--canvas); }
.topbar h1 { font-size: var(--fs-lg); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar--sub h1 { font-size: 1.125rem; }
.page { padding: 4px var(--gutter) var(--s-8); display: grid; gap: var(--s-4); align-content: start; }
.brandmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brandmark__ico { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }
.brandmark__ico .ico { width: 18px; height: 18px; }
.brandmark span { font: 600 .9375rem/1.2 var(--font); letter-spacing: -.01em; }

/* Nav inferior flotante (Loyalty .tabbar) */
.tabbar { position: fixed; z-index: var(--z-nav); left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100vw - 24px), 416px); height: 64px; padding: 6px; background: var(--surface); border-radius: var(--r-pill); box-shadow: var(--sh-float); display: flex; gap: 4px; }
.tabbar a { position: relative; flex: 1; border-radius: var(--r-pill); display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); text-decoration: none; font: 500 var(--fs-xs)/1 var(--font); letter-spacing: 0; transition: background var(--t-fast), color var(--t-fast); }
.tabbar .ico { width: 24px; height: 24px; }
.tabbar [aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.tabbar__badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font: 600 11px/18px var(--font); text-align: center; font-variant-numeric: tabular-nums; }

/* Barra lateral (Loyalty .side) — solo escritorio */
.side { display: none; }
.side nav { display: grid; gap: 2px; }
.nav-a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font: 500 var(--fs-sm)/1 var(--font); letter-spacing: 0; transition: background var(--t-fast), color var(--t-fast); }
.nav-a .ico { width: 18px; height: 18px; }
.nav-a:hover { background: var(--surface-2); color: var(--ink); }
.nav-a[aria-current="page"] { background: var(--surface-3); color: var(--ink); }
.nav-a .n { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.side__foot { margin-top: auto; display: grid; gap: 8px; padding: 0 4px; }

.only-desk { display: none !important; }
/* Lista ↔ detalle en móvil: el frontend cambia data-view */
@media (max-width: 959.98px) {
  .split[data-view="list"] .split__detail { display: none; }
  .split[data-view="detail"] .split__list { display: none; }
}

/* ---------- 16. Escritorio (≥ 960px): barra lateral + vista dividida ---------- */
@media (min-width: 960px) {
  body { background: var(--canvas-2); }
  .app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100dvh; overflow: hidden; }
  .side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; border-right: 1px solid var(--line); background: var(--canvas-2); overflow-y: auto; }
  .side .brandmark { padding: 6px 8px 20px; }
  .tabbar, .only-mobile { display: none !important; }
  .only-desk { display: revert !important; }
  .main { padding-bottom: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .topbar { background: var(--canvas-2); padding: 0 32px; height: 64px; }
  .split { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--list-w) minmax(0, 1fr); }
  .split__list, .split__detail { overflow-y: auto; min-height: 0; }
  .split__list { border-right: 1px solid var(--line); }
  .split__list .page { padding: 8px 20px 32px 32px; }
  .split__detail .page { padding: 28px 32px 64px; max-width: 840px; }
  .split__list .filters { margin: 0 -20px 0 -32px; padding: 2px 20px 2px 32px; scroll-padding-inline: 32px; }
  .kpi__value { font-size: 1.75rem; }
  .contact { padding: 14px 16px; }
  dialog.sheet { inset: 0; margin: auto; width: 440px; max-width: calc(100vw - 32px); border-radius: var(--r-card); height: fit-content; }
  dialog.sheet[open] { animation: modal-in 280ms var(--ease-out) both; }
  .sheet__grip { display: none; }
  .sheet__in { padding: 24px; }
  .toasts { left: auto; right: 24px; transform: none; bottom: 24px; }
}
@media (min-width: 1280px) { :root { --list-w: 440px; } }

/* ---------- 17. Movimiento ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal > * { animation: rise 480ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
  .skel { animation: pulse 1.4s ease-in-out infinite; }
}
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ==========================================================================
   18. Pantallas de la app (frontend). Solo componen tokens existentes.
   ========================================================================== */

/* Arranque y acceso */
.boot { min-height: 100dvh; display: grid; place-items: center; padding: var(--gutter); }
@media (prefers-reduced-motion: no-preference) { .boot[aria-busy="true"] .brandmark { animation: pulse 1.6s ease-in-out infinite; } }
.login { min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom)); }
.login__card { width: 100%; max-width: 400px; display: grid; gap: var(--s-6); }
.login__t { font-size: var(--fs-xl); letter-spacing: -.03em; }
.login__d { color: var(--ink-2); margin-top: var(--s-2); max-width: 32ch; }
.login__box { display: grid; gap: var(--s-4); padding: 24px; }
.brandmark--lg .brandmark__ico { width: 40px; height: 40px; }
.brandmark--lg .brandmark__ico .ico { width: 22px; height: 22px; }
.brandmark--lg span { font-size: 1.0625rem; }

/* Pantallas de una columna (Recordatorios, Conexión, Ajustes) */
.screen { min-width: 0; }
.page--narrow { max-width: 760px; width: 100%; }
.stack[style*="--g"] > * + * { margin-top: var(--g); }

/* Lista: paginación y chips extra */
.list-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.chip--suggest { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-2); }
.chip--suggest .ico { color: var(--brand-text); }
.contact__tags .chip .ico { width: 12px; height: 12px; }
.buscar { margin: 0; }
.input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

/* Detalle */
.detail-empty { min-height: 100%; display: grid; place-items: center; padding: 48px 32px; }
.detail-empty .empty { background: transparent; }
.profile__txt { min-width: 0; overflow-wrap: anywhere; }
.profile__wa { font-family: var(--font); font-size: var(--fs-xs); letter-spacing: 0; font-weight: 400; }
.pick__label { font-size: var(--fs-xs); font-weight: 500; color: var(--ink-2); margin: 16px 0 8px; }
.empty--inline { background: var(--surface-2); padding: 24px 16px; }
.empty--inline .ico { width: 24px; height: 24px; color: var(--brand-text); }
.name-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.name-edit .input { height: 44px; flex: 1 1 12rem; min-width: 0; }
.chat__vacio, .chat__inicio { align-self: center; font-size: var(--fs-xs); color: var(--ink-2); padding: 4px 0 8px; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"] .ico { animation: spin 1.1s linear infinite; }

/* Recordatorios (pantalla) */
.seg--scroll { overflow-x: auto; scrollbar-width: none; }
.seg--scroll::-webkit-scrollbar { display: none; }
.seg__n { font-variant-numeric: tabular-nums; font-size: var(--fs-xs); color: var(--ink-2); }
.seg__n:empty { display: none; }
.seg__n--danger { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-weight: 600; display: inline-grid; place-items: center; }
.box--rems { padding-top: 8px; padding-bottom: 8px; }
.rem--full { grid-template-columns: 44px minmax(0, 1fr); align-items: start; }
.rem--full .rem__acts { grid-column: 2; flex-wrap: wrap; }
.rem__meta a { color: var(--ink-2); font-weight: 500; text-decoration: none; }
.rem__meta a:hover { color: var(--ink); text-decoration: underline; }
.rem--late .rem__meta { color: var(--danger); }
.rem__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
@media (min-width: 640px) {
  .rem--full { grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; }
  .rem--full .rem__acts { grid-column: auto; flex-wrap: nowrap; }
}

/* Conexión */
.connect__t { font-size: var(--fs-lg); }
.connect__d { color: var(--ink-2); font-size: var(--fs-sm); max-width: 38ch; }
.connect__ico { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); color: var(--ink-2); display: grid; place-items: center; }
.connect__acts { display: grid; gap: 8px; justify-items: center; }
.connect__nota { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: var(--fs-sm); color: var(--ink-2); max-width: 40ch; }
.connect__nota .ico { color: var(--ok); margin-top: 2px; }
.wa-card { width: 100%; background: var(--surface); border-radius: var(--r-lg); padding: 20px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; text-align: left; }
.wa-card__ico { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; }
.wa-card__t { font-weight: 560; }
.pair-form { width: 100%; display: grid; gap: 12px; text-align: left; }
.qr img { border-radius: 4px; }
a.wa-state { text-decoration: none; }

/* Ajustes */
.settings { display: grid; gap: var(--s-5); }
.settings .box__head { margin-bottom: 0; }
.box__head h2 { font-size: 1rem; letter-spacing: -.01em; }
.switch__t { display: block; font-weight: 500; font-size: var(--fs-sm); }
.switch .field__hint { display: block; margin-top: 2px; }
.kv { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; font-size: var(--fs-sm); color: var(--ink-2); }
.kv > span:first-child { flex: 1 1 14rem; }
.settings__acts { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 12px 0; display: grid; gap: 4px; }
.hist li + li { border-top: 1px solid var(--line); }
.hist li:first-child { padding-top: 0; }
.hist__t { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; }
.hist__m { font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hist__e { font-size: var(--fs-xs); color: var(--danger); }

/* Barra lateral: contador de pendientes */
.nav-a .n--badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-weight: 600; display: inline-grid; place-items: center; }
.nav-a[aria-current="page"] .ico { color: var(--ink); }

/* Escritorio: pantallas de una columna con su propio scroll */
@media (min-width: 960px) {
  .screen { flex: 1; min-height: 0; overflow-y: auto; }
  .screen .page { padding: 8px 32px 64px; }
  .split__detail .topbar { display: none; }
  .login__card { max-width: 420px; }
}

/* Móvil angosto: "Abrir en WhatsApp" a lo ancho; Recordar y Revisar comparten fila */
@media (max-width: 559.98px) {
  .profile__actions .btn { flex: 1 1 0; padding: 0 12px; }
  .profile__actions .btn--brand { flex-basis: 100%; }
}

/* Campos en fila: que la hora no desborde la hoja en 390 px */
.field-row > .field { min-width: 0; }
.field-row .input { min-width: 0; }
/* Recordatorios en móvil: acciones en su propia fila, WhatsApp al final */
.rem--full .rem__acts { grid-column: 1 / -1; gap: 4px; align-items: center; }
.rem--full .rem__acts .btn--sm:not(.btn--icon) { padding: 0 12px; }
.rem__wa { margin-left: auto; }
@media (min-width: 640px) {
  .rem--full .rem__acts { grid-column: auto; gap: 6px; }
  .rem__wa { margin-left: 6px; order: 9; }
}
.side__num { padding: 0 4px; }
.side__num:empty { display: none; }
