:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --line: #e2e5ea;
  --ink: #0f1722;
  --ink-2: #4a5462;
  --ink-3: #7b8592;
  --brand: #183863;          /* azul MegaHierro */
  --brand-ink: #ffffff;
  --accent: #e33a1a;         /* rojo MegaHierro: solo marca, nunca datos */
  --series-1: #2a78d6;       /* venta */
  --series-ref: #0f1722;     /* presupuesto (marca de referencia) */
  --series-ant: #b9bfc8;     /* año anterior */
  --grid: #e8eaee;
  --good: #0ca30c; --good-ink: #067a06; --good-soft: #e5f6e5;
  --warn: #fab219; --warn-ink: #8a5a00; --warn-soft: #fff4dc;
  --crit: #d03b3b; --crit-ink: #b02a2a; --crit-soft: #fbe7e7;
  --info-soft: #e7f0fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 34, .06), 0 2px 8px rgba(15, 23, 34, .04);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111214; --surface: #1a1a19; --surface-2: #232422; --line: #2f302d;
    --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #8f8e86;
    --brand: #1d4277; --series-1: #3987e5; --series-ref: #f0efec; --series-ant: #5a5c5f; --grid: #2a2b29;
    --good-ink: #4cc94c; --good-soft: #15301a; --warn-ink: #fab219; --warn-soft: #33290f; --crit-ink: #ef7a7a; --crit-soft: #3a1b1b;
    --info-soft: #172438;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214; --surface: #1a1a19; --surface-2: #232422; --line: #2f302d;
  --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #8f8e86;
  --brand: #1d4277; --series-1: #3987e5; --series-ref: #f0efec; --series-ant: #5a5c5f; --grid: #2a2b29;
  --good-ink: #4cc94c; --good-soft: #15301a; --warn-ink: #fab219; --warn-soft: #33290f; --crit-ink: #ef7a7a; --crit-soft: #3a1b1b;
  --info-soft: #172438; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--series-1); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.cargando-inicial { padding: 40vh 16px; text-align: center; color: var(--ink-3); }

