/* ============================================================================
   ALÓ — Sistema de diseño para las apps internas (app.alohaestudio.com.ar)
   ----------------------------------------------------------------------------
   Base: la app de Tareas (escala, formas, densidad, modo claro/oscuro).
   Identidad: ALÓ — acento azul de marca #3a6e9c (el punto del logo).

   Uso en una app nueva:
     <link rel="stylesheet" href="/assets/alo-ds.css">
     <script src="/assets/alo-ds.js" defer></script>
   Todo lo específico de la app va DESPUÉS de este link y usa estas variables.
   Nunca hardcodear un color: siempre var(--…).

   Modo de color: sigue el sistema por defecto; el botón de tema escribe
   html[data-theme="light"|"dark"] y lo persiste en localStorage ('alo_theme').
   ============================================================================ */

/* ── RESET ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS ────────────────────────────────────────────────────────────── */
:root {
  /* Superficies */
  --bg:#f6f7f9; --card:#ffffff; --l2:#eceef1; --l3:#e2e5ea;
  /* Bordes */
  --b1:rgba(0,0,0,.07); --b2:rgba(0,0,0,.12);
  /* Texto */
  --t1:#1b1c1f; --t2:rgba(0,0,0,.5); --t3:rgba(0,0,0,.36);
  /* Sidebar */
  --sb:#eef0f3; --sb-b:rgba(0,0,0,.07); --sb-hov:rgba(0,0,0,.045); --sb-act:rgba(58,110,156,.11);
  --sb-t1:#1b1c1f; --sb-t2:rgba(0,0,0,.6); --sb-t3:rgba(0,0,0,.42);
  /* Acento — azul de marca ALÓ */
  --acc:#3a6e9c; --acc-hov:#325f88; --acc-bg:rgba(58,110,156,.10); --acc-b:rgba(58,110,156,.26);
  --on-acc:#ffffff;
  /* Semánticos — gama pastel. Los fondos son el color PLENO resultante de
     componer el color sobre blanco al 10%: así el mismo valor sirve en claro y
     en oscuro y las etiquetas nunca se vuelven fosforescentes. */
  --grn:#1aa251; --grn-bg:#e8f6ee;
  --red:#e0463c; --red-bg:#fcedec;
  --ylw:#d97706; --ylw-bg:#fbf1e6;
  --amber:#f5860b;
  --purple:#7c5cd6; --purple-bg:#f2effb;
  /* Tinta del cuerpo de texto dentro de una pastilla/aviso teñido */
  --on-tint:#3f4147;
  /* Borde de la pastilla (en claro no hace falta: el tinte ya la separa) */
  --tint-bd:transparent;
  /* Azul de la pastilla: en claro es el acento; en oscuro se apaga */
  --acc-tint:#3a6e9c;
  /* Burbuja de contador (pendientes) */
  --count-bg:#ffffff; --count-fg:#3a6e9c;
  /* Marca en valor fijo: idéntico en claro y oscuro */
  --acc-ink:#3a6e9c; --pure-white:#ffffff;
  /* Header traslúcido + sombra */
  --hbg:rgba(246,247,249,.85);
  --sh:0 1px 3px rgba(0,0,0,.05),0 1px 2px rgba(0,0,0,.03);
  --sh-lg:0 12px 36px rgba(0,0,0,.14),0 2px 8px rgba(0,0,0,.06);
  /* Métrica */
  --sb-w:240px; --hdr-h:64px; --pad:22px;
  --r-sm:8px; --r:12px; --r-lg:16px; --r-xl:20px; --r-pill:999px;
  /* Tipografía */
  --font:-apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI',Roboto,sans-serif;
  --font-mono:ui-monospace,SFMono-Regular,'SF Mono',Menlo,monospace;
  /* Escala fluida: móvil = cómodo, desktop = compacto (idéntica a Tareas) */
  --fs-dh:clamp(11px, 12.438px - 0.112vw, 12px);          /* encabezado de sección */
  --fs-label:clamp(10.5px, 11.219px - 0.056vw, 11px);      /* label de campo */
  --fs-meta:clamp(11.5px, 12.219px - 0.056vw, 12px);       /* metadatos */
  --fs-bsm:clamp(12.5px, 13.219px - 0.056vw, 13px);        /* botón chico */
  --fs-chip:clamp(12.5px, 13.938px - 0.112vw, 13.5px);
  --fs-body:clamp(13.5px, 14.219px - 0.056vw, 14px);       /* texto base */
  --fs-card-ttl:clamp(13.5px, 15.657px - 0.169vw, 15px);   /* título de card */
  --fs-cbtn:clamp(14px, 15.438px - 0.112vw, 15px);
  --fs-field:clamp(14.5px, 16.657px - 0.169vw, 16px);      /* input */
  --fs-btn:clamp(14.5px, 16.657px - 0.169vw, 16px);
  --fs-modal-h:clamp(15px, 16.438px - 0.112vw, 16px);
  --fs-h3:clamp(15.5px, 17.657px - 0.169vw, 17px);
  --fs-h2:clamp(18px, 20.876px - 0.225vw, 20px);
  --fs-h1:clamp(22px, 24.876px - 0.225vw, 24px);
  --fs-display:clamp(28px, 34px - 0.5vw, 34px);
  color-scheme: light;
}

