/* ═══════════════════════════════════════════════════════════════════
   EBrain — eb-theme.css
   Sistema de temas Elena Busto (light + dark). FUENTE DE VERDAD de color,
   tipografía y componentes EB. Cargar DESPUÉS de main.css y mobile.css.

   Estrategia (paso 2 del rediseño A.2):
     · Reusa los NOMBRES de variables que ya consume main.css/mobile.css
       (--bg-0..6, --line, --text-1..4, --gold*, --ok/warn/err/info) pero
       les da valores EB que cambian con `html.theme-light` / `theme-dark`.
     · Define además triploides `--*-rgb` (canales R G B separados por espacio)
       para que tailwind-config.js pueda generar utilidades con opacidad
       (`bg-dark-800/50`, `text-gold-300`, `ring-gold-400/30`) que SIGUEN el tema.
     · Remapea `text-white/NN` a tinta en tema claro (legibilidad).
     · Tipografía EB (Special Elite / Cormorant / Lato) — las fuentes se
       cargan en el <head> de cada página.
     · Componentes EB reutilizables (stepper de pedido, chips, etc.) para
       las vistas que nacen en EB (MCB Pedidos, Logs — paso 3).

   ROLLBACK: quitar el <link> a este archivo en los <head> (y revertir
   tailwind-config.js + el bloque mobile.css) deja la app como estaba.
   El árbol git estaba limpio: `git checkout -- frontend/` revierte todo.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Paleta cruda EB (constante) ────────────────────────────────── */
:root {
  --moss-900:#1a3d38; --moss-700:#305c56; --moss-500:#3d7a72; --moss-300:#7aada5; --moss-100:#d4e5e3;
  --ochre-900:#5a3a14; --ochre-700:#8a5a1f; --ochre-500:#b88346; --ochre-300:#d8a876; --ochre-100:#f0dbb8;
  --parchment:#f4ece0; --parchment-soft:#faf5ec; --parchment-deep:#e8dcc5; --parchment-bright:#fffaf7;
  --carbon:#17140f; --carbon-soft:#2a241c; --eb-ink:#3a342a;
  --rust:#9c4221; --blood:#7b1e1e;

  --font-display:'Special Elite','Courier Prime','Courier New',monospace;
  --font-serif:'Cormorant Garamond','EB Garamond',Georgia,serif;
  --font-body:'Lato','Plus Jakarta Sans','Helvetica Neue',Helvetica,Arial,sans-serif;
}

/* ─── Tema OSCURO (Bru elige) — carbón cálido, default ───────────── */
:root,
html.theme-dark {
  --bg-0-rgb: 20 17 11;     /* #14110B body */
  --bg-1-rgb: 29 25 19;     /* #1D1913 cards/drawer */
  --bg-2-rgb: 38 31 22;     /* #261F16 elevado */
  --bg-3-rgb: 47 39 25;     /* #2F2719 hover */
  --bg-4-rgb: 56 48 31;     /* #38301F input */
  --bg-5-rgb: 68 58 38;     /* #443A26 divisor+ */
  --bg-6-rgb: 86 74 50;     /* #564A32 */
  --gold-rgb: 216 168 118;  /* #D8A876 ochre-300 — acento cálido */

  --bg-0:rgb(var(--bg-0-rgb)); --bg-1:rgb(var(--bg-1-rgb)); --bg-2:rgb(var(--bg-2-rgb));
  --bg-3:rgb(var(--bg-3-rgb)); --bg-4:rgb(var(--bg-4-rgb)); --bg-5:rgb(var(--bg-5-rgb)); --bg-6:rgb(var(--bg-6-rgb));

  --line: rgba(240,219,184,.11);
  --line-strong: rgba(240,219,184,.20);

  --text-1: rgba(246,239,228,.96);
  --text-2: rgba(246,239,228,.72);
  --text-3: rgba(246,239,228,.54);
  --text-4: rgba(246,239,228,.32);

  --gold: rgb(var(--gold-rgb));
  --gold-soft: rgba(216,168,118,.14);
  --gold-glow: rgba(216,168,118,.30);
  --gold-bg:   rgba(216,168,118,.07);

  --ok:#8cb784; --warn:#dcab78; --err:#df7a55; --info:#80a9c6;

  /* Acentos de marca para componentes EB */
  --primary:#3d7a72; --primary-strong:#305c56; --primary-contrast:#faf5ec; --primary-ink:#8fc0b8;
  --accent:#d8a876; --accent-ink:#e2bc91;
  --surface-card: var(--bg-1);
}

