/* =====================================================================
   SÍSIFO — sistema de diseño
   Marca (aprobada): azul petróleo #123B50 · naranja ámbar #E99A43 · amarillo dorado #F4C95D ·
   crema #F7F4ED · blanco. Escalas, semánticos, modo oscuro y tipografía: propuesta (ver DISENO.md).
   Todo color de la interfaz sale de estas variables: para ajustar la marca se cambia aquí.
   ===================================================================== */

@font-face { font-family: "Inter"; src: url("fuentes/inter-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fuentes/cormorant-italic-500.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  /* Marca */
  --petroleo-900: #0B2532; --petroleo-800: #123B50; --petroleo-700: #1A4E69; --petroleo-600: #24627F;
  --petroleo-400: #5D8EA6; --petroleo-200: #B9D0DB; --petroleo-100: #E1ECF1; --petroleo-50: #F0F5F7;
  --ambar-700: #9A5A14; --ambar-500: #E99A43; --ambar-300: #F3C48F; --ambar-100: #FCEBD7;
  --dorado-500: #F4C95D; --dorado-100: #FDF3D8;
  --crema: #F7F4ED; --crema-2: #EFEAE0;

  /* Roles (modo claro) */
  --bg: var(--crema); --card: #FFFFFF; --card-2: #FBF9F4; --ink: #1B2A33; --muted: #5B6770; --line: #E6E0D3; --line-2: #D9D2C3;
  --brand: var(--petroleo-800); --brand-hover: var(--petroleo-700); --brand-2: var(--petroleo-100); --on-brand: #FFFFFF; --brand-ink: var(--petroleo-800); --ic-ink: var(--petroleo-700); --link: var(--petroleo-700); --badge-off-bg: var(--crema-2); --on-bad: #FFFFFF;
  --accent: var(--ambar-500); --accent-hover: #DF8A2E; --on-accent: var(--petroleo-800); --accent-ink: var(--ambar-700); --accent-2: var(--ambar-100);
  --highlight: var(--dorado-500); --highlight-2: var(--dorado-100);
  --nav-bg: var(--petroleo-800); --nav-ink: #FFFFFF;
  --ok: #1F7A55; --ok-bg: #E4F2EA; --bad: #B3261E; --bad-bg: #FBE9E7;
  --warn: #8A5A00; --warn-bg: #FDF1D6; --info: #1F5F86; --info-bg: #E3EEF5;
  --overlay: rgba(11, 37, 50, .48); --toast-bg: var(--petroleo-900);
  --shadow-1: 0 1px 2px rgba(18, 59, 80, .06), 0 1px 1px rgba(18, 59, 80, .03);
  --shadow-2: 0 8px 24px rgba(18, 59, 80, .12), 0 2px 6px rgba(18, 59, 80, .06);
  --focus: 0 0 0 3px rgba(233, 154, 67, .55);

  /* Gráficas */
  --s1: var(--petroleo-600); --s2: var(--ambar-500); --b-bajo: #C8463D; --b-medio: #E0A33A; --b-alto: #2E8B63;
  --viz-grid: var(--line); --viz-on: #FFFFFF;

  /* Tipografía, espacio, forma */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-md: .9375rem; --fs-base: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.375rem; --fs-2xl: 1.75rem;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
  --nav-h: 64px; --side-w: 236px; --top-h: 60px;
  color-scheme: light;
}

/* Modo oscuro: derivado del azul petróleo (no es una inversión) */
:root[data-tema="oscuro"] {
  --bg: #0A1A23; --card: #112532; --card-2: #15303F; --ink: #E7EEF1; --muted: #9DB0BA; --line: #1F3A4A; --line-2: #2A4A5C;
  --brand: var(--ambar-500); --brand-hover: #F1AC60; --brand-2: #1B3B4D; --on-brand: var(--petroleo-900); --brand-ink: #F3B877; --ic-ink: #F3B877; --link: #F3B877; --badge-off-bg: #1F3A4A; --on-bad: #2A0F0D;
  --accent: var(--ambar-500); --accent-hover: #F1AC60; --on-accent: var(--petroleo-900); --accent-ink: #F3B877; --accent-2: #3A2A17;
  --highlight: var(--dorado-500); --highlight-2: #3A3016;
  --nav-bg: #0D202B; --nav-ink: #E7EEF1;
  --ok: #6FD3A5; --ok-bg: #143A2D; --bad: #FF9D94; --bad-bg: #401C1A; --warn: #F4C95D; --warn-bg: #3A2E12; --info: #8EC5E8; --info-bg: #15344A;
  --overlay: rgba(2, 10, 14, .66); --toast-bg: #1E3E50;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow-2: 0 10px 28px rgba(0, 0, 0, .45);
  --s1: #6FA9C6; --s2: var(--ambar-500); --b-bajo: #E86A60; --b-medio: #E8B04E; --b-alto: #4FB487; --viz-on: #0A1A23;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --bg: #0A1A23; --card: #112532; --card-2: #15303F; --ink: #E7EEF1; --muted: #9DB0BA; --line: #1F3A4A; --line-2: #2A4A5C;
    --brand: var(--ambar-500); --brand-hover: #F1AC60; --brand-2: #1B3B4D; --on-brand: var(--petroleo-900); --brand-ink: #F3B877; --ic-ink: #F3B877; --link: #F3B877; --badge-off-bg: #1F3A4A; --on-bad: #2A0F0D;
    --accent: var(--ambar-500); --accent-hover: #F1AC60; --on-accent: var(--petroleo-900); --accent-ink: #F3B877; --accent-2: #3A2A17;
    --highlight: var(--dorado-500); --highlight-2: #3A3016;
    --nav-bg: #0D202B; --nav-ink: #E7EEF1;
    --ok: #6FD3A5; --ok-bg: #143A2D; --bad: #FF9D94; --bad-bg: #401C1A; --warn: #F4C95D; --warn-bg: #3A2E12; --info: #8EC5E8; --info-bg: #15344A;
    --overlay: rgba(2, 10, 14, .66); --toast-bg: #1E3E50;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow-2: 0 10px 28px rgba(0, 0, 0, .45);
    --s1: #6FA9C6; --s2: var(--ambar-500); --b-bajo: #E86A60; --b-medio: #E8B04E; --b-alto: #4FB487; --viz-on: #0A1A23;
    color-scheme: dark;
  }
}