/* Modo oscuro por sistema (salvo que el usuario haya forzado claro) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#16171b; --card:#1f2127; --l2:#292b32; --l3:#34373f;
    --b1:rgba(255,255,255,.07); --b2:rgba(255,255,255,.14);
    --t1:#f0f1f3; --t2:rgba(235,237,242,.58); --t3:rgba(235,237,242,.4);
    --sb:#1b1d22; --sb-b:rgba(255,255,255,.06); --sb-hov:rgba(255,255,255,.05); --sb-act:rgba(110,163,212,.16);
    --sb-t1:#f0f1f3; --sb-t2:rgba(235,237,242,.64); --sb-t3:rgba(235,237,242,.44);
    --acc:#6ea3d4; --acc-hov:#84b3de; --acc-b:rgba(110,163,212,.32);
    --on-acc:#10151c;
    /* Semánticos en oscuro — NO son los del claro.
       Sobre fondo oscuro un tinte de color se lee como brillo, así que la
       pastilla es un neutro fijo (= --l2) con un borde de un pelo y lo único
       que cambia entre estados es el color de la tipografía, muy desaturado
       (OKLCH L .775 / C .034: mismo peso visual para los cinco). */
    --grn:#a7bcab; --red:#cbaeaa; --ylw:#c7b1a1; --purple:#b6b2ca; --amber:#c7b1a1;
    --grn-bg:#292b32; --red-bg:#292b32; --ylw-bg:#292b32; --purple-bg:#292b32;
    --acc-bg:#292b32; --acc-tint:#a5b8cb;
    --tint-bd:rgba(255,255,255,.11);
    --on-tint:rgba(235,237,242,.74);
    --count-bg:#223241; --count-fg:#a5b8cb;
    --hbg:rgba(22,23,27,.82);
    --sh:0 1px 3px rgba(0,0,0,.4);
    --sh-lg:0 12px 36px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

/* Modo forzado por el botón de tema (gana en ambas direcciones) */
:root[data-theme="dark"] {
  --bg:#16171b; --card:#1f2127; --l2:#292b32; --l3:#34373f;
  --b1:rgba(255,255,255,.07); --b2:rgba(255,255,255,.14);
  --t1:#f0f1f3; --t2:rgba(235,237,242,.58); --t3:rgba(235,237,242,.4);
  --sb:#1b1d22; --sb-b:rgba(255,255,255,.06); --sb-hov:rgba(255,255,255,.05); --sb-act:rgba(110,163,212,.16);
  --sb-t1:#f0f1f3; --sb-t2:rgba(235,237,242,.64); --sb-t3:rgba(235,237,242,.44);
  --acc:#6ea3d4; --acc-hov:#84b3de; --acc-b:rgba(110,163,212,.32);
  --on-acc:#10151c;
    /* Semánticos en oscuro — NO son los del claro.
     Sobre fondo oscuro un tinte de color se lee como brillo, así que la
     pastilla es un neutro fijo (= --l2) con un borde de un pelo y lo único
     que cambia entre estados es el color de la tipografía, muy desaturado
     (OKLCH L .775 / C .034: mismo peso visual para los cinco). */
  --grn:#a7bcab; --red:#cbaeaa; --ylw:#c7b1a1; --purple:#b6b2ca; --amber:#c7b1a1;
  --grn-bg:#292b32; --red-bg:#292b32; --ylw-bg:#292b32; --purple-bg:#292b32;
  --acc-bg:#292b32; --acc-tint:#a5b8cb;
  --tint-bd:rgba(255,255,255,.11);
  --on-tint:rgba(235,237,242,.74);
  --count-bg:#223241; --count-fg:#a5b8cb;
  --hbg:rgba(22,23,27,.82);
  --sh:0 1px 3px rgba(0,0,0,.4);
  --sh-lg:0 12px 36px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.3);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ── BASE ──────────────────────────────────────────────────────────────── */
