/* Sistema Guías Mayores · Sistema creado por Codexia
   Diseño: menú lateral azul marino con acento dorado, superficies claras y
   suaves, tipografía Plus Jakarta Sans. Modo claro y oscuro según el equipo. */

:root {
  /* Superficies y texto */
  --bg: #F3F5FA; --surface: #FFFFFF; --surface-2: #F8F9FC; --sunk: #EDF0F6;
  --ink: #0E1A36; --ink-2: #344260; --muted: #6A7591; --line: #E3E7EF; --line-2: #D3D9E6;
  /* Marca */
  --brand: #13285A; --brand-2: #1E3C82; --accent: #2747A8; --accent-ink: #FFFFFF; --accent-soft: #EBF0FD;
  --gold: #B8892B; --gold-2: #D9A93F; --gold-soft: #FBF3E1;
  /* Estados */
  --ok: #14855A; --ok-soft: #E2F5EB; --warn: #B06A00; --warn-soft: #FDF1DB; --bad: #C2412D; --bad-soft: #FCE9E5;
  --violet: #6A4CC9; --violet-soft: #EFEBFC; --teal: #0E8A8A; --teal-soft: #E0F4F3;
  /* Menú lateral (siempre oscuro) */
  --sb-bg: #0F1F47; --sb-bg-2: #0B1736; --sb-ink: #C8D2EC; --sb-muted: #7F8DB4; --sb-hover: rgba(255,255,255,.06); --sb-active: rgba(255,255,255,.11);
  /* Sombras y radios */
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 20px -8px rgba(16,24,40,.12);
  --shadow-lg: 0 12px 40px -12px rgba(16,24,40,.28);
  --r: 16px; --r-sm: 11px;
  --f-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090E1C; --surface: #111830; --surface-2: #141C37; --sunk: #1A2343;
    --ink: #E9EDF7; --ink-2: #C3CBE0; --muted: #8C97B6; --line: #222C4C; --line-2: #2D3961;
    --brand: #0A142E; --brand-2: #1A2E66; --accent: #8FA9F8; --accent-ink: #0A1022; --accent-soft: #1B2652;
    --gold: #E2BE62; --gold-2: #F0CF7A; --gold-soft: #33290F;
    --ok: #4CC38A; --ok-soft: #12301F; --warn: #F0B34A; --warn-soft: #35270C; --bad: #F2826F; --bad-soft: #3A1A16;
    --violet: #B4A2F5; --violet-soft: #251D46; --teal: #4FD0CF; --teal-soft: #0E2E30;
    --sb-bg: #0A1430; --sb-bg-2: #070E22;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 1px 2px rgba(0,0,0,.25), 0 8px 24px -10px rgba(0,0,0,.5);
    --shadow-lg: 0 16px 48px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; margin: 0; letter-spacing: -.015em; text-wrap: balance; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent;
  border-radius: var(--r-sm); padding: 10px 18px; font-weight: 700; font-size: 14.5px; letter-spacing: -.005em;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff) 0%, var(--accent) 100%); color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(16,24,40,.12), inset 0 1px 0 rgba(255,255,255,.18); transition: transform .12s, box-shadow .15s, background .15s; }