/* Base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-base)/1.45 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 var(--sp-2); line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-lg); font-weight: 650; }
h3 { font-size: var(--fs-base); font-weight: 650; }
a { color: var(--link); }
.muted { color: var(--muted); font-size: var(--fs-md); }
.small { font-size: var(--fs-sm); }
.hidden, [hidden] { display: none !important; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 500; }
/* Números alineados en tablas, contadores y calificaciones */
table, .num, .g, .stat b, .state, input[type=number], .tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.ic-svg { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -.22em; flex: none; }
.ic .ic-svg, .icon-btn .ic-svg { width: 1em; height: 1em; vertical-align: 0; display: block; }
.btn .ic-svg { margin-right: 4px; }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--nav-bg); color: var(--nav-ink); min-height: var(--top-h); padding: calc(10px + env(safe-area-inset-top)) var(--sp-4) 10px; display: flex; gap: var(--sp-3); align-items: center; }
.topbar .marca-mini { width: 34px; height: 34px; border-radius: 9px; flex: none; display: block; }
.topbar .title { flex: 1; min-width: 0; }
.topbar .title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; font-size: var(--fs-base); }
.topbar .title span { font-size: var(--fs-xs); opacity: .78; }
.topbar select { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); color: inherit; border-radius: var(--radius-sm); padding: 7px 10px; max-width: 150px; width: auto; }
.topbar select option { color: #1B2A33; background: #fff; }
.topbar .icon-btn { background: rgba(255, 255, 255, .12); color: inherit; }
main { padding: var(--sp-4) var(--sp-4) calc(var(--nav-h) + 90px + env(safe-area-inset-bottom)); max-width: 920px; margin: 0 auto; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav button { flex: 1; height: var(--nav-h); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .6875rem; font-weight: 500; color: var(--muted); cursor: pointer; position: relative; }
.bottomnav button .ic { font-size: 1.35rem; line-height: 1; }
.bottomnav button.active { color: var(--brand); font-weight: 650; }
.bottomnav button.active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.bottomnav .marca-nav { display: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4); margin-bottom: var(--sp-3); box-shadow: var(--shadow-1); }
.row { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

/* Controles */
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; min-height: 44px; background: var(--brand-2); color: var(--brand-ink); font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn:hover { background: color-mix(in srgb, var(--brand-2) 80%, var(--brand) 20%); }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.accent, .sticky-actions .btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.accent:hover, .sticky-actions .btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.ghost { background: transparent; color: var(--brand-ink); padding: 8px 10px; min-height: 40px; }
.btn.ghost:hover { background: var(--brand-2); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-2); color: var(--brand-ink); font-size: 1.1rem; cursor: pointer; flex: none; display: inline-flex; align-items: center; justify-content: center; }
label.field { display: block; }
label.field > span, div.field > span { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=search], input[type=date], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line-2); background: var(--card); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--focus); }
input:disabled, select:disabled { opacity: .6; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--petroleo-700); }
textarea { min-height: 120px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 7px 13px; white-space: nowrap; cursor: pointer; font-size: var(--fs-md); font-weight: 500; }
.chip.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* Listas */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.item { display: flex; align-items: center; gap: var(--sp-3); padding: 9px var(--sp-3); border-bottom: 1px solid var(--line); min-height: 52px; }
.item:last-child { border-bottom: 0; }
.item .num { width: 26px; text-align: right; color: var(--muted); font-size: var(--fs-sm); flex: none; }
.item .name { flex: 1; min-width: 0; font-size: var(--fs-md); }
.item .name small { display: block; color: var(--muted); font-size: var(--fs-xs); margin-top: 1px; }
.item.clickable, .menu-list .item { cursor: pointer; transition: background-color .12s; }
.item.clickable:hover, .menu-list .item:hover { background: var(--card-2); }
.item input[type=number] { width: 76px; text-align: center; padding: 8px; }