html, body {
  background: var(--bg); color: var(--t1);
  font-family: var(--font); font-size: var(--fs-body); line-height: 1.5;
  min-height: 100%; -webkit-font-smoothing: antialiased;
}
/* El overflow-x va SÓLO en html: el de html se propaga al viewport y sigue
   cortando el scroll horizontal, pero puesto también en body lo convierte en
   contenedor de scroll y deja inertes TODOS los position:sticky de la página
   (topbar, paneles fijos). No moverlo a body. */
html { overflow-x: hidden; }
button, a, input, select, textarea, label { touch-action: manipulation; }
/* 16px real en móvil evita el zoom automático de iOS al enfocar un campo */
input, select, textarea { font-size: 16px; font-family: inherit; }
select option { background: var(--card); color: var(--t1); }
a { color: var(--acc); }
h1,h2,h3,h4 { font-weight: 700; letter-spacing: -.3px; line-height: 1.2; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
code, pre, .alo-mono { font-family: var(--font-mono); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--b2); border-radius: var(--r-pill); }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
input[type=time]::-webkit-calendar-picker-indicator,
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .45; }
:root[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type=time]::-webkit-calendar-picker-indicator { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) input[type=date]::-webkit-calendar-picker-indicator,
  :root:not([data-theme="light"]) input[type=time]::-webkit-calendar-picker-indicator { filter: invert(1); }
}

/* ── MARCA ─────────────────────────────────────────────────────────────── */
/* El logo correcto se elige solo por modo: negro en claro, blanco en oscuro.
   Marcar el <img> negro con .alo-logo--light y el blanco con .alo-logo--dark. */
/* align-self evita que un contenedor flex en columna estire el logo a todo el
   ancho (con la altura fija eso lo deformaba). En .alo-brand, que es fila, se
   vuelve a centrar más abajo. */
.alo-logo { height: 26px; width: auto; max-width: 100%; display: block;
  align-self: flex-start; flex: 0 0 auto; object-fit: contain; }
.alo-logo--dark { display: none; }
:root[data-theme="dark"] .alo-logo--light { display: none; }
:root[data-theme="dark"] .alo-logo--dark  { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .alo-logo--light { display: none; }
  :root:not([data-theme="light"]) .alo-logo--dark  { display: block; }
}
/* Sobre fondo permanentemente oscuro (sidebar tinta, card de acento): usar
   siempre el blanco, sin importar el modo. */
.alo-on-dark .alo-logo--light { display: none !important; }
.alo-on-dark .alo-logo--dark  { display: block !important; }

.alo-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.alo-brand .alo-logo { align-self: center; }
.alo-brand-sep { width: 1px; height: 18px; background: var(--b2); flex-shrink: 0; }
.alo-brand-app { font-size: var(--fs-card-ttl); font-weight: 600; color: var(--t1);
  letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── LAYOUT ────────────────────────────────────────────────────────────── */
.alo-shell { display: flex; min-height: 100vh; }
.alo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.alo-content { flex: 1; padding: 18px var(--pad) 88px; width: 100%; }
@media (min-width: 769px) { .alo-content { padding: 24px 32px 64px; } }

.alo-hdr {
  min-height: var(--hdr-h); padding: 0 14px; display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 30; background: var(--hbg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--b1); flex-shrink: 0;
}
@media (min-width: 769px) { .alo-hdr { padding: 0 24px; } }
.alo-hdr-title { font-size: var(--fs-h2); font-weight: 700; letter-spacing: -.4px;
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── SIDEBAR ───────────────────────────────────────────────────────────── */
.alo-sb {
  width: var(--sb-w); flex-shrink: 0; background: var(--sb);
  border-right: 1px solid var(--sb-b); display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0; z-index: 20;
}
.alo-sb-hdr { min-height: var(--hdr-h); padding: 0 14px; display: flex; align-items: center;
  gap: 9px; flex-shrink: 0; border-bottom: 1px solid var(--sb-b); }
.alo-sb-body { flex: 1; overflow-y: auto; padding: 8px 10px; }
.alo-sb-foot { padding: 8px 10px 12px; border-top: 1px solid var(--sb-b); flex-shrink: 0; }
.alo-sb-sec { font-size: var(--fs-dh); font-weight: 700; color: var(--sb-t3);
  text-transform: uppercase; letter-spacing: .5px; padding: 14px 8px 5px;
  display: flex; align-items: center; justify-content: space-between; }
.alo-sb-item {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: 9px; border: none; background: transparent; color: var(--sb-t2);
  font-size: var(--fs-body); font-weight: 500; font-family: inherit; cursor: pointer;
  transition: background .12s, color .12s; text-align: left; text-decoration: none;
}
@media (hover: hover) { .alo-sb-item:hover { background: var(--sb-hov); color: var(--sb-t1); } }
.alo-sb-item.is-active { background: var(--sb-act); color: var(--acc); font-weight: 600; }
.alo-sb-item svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .8; }
.alo-sb-item.is-active svg { opacity: 1; }
.alo-sb-item-lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alo-sb-badge { font-size: var(--fs-meta); font-weight: 700; color: var(--sb-t3); }
.alo-sb-item.is-active .alo-sb-badge { color: var(--acc); }
.alo-sb-ver { font-size: 10px; color: var(--sb-t3); text-align: center; padding-top: 8px;
  opacity: .6; letter-spacing: .4px; }

/* Drawer en móvil */
.alo-sb-ov { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 79; }
.alo-sb-ov.is-open { display: block; }
@media (max-width: 768px) {
  .alo-sb { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; z-index: 80;
    width: 84vw; max-width: 320px; transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.4,0,.2,1); }
  .alo-sb.is-open { transform: translateX(0); }
}

/* ── BOTONES ───────────────────────────────────────────────────────────── */
.alo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent;
  background: var(--acc); color: var(--on-acc);
  font-family: inherit; font-size: var(--fs-cbtn); font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, transform .08s;
}
@media (hover: hover) { .alo-btn:hover { background: var(--acc-hov); } }
.alo-btn:active { transform: scale(.97); }
.alo-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.alo-btn[disabled], .alo-btn.is-disabled { opacity: .45; pointer-events: none; }

.alo-btn--ghost { background: transparent; color: var(--t2); border-color: var(--b2); }
@media (hover: hover) { .alo-btn--ghost:hover { background: var(--l2); color: var(--t1); border-color: var(--b2); } }
.alo-btn--soft { background: var(--l2); color: var(--t1); border-color: var(--b1); }
@media (hover: hover) { .alo-btn--soft:hover { background: var(--l3); } }
.alo-btn--danger { background: var(--red); color: #fff; }
@media (hover: hover) { .alo-btn--danger:hover { background: var(--red); filter: brightness(1.08); } }
.alo-btn--sm { height: 32px; padding: 0 11px; font-size: var(--fs-bsm); border-radius: var(--r-sm); }
.alo-btn--sm svg { width: 15px; height: 15px; }
.alo-btn--block { width: 100%; }

/* Botón sólo icono */
.alo-ibtn {
  width: 36px; height: 36px; border-radius: 9px; border: none; background: transparent;
  color: var(--t2); cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: background .12s, color .12s;
}
@media (hover: hover) { .alo-ibtn:hover { background: var(--l2); color: var(--t1); } }
.alo-ibtn svg { width: 19px; height: 19px; }
.alo-ibtn--sm { width: 30px; height: 30px; border-radius: var(--r-sm); }
.alo-ibtn--sm svg { width: 16px; height: 16px; }


/* Tamaño por defecto de los iconos dentro de botones y enlaces. :where() tiene
   especificidad cero: cualquier regla propia de una app lo sobrescribe. */
:where(button, a, summary, label) svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ── FORMULARIOS ───────────────────────────────────────────────────────── */
.alo-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.alo-label { font-size: var(--fs-label); font-weight: 700; color: var(--t3);
  text-transform: uppercase; letter-spacing: .5px; }
.alo-input, .alo-select, .alo-textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px;
  border: 1.5px solid var(--b1); background: var(--card); color: var(--t1);
  font-family: inherit; font-size: var(--fs-field); outline: none;
  transition: border-color .14s, background .14s; -webkit-appearance: none; appearance: none;
}
.alo-textarea { min-height: 88px; resize: vertical; line-height: 1.55; }
.alo-input:focus, .alo-select:focus, .alo-textarea:focus { border-color: var(--acc); }
.alo-input::placeholder, .alo-textarea::placeholder { color: var(--t3); }
.alo-select {
  padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.alo-hint { font-size: var(--fs-meta); color: var(--t3); }

/* Buscador tipo pill */
.alo-search { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-radius: var(--r-pill); background: var(--l2); border: 1.5px solid var(--b1);
  transition: border-color .14s; }
.alo-search:focus-within { border-color: var(--acc); }
.alo-search svg { width: 16px; height: 16px; color: var(--t3); flex-shrink: 0; }
.alo-search input { flex: 1; min-width: 0; border: none; background: transparent;
  color: var(--t1); font-family: inherit; outline: none; }

/* ── CARDS ─────────────────────────────────────────────────────────────── */
.alo-card { background: var(--card); border: 1px solid var(--b1); border-radius: var(--r-lg);
  padding: 16px; box-shadow: var(--sh); }
.alo-card-ttl { font-size: var(--fs-card-ttl); font-weight: 600; letter-spacing: -.2px; }
.alo-card-meta { font-size: var(--fs-meta); color: var(--t3); }
.alo-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* KPI */
.alo-kpi { background: var(--card); border: 1px solid var(--b1); border-radius: var(--r-lg);
  padding: 15px 16px; display: flex; flex-direction: column; gap: 5px; box-shadow: var(--sh); }
.alo-kpi-lbl { font-size: var(--fs-label); font-weight: 700; color: var(--t3);
  text-transform: uppercase; letter-spacing: .5px; }
.alo-kpi-val { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.6px;
  font-variant-numeric: tabular-nums; }
.alo-kpi-sub { font-size: var(--fs-meta); color: var(--t3); }

/* ── CHIPS / BADGES ────────────────────────────────────────────────────── */
.alo-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--r-pill); border: 1.5px solid var(--b1); background: var(--l2);
  color: var(--t2); font-family: inherit; font-size: var(--fs-chip); font-weight: 600;
  cursor: pointer; transition: border-color .12s, color .12s, background .12s;
  -webkit-appearance: none; appearance: none; white-space: nowrap;
}
@media (hover: hover) { .alo-chip:hover { border-color: var(--b2); color: var(--t1); } }
.alo-chip.is-active { border-color: var(--acc); color: var(--acc); background: var(--acc-bg); }
.alo-chip svg { width: 15px; height: 15px; flex-shrink: 0; }

.alo-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--r-pill); font-size: var(--fs-meta); font-weight: 600;
  border: 1px solid var(--tint-bd);
  background: var(--l2); color: var(--t2); white-space: nowrap; line-height: 1.4;
}
.alo-badge--acc    { background: var(--acc-bg);    color: var(--acc-tint); }
.alo-badge--ok     { background: var(--grn-bg);    color: var(--grn); }
.alo-badge--warn   { background: var(--ylw-bg);    color: var(--ylw); }
.alo-badge--danger { background: var(--red-bg);    color: var(--red); }
.alo-badge--info   { background: var(--purple-bg); color: var(--purple); }
.alo-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: currentColor; }

/* ── TABLAS ────────────────────────────────────────────────────────────── */
.alo-table-wrap { overflow-x: auto; border: 1px solid var(--b1); border-radius: var(--r-lg);
  background: var(--card); }
.alo-table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.alo-table th {
  text-align: left; padding: 10px 14px; font-size: var(--fs-label); font-weight: 700;
  color: var(--t3); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--b1); background: var(--l2); white-space: nowrap;
}
.alo-table td { padding: 11px 14px; border-bottom: 1px solid var(--b1); vertical-align: middle; }
.alo-table tr:last-child td { border-bottom: none; }
@media (hover: hover) { .alo-table tbody tr:hover { background: var(--l2); } }
.alo-num { font-variant-numeric: tabular-nums; text-align: right; }