/* ─── Tema CLARO (Elena fijo) — pergamino ────────────────────────── */
html.theme-light {
  --bg-0-rgb: 250 245 236;  /* #FAF5EC body */
  --bg-1-rgb: 255 250 247;  /* #FFFAF7 cards */
  --bg-2-rgb: 244 236 224;  /* #F4ECE0 elevado */
  --bg-3-rgb: 239 230 214;  /* #EFE6D6 hover */
  --bg-4-rgb: 251 246 238;  /* #FBF6EE input */
  --bg-5-rgb: 232 220 197;  /* #E8DCC5 divisor+ */
  --bg-6-rgb: 215 202 178;  /* #D7CAB2 */
  --gold-rgb: 138 90 31;    /* #8A5A1F ochre-700 — acento legible */

  --bg-0:rgb(var(--bg-0-rgb)); --bg-1:rgb(var(--bg-1-rgb)); --bg-2:rgb(var(--bg-2-rgb));
  --bg-3:rgb(var(--bg-3-rgb)); --bg-4:rgb(var(--bg-4-rgb)); --bg-5:rgb(var(--bg-5-rgb)); --bg-6:rgb(var(--bg-6-rgb));

  --line: rgba(58,52,42,.16);
  --line-strong: rgba(58,52,42,.26);

  --text-1: rgba(51,46,37,.96);
  --text-2: rgba(51,46,37,.72);
  --text-3: rgba(51,46,37,.54);
  --text-4: rgba(51,46,37,.34);

  --gold: rgb(var(--gold-rgb));
  --gold-soft: rgba(184,131,70,.16);
  --gold-glow: rgba(184,131,70,.32);
  --gold-bg:   rgba(184,131,70,.09);

  --ok:#54824f; --warn:#a9742f; --err:#9c4221; --info:#4f7388;

  --primary:#305c56; --primary-strong:#1a3d38; --primary-contrast:#faf5ec; --primary-ink:#2b5650;
  --accent:#b88346; --accent-ink:#8a5a1f;
  --surface-card: var(--bg-1);
}

/* ─── Base: tipografía EB ────────────────────────────────────────── */
body { font-family: var(--font-body); }
/* Los títulos de la app son <div> con clases Tailwind; el carácter EB
   (Special Elite en titulares) se aplica por componente en el paso 3.
   Aquí solo damos cuerpo Lato + enlaces en color de marca. */
a { color: var(--gold); }

/* ─── Tema claro: remapear text-white a tinta (legibilidad) ──────── */
/* Las clases Tailwind text-white/NN son texto sobre oscuro; en claro
   deben ser tinta. Especificidad (0,2,1) gana a la utilidad sin !important. */
html.theme-light .text-white,
html.theme-light .text-white\/95,
html.theme-light .text-white\/90 { color: var(--text-1); }
html.theme-light .text-white\/80,
html.theme-light .text-white\/75,
html.theme-light .text-white\/70,
html.theme-light .text-white\/60,
html.theme-light .text-white\/55,
html.theme-light .text-white\/50 { color: var(--text-2); }
html.theme-light .text-white\/45,
html.theme-light .text-white\/40,
html.theme-light .text-white\/35,
html.theme-light .text-white\/30,
html.theme-light .text-white\/25,
html.theme-light .text-white\/20 { color: var(--text-3); }

/* ═══════════════════════════════════════════════════════════════════
   COMPONENTES EB reutilizables (namespaced eb-/ebr-). Aditivos: no
   afectan al markup existente. Para las vistas que nacen en EB.
   ═══════════════════════════════════════════════════════════════════ */

/* Etiqueta funcional: Lato bold mayúsculas (legible a 10px) */
.eb-ulabel{font-family:var(--font-body);font-weight:700;text-transform:uppercase;letter-spacing:.06em;}

/* Kicker (pre-título) */
.eb-kicker{display:inline-flex;align-items:center;gap:.6rem;font-family:var(--font-display);font-size:.74rem;letter-spacing:.2em;text-transform:uppercase;color:var(--accent-ink);}
.eb-kicker::before{content:"";width:2rem;height:1px;background:var(--accent);opacity:.85;}