.btn:hover { box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); font-weight: 600; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--accent); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, transparent); box-shadow: none; }
.btn.danger.armed { background: var(--bad); color: #fff; }
.link { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 4px 0; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.bad { color: var(--bad); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: var(--r-sm); padding: 10px 13px; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.field .ayuda { font-size: 12.5px; color: var(--muted); }
.alert { border-radius: var(--r-sm); padding: 11px 14px; font-weight: 600; font-size: 14px; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.tag.soon { background: var(--gold-soft); color: var(--gold); }
.tag.today { background: var(--accent); color: var(--accent-ink); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.e-confirmada { background: var(--accent-soft); color: var(--accent); }
.tag.e-realizada { background: var(--ok-soft); color: var(--ok); }
.tag.e-cancelada { background: var(--bad-soft); color: var(--bad); }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600;
  color: var(--ink-2); white-space: nowrap; min-height: 36px; transition: .15s; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; padding-bottom: 2px; }
.cats::-webkit-scrollbar { display: none; }
.seg { display: inline-flex; background: var(--sunk); border-radius: 12px; padding: 4px; max-width: 100%; overflow-x: auto; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; min-height: 32px; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.radios { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.radios legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.radios label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 13px; font-weight: 600; min-height: 44px; background: var(--surface); transition: .15s; }
.radios label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.radios input { accent-color: var(--accent); }
.toast { position: fixed; left: 50%; transform: translate(-50%, 16px); bottom: calc(96px + env(safe-area-inset-bottom)); background: var(--brand); color: #fff;
  padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 80;
  max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { display: grid; place-items: center; min-height: 50dvh; color: var(--muted); }
.soon-box { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 36px 22px; text-align: center; color: var(--muted); }
.soon-box h3 { color: var(--ink); font-size: 18px; margin-bottom: 6px; }
.av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13.5px; letter-spacing: .02em; }
.emblem { flex: none; }

/* ---------- Inicio de sesión ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.login::before { content: ""; background:
    radial-gradient(1200px 500px at 0% 0%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(80,120,255,.25), transparent 60%),
    linear-gradient(160deg, var(--sb-bg) 0%, var(--sb-bg-2) 100%); }
.login-card { align-self: center; justify-self: center; width: min(420px, calc(100% - 32px)); display: grid; gap: 20px; padding: 32px 4px; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand h1 { font-size: 24px; line-height: 1.15; }
.login-card form { display: grid; gap: 16px; }
.login-card .btn { min-height: 48px; }
.login-foot { text-align: center; font-size: 12.5px; color: var(--muted); }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login::before { display: none; }
  .login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px 22px; box-shadow: var(--shadow); }
}

/* ---------- Estructura de la app ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(180deg, var(--sb-bg) 0%, var(--sb-bg-2) 100%); color: var(--sb-ink);
  padding: calc(18px + env(safe-area-inset-top)) 14px 16px max(14px, env(safe-area-inset-left)); overflow-y: auto; }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sb-brand b { display: block; color: #fff; font-size: 16.5px; letter-spacing: -.01em; line-height: 1.2; }
.sb-brand span { font-size: 11.5px; color: var(--gold-2); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.side { display: grid; gap: 2px; align-content: start; flex: 1; }
.side .sec { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sb-muted); padding: 14px 12px 6px; }
.side a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--sb-ink); text-decoration: none;
  font-weight: 600; font-size: 14px; min-height: 42px; transition: background .15s, color .15s; }
.side a:hover { background: var(--sb-hover); color: #fff; }
.side a[aria-current="page"] { background: var(--sb-active); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.side a[aria-current="page"] svg { color: var(--gold-2); }
.side svg { width: 19px; height: 19px; flex: none; opacity: .95; }
.side .ro { margin-left: auto; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--sb-muted);
  border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 2px 5px; }
.side hr { border: 0; border-top: 1px solid rgba(255,255,255,.07); margin: 10px 4px; }
.side .salir:hover { color: #FFB4A6; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); }
.sb-user .av { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1A1405; border-radius: 11px; }
.who-txt { min-width: 0; line-height: 1.25; }
.who-txt b { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-txt span { font-size: 12px; color: var(--sb-muted); }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) 12px max(28px, env(safe-area-inset-left)); min-height: 62px; }
.tb-brand { display: none; align-items: center; gap: 10px; }
.tb-brand b { font-size: 16px; }
.tb-title { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; }
.tb-fecha { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tb-av { display: none; }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 26px max(28px, env(safe-area-inset-right)) 40px max(28px, env(safe-area-inset-left)); flex: 1; }
.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h2 { font-size: clamp(24px, 4.2vw, 30px); letter-spacing: -.025em; }
.acciones-head { display: flex; gap: 10px; flex-wrap: wrap; }

.bottomnav { display: none; }
.sheet-bg { position: fixed; inset: 0; background: rgba(6,10,24,.5); backdrop-filter: blur(2px); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--sb-bg); color: var(--sb-ink); border-radius: 22px 22px 0 0;
  padding: 10px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: grid; gap: 2px; max-height: 82dvh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.sheet::before { content: ""; width: 40px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); justify-self: center; margin: 4px 0 10px; }
.sheet a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; color: var(--sb-ink); text-decoration: none; font-weight: 600; min-height: 48px; }
.sheet a[aria-current="page"] { background: var(--sb-active); color: #fff; }
.sheet svg { width: 20px; height: 20px; }
.sheet .salir { color: #FFB4A6; }

/* ---------- Tarjetas y listas generales ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; box-shadow: var(--shadow-sm); }
.card h3 { font-size: 16.5px; margin-bottom: 10px; }
.card.feature { border-color: color-mix(in srgb, var(--gold) 55%, transparent); box-shadow: 0 0 0 4px var(--gold-soft); }
.stat { font-family: var(--f-display); font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stat small { font-size: 15px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.list .t { font-weight: 600; font-size: 14.5px; }
.list .s { font-size: 12.5px; color: var(--muted); }
.bar { height: 8px; background: var(--sunk); border-radius: 999px; overflow: hidden; margin-top: 7px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #fff)); }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px 18px; }
.dato span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.dato b { font-weight: 600; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; margin: 12px 0 0; overflow-wrap: anywhere; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: baseline; }
.checks li span { width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; background: var(--sunk); color: var(--muted); }
.checks li.si span { color: var(--ok); background: var(--ok-soft); }
.checks li.no { color: var(--muted); }
.checks-form { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; margin: 0; display: grid; gap: 8px; background: var(--surface-2); }
.checks-form legend { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0 6px; }
h4.grupo { font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 24px 0 10px; display: flex; gap: 8px; align-items: center; }
h4.grupo .num { background: var(--sunk); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; }
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.filtros .buscar { flex: 1 1 240px; }
.filtros .field select { min-width: 170px; }
.filtros .field input, .filtros .field select { min-height: 42px; background: var(--surface-2); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 18px 0 12px; }

/* Filas de personas (listas, fichas, pagos) */
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.prow { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; box-shadow: var(--shadow-sm); transition: .15s; }
.prow:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); transform: translateY(-1px); }
.prow.inactivo { opacity: .6; }
.nm { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; letter-spacing: -.005em; }
.nm small { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); letter-spacing: 0; }
.minibar { display: block; height: 6px; background: var(--sunk); border-radius: 999px; overflow: hidden; margin-top: 7px; }
.minibar i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.late, .alldone { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.late { color: var(--bad); background: var(--bad-soft); }
.alldone { color: var(--ok); background: var(--ok-soft); }

/* Avatares con color estable por persona */
.av.c1 { background: #E6EDFD; color: #2747A8; } .av.c2 { background: #E3F5EC; color: #14855A; } .av.c3 { background: #FDF1DB; color: #A35F00; }
.av.c4 { background: #EFEBFC; color: #5B3FBF; } .av.c5 { background: #E0F4F3; color: #0E7A7A; } .av.c6 { background: #FCE9E5; color: #B23A27; }
@media (prefers-color-scheme: dark) {
  .av.c1 { background: #1B2652; color: #A9BEFA; } .av.c2 { background: #12301F; color: #6FD7A4; } .av.c3 { background: #35270C; color: #F3C46C; }
  .av.c4 { background: #251D46; color: #C3B4F8; } .av.c5 { background: #0E2E30; color: #6ADAD9; } .av.c6 { background: #3A1A16; color: #F59C8C; }
}

/* ---------- Tablero de inicio ---------- */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px; color: #fff; margin-bottom: 18px;
  background:
    radial-gradient(600px 220px at 100% 0%, color-mix(in srgb, var(--gold-2) 30%, transparent), transparent 70%),
    radial-gradient(500px 260px at 0% 100%, rgba(90,130,255,.30), transparent 70%),
    linear-gradient(135deg, var(--brand-2) 0%, var(--sb-bg) 70%); box-shadow: var(--shadow); }
.hero-top { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; justify-content: space-between; }
.hero .eyebrow { color: var(--gold-2); }
.hero h2 { font-size: clamp(26px, 4.6vw, 34px); letter-spacing: -.03em; margin-top: 4px; }
.hero p { margin: 6px 0 0; color: #C9D3EE; font-size: 14.5px; }
.ciclo { margin-top: 20px; max-width: 560px; }
.ciclo-txt { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: #C9D3EE; font-weight: 600; }
.ciclo-txt span:last-child { white-space: nowrap; }
.ciclo-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.14); overflow: hidden; margin-top: 8px; }
.ciclo-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.rapidas { display: flex; flex-wrap: wrap; gap: 8px; }
.rapidas a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 13.5px;
  color: #fff; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); transition: .15s; }
.rapidas a:hover { background: rgba(255,255,255,.18); }
.rapidas svg { width: 17px; height: 17px; }

.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); margin-bottom: 18px; }
.kpi { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; transition: .15s; }
a.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi-ico.i-azul { background: var(--accent-soft); color: var(--accent); } .kpi-ico.i-verde { background: var(--ok-soft); color: var(--ok); }
.kpi-ico.i-oro { background: var(--gold-soft); color: var(--gold); } .kpi-ico.i-violeta { background: var(--violet-soft); color: var(--violet); }
.kpi-ico.i-rojo { background: var(--bad-soft); color: var(--bad); } .kpi-ico.i-teal { background: var(--teal-soft); color: var(--teal); }
.kpi-val { font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.kpi-val small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi .bar { margin-top: 0; height: 6px; }

.dash { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; }
.panel-head a { font-size: 13px; font-weight: 700; text-decoration: none; }
.panel-vacio { color: var(--muted); font-size: 14px; padding: 6px 0; }

.reunion-dia { display: flex; gap: 16px; align-items: center; }
.cal-dia { width: 72px; flex: none; border-radius: 16px; overflow: hidden; text-align: center; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.cal-dia span { display: block; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: var(--gold-2); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 0; }
.cal-dia b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; padding: 6px 0 4px; }
.cal-dia small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; padding-bottom: 6px; text-transform: uppercase; }
.reunion-txt h4 { font-size: 18px; letter-spacing: -.02em; }
.reunion-txt p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.entrega-box { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); color: var(--ink); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.entrega-box svg { width: 18px; height: 18px; color: var(--gold); flex: none; margin-top: 2px; }
.cuenta-atras { margin-left: auto; text-align: right; }
.cuenta-atras b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--gold); }
.cuenta-atras span { font-size: 12px; color: var(--muted); font-weight: 600; }

.barras { display: grid; gap: 14px; }
.barra-fila { display: grid; gap: 6px; }
.barra-fila .bf-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 600; }
.barra-fila .bf-top span { color: var(--muted); font-weight: 600; }
.barra-fila .bar { margin: 0; height: 10px; }
.barra-fila .bar.b2 i { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff)); }
.barra-fila .bar.b3 i { background: linear-gradient(90deg, var(--violet), color-mix(in srgb, var(--violet) 60%, #fff)); }
.barra-fila .bar.b4 i { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }

.anillo { --p: 0; width: 120px; height: 120px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--sunk) 0); }
.anillo > div { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.anillo b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.anillo span { font-size: 11px; color: var(--muted); font-weight: 700; }
.avance-top { display: flex; gap: 20px; align-items: center; margin-bottom: 18px; }
.avance-top .mini { display: grid; gap: 8px; font-size: 13.5px; }
.avance-top .mini b { font-size: 18px; }
.punto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

.lista-dash { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lista-dash li { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 12px; }
.lista-dash li:hover { background: var(--surface-2); }
.lista-dash .nm { font-size: 14px; }
.lista-dash .av { width: 36px; height: 36px; border-radius: 10px; font-size: 12.5px; }
.lista-dash .d-fecha { width: 42px; flex: none; text-align: center; line-height: 1.05; }
.lista-dash .d-fecha b { display: block; font-size: 18px; font-weight: 800; }
.lista-dash .d-fecha span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.pct-chip { font-size: 12.5px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.pct-chip.full { background: var(--ok-soft); color: var(--ok); }
.pct-chip.bajo { background: var(--bad-soft); color: var(--bad); }
.cumple-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); flex: none; }
.cumple-ico svg { width: 18px; height: 18px; }
.lista-dash li.hoy { background: var(--gold-soft); }

/* ---------- Escuela ---------- */
.tgrid { display: grid; gap: 18px; grid-template-columns: 330px minmax(0, 1fr); align-items: start; }
.picker { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; position: sticky; top: 80px;
  max-height: calc(100dvh - 104px); display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.tlist { list-style: none; margin: 0; padding: 0 8px 10px; overflow-y: auto; }
.titem { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; text-align: left; border: 0; background: transparent; padding: 10px; border-radius: 12px; transition: background .12s; }
.titem:hover { background: var(--surface-2); }
.titem[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.titem .date { width: 44px; text-align: center; line-height: 1.05; color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  border-radius: 10px; background: var(--sunk); padding: 5px 0; }
.titem .date b { display: block; font-size: 17px; color: var(--ink); letter-spacing: 0; }
.titem.past .date b { color: var(--muted); }
.titem .tt { font-weight: 650; font-size: 14px; line-height: 1.3; }
.titem .tr { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.titem .cnt { font-size: 12px; font-weight: 800; color: var(--ink-2); background: var(--sunk); padding: 3px 9px; border-radius: 999px; }
.titem .cnt.full { background: var(--ok-soft); color: var(--ok); }
.req-select { display: none; margin-bottom: 14px; }
.taskcard { box-shadow: var(--shadow); padding: 22px; }
.tc-top { display: flex; gap: 12px; align-items: flex-start; }
.tc-title { font-size: clamp(20px, 4.4vw, 26px); line-height: 1.2; margin: 6px 0 0; letter-spacing: -.025em; }
.tc-botones { display: flex; gap: 8px; flex: none; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 14px; }
.meta b { color: var(--ink); }
.note { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; max-width: 70ch; }
.prog { margin-top: 18px; display: flex; align-items: center; gap: 16px; }
.prog .big { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.035em; }
.prog .big small { font-size: 16px; color: var(--muted); font-weight: 600; }
.pbar { flex: 1; height: 12px; background: var(--sunk); border-radius: 999px; overflow: hidden; display: flex; }
.pbar i { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.pbar i.alt { background: var(--warn); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; font-weight: 600; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--sunk); border: 1px solid var(--line-2); }
.legend .l-ok::before { background: var(--ok); border-color: var(--ok); }
.legend .l-alt::before { background: var(--warn); border-color: var(--warn); }

.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
.rrow { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: .15s; box-shadow: var(--shadow-sm); }
.rrow:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.rrow .row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; background: none; border: 0; padding: 11px 13px; min-height: 62px; }
.rrow .more { border: 0; border-left: 1px solid var(--line); background: none; width: 46px; font-size: 20px; color: var(--muted); }
.rrow .more:hover { background: var(--surface-2); }
.pill { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 800;
  background: var(--sunk); color: var(--muted); border: 1px dashed var(--line-2); }
.pill svg { width: 14px; height: 14px; }
.s-ok { background: color-mix(in srgb, var(--ok-soft) 70%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.s-ok .av { background: var(--ok); color: #fff; }
.s-ok .pill { background: var(--ok); color: #fff; border: 1px solid var(--ok); }
.s-alt { background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.s-alt .av { background: var(--warn); color: #fff; }
.s-alt .pill { background: var(--warn); color: #fff; border: 1px solid var(--warn); }

.matriz-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.matriz { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.matriz th, .matriz td { border-bottom: 1px solid var(--line); padding: 0; text-align: center; }
.matriz tbody tr:hover td, .matriz tbody tr:hover th { background: var(--surface-2); }
.matriz thead th { vertical-align: bottom; height: 160px; padding: 8px 2px; font-weight: 600; color: var(--muted); }
.matriz thead th span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; max-height: 148px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matriz th[scope="row"], .matriz thead th:first-child { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 9px 14px; white-space: nowrap; z-index: 1; font-weight: 700; color: var(--ink); }
.matriz td { min-width: 38px; height: 40px; }
.matriz td button, .matriz td span { width: 100%; height: 40px; border: 0; background: none; font-weight: 800; display: grid; place-items: center; }
.matriz td.s-ok { color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 50%, transparent); }
.matriz td.s-alt { color: var(--warn); background: color-mix(in srgb, var(--warn-soft) 50%, transparent); }
.matriz td.tot { padding: 0 14px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }

/* ---------- Diálogos y formularios ---------- */
dialog { border: 1px solid var(--line); padding: 0; background: var(--surface); color: var(--ink); border-radius: 22px; width: min(660px, calc(100vw - 24px));
  max-height: min(88dvh, 880px); box-shadow: var(--shadow-lg); }
dialog[open] { animation: aparecer .18s ease-out; }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(6,10,24,.55); backdrop-filter: blur(3px); }
.dlg { display: flex; flex-direction: column; max-height: min(88dvh, 880px); }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 19px; flex: 1; min-width: 0; overflow-wrap: anywhere; letter-spacing: -.02em; }
.x { border: 0; background: var(--sunk); width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; line-height: 1; flex: none; color: var(--ink-2); }
.x:hover { background: var(--line); }
.dlg-body { overflow-y: auto; padding: 18px 20px 22px; }
.dlg-body h4 { margin: 20px 0 10px; font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.dlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.drow { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.drow .nm { font-weight: 600; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 12px; }
.stat-box b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat-box span { font-size: 12px; color: var(--muted); font-weight: 600; }
.form { display: grid; gap: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.seccion-form { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 14px; background: var(--surface-2); }
.seccion-form > .eyebrow { margin-bottom: -4px; }
details.mas { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
details.mas summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.mas summary::-webkit-details-marker { display: none; }
details.mas summary::after { content: "+"; font-size: 20px; color: var(--muted); }
details.mas[open] summary::after { content: "–"; }
details.mas > div { padding: 0 16px 16px; display: grid; gap: 14px; }
.edad-chip { display: inline-flex; margin-top: 2px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.wa { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; color: #128C4A; }
.wa svg { width: 16px; height: 16px; }

/* ---------- Calendario ---------- */
.calintro { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin-bottom: 26px; }
.calintro p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.month { margin-bottom: 26px; }
.month > h3 { font-size: 18px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.month > h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.meets { display: grid; gap: 10px; }
.meet { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.meet .d { text-align: center; line-height: 1.05; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 8px 0; align-self: start; }
.meet .d b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.meet .d span { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.meet-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.meet-edit { margin-left: auto; }
.meet h4 { font-size: 16.5px; margin: 6px 0 0; letter-spacing: -.015em; }
.meet p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.meet .ent { margin-top: 10px; font-size: 13.5px; color: var(--ink); font-weight: 600; background: var(--gold-soft); padding: 8px 12px; border-radius: 10px; }
.meet .ent span { color: var(--gold); font-weight: 800; }
.meet.past { opacity: .55; }
.meet.isnext { border-color: color-mix(in srgb, var(--gold) 60%, transparent); box-shadow: 0 0 0 4px var(--gold-soft); }
.meet.isnext .d { background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: transparent; color: #fff; }
.meet.isnext .d span { color: var(--gold-2); }
.kind { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

/* ---------- Asistencia ---------- */
.asi-sel { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.asi-sel .field { flex: 1 1 280px; max-width: 540px; }
.asi-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.asi-head h3 { margin: 4px 0 0; }
.conteo { display: flex; flex-wrap: wrap; gap: 6px; }
.conteo span { font-size: 12.5px; font-weight: 800; padding: 5px 10px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.conteo .c-presente { background: var(--ok-soft); color: var(--ok); }
.conteo .c-tarde, .conteo .c-justificado { background: var(--warn-soft); color: var(--warn); }
.conteo .c-ausente { background: var(--bad-soft); color: var(--bad); }
.asi-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.asi-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; box-shadow: var(--shadow-sm); }
.asi-nombre { display: flex; align-items: center; gap: 11px; flex: 1 1 220px; min-width: 0; }
.asi-botones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; flex: 1 1 380px; }
.asi-botones button { min-height: 42px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--ink-2); padding: 0 4px; transition: .12s; }
.asi-botones button:hover { border-color: var(--accent); }
.asi-botones .corto { display: none; }
.asi-botones .b-presente[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.asi-botones .b-tarde[aria-pressed="true"], .asi-botones .b-justificado[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); color: #fff; }
.asi-botones .b-ausente[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }
.asi-row.e-presente { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.asi-row.e-ausente { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.barra-guardar { position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; margin-top: 18px; }
.barra-guardar .btn { box-shadow: var(--shadow-lg); min-width: 220px; }
.res-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.res-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(80px, 1fr) 60px; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; }
.res-row.bajo { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad-soft) 60%, var(--surface)); }
.res-bar { position: relative; height: 9px; background: var(--sunk); border-radius: 999px; }
.res-bar i { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.res-row.bajo .res-bar i { background: var(--bad); }
.res-bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .4; border-radius: 2px; }
.res-pct { text-align: right; font-weight: 800; }

/* ---------- Actividades y noticias ---------- */
.act-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.act-lista.pasadas { opacity: .7; }
.act { width: 100%; text-align: left; display: grid; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm); transition: .15s; }
.act:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.act-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.act-titulo { font-weight: 800; font-size: 17px; line-height: 1.3; letter-spacing: -.02em; }
.act-meta { font-size: 13.5px; color: var(--muted); }
.act.concepto { cursor: default; }
.part-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 50dvh; overflow-y: auto; }
.part-lista li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 40%); gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 7px 11px; }
.part-lista .funcion { min-height: 38px; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 9px; padding: 6px 10px; font-size: 15px; width: 100%; }
.noticias { display: grid; gap: 14px; max-width: 780px; }
.noticia { padding: 22px; }
.noticia h3 { font-size: 19px; margin: 10px 0 0; letter-spacing: -.02em; }
.noticia.fijada { border-color: color-mix(in srgb, var(--gold) 55%, transparent); box-shadow: 0 0 0 4px var(--gold-soft); }
.noticia.borrador { border-style: dashed; }
.noticia-fecha { font-size: 13px; }
.noticia .act-top .link { margin-left: auto; }

/* ---------- Estados de cuenta ---------- */
.fin-stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.fin-stats .stat { font-size: 28px; margin-top: 10px; }
.fin-stats p { margin: 6px 0 0; font-size: 13px; }
.stat.bad { color: var(--bad); }
.saldo { font-size: 12.5px; font-weight: 800; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.saldo.debe { background: var(--bad-soft); color: var(--bad); }
.saldo.aldia { background: var(--ok-soft); color: var(--ok); }
.saldo.favor { background: var(--accent-soft); color: var(--accent); }
.saldo-box.debe b { color: var(--bad); }
.saldo-box.aldia b { color: var(--ok); }
.drow.mov { flex-wrap: wrap; }
.mov-monto { font-weight: 800; text-align: right; }
.mov-monto small { display: block; font-size: 11.5px; color: var(--bad); font-weight: 600; }
.mov-acciones { display: flex; gap: 12px; }
.drow.anulado .mov-monto { text-decoration: line-through; color: var(--muted); }

.recibo { position: relative; border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--surface); overflow: hidden; }
.recibo-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 2px solid var(--gold); padding-bottom: 12px; margin-bottom: 16px; }
.recibo-titulo { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.recibo-num { font-size: 20px; font-weight: 800; color: var(--bad); font-variant-numeric: tabular-nums; }
.recibo dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 0; }
.recibo dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.recibo dd { margin: 0; overflow-wrap: anywhere; }
.recibo .letras { font-size: 13.5px; color: var(--muted); }
.recibo-firma { margin: 42px 0 0 auto; width: 220px; text-align: center; font-size: 12.5px; color: var(--muted); }
.recibo-firma span { display: block; border-top: 1px solid var(--ink); margin-bottom: 4px; }
.recibo-pie { margin-top: 16px; font-size: 11px; color: var(--muted); text-align: center; }
.recibo-sello { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 54px; font-weight: 800; color: var(--bad); opacity: .2; letter-spacing: .1em; pointer-events: none; }
#zona-impresion { display: none; }
@media print {
  body.imprimiendo > *:not(#zona-impresion) { display: none !important; }
  body.imprimiendo #zona-impresion { display: block; }
  /* Siempre en colores claros al imprimir, aunque la pantalla esté en modo oscuro. */
  body.imprimiendo { background: #fff; color: #000; --ink: #15213B; --muted: #5A6479; --line: #DCE1EA; --surface: #FFFFFF; --bad: #A33A2E; --gold: #A97A22; }
  body.imprimiendo .recibo { border-color: #999; background: #fff; color: #000; max-width: 640px; margin: 0 auto; }
}

/* ---------- Documentos ---------- */
.docs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.doc { display: grid; gap: 12px; }
.doc h3 { margin: 0; }
.doc p { margin: 0; font-size: 13.5px; }
.doc-campos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.doc .btn { justify-self: start; }

/* ---------- Usuarios y bitácora ---------- */
.clave-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 16px; }
.clave-box .field { flex: 1 1 220px; }
.roles { display: grid; gap: 8px; }
.roles label { align-items: flex-start; }
.roles label span { display: grid; gap: 2px; }
.roles label small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.bit-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bit-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 14px; }
.bit-hora { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.bit-que { overflow-wrap: anywhere; }
.bit-que small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
@media (max-width: 600px) { .bit-row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ---------- Pantallas medianas ---------- */
@media (max-width: 1100px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .dash > .media { grid-column: span 6; }
}

/* ---------- Celular y tableta ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .tb-brand { display: flex; flex: 1; min-width: 0; }
  .tb-title, .tb-fecha { display: none; }
  .tb-av { display: grid; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1A1405; }
  .content { padding: 18px max(16px, env(safe-area-inset-right)) calc(104px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .dash > .media { grid-column: span 12; }
  .hero { padding: 22px 20px; border-radius: 20px; }
  .hero-top { gap: 14px; }
  .rapidas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; width: calc(100% + 40px); }
  .rapidas::-webkit-scrollbar { display: none; }
  .rapidas a { flex: none; padding: 9px 12px; font-size: 13px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-val { font-size: 24px; }
  .avance-top { flex-wrap: wrap; }

  .bottomnav { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
    background: color-mix(in srgb, var(--sb-bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 6px; box-shadow: var(--shadow-lg); }
  .bottomnav a, .bottomnav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 0; font-size: 11px; font-weight: 700; color: var(--sb-muted); border-radius: 14px; text-decoration: none; min-height: 54px; }
  .bottomnav svg { width: 21px; height: 21px; }
  .bottomnav [aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); }
  .bottomnav [aria-current="page"] svg { color: var(--gold-2); }

  .barra-guardar { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .barra-guardar .btn { width: 100%; }
  .res-row { grid-template-columns: minmax(0, 1fr) 60px; }
  .res-bar { grid-column: 1 / -1; grid-row: 2; }
  .fin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fin-stats .card { padding: 12px 10px; }
  .fin-stats .eyebrow { font-size: 10px; letter-spacing: .05em; }
  .fin-stats .stat { font-size: 17px; margin-top: 6px; overflow-wrap: anywhere; }
  .fin-stats p { display: none; }
  .tgrid { grid-template-columns: minmax(0, 1fr); }
  .picker { display: none; }
  .req-select { display: grid; }
  .two { grid-template-columns: 1fr; }
  .filtros { padding: 10px; }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; border-bottom: 0; }
  .dlg { max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 440px) {
  .asi-botones .largo { display: none; }
  .asi-botones .corto { display: inline; }
  .kpi-val { font-size: 22px; }
  .cuenta-atras { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