/* ── MODALES ───────────────────────────────────────────────────────────── */
.alo-modal-ov {
  position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.alo-modal {
  background: var(--card); border: 1px solid var(--b1); border-radius: var(--r-xl);
  width: 100%; max-width: 480px; max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: var(--sh-lg); overflow: hidden;
}
.alo-modal-hdr { padding: 16px 18px; border-bottom: 1px solid var(--b1);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.alo-modal-ttl { font-size: var(--fs-modal-h); font-weight: 700; flex: 1;
  letter-spacing: -.2px; min-width: 0; }
.alo-modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.alo-modal-foot { padding: 14px 18px; border-top: 1px solid var(--b1);
  display: flex; gap: 9px; justify-content: flex-end; flex-shrink: 0; }
/* En móvil el modal sube desde abajo, a pantalla casi completa */
@media (max-width: 640px) {
  .alo-modal-ov { padding: 0; align-items: flex-end; }
  .alo-modal { max-width: none; max-height: 92vh; border-radius: var(--r-xl) var(--r-xl) 0 0;
    animation: aloSlideUp .22s cubic-bezier(.4,0,.2,1); }
  .alo-modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
@keyframes aloSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── ESTADOS ───────────────────────────────────────────────────────────── */
.alo-empty { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 56px 24px; text-align: center; color: var(--t3); }
.alo-empty-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--l2);
  display: flex; align-items: center; justify-content: center; color: var(--t3); }
.alo-empty-ic svg { width: 26px; height: 26px; }
.alo-empty h3 { font-size: var(--fs-h3); color: var(--t1); }
.alo-empty p { font-size: var(--fs-body); max-width: 280px; line-height: 1.6; }

.alo-skel { background: var(--l2); border-radius: var(--r-sm); animation: aloPulse 1.4s ease-in-out infinite; }
@keyframes aloPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.alo-spin { width: 18px; height: 18px; border: 2px solid var(--b2); border-top-color: var(--acc);
  border-radius: 50%; animation: aloSpin .7s linear infinite; }
@keyframes aloSpin { to { transform: rotate(360deg); } }

.alo-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 200;
  background: var(--t1); color: var(--bg); padding: 11px 18px; border-radius: var(--r-pill);
  font-size: var(--fs-bsm); font-weight: 600; box-shadow: var(--sh-lg);
  max-width: calc(100vw - 32px); text-align: center;
}

/* ── SELECTOR DE TEMA ──────────────────────────────────────────────────── */
.alo-theme { display: flex; gap: 2px; background: var(--l2); border-radius: 9px; padding: 3px; }
.alo-theme button {
  flex: 1; padding: 6px 10px; border: none; border-radius: 7px; background: transparent;
  color: var(--t2); font-family: inherit; font-size: var(--fs-bsm); font-weight: 600;
  cursor: pointer; transition: background .12s, color .12s;
  -webkit-appearance: none; appearance: none;
}
.alo-theme button.is-active { background: var(--card); color: var(--t1); box-shadow: var(--sh); }

/* Botón compacto que cicla auto → claro → oscuro (para la barra superior) */
.alo-theme-toggle svg { width: 19px; height: 19px; }
.alo-theme-toggle .ic-auto, .alo-theme-toggle .ic-light, .alo-theme-toggle .ic-dark { display: none; }
:root:not([data-theme]) .alo-theme-toggle .ic-auto { display: block; }
:root[data-theme="light"] .alo-theme-toggle .ic-light { display: block; }
:root[data-theme="dark"]  .alo-theme-toggle .ic-dark  { display: block; }

/* ── UTILIDADES ────────────────────────────────────────────────────────── */
.alo-row { display: flex; align-items: center; gap: 10px; }
.alo-col { display: flex; flex-direction: column; gap: 10px; }
.alo-wrap { flex-wrap: wrap; }
.alo-spacer { flex: 1; }
.alo-t2 { color: var(--t2); }
.alo-t3 { color: var(--t3); }
.alo-meta { font-size: var(--fs-meta); color: var(--t3); }
.alo-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.alo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.alo-hide-desktop { display: none; }
@media (max-width: 768px) {
  .alo-hide-mobile  { display: none !important; }
  .alo-hide-desktop { display: inherit; }
}

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