/* CTA */
.eb-cta{display:inline-flex;align-items:center;gap:.6rem;padding:.85rem 1.6rem;border-radius:10px;font-family:var(--font-display);font-size:.82rem;letter-spacing:.1em;text-transform:uppercase;border:1px solid transparent;cursor:pointer;transition:all .22s cubic-bezier(.22,1,.36,1);}
.eb-cta--primary{background:var(--carbon);color:var(--parchment-soft);border-color:var(--carbon);}
html.theme-dark .eb-cta--primary{background:var(--parchment-soft);color:var(--carbon);border-color:var(--parchment-soft);}
.eb-cta--primary:hover{background:var(--primary);color:var(--primary-contrast);border-color:var(--primary);transform:translateY(-1px);}
.eb-cta--secondary{background:transparent;color:var(--text-1);border-color:var(--line-strong);}
.eb-cta--secondary:hover{border-color:var(--primary);color:var(--primary-ink);}

/* Chip / badge */
.eb-chip{display:inline-flex;align-items:center;gap:.45rem;padding:.4rem .9rem;border:1px solid var(--accent);border-radius:999px;font-family:var(--font-serif);font-style:italic;font-size:.95rem;color:var(--text-1);background:color-mix(in srgb,var(--accent) 8%,transparent);}
.eb-badge{display:inline-flex;align-items:center;font-family:var(--font-body);font-weight:700;font-size:.66rem;letter-spacing:.1em;text-transform:uppercase;padding:.3rem .65rem;border:1px solid currentColor;border-radius:8px;color:var(--accent-ink);}

/* Subtabs EB (alternativa a .ebrain-subtabs si se quiere el look EB) */
.eb-subtabs{display:flex;gap:.3rem;border-bottom:1px solid var(--line);overflow-x:auto;}
.eb-subtab{border:0;background:transparent;padding:.7rem 1.05rem;white-space:nowrap;font-family:var(--font-body);font-weight:700;font-size:.8rem;letter-spacing:.04em;text-transform:uppercase;color:var(--text-2);border-bottom:2px solid transparent;margin-bottom:-1px;cursor:pointer;transition:all .22s ease;}
.eb-subtab:hover{color:var(--text-1);}
.eb-subtab.is-active{color:var(--text-1);border-bottom-color:var(--accent);}

/* Barra de progreso continua animada */
.eb-bar{height:9px;background:var(--bg-3);border-radius:999px;overflow:hidden;position:relative;}
.eb-bar__fill{height:100%;border-radius:999px;position:relative;overflow:hidden;background:linear-gradient(90deg,var(--primary-strong),var(--primary));width:0;transition:width 1.3s cubic-bezier(.22,1,.36,1);}
.eb-bar__fill::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.22),transparent);transform:translateX(-100%);animation:eb-sheen 2.6s ease-in-out infinite;}
@keyframes eb-sheen{to{transform:translateX(100%);}}

/* ─── Stepper de pedido MCB (validado, re-vestido a EB) ──────────── */
.ebr-progress{background:var(--bg-1);border:1px solid var(--line);border-radius:14px;padding:1.6rem 1.5rem 1.25rem;position:relative;overflow:hidden;animation:ebr-reveal .55s cubic-bezier(.22,1,.36,1);}
.ebr-progress::before{content:"";position:absolute;top:0;left:1.5rem;right:1.5rem;height:1px;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--accent) 55%,transparent),transparent);}
@keyframes ebr-reveal{from{opacity:0;transform:translateY(-4px);}to{opacity:1;transform:translateY(0);}}
.ebr-progress__track{display:flex;align-items:flex-start;}
.ebr-step{flex:0 0 auto;min-width:72px;display:flex;flex-direction:column;align-items:center;text-align:center;}
.ebr-step__dot{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--bg-2);border:1px solid var(--line-strong);transition:all .5s cubic-bezier(.65,0,.35,1);position:relative;animation:ebr-pop .45s cubic-bezier(.34,1.56,.64,1) backwards;}
@keyframes ebr-pop{from{transform:scale(.4);opacity:0;}to{transform:scale(1);opacity:1;}}
.ebr-step--done .ebr-step__dot{background:linear-gradient(135deg,var(--moss-500),var(--moss-700));border-color:var(--moss-500);box-shadow:0 0 0 4px color-mix(in srgb,var(--moss-500) 14%,transparent);}
.ebr-step--active .ebr-step__dot{background:color-mix(in srgb,var(--accent) 12%,transparent);border:1.5px solid var(--accent);animation:ebr-pop .45s cubic-bezier(.34,1.56,.64,1) backwards, ebr-pulse 2.4s ease-in-out .5s infinite;}
.ebr-step--active .ebr-step__dot::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--accent);box-shadow:0 0 8px color-mix(in srgb,var(--accent) 70%,transparent);}
@keyframes ebr-pulse{0%,100%{box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 16%,transparent),0 0 14px color-mix(in srgb,var(--accent) 28%,transparent);}50%{box-shadow:0 0 0 7px color-mix(in srgb,var(--accent) 6%,transparent),0 0 26px color-mix(in srgb,var(--accent) 50%,transparent);}}
.ebr-step--future .ebr-step__dot{background:transparent;border:1px dashed var(--line-strong);}
.ebr-step__dot svg{width:12px;height:12px;stroke:var(--parchment-soft);stroke-width:2.5;fill:none;stroke-linecap:round;stroke-linejoin:round;}
.ebr-step--active .ebr-step__dot svg,.ebr-step--future .ebr-step__dot svg{display:none;}
.ebr-step__line{flex:1 1 0;height:1px;margin-top:14px;background:var(--line-strong);position:relative;}
.ebr-step__line--done{background:linear-gradient(90deg,var(--moss-700),var(--moss-500));}
.ebr-step__line--active-from{background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 55%,transparent),var(--line-strong));}
.ebr-step__line--future{background-image:linear-gradient(90deg,var(--line-strong) 50%,transparent 50%);background-size:6px 1px;background-repeat:repeat-x;}
.ebr-step__label{margin-top:.7rem;font-family:var(--font-body);font-weight:700;font-size:10px;letter-spacing:.05em;text-transform:uppercase;color:var(--text-2);white-space:nowrap;line-height:1.2;}
.ebr-step--done .ebr-step__label{color:var(--primary-ink);}
.ebr-step--active .ebr-step__label{color:var(--accent-ink);}
.ebr-step__time{margin-top:.3rem;font-family:var(--font-body);font-size:10.5px;color:var(--text-3);font-variant-numeric:tabular-nums;line-height:1.2;white-space:nowrap;}
.ebr-progress__shopify-wrap{display:flex;justify-content:center;margin-top:1.2rem;}
.ebr-progress__shopify{display:inline-flex;align-items:center;gap:.55rem;padding:.42rem .9rem;background:color-mix(in srgb,var(--moss-500) 9%,transparent);border:1px solid color-mix(in srgb,var(--moss-500) 30%,transparent);border-radius:999px;font-family:var(--font-body);font-weight:700;font-size:10px;letter-spacing:.05em;text-transform:uppercase;color:var(--primary-ink);}
.ebr-progress__shopify-dot{width:6px;height:6px;border-radius:50%;background:var(--moss-500);box-shadow:0 0 6px color-mix(in srgb,var(--moss-500) 65%,transparent);}
.ebr-progress__shopify-time{color:var(--text-3);font-weight:400;letter-spacing:.02em;text-transform:none;}
.ebr-progress__warning{margin-top:1rem;padding:.6rem .9rem;background:color-mix(in srgb,var(--warn) 14%,transparent);border-radius:10px;border:1px solid color-mix(in srgb,var(--warn) 40%,transparent);border-left:2px solid var(--warn);font-size:13px;color:var(--text-1);line-height:1.45;}
.ebr-progress__warning strong{font-family:var(--font-body);font-weight:700;text-transform:uppercase;letter-spacing:.06em;font-size:10px;color:var(--accent-ink);display:block;margin-bottom:.15rem;}
.ebr-progress--error{display:flex;gap:.95rem;align-items:flex-start;padding:1.1rem 1.2rem;border-radius:14px;background:color-mix(in srgb,var(--err) 12%,transparent);border:1px solid color-mix(in srgb,var(--err) 38%,transparent);border-left:3px solid var(--err);animation:ebr-reveal .5s cubic-bezier(.22,1,.36,1);}
.ebr-progress--error__icon{width:30px;height:30px;border-radius:50%;background:color-mix(in srgb,var(--err) 18%,transparent);color:var(--err);display:flex;align-items:center;justify-content:center;flex-shrink:0;font-family:var(--font-serif);font-weight:600;font-size:16px;line-height:1;}
.ebr-progress--error__title{font-family:var(--font-body);font-weight:700;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--err);margin-bottom:.35rem;}
.ebr-progress--error__msg{font-size:13.5px;color:var(--text-1);line-height:1.45;}
.ebr-progress--error__time{margin-top:.55rem;font-size:10.5px;color:var(--text-3);font-variant-numeric:tabular-nums;}