/* Estados de asistencia y entrega: color + letra (no depende solo del color) */
.state { border: 1px solid transparent; min-width: 76px; height: 40px; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; flex: none; }
.st-P, .st-1 { background: var(--ok-bg); color: var(--ok); }
.st-F, .st-0 { background: var(--bad-bg); color: var(--bad); }
.st-R, .st-05 { background: var(--warn-bg); color: var(--warn); }
.st-J { background: var(--info-bg); color: var(--info); }

.sticky-actions { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 10px var(--sp-4); background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 9; }
.sticky-actions .inner { max-width: 920px; margin: 0 auto; display: flex; gap: var(--sp-2); }
.sticky-actions .btn { flex: 1; padding: 14px; box-shadow: var(--shadow-2); }

.banner { border-radius: var(--radius); padding: var(--sp-3) 14px; margin-bottom: var(--sp-3); border: 1px solid transparent; }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 18%, transparent); }
.banner.info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 16%, transparent); }
.banner.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 16%, transparent); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--sp-2); text-align: center; }
.stat b { display: block; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; }
.stat span { font-size: var(--fs-xs); color: var(--muted); }

/* Tablas */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
table { border-collapse: collapse; width: 100%; font-size: .875rem; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
th { background: var(--card-2); font-weight: 600; font-size: var(--fs-xs); color: var(--muted); position: sticky; top: 0; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover td { background: var(--card-2); }
td.left, th.left { text-align: left; }
td.name { text-align: left; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
tr.clickable { cursor: pointer; }
.g { display: inline-block; min-width: 42px; padding: 3px 7px; border-radius: 6px; font-weight: 700; }
.g-bajo { background: var(--bad-bg); color: var(--bad); }
.g-medio { background: var(--warn-bg); color: var(--warn); }
.g-alto { background: var(--ok-bg); color: var(--ok); }

/* Entrada, registro y carga */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: var(--sp-5); background: var(--bg); position: relative; overflow: hidden; }
.login::after { content: ""; position: absolute; inset: auto 0 0 0; height: 34vh; background: var(--petroleo-800); clip-path: polygon(0 62%, 18% 40%, 34% 55%, 52% 22%, 70% 48%, 84% 30%, 100% 50%, 100% 100%, 0 100%); opacity: .05; pointer-events: none; }
.login .card { width: 100%; max-width: 400px; padding: 28px 26px; position: relative; z-index: 1; box-shadow: var(--shadow-2); }
.login .logo { display: block; margin: 0 auto 4px; }
.login .logo img { display: block; margin: 0 auto; }
.login .logo-completo img { width: 230px; max-width: 72%; height: auto; }
.login .logo-iso img { width: 92px; height: auto; }
.login h1 { text-align: center; font-size: var(--fs-xl); }
.login .lema { text-align: center; color: var(--muted); font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 1.15rem; margin: -2px 0 6px; }
:root[data-tema="oscuro"] .login .logo-completo, :root[data-tema="oscuro"] .login .logo-iso, :root[data-tema="oscuro"] .splash .logo-completo { background: var(--crema); border-radius: var(--radius); padding: 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .login .logo-completo, :root:not([data-tema="claro"]) .login .logo-iso, :root:not([data-tema="claro"]) .splash .logo-completo { background: var(--crema); border-radius: var(--radius); padding: 12px; } }
.splash { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: var(--sp-5); align-items: center; justify-content: center; background: var(--bg); }
.splash .logo-completo img { width: 210px; height: auto; display: block; }
.splash .spinner { margin-top: 4px; }

/* Modal y avisos */
.modal { position: fixed; inset: 0; background: var(--overlay); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-card { background: var(--card); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 18px var(--sp-4) calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-2); }
@media (min-width: 700px) { .modal { align-items: center; } .modal-card { border-radius: var(--radius-lg); } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(74px + env(safe-area-inset-top)); background: var(--toast-bg); color: #fff; padding: 11px 18px; border-radius: var(--radius); z-index: 60; max-width: 90vw; text-align: center; box-shadow: var(--shadow-2); font-size: var(--fs-md); font-weight: 500; }
.toast::before { content: "✓"; display: inline-block; margin-right: 8px; color: var(--dorado-500); font-weight: 700; }
.toast.error { background: var(--bad); color: var(--on-bad); }
.toast.error::before { content: "!"; color: inherit; }
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--muted); gap: 10px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--brand-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.menu-list .item .ic { font-size: 1.15rem; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-2); color: var(--ic-ink); flex: none; }
.menu-list .item > span:last-child { color: var(--muted); }
.badge { font-size: var(--fs-xs); padding: 2px 9px; border-radius: 999px; background: var(--brand-2); color: var(--ic-ink); font-weight: 600; }
.badge.off { background: var(--badge-off-bg); color: var(--muted); }

/* Escritorio: barra lateral en lugar de la barra inferior */
@media (min-width: 1024px) {
  body { --nav-h: 0px; }
  .bottomnav { top: 0; right: auto; width: var(--side-w); flex-direction: column; justify-content: flex-start; gap: 2px; padding: var(--sp-4) var(--sp-3); background: var(--nav-bg); border-top: 0; border-right: 1px solid var(--line); }
  .bottomnav .marca-nav { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: var(--nav-ink); font-weight: 800; letter-spacing: .12em; font-size: 1.05rem; }
  .bottomnav .marca-nav img { width: 36px; height: 36px; border-radius: 9px; }
  .bottomnav button { flex: none; height: 44px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; border-radius: 10px; font-size: var(--fs-md); color: color-mix(in srgb, var(--nav-ink) 78%, transparent); }
  .bottomnav button:hover { background: rgba(255, 255, 255, .07); color: var(--nav-ink); }
  .bottomnav button .ic { font-size: 1.2rem; }
  .bottomnav button.active { background: rgba(255, 255, 255, .1); color: var(--nav-ink); }
  .bottomnav button.active::before { top: 10px; bottom: 10px; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  body:has(.bottomnav) .topbar, body:has(.bottomnav) main, body:has(.bottomnav) .sup-franja { margin-left: var(--side-w); }
  body:has(.bottomnav) .topbar { background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line); }
  body:has(.bottomnav) .topbar .marca-mini { display: none; }
  body:has(.bottomnav) .topbar select, body:has(.bottomnav) .topbar .icon-btn { background: var(--brand-2); border-color: var(--line); color: var(--ink); }
  main { padding: var(--sp-6) var(--sp-8) 120px; max-width: 1100px; }
  .sticky-actions { left: var(--side-w); bottom: 0; }
  .sticky-actions .inner { max-width: 1036px; }
  .toast { top: 84px; }
}

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

@media print {
  .topbar, .bottomnav, .sticky-actions, .no-print, .toast, .btn { display: none !important; }
  main { padding: 0; max-width: none; margin: 0 !important; }
  body { background: #fff; color: #000; }
  .card, .table-wrap { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* Gráficas */
.viz { width: 100%; height: auto; display: block; font-family: inherit; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-umbral { stroke: var(--b-bajo); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.viz-axis { font-size: 9px; fill: var(--muted); }
.viz-label { font-size: 11px; fill: var(--ink); }
.viz-value { font-size: 10px; fill: var(--ink); font-weight: 600; }
.viz-muted { font-size: 10px; fill: var(--muted); }
.viz-in { font-size: 10px; fill: var(--viz-on); font-weight: 700; }
.viz-in-dark { fill: #0b0b0b; }
.viz-dot { stroke: var(--card); stroke-width: 2; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); color: var(--muted); margin-bottom: 6px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.riesgo-motivo { display: inline-block; font-size: var(--fs-xs); padding: 2px 8px; border-radius: 999px; background: var(--bad-bg); color: var(--bad); margin: 3px 4px 0 0; }
.riesgo-motivo.medio { background: var(--warn-bg); color: var(--warn); }

.info-btn { width: 32px; height: 32px; font-size: 1rem; border-radius: 50%; }
.info-btn.active { background: var(--brand); color: var(--on-brand); }

/* Al generar el PDF: siempre en claro, ancho de hoja y sin sombras */
.pdf-modo { width: 720px; max-width: none; background: #fff; color: #1B2A33; padding: 0;
  --card: #fff; --card-2: #FBF9F4; --ink: #1B2A33; --muted: #5B6770; --line: #E6E0D3; --viz-grid: #E6E0D3; --viz-on: #fff;
  --ok: #1F7A55; --ok-bg: #E4F2EA; --bad: #B3261E; --bad-bg: #FBE9E7; --warn: #8A5A00; --warn-bg: #FDF1D6; --info: #1F5F86; --info-bg: #E3EEF5;
  --s1: #24627F; --s2: #E99A43; --b-bajo: #C8463D; --b-medio: #E0A33A; --b-alto: #2E8B63; }
.pdf-modo .card, .pdf-modo .table-wrap { box-shadow: none; border: 1px solid #E6E0D3; }
.pdf-modo .table-wrap { overflow: visible; }

/* Suplentes */
.sup-franja { background: var(--highlight-2); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; text-align: center; padding: 7px var(--sp-3); border-bottom: 1px solid color-mix(in srgb, var(--highlight) 45%, transparent); }
.card.cred { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card.cred div { display: flex; flex-direction: column; gap: 2px; }
.card.cred b { font-family: ui-monospace, Menlo, monospace; font-size: 18px; letter-spacing: .5px; word-break: break-all; }
.solo-lectura .sticky-actions, .solo-lectura [data-act="pegar-abrir"], .solo-lectura .btn.danger,
.solo-lectura [data-act$="-todos"], .solo-lectura [data-act="asis-sinclase"], .solo-lectura [data-act="asis-quitar-sinclase"], .solo-lectura .hint-editar { display: none !important; }
.solo-lectura button.state:disabled { opacity: 1; cursor: default; }

/* CAPTCHA (Cloudflare Turnstile): solo ocupa espacio si le pide algo a la persona */
.captcha { display: flex; justify-content: center; }
.captcha:empty { display: none; }

/* Apariencia (Mi cuenta) */
.segmented { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 500; cursor: pointer; color: var(--muted); min-height: 36px; }
.segmented button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }
