/* 1242BNB PMS — tokens de marca (styles.css del sitio + reporte mensual como referencia visual) */
:root {
  --brand: #ED1C24;        /* rojo oficial — NO cambiar */
  --brand-deep: #c1141b;
  --tint: #fdeced;
  --tint-bar: #f9c9cb;     /* barras de meses inactivos (como el reporte) */
  --paper: #f6f6f5;
  --card: #ffffff;
  --ink: #1a1a1a;
  --text: #2a2a2a;
  --muted: #767676;
  --line: #e7e7e6;
  --good: #2CA089;         /* verde de las donas del reporte */
  --warn: #d6a23a;         /* ámbar de las donas del reporte */
  --crit: #c1141b;
  --font: "Helvetica Neue", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --tab-h: calc(58px + env(safe-area-inset-bottom));
}
@media (prefers-color-scheme: dark) {
  :root {
    --tint: #3a1517; --tint-bar: #5a2326;
    --paper: #141414; --card: #1d1d1d; --ink: #f2f2f2; --text: #d8d8d8;
    --muted: #9a9a9a; --line: #2a2a2a; --good: #4fbfa5; --warn: #dfae4d; --crit: #ff5b61;
    /* el hero y el monograma mantienen el ROJO OFICIAL #ED1C24 con texto blanco (marca literal) */
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--paper); color: var(--text);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
.oculto { display: none !important; }
h1, h2, h3 { color: var(--ink); line-height: 1.15; }

/* ===== WORDMARK ===== */
.wordmark { font-weight: 800; letter-spacing: -.02em; }
.wordmark .bnb { font-weight: 800; }

/* ===== LOGIN ===== */
.pantalla { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-caja { width: 100%; max-width: 340px; text-align: center; }
.login-logo { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 10px 26px rgba(237,28,36,.3); }
.login-caja h1 { font-size: 1.7rem; margin: 14px 0 2px; font-weight: 800; }
.login-caja h1 span { color: var(--brand); }
.login-sub { color: var(--muted); margin: 0 0 26px; font-size: .95rem; }
.campo-label { display: block; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.campo {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 1rem; background: var(--card); color: var(--ink); margin-bottom: 14px;
}
.campo:focus { outline: none; border-color: var(--brand); }
.btn {
  width: 100%; padding: 14px; background: var(--brand); color: #fff; border: none;
  border-radius: 12px; font-size: 1.05rem; font-weight: 700; cursor: pointer; font-family: var(--font);
}
.btn:active { background: var(--brand-deep); }
.btn.secundario { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.login-error { color: var(--crit); font-size: .9rem; margin-top: 12px; }
.login-nota { color: var(--muted); font-size: .8rem; margin-top: 22px; }

/* ===== APP SHELL ===== */
.appbar {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: #ED1C24;
}
.appbar-marca { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: #fff; }
.appbar-logo { width: 28px; height: 28px; border-radius: 7px; }
.btn-icono { background: none; border: none; font-size: 1.35rem; color: #fff; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; }
.btn-icono:active { background: rgba(255,255,255,.2); }

.contenido { padding: 0 0 calc(var(--tab-h) + 18px); max-width: 640px; margin: 0 auto; }
.cuerpo-vista { padding: 14px; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; background: none; border: none; font-family: var(--font); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .68rem; font-weight: 600; color: var(--muted); padding: 4px 0;
}
.tab .tab-icono { font-size: 1.25rem; line-height: 1; }
.tab.activo { color: var(--brand); font-weight: 800; }

/* ===== HERO ROJO (patrón del reporte mensual) ===== */
.hero {
  background: #ED1C24; color: #fff; text-align: center;
  padding: 18px 16px 20px; border-radius: 0 0 18px 18px; margin-bottom: 14px;
}
.hero .hero-wordmark { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.hero .hero-sub { font-size: .82rem; opacity: .92; margin-top: 2px; }
.hero .hero-kpis { display: flex; justify-content: center; gap: 26px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.hero .hero-kpis .n { font-size: 1.5rem; font-weight: 800; }
.hero .hero-kpis .l { font-size: .6rem; letter-spacing: .08em; opacity: .9; margin-top: 1px; }

/* ===== TÍTULOS DE SECCIÓN (subrayado rojo, como el reporte) ===== */
.titulo-seccion { text-align: center; margin: 22px 0 2px; }
.titulo-seccion h2 { font-size: 1.05rem; font-weight: 800; margin: 0; display: inline-block; padding-bottom: 5px; border-bottom: 3px solid var(--brand); }
.titulo-sub { text-align: center; color: var(--muted); font-size: .78rem; margin: 6px 0 12px; }

/* ===== TARJETAS ===== */
.tarjeta {
  background: var(--card); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(20,20,20,.06); border: 1px solid var(--line);
}
.tarjeta.tocable { cursor: pointer; }
.tarjeta.tocable:active { background: var(--tint); }
.tarjeta-fila { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tarjeta h3 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.sub { color: var(--muted); font-size: .84rem; margin-top: 4px; }

/* Monograma rojo de unidad (estilo wordmark) */
.monograma {
  width: 52px; height: 52px; border-radius: 13px; background: #ED1C24; color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em;
}
.fila-unidad { display: flex; align-items: center; gap: 12px; }
.foto-unidad { width: 74px; height: 74px; border-radius: 13px; object-fit: cover; flex: none; background: var(--tint); }
.fila-unidad .resto { flex: 1; min-width: 0; }

.pill { border-radius: 999px; padding: 3px 10px; font-size: .66rem; font-weight: 800; letter-spacing: .03em; white-space: nowrap; }
.pill.ok    { background: rgba(44,160,137,.14); color: var(--good); }
.pill.busy  { background: rgba(118,118,118,.16); color: var(--ink); }
.pill.warn  { background: rgba(214,162,58,.18); color: var(--warn); }
.pill.crit  { background: rgba(237,28,36,.12); color: var(--crit); }

.kpis { display: flex; gap: 8px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpis > div { flex: 1; background: var(--paper); border-radius: 10px; padding: 8px 6px; text-align: center; }
.kpis .n { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.kpis .l { font-size: .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 1px; }

.lista-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: .92rem; align-items: center; }
.lista-item:last-child { border-bottom: none; }
.lista-item .quien { font-weight: 600; color: var(--ink); }
.lista-item .monto { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

.volver { background: none; border: none; color: var(--brand); font-weight: 700; font-size: .95rem; cursor: pointer; padding: 4px 0 10px; font-family: var(--font); }
.vacio { text-align: center; color: var(--muted); padding: 40px 16px; font-size: .95rem; }
.error-caja { background: var(--tint); color: var(--crit); border-radius: 12px; padding: 14px 16px; font-size: .9rem; margin-bottom: 12px; }
.cargando { display: flex; justify-content: center; padding: 48px 0; }
.spinner { width: 34px; height: 34px; border: 3.5px solid var(--tint); border-top-color: var(--brand); border-radius: 50%; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.check { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.tarea-hecha .quien, .tarea-hecha .sub { text-decoration: line-through; opacity: .55; }
.grafica { width: 100%; height: auto; }
.badge-f2 { background: var(--tint); color: var(--brand-deep); border-radius: 6px; padding: 2px 7px; font-size: .62rem; font-weight: 800; letter-spacing: .04em; }

/* ===== BARRAS 12 MESES (mes activo rojo sólido, resto tint — como el reporte) ===== */
.barras-12m { margin: 6px 0 4px; }

/* ===== DONAS (verde/ámbar/rojo del reporte) ===== */
.donas { display: flex; justify-content: space-around; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.dona-caja { text-align: center; flex: 1; min-width: 130px; }
.dona-centro-n { font-size: 1.05rem; font-weight: 800; fill: var(--ink); }
.dona-centro-l { font-size: .55rem; fill: var(--muted); }
.dona-nombre { font-weight: 800; color: var(--ink); font-size: .85rem; margin-top: 6px; }

/* ===== AGENDA SEMANAL (grid del bot: píldoras negras, S, P✦, carga) ===== */
.agenda-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.agenda { min-width: 560px; }
.agenda-dias { display: grid; grid-template-columns: 56px repeat(7, 1fr); gap: 3px; margin-bottom: 6px; align-items: center; }
.agenda-dias .dia { text-align: center; font-size: .66rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.agenda-dias .dia .num { display: block; font-size: .85rem; color: var(--ink); font-weight: 800; }
.agenda-dias .dia.hoy .num { background: var(--brand); color: #fff; border-radius: 50%; width: 24px; height: 24px; line-height: 24px; margin: 0 auto; }
.agenda-grupo { background: var(--tint); color: var(--brand-deep); font-weight: 800; font-size: .72rem; padding: 5px 10px; border-radius: 7px; margin: 8px 0 5px; border-left: 3px solid var(--brand); }
.agenda-fila { display: grid; grid-template-columns: 56px repeat(7, 1fr); gap: 3px; margin-bottom: 4px; position: relative; align-items: stretch; }
.agenda-fila .unidad-label { font-weight: 800; color: var(--ink); font-size: .8rem; display: flex; align-items: center; }
.agenda-celda { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 34px; position: relative; font-size: .62rem; }
.agenda-celda .marca-s { position: absolute; bottom: 1px; left: 4px; color: var(--muted); font-weight: 800; }
.agenda-celda .marca-p { position: absolute; bottom: 1px; right: 4px; color: var(--brand); font-weight: 800; }
.agenda-pildoras { position: absolute; left: 59px; right: 0; top: 0; bottom: 0; pointer-events: none; }
.pildora {
  position: absolute; top: 6px; height: 22px; background: var(--ink); color: var(--paper);
  border-radius: 999px; font-size: .66rem; font-weight: 700; display: flex; align-items: center;
  padding: 0 8px 0 3px; overflow: hidden; white-space: nowrap;
}
.pildora .ini { width: 16px; height: 16px; border-radius: 50%; background: var(--paper); color: var(--ink); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-right: 4px; flex: none; font-size: .6rem; }
.carga-titulo { font-size: .7rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 4px; }
.carga-fila { display: grid; grid-template-columns: 56px repeat(7, 1fr); gap: 3px; margin-bottom: 4px; align-items: center; }
.carga-fila .nombre { font-size: .74rem; font-weight: 700; color: var(--ink); }
.chip-carga { border-radius: 999px; text-align: center; font-size: .68rem; font-weight: 800; color: #fff; padding: 2px 0; }
.chip-carga.c0 { background: transparent; color: var(--muted); }
.chip-carga.c1 { background: #3d7dc8; }
.chip-carga.c2 { background: var(--warn); }
.chip-carga.c3 { background: var(--brand); }
.agenda-leyenda { text-align: center; color: var(--muted); font-size: .68rem; margin-top: 8px; }
.agenda-leyenda b { color: var(--brand); }

/* ===== SELECTORES (unidad / mes en Reportes) ===== */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.chip { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 16px; font-weight: 800; font-size: .85rem; cursor: pointer; white-space: nowrap; font-family: var(--font); }
.chip.activo { background: #ED1C24; border-color: #ED1C24; color: #fff; }
.nav-mes { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 4px 0 10px; }
.nav-mes button { background: none; border: none; color: var(--brand); font-size: 1.3rem; font-weight: 800; cursor: pointer; padding: 2px 10px; }
.nav-mes .actual { font-weight: 800; color: var(--ink); min-width: 130px; text-align: center; }

/* ===== FOOTER DE MARCA (como el reporte) ===== */
.pie-marca { text-align: center; padding: 26px 0 8px; }
.pie-marca .pm-wordmark { color: var(--brand); font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.pie-marca .pm-tagline { color: var(--muted); font-size: .68rem; letter-spacing: .12em; margin-top: 3px; }
.pie-marca .pm-url { color: var(--brand); font-weight: 700; font-size: .78rem; margin-top: 5px; }

.switch-fila { display: flex; justify-content: space-between; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.switch-fila:last-child { border-bottom: none; }
.switch-punto { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.switch-punto.on { background: var(--good); }
.switch-punto.off { background: var(--muted); }
a.enlace-wa { color: var(--good); text-decoration: none; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.btn-flotante {
  position: fixed; right: 18px; bottom: calc(var(--tab-h) + 14px); z-index: 9;
  width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 1.9rem; border: none; box-shadow: 0 6px 18px rgba(237,28,36,.4); cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.btn-flotante:active { background: var(--brand-deep); }