/* ---------- estructura ---------- */
.barra-sup {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: var(--brand-ink);
  padding: calc(var(--safe-t) + 10px) 16px 10px;
}
.barra-sup .fila { display: flex; align-items: center; gap: 10px; max-width: 980px; margin: 0 auto; }
.barra-sup h1 { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-sup .sub { font-size: 12px; opacity: .8; font-weight: 500; }
.filtros { display: flex; gap: 8px; max-width: 980px; margin: 8px auto 0; }
.filtros select {
  flex: 1; min-width: 0; appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: #fff; border: 1px solid rgba(255,255,255,.22); border-radius: 10px; padding: 8px 28px 8px 10px; font-size: 14px;
}
.filtros select option { color: #0f1722; }
main { max-width: 980px; margin: 0 auto; padding: 14px 16px calc(84px + var(--safe-b)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + var(--safe-b));
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 600; padding: 4px 0; border-radius: 10px;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.activo { color: var(--brand); }
:root[data-theme="dark"] .tabbar a.activo { color: var(--series-1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar a.activo { color: var(--series-1); } }

.subtabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.subtabs button.activo { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- tarjetas ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 14px; margin-bottom: 12px; }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.card .nota { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; }
.titulo-sec { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin: 18px 2px 8px; }

.heroes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
@media (min-width: 720px) { .heroes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); min-width: 0; }
.hero .et { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.hero .val { font-size: 22px; font-weight: 750; margin-top: 2px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .det { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.estado { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.estado.bien { background: var(--good-soft); color: var(--good-ink); }
.estado.aviso { background: var(--warn-soft); color: var(--warn-ink); }
.estado.mal { background: var(--crit-soft); color: var(--crit-ink); }
.estado.neutro { background: var(--surface-2); color: var(--ink-2); }
.estado.info { background: var(--info-soft); color: var(--series-1); }

/* ---------- listas ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { padding: 11px 0; border-top: 1px solid var(--line); }
.lista > li:first-child { border-top: 0; padding-top: 2px; }
.fila-x { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fila-x .crece { flex: 1; min-width: 0; }
.fila-x .nombre { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-x .meta { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.fuerte { font-weight: 700; }
.tenue { color: var(--ink-3); }
.pequeno { font-size: 12px; }
.clic { cursor: pointer; }

/* barra de avance vs presupuesto (con marca del 100%) */
.avance { position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; margin-top: 7px; }
.avance .relleno { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--series-1); }
.avance .meta100 { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--series-ref); border-radius: 1px; }

/* ---------- tablas ---------- */
.tabla-scroll { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th.num, table.t td.num { text-align: right; }
table.t tr:last-child td { border-bottom: 0; }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

/* ---------- gráficos ---------- */
.grafico { position: relative; width: 100%; }
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafico .eje { font-size: 11px; fill: var(--ink-3); }
.grafico .grid { stroke: var(--grid); stroke-width: 1; }
.leyenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin: 2px 0 8px; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.leyenda i.ref { height: 2px; width: 14px; border-radius: 1px; }
#tooltip {
  position: fixed; z-index: 100; pointer-events: none; max-width: 240px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 8px 10px; font-size: 12px;
}
#tooltip b { display: block; font-size: 13px; margin-bottom: 2px; }
.ver-tabla { background: none; border: 0; color: var(--series-1); font-size: 12px; font-weight: 600; padding: 4px 0; cursor: pointer; }

/* ---------- formularios ---------- */
.campo { display: block; margin-bottom: 12px; }
.campo > span { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.campo input, .campo select, .campo textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 16px;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid var(--series-1); outline-offset: 0; border-color: transparent; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 10px; font-weight: 650; font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn.prim { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.peligro { color: var(--crit-ink); }
.btn.chico { padding: 6px 10px; font-size: 13px; }
.btn.bloque { width: 100%; }
.btn:disabled { opacity: .5; }
.acciones { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.error { color: var(--crit-ink); font-size: 13px; margin: 6px 0; min-height: 18px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; padding: 4px 0; }
.check input { width: 18px; height: 18px; }

/* estrellas de evaluación */
.kpi-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.kpi-fila .t { font-size: 13px; flex: 1; min-width: 0; }
.estrellas { display: flex; gap: 2px; flex: none; }
.estrellas button { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--ink-3); padding: 0; }
.estrellas button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.login .caja { width: 100%; max-width: 380px; }
.login img { width: 100%; max-width: 320px; display: block; margin: 0 auto 18px; border-radius: 12px; }

/* modal */
dialog#modal { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog#modal::backdrop { background: rgba(10, 14, 20, .5); }
#modal-cuerpo { padding: 18px 16px; }
#modal-cuerpo h3 { font-size: 17px; margin-bottom: 12px; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--safe-b)); z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; max-width: calc(100vw - 32px);
}
.vacio { text-align: center; padding: 22px 8px; color: var(--ink-3); font-size: 14px; }
.aviso-caja { background: var(--warn-soft); color: var(--warn-ink); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.info-caja { background: var(--info-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.detalle { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
@media (forced-colors: active) { .avance .relleno { background: Highlight; } }
.grupo-cab { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin-bottom: 2px; }
.t.ajustada td { white-space: normal; } .t.ajustada td.num { white-space: nowrap; padding-left: 12px; }
/* barra superior: buscador y campana */
.icono-sup { position: relative; flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: inherit; background: rgba(255,255,255,.12); }
.icono-sup svg { width: 22px; height: 22px; }
.icono-sup .globo { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; line-height: 1; border: 2px solid var(--brand); }
.icono-sup .globo[hidden] { display: none; }
.card.tenue { opacity: .65; }
/* chips seleccionables (filtro de familia, búsquedas recientes) */
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; min-height: 32px; }
.chip.activo { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.chip.activo .tenue { color: rgba(255,255,255,.8); }
details > summary { list-style: none; } details > summary::before { content: '▸ '; color: var(--ink-3); } details[open] > summary::before { content: '▾ '; }
/* capacitación: tarjetas de práctica */
.barra-prog { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.barra-prog i { display: block; height: 100%; background: var(--series-1); transition: width .25s; }
.tarjeta-cap .frente { font-size: 18px; font-weight: 600; line-height: 1.35; margin: 10px 0 12px; }
.tarjeta-cap .dorso { margin: 0 0 6px; padding: 10px 12px 10px 30px; background: var(--bg); border-radius: 10px; }
.tarjeta-cap .dorso li { margin: 4px 0; }

/* =========================================================
   Diseño 2 (2026-11-19): más claro en celular y en computadora
   ========================================================= */
.hero .val { font-size: 24px; }
.card h2 { font-size: 16px; }
.lista > li.clic:hover, tr.clic:hover td { background: var(--surface-2); }
.lista > li.clic { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal !important; }

/* aviso de versión nueva */
.banda-version { max-width: 980px; margin: 10px auto 0; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--info-soft); color: var(--ink); border-radius: 12px; font-size: 14px; font-weight: 600; }
main > .banda-version, #vista + .banda-version { margin: 0 0 12px; }

/* selector de día compacto: ‹ miércoles 18 de noviembre › */
.dia-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.dia-nav button { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-2); }
.dia-nav button:disabled { opacity: .35; cursor: default; }
.dia-nav select { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 12px; font-weight: 650; text-align: center; text-align-last: center; appearance: none; -webkit-appearance: none; cursor: pointer; }

/* tarjeta principal de Hoy */
.hoy-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.grande { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; position: relative; overflow: hidden; }
.grande .et { font-size: 13px; color: var(--ink-3); font-weight: 650; }
.grande .val { font-size: 34px; font-weight: 780; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0 2px; }
.grande .val small { font-size: 15px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.grande .msj { font-size: 15px; margin-top: 8px; }
.grande.ok { border-top: 4px solid var(--good); }
.grande.falta { border-top: 4px solid var(--warn); }
.grande .avance { height: 10px; border-radius: 5px; margin-top: 10px; }
.grande .avance .relleno { border-radius: 5px; }
.grande .pie { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.mini-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mini-datos div { min-width: 0; }
.mini-datos .et { font-size: 11px; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.mini-datos b { display: block; font-size: 16px; }

/* columnas en pantallas anchas */
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; }
.cols > div { min-width: 0; }

/* menú lateral: solo en computadora */
.lateral { display: none; }
@media (min-width: 1000px) {
  .tabbar { display: none; }
  .lateral { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 232px; z-index: 40; overflow-y: auto;
    background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px 20px; gap: 1px; }
  .lateral .lat-marca { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px 8px 14px; }
  .lateral .lat-marca img { width: 168px; height: auto; border-radius: 6px; }
  .lateral .lat-marca span { font-size: 11px; font-weight: 750; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; padding-left: 2px; }
  .lateral a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 550; }
  .lateral a svg { width: 20px; height: 20px; flex: none; }
  .lateral a:hover { background: var(--surface-2); color: var(--ink); }
  .lateral a.activo { background: var(--info-soft); color: var(--brand); font-weight: 700; }
  .lateral .lat-sec { font-size: 11px; font-weight: 750; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 4px; }
  .lateral .lat-sec:empty { padding: 6px 0; border-top: 1px solid var(--line); margin-top: 10px; }
  body { padding-left: 232px; }
  main { max-width: 1180px; padding-bottom: 32px; }
  .barra-sup .fila, .filtros, .banda-version { max-width: 1180px; }
  .filtros { justify-content: flex-start; }
  .filtros select { flex: 0 1 280px; }
  #toast { bottom: 24px; }
  .cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .hoy-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
:root[data-theme="dark"] .lateral a.activo { color: var(--series-1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lateral a.activo { color: var(--series-1); } }
/* en el celular, "Para atender" va justo debajo de las cifras principales */
@media (max-width: 999px) { .cols > .lado { order: -1; } }
/* marcas estrella: familias y marcas plegables */
details.plegable > summary { cursor: pointer; align-items: center; gap: 8px; }
details.plegable > summary::-webkit-details-marker { display: none; }
details.card.plegable[open] > summary { margin-bottom: 6px; }
details.detalle.plegable > summary.grupo-cab { margin-bottom: 0; }
details.detalle.plegable[open] > summary.grupo-cab { margin-bottom: 2px; }
details.detalle.plegable { margin-top: 6px; padding-top: 0; border-top: 0; }

/* ayuda de cada pantalla */
.banda-ayuda { max-width: 980px; margin: 10px auto 0; padding: 8px 8px 8px 12px; display: flex; align-items: center; gap: 10px;
  background: var(--info-soft); color: var(--ink); border-radius: 12px; font-size: 14px; }
.banda-ayuda .btn { margin-left: auto; }
.banda-ayuda .cerrar-banda { background: none; border: 0; color: var(--ink-2); font-size: 22px; line-height: 1; padding: 0 6px; cursor: pointer; }
button.icono-sup { border: 0; cursor: pointer; }
.ayuda-pasos { margin: 4px 0 0; padding-left: 20px; }
.ayuda-pasos li { margin: 4px 0; line-height: 1.4; }
.glosario { margin: 4px 0 0; }
.glosario dt { font-weight: 700; margin-top: 8px; }
.glosario dd { margin: 2px 0 0; color: var(--ink-2); line-height: 1.4; }
.explica { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; line-height: 1.4; }
@media (min-width: 900px) { .banda-ayuda { max-width: 1180px; } }
.resumen-frase p { margin: 0; font-size: 15px; line-height: 1.5; }
.resumen-frase p + p { margin-top: 6px; }

/* ---------- secciones nuevas (v26): tarjetas que son botones ---------- */
a.ir, .ir { display: block; position: relative; color: inherit; text-decoration: none; cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease; }
a.ir:hover { border-color: var(--brand); }
a.ir:active { transform: scale(.985); }
a.ir:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ir .flecha { position: absolute; top: 10px; right: 12px; font-size: 20px; line-height: 1; color: var(--ink-3); font-weight: 600; }
.hero.ir { padding-right: 26px; }
.hero.ir.aviso { border-top: 4px solid var(--warn); }
.hero.ir.mal { border-top: 4px solid var(--crit); }
.hero.ir .val small { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.card.ir { padding-right: 32px; }
.card.ir h2 { margin: 0; }
.bono-card p { font-size: 14px; line-height: 1.45; }
.inicio-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 2px 2px 10px; }
.hoy-top { display: grid; gap: 10px; margin-bottom: 12px; }
@media (min-width: 720px) { .hoy-top { grid-template-columns: 1fr 1fr; } }
.acciones-rapidas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.acciones-rapidas .btn { padding: 10px 4px; font-size: 12.5px; white-space: normal; line-height: 1.2; min-height: 48px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 4px; }
.trio .et { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.trio .val { font-size: 20px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trio .det { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
@media (max-width: 380px) { .trio { grid-template-columns: 1fr 1fr; } .trio > :last-child { grid-column: 1 / -1; } }
.hero.alerta-suave { background: var(--crit-soft); border-color: transparent; }
.hero.alerta-suave .val { color: var(--crit-ink); }
.txt-mal { color: var(--crit-ink); font-weight: 600; }
tr.activa td { background: var(--surface-2); font-weight: 650; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
.material-lista .archivo { display: flex; align-items: center; gap: 10px; }

/* ---------- calendario ---------- */
:root { --ag-prom: #2a78d6; --ag-cap: #1e9e6a; --ag-aud: #c2410c; --ag-inv: #8b5cf6; --ag-reu: #64748b; --ag-vis: #0891b2; --ag-otro: #a3a3a3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ag-prom: #5b9cf0; --ag-cap: #3cc48c; --ag-aud: #f0864a; --ag-inv: #a98bfa; --ag-reu: #94a3b8; --ag-vis: #22b8d6; --ag-otro: #8a8a8a; } }
:root[data-theme="dark"] { --ag-prom: #5b9cf0; --ag-cap: #3cc48c; --ag-aud: #f0864a; --ag-inv: #a98bfa; --ag-reu: #94a3b8; --ag-vis: #22b8d6; --ag-otro: #8a8a8a; }
.c-prom { --c: var(--ag-prom); } .c-cap { --c: var(--ag-cap); } .c-aud { --c: var(--ag-aud); } .c-inv { --c: var(--ag-inv); }
.c-reu { --c: var(--ag-reu); } .c-vis { --c: var(--ag-vis); } .c-otro { --c: var(--ag-otro); }
.ag-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ag-cab .nav-mes { display: flex; align-items: center; gap: 8px; }
.ag-cab .nav-mes b { min-width: 140px; text-align: center; font-size: 16px; }
.ag-filtros { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; }
.ag-filtros .chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.ag-punto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ag-otro)); flex: none; }
.ag-mes { padding: 8px; }
.ag-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.ag-sem div { text-align: center; font-size: 11px; color: var(--ink-3); padding: 4px 0; text-transform: uppercase; letter-spacing: .03em; }
.ag-dia { min-height: 54px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; padding: 4px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.ag-dia .n { font-size: 13px; font-weight: 600; }
.ag-dia.fuera { opacity: .45; }
.ag-dia.hoy .n { background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 0 6px; align-self: flex-start; }
.ag-dia.sel { border-color: var(--series-1, var(--brand)); box-shadow: inset 0 0 0 1px var(--series-1, var(--brand)); }
.ag-dia:hover, .ag-dia:focus-visible { border-color: var(--brand); outline: none; }
.ag-evs { display: none; }
.ag-puntos { display: flex; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.ag-ev { display: block; font-size: 11px; line-height: 1.3; padding: 1px 4px; border-radius: 4px; background: color-mix(in srgb, var(--c) 16%, transparent); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev.tachado { text-decoration: line-through; opacity: .6; }
.ag-mas { font-size: 11px; color: var(--ink-3); }
@media (min-width: 900px) {
  .ag-dia { min-height: 96px; }
  .ag-evs { display: flex; flex-direction: column; gap: 2px; }
  .ag-puntos { display: none; }
}

/* lo oculto se oculta siempre, aunque el elemento tenga su propio display (campos, grillas) */
[hidden] { display: none !important; }