@media (prefers-reduced-motion: reduce){
  .ebr-progress,.ebr-step__dot,.eb-bar__fill::after{animation:none!important;}
}

@media (max-width:640px){
  .ebr-progress{padding:1.25rem 1rem 1rem;}
  .ebr-step{min-width:0;flex:1 1 0;}
  .ebr-step__dot{width:24px;height:24px;}
  .ebr-step__line{margin-top:12px;}
  .ebr-step__dot svg{width:10px;height:10px;stroke-width:3;}
  .ebr-step__label{font-size:8.5px;letter-spacing:.03em;margin-top:.5rem;opacity:.8;}
  .ebr-step__time{font-size:9px;}
  .ebr-step--done .ebr-step__time,.ebr-step--future .ebr-step__time{display:none;}
  .ebr-step--active .ebr-step__label{opacity:1;}
}

/* ─── Card de pedido completa (header + stepper + meta) ──────────── */
/* Vista principal de MCB: cada pedido es una card con cabecera, el stepper
   dentro del cuerpo y un pie de metadatos. Diseño aprobado en la vitrina. */
.order{background:var(--bg-1);border:1px solid var(--line);border-radius:14px;overflow:hidden;}
.order.is-clickable{cursor:pointer;transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease;}
.order.is-clickable:hover{border-color:var(--line-strong);box-shadow:0 6px 22px rgba(0,0,0,.14);transform:translateY(-1px);}
.order__head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding:.6rem .9rem;border-bottom:1px solid var(--line);}
.order__id{font-family:var(--font-display);font-size:.92rem;line-height:1.15;color:var(--text-1);}
.order__who{font-family:var(--font-serif);font-style:italic;font-size:.86rem;color:var(--text-2);margin-top:.05rem;}
.order__src{flex:0 0 auto;font-family:var(--font-body);font-weight:700;font-size:.6rem;letter-spacing:.08em;text-transform:uppercase;color:var(--text-2);padding:.24rem .5rem;border:1px solid var(--line-strong);border-radius:8px;white-space:nowrap;}
.order__body{padding:.45rem .65rem .25rem;}
/* Stepper compacto dentro de la card: sin animación, sin borde/fondo propios
   (la card ya delimita la sección — evita el doble borde). */
.order__body .ebr-progress{animation:none;padding:.5rem .35rem .15rem;border:0;background:transparent;}
.order__body .ebr-progress::before{display:none;}
.order__body .ebr-step__dot{width:23px;height:23px;}
.order__body .ebr-step__line{margin-top:11px;}
.order__body .ebr-step__label{margin-top:.4rem;font-size:9px;}
.order__body .ebr-step__time{margin-top:.1rem;font-size:9px;}
.order__body .ebr-progress__shopify-wrap{margin-top:.6rem;}
.order__body .ebr-progress__shopify{padding:.28rem .65rem;font-size:9px;}
.order__body .ebr-progress__warning{margin-top:.55rem;padding:.4rem .65rem;}
/* Meta homogénea: columnas de ancho fijo para que los campos queden alineados
   entre tarjetas. Destino más ancha (pueblos largos) y truncada con … en vez
   de empujar el resto a la derecha. */
.order__meta{display:grid;grid-template-columns:1.6fr 1.1fr 1fr 1fr;gap:.35rem .9rem;padding:.5rem .9rem;border-top:1px solid var(--line);}
.order__meta > div{display:flex;flex-direction:column;min-width:0;}
.order__meta dt{font-family:var(--font-body);font-weight:700;font-size:.58rem;letter-spacing:.07em;text-transform:uppercase;color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.order__meta dd{margin:.12rem 0 0;font-size:.82rem;color:var(--text-1);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
@media (max-width:640px){
  .order__head{flex-direction:column;gap:.4rem;}
  .order__meta{grid-template-columns:1fr 1fr;}
}

/* Lista de cards de pedido (vista principal) + título de sección EB */
.ebr-orders{display:flex;flex-direction:column;gap:.7rem;}
.ebr-section-title{font-family:var(--font-display);font-size:1.4rem;line-height:1.2;color:var(--text-1);letter-spacing:.01em;margin-top:.55rem;}

/* Timeline fino del envío (eventos[] de MCB / fases de GLS) — detalle del pedido */
.ebr-timeline{display:flex;flex-direction:column;}
.ebr-timeline__item{position:relative;display:flex;gap:.6rem;padding:0 0 .65rem .15rem;margin-left:3px;border-left:1px solid var(--line-strong);padding-left:.85rem;}
.ebr-timeline__item:last-child{border-left-color:transparent;padding-bottom:0;}
.ebr-timeline__dot{position:absolute;left:-4.5px;top:.2rem;width:8px;height:8px;border-radius:50%;background:var(--text-4);flex:0 0 auto;}
.ebr-timeline__item.is-latest .ebr-timeline__dot{background:var(--accent);box-shadow:0 0 0 3px var(--gold-soft);}
.ebr-timeline__evento{font-size:.86rem;color:var(--text-2);line-height:1.25;}
.ebr-timeline__item.is-latest .ebr-timeline__evento{color:var(--text-1);font-weight:600;}
.ebr-timeline__fecha{font-size:.72rem;color:var(--text-3);font-variant-numeric:tabular-nums;margin-top:.1rem;}

/* ─── Overrides de colores hardcodeados de main.css (theme-aware) ─── */
/* main.css define algunos colores fijos (oscuros) que no seguían el tema.
   Los reconducimos a tokens. (El resto del pulido por página = paso 3.) */
.glass { background: color-mix(in srgb, var(--bg-1) 82%, transparent) !important; }

/* Tablas .ebrain-tablecards: main.css usa rgba(255,255,255,…) para texto,
   bordes y hover; sobre pergamino (tema claro) quedan invisibles. Solo en
   claro los reconducimos a tokens. El tema oscuro queda intacto. */
html.theme-light .ebrain-table-wrap{background:var(--bg-1);border-color:var(--line);box-shadow:0 8px 24px rgba(58,52,42,.08);}
html.theme-light .ebrain-tablecards th{color:var(--text-3);border-bottom-color:var(--line-strong);}
html.theme-light .ebrain-tablecards td{color:var(--text-2);border-bottom-color:var(--line);}
html.theme-light .ebrain-tablecards tbody tr:hover{background:var(--bg-2);}
@media (max-width:768px){
  html.theme-light .ebrain-tablecards tbody tr{background:var(--bg-1);border-color:var(--line);box-shadow:0 6px 16px rgba(58,52,42,.08);}
  html.theme-light .ebrain-tablecards td{border-bottom-color:var(--line);}
  html.theme-light .ebrain-tablecards td::before{color:var(--text-3);}
}

/* Shell compartido (header, subtabs, badges, cards, botones, selects):
   main.css los pinta con blancos hardcodeados → invisibles sobre pergamino.
   Reconducidos a tokens SOLO en claro; el tema oscuro queda intacto. */
html.theme-light .ebrain-page-header{background:rgba(var(--bg-1-rgb),.80);border-bottom-color:var(--line);}
html.theme-light .ebrain-page-title{color:var(--text-1);}
html.theme-light .ebrain-subtabs{background:transparent;border-bottom-color:var(--line);}
html.theme-light .ebrain-subtab{color:var(--text-2);}
html.theme-light .ebrain-subtab:hover{color:var(--text-1);background:var(--bg-3);}
html.theme-light .ebrain-subtab.is-active{background:var(--gold-soft);color:var(--accent-ink);box-shadow:inset 0 0 0 1px var(--gold-glow);}
html.theme-light .ebrain-badge{background:var(--gold-soft);color:var(--accent-ink);}
html.theme-light .ebrain-card{background:var(--bg-1);border-color:var(--line);box-shadow:0 1px 0 rgba(255,255,255,.45) inset,0 8px 22px rgba(58,52,42,.08);}
html.theme-light .ebrain-card:hover{border-color:var(--line-strong);}
html.theme-light .ebrain-card__label{color:var(--text-3);}
html.theme-light .ebrain-card__value{color:var(--text-1);}
html.theme-light .ebrain-card__hint{color:var(--text-2);}
html.theme-light .ebrain-action-btn{color:var(--text-1);background:var(--bg-2);border-color:var(--line-strong);}
html.theme-light .ebrain-action-btn:hover{color:var(--text-1);background:var(--bg-3);border-color:var(--gold);}
html.theme-light .ebrain-select{color:var(--text-1);background-color:var(--bg-2);border-color:var(--line-strong);background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233a342a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");}

/* Tints de estado de Tailwind (text-*-200/300, pensados para fondo oscuro):
   sobre pergamino son ilegibles (amarillo/verde claro/morado claro). En claro
   reconducimos el TEXTO a tonos oscuros legibles; los fondos /10-/20 quedan
   como wash suave con borde. Afecta a pills de estado, banners y "En MCB". */
html.theme-light .text-amber-100,
html.theme-light .text-amber-200,
html.theme-light .text-amber-300{color:#92400e;}
html.theme-light .text-emerald-100,
html.theme-light .text-emerald-200,
html.theme-light .text-emerald-300{color:#066e52;}
html.theme-light .text-green-200,
html.theme-light .text-green-300{color:#15803d;}
html.theme-light .text-violet-200,
html.theme-light .text-violet-300{color:#6d28d9;}
html.theme-light .text-blue-200,
html.theme-light .text-blue-300{color:#1d4ed8;}
html.theme-light .text-indigo-200,
html.theme-light .text-indigo-300{color:#4338ca;}
html.theme-light .text-cyan-200,
html.theme-light .text-cyan-300{color:#0e7490;}
html.theme-light .text-rose-100,
html.theme-light .text-rose-200,
html.theme-light .text-rose-300{color:#be123c;}

/* ─── Toggle de tema (desktop, inyectado en el pie del sidebar) ──── */
.eb-theme-toggle{display:flex;align-items:center;gap:.4rem;padding:.3rem;margin-bottom:.5rem;border:1px solid var(--line);border-radius:999px;background:var(--bg-2);}
.eb-theme-toggle button{flex:1;border:0;background:transparent;color:var(--text-3);font-family:var(--font-body);font-weight:700;font-size:.62rem;letter-spacing:.08em;text-transform:uppercase;padding:.4rem .3rem;border-radius:999px;cursor:pointer;transition:all .22s ease;display:inline-flex;align-items:center;justify-content:center;gap:.3rem;}
.eb-theme-toggle button.is-active{background:var(--gold);color:var(--bg-0);}
.eb-theme-toggle svg{width:13px;height:13px;stroke:currentColor;stroke-width:1.6;fill:none;}

/* ─── "···" de acciones móviles + su hoja en tema claro (2026-10-08) ── */
/* main.css los pinta con blancos fijos pensados para oscuro: en el tema de
   Elena el botón era blanco sobre pergamino (invisible) y la hoja salía
   azul noche. Aquí siguen las variables del tema. */
html.theme-light .ebrain-action-overflow { color: var(--text-1); background: var(--bg-2); border-color: var(--line-strong); }
html.theme-light .ebrain-action-overflow:hover { background: var(--bg-3); }
html.theme-light .ebrain-action-sheet__inner { background: var(--bg-1); border-top-color: var(--line); }
html.theme-light .ebrain-action-sheet__title { color: var(--text-3); border-bottom-color: var(--line); }
html.theme-light .ebrain-action-sheet__item { color: var(--text-1); border-bottom-color: var(--line); }
html.theme-light .ebrain-action-sheet__item.is-disabled { color: var(--text-4); }
html.theme-light .ebrain-action-sheet__item:active,
html.theme-light .ebrain-action-sheet__cancel:active { background: var(--bg-3); }
html.theme-light .ebrain-action-sheet__cancel { color: var(--accent-ink); }

/* ─── Contador en items del menú (sidebar + drawer móvil) ───────────── */
.ebrain-nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--primary); color: var(--primary-contrast); }
.ebrain-nav-badge.is-late { background: var(--err); color: #fff; }
