
/* Concepto: aplicación de laboratorio con barra lateral por módulos, panel de vencimientos y fichas de equipo con pestañas.
   Tipografía: Verdana (preferencia del usuario). Tokens de color derivados de un único matiz de acento (--h). */
:root {
  --h: 190;
  --font: Verdana, Geneva, "DejaVu Sans", sans-serif;
  --mono: "SFMono-Regular", Consolas, "DejaVu Sans Mono", monospace;
  --bg: #f3f6f6;
  --surface: #ffffff;
  --surface-2: #e9eeef;
  --line: #d6dddf;
  --fg: #172429;
  --muted: #566870;
  --accent: hsl(var(--h) 62% 27%);
  --accent-fg: #ffffff;
  --accent-soft: hsl(var(--h) 38% 91%);
  --series2: #8497a0;
  --tarea: hsl(calc(var(--h) + 130) 42% 36%);
  --ok: #1b6f40; --ok-bg: #dff1e6;
  --warn: #7d5200; --warn-bg: #fbeccb;
  --crit: #aa2119; --crit-bg: #fbe1de;
  --r: 6px;
  --pad-y: 10px;
  --fs: 13px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11181b; --surface: #192226; --surface-2: #212c31; --line: #2e3c42;
    --fg: #e5edee; --muted: #9aabb1;
    --accent: hsl(var(--h) 55% 63%); --accent-fg: #0a1215; --accent-soft: hsl(var(--h) 28% 19%);
    --series2: #7f949d; --tarea: hsl(calc(var(--h) + 130) 45% 62%);
    --ok: #62c78c; --ok-bg: #17301f; --warn: #e8b550; --warn-bg: #352a10; --crit: #f28e86; --crit-bg: #3b1c1a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11181b; --surface: #192226; --surface-2: #212c31; --line: #2e3c42;
  --fg: #e5edee; --muted: #9aabb1;
  --accent: hsl(var(--h) 55% 63%); --accent-fg: #0a1215; --accent-soft: hsl(var(--h) 28% 19%);
  --series2: #7f949d; --tarea: hsl(calc(var(--h) + 130) 45% 62%);
  --ok: #62c78c; --ok-bg: #17301f; --warn: #e8b550; --warn-bg: #352a10; --crit: #f28e86; --crit-bg: #3b1c1a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: var(--fs); line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.55em; font-weight: 700; }
h2 { font-size: 1.1em; font-weight: 700; }
h3 { font-size: 0.95em; font-weight: 700; }
a { color: var(--accent); }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78em; color: var(--muted); }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 12px; padding-left: max(12px, env(safe-area-inset-left, 0px));
  position: sticky; top: env(safe-area-inset-top, 0px); align-self: start;
  max-height: calc(100vh - env(safe-area-inset-top, 0px)); overflow-y: auto;
}
.brand { display: flex; align-items: baseline; gap: 8px; padding: 2px 8px 16px; }
.brand b { font-size: 1.25em; letter-spacing: -.02em; }
.brand span { color: var(--accent); font-weight: 700; }
.navgroup { margin-top: 14px; }
.navgroup > .eyebrow { padding: 0 8px 4px; display: block; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 8px; border-radius: var(--r); color: var(--fg); text-decoration: none;
}
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.tag { font-size: .72em; padding: 1px 6px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.main { padding-block: 0 48px; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px max(24px, env(safe-area-inset-right, 0px)) 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.topbar .grow { flex: 1; min-width: 0; }
.topbar .field.grow { flex: 1 1 170px; }
td .mono, td b.mono { white-space: nowrap; }
.menu-btn { display: none; }
.content { padding: 24px max(24px, env(safe-area-inset-right, 0px)) 0 24px; max-width: 1240px; }
.demo-note {
  font-size: .85em; background: var(--warn-bg); color: var(--warn); padding: 8px 12px; border-radius: var(--r); margin-bottom: 18px;
}
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead p { margin: 4px 0 0; color: var(--muted); max-width: 68ch; }

/* ---------- Controles ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: var(--r); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.1); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: .82em; color: var(--muted); }
input[type=text], input[type=date], select, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 9px; width: 100%; min-width: 0;
}
textarea { min-height: 70px; resize: vertical; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .8em; font-weight: 700; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.crit { background: var(--crit-bg); color: var(--crit); }
.chip.neutral { background: var(--surface-2); color: var(--muted); }

/* ---------- Superficies ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid2.split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; }
.summary a { padding: 14px 16px; text-decoration: none; color: inherit; border-right: 1px solid var(--line); display: block; }
.summary a:last-child { border-right: 0; }
.summary a:hover { background: var(--surface-2); }
.summary .n { font-size: 2em; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.summary .n.crit { color: var(--crit); } .summary .n.warn { color: var(--warn); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .78em; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: var(--pad-y) 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
td.num, th.num { font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: end; }
.toolbar .field { flex: 1 1 160px; max-width: 260px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
dl.kv { display: grid; grid-template-columns: 11.5em minmax(0, 1fr); gap: 8px 12px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85em; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.statebar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 12px; }
.formgrid .wide { grid-column: 1 / -1; }
.err { color: var(--crit); font-size: .85em; margin-top: 6px; }
.todo { border: 1px dashed var(--line); border-radius: var(--r); padding: 12px; }
.todo ul { margin: 6px 0 0; padding-left: 1.2em; }
.entity { display: inline-block; font-family: var(--mono); font-size: .85em; border: 1px solid var(--line); background: var(--surface); padding: 3px 8px; border-radius: var(--r); margin: 0 6px 6px 0; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: var(--r); z-index: 20; max-width: calc(100vw - 32px); }
details.settings { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.settings summary { cursor: pointer; font-weight: 700; padding: 0 8px; }
.settings .field { margin: 10px 8px 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatches button[aria-pressed="true"] { border-color: var(--fg); }

/* ---------- Teléfono ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .side[hidden-mobile="true"] { display: none; }
  .menu-btn { display: inline-block; }
  .topbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .grid2, .grid2.split, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary a:nth-child(2) { border-right: 0; } .summary a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 0; } dl.kv dd { margin-bottom: 10px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); }
  .gate { grid-template-columns: minmax(0, 1fr); }
}
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.steps li { flex: 1 1 120px; padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); color: var(--muted); font-size: .85em; border-top: 3px solid var(--line); }
.steps li.done { border-top-color: var(--ok); color: var(--fg); }
.steps li.cur { border-top-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.gate { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.gate:last-child { border-bottom: 0; }
.gate .why { grid-column: 1 / -1; font-size: .85em; color: var(--muted); }
.uin { width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.notice { font-size: .85em; border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 8px 12px; border-radius: var(--r); margin-bottom: 14px; }
@media (prefers-reduced-motion: no-preference) { .btn, .nav a, tr.click td { transition: background .12s; } }

/* ---------- Extras de la aplicación Django ---------- */
input[type=number], input[type=file], input[type=password], input[type=email] { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 9px; width: 100%; min-width: 0; }
.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px; background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--crit-bg); color: var(--crit); }
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--crit); font-size: .85em; }
.helptext { color: var(--muted); font-size: .8em; }
.bars { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; align-items: end; height: 170px; }
.bars .col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; font-size: .72em; color: var(--muted); }
.bars .stackbar { display: flex; flex-direction: column-reverse; width: 100%; }
.bars .stackbar i { display: block; width: 100%; }
.loginbox { max-width: 380px; margin: 12vh auto 0; }
.inline-form { display: inline; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; cursor: pointer; text-decoration: underline; }
a.btn { text-decoration: none; display: inline-block; color: inherit; }
a.btn.primary { color: var(--accent-fg); }
.tabs a { text-decoration: none; }

/* ---------- Cuadro de mando ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi .v { font-size: 1.9em; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi.ok .v { color: var(--ok); } .kpi.warn .v { color: var(--warn); } .kpi.crit .v { color: var(--crit); }
.kpi a.t { color: var(--fg); text-decoration: none; } .kpi a.t:hover { text-decoration: underline; }
.kpi details { font-size: .78em; color: var(--muted); margin-top: auto; padding-top: 6px; }
.kpi summary { cursor: pointer; }
.kpi .st { align-self: flex-start; }

/* ---------- Calendario ---------- */
.ev { display: block; font-size: .74em; line-height: 1.3; padding: 2px 6px; border-radius: 4px; margin-top: 3px; text-decoration: none; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--line); background: var(--surface-2); }
.ev.cal { border-left-color: var(--accent); } .ev.mant { border-left-color: var(--series2); } .ev.tarea { border-left-color: var(--tarea); }
.ev.vencido { background: var(--crit-bg); color: var(--crit); }
.calgrid { width: 100%; table-layout: fixed; border-collapse: collapse; }
.calgrid th { text-align: center; }
.calgrid td { height: 108px; padding: 4px; border: 1px solid var(--line); vertical-align: top; overflow: hidden; }
.calgrid td.otro { background: var(--surface-2); opacity: .65; }
.calgrid td.hoy { outline: 2px solid var(--accent); outline-offset: -2px; }
.calgrid .dn { font-size: .8em; color: var(--muted); font-variant-numeric: tabular-nums; }
.calnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.calnav h2 { min-width: 11em; text-align: center; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; font-size: .9em; }
.filters label { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.agenda li { grid-template-columns: 7em minmax(0, 1fr); }

/* ---------- Barra lateral de tareas (derecha) ---------- */
.tasks {
  background: var(--surface); border-left: 1px solid var(--line); padding: 18px 14px; padding-right: max(14px, env(safe-area-inset-right, 0px));
  position: sticky; top: env(safe-area-inset-top, 0px); align-self: start; max-height: calc(100vh - env(safe-area-inset-top, 0px)); overflow-y: auto;
}
.tasks h2 { font-size: 1em; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tasks .sec { margin-top: 16px; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9em; }
.task:last-child { border-bottom: 0; }
.task form { margin: 0; }
.task .check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: none; cursor: pointer; padding: 0; color: transparent; }
.task .check:hover { border-color: var(--ok); color: var(--ok); }
.task .meta { grid-column: 2; font-size: .85em; color: var(--muted); }
.tasks details.nueva { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; }
.tasks details.nueva summary { cursor: pointer; font-weight: 700; }
.tasks details.nueva .field { margin-top: 8px; }
.tasks-btn { display: none; }
.tasks-close { display: none; }

@media (min-width: 1281px) { .app { grid-template-columns: 250px minmax(0, 1fr) 300px; } }
@media (max-width: 1280px) {
  .tasks-btn { display: inline-block; }
  .tasks { position: fixed; align-self: stretch; z-index: 15; right: 0; top: 0; bottom: 0; width: min(340px, 100vw); max-height: none; padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: -8px 0 24px rgba(0, 0, 0, .25); }
  .tasks[hidden-tasks="true"] { display: none; }
  .tasks-close { display: inline-block; }
}
@media (max-width: 860px) { .calgrid { display: none; } }
@media (min-width: 861px) { .agenda-titulo { display: none; } }

/* ---------- Menú lateral por grupos plegables ---------- */
details.navgroup { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
details.navgroup:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
details.navgroup > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r); font-weight: 700; }
details.navgroup > summary::-webkit-details-marker { display: none; }
details.navgroup > summary:hover { background: var(--surface-2); }
details.navgroup > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .12s; flex: none; }
details.navgroup[open] > summary::before { transform: rotate(45deg); }
details.navgroup > summary .nm { flex: 1; min-width: 0; }
details.navgroup > summary .norma { font-weight: 400; font-size: .75em; color: var(--muted); display: block; line-height: 1.2; }
.navsub { display: block; margin: 8px 8px 2px 24px; font-size: .72em; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav details a { margin-left: 16px; }
.nav details .navsub + a, .nav details > a:first-of-type { margin-top: 0; }
.nbadge { font-size: .72em; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.nbadge.crit { background: var(--crit-bg); color: var(--crit); }
.nbadge.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- Página de bienvenida: diseño web oscuro, minimalista, con botones tipo píldora ---------- */
body.landing { --bg: #fff; --surface: #fff; --surface-2: #f3f5f6; --line: #e1e7e9; --fg: #172429; --muted: #5b6b72; --accent: hsl(var(--h) 62% 27%); --accent-soft: hsl(var(--h) 38% 93%); color-scheme: light; background: #fff; color: var(--fg); }
body.landing .demo-note { display: none; }
body.landing .app { grid-template-columns: 250px minmax(0, 1fr); }
@media (min-width: 1281px) { body.landing .tasks { display: none; } }
@media (max-width: 860px) { body.landing .app { grid-template-columns: minmax(0, 1fr); } }
body.landing .content { max-width: none; padding: 0; }
.land { position: relative; min-height: 100vh; overflow: hidden; }
.land::before { content: ''; position: absolute; inset: -20% 0 auto 0; height: 640px; background: radial-gradient(ellipse 60% 55% at 50% 0%, hsl(var(--h) 60% 55% / .11), transparent 70%); pointer-events: none; }
.lwrap { position: relative; max-width: 1040px; margin: 0 auto; padding: 14px max(22px, env(safe-area-inset-right, 0px)) 64px max(22px, env(safe-area-inset-left, 0px)); }
.lbrand { display: inline-flex; align-items: center; gap: 9px; }
.lbicon { height: 28px; width: auto; display: block; }
.lgrupo { height: 46px; width: auto; display: block; margin: 0 auto 20px; }
.brand a { display: inline-flex; align-items: center; gap: 8px; }
.brand img { height: 24px; width: auto; display: block; }
.lhead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 6px 0 0; }
.lbrand { font-size: 1.15em; letter-spacing: -.02em; color: var(--fg); text-decoration: none; }
.lbrand span { color: var(--accent); }
.lnav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; justify-content: center; }
.lnav .pill { border-color: transparent; background: transparent; color: var(--muted); padding: 7px 14px; }
.lnav .pill:hover { background: var(--surface-2); color: var(--fg); border-color: transparent; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--fg); text-decoration: none; font: inherit; font-size: .88em; cursor: pointer; line-height: 1.2; transition: background .15s, border-color .15s; }
a.pill:hover, button.pill:hover { background: var(--surface-2); border-color: #b9c6cb; }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill.solid { background: #172429; color: #fff; border-color: #172429; font-weight: 700; }
.pill.solid:hover { background: #0e1a1e; border-color: #0e1a1e; }
.pill.ghost { border-color: transparent; background: var(--surface-2); color: var(--muted); cursor: default; font-size: .8em; }
.lhero { text-align: center; padding: 74px 0 52px; }
.lbadge { display: inline-flex; margin-bottom: 22px; font-size: .78em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; background: var(--surface-2); }
.lhero h1 { font-size: 3.1em; line-height: 1.08; letter-spacing: -.035em; max-width: 14em; margin: 0 auto 16px; background: linear-gradient(180deg, #0d1a1f 35%, #5d6e75); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lhero .lsub { margin: 0 auto 30px; color: var(--muted); max-width: 34em; font-size: 1.02em; line-height: 1.6; }
.lcta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.lent-label { color: var(--muted); font-size: .72em; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 12px; }
.lent { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pill.ent { background: #fff; border-color: var(--line); color: #172429; padding: 9px 22px; min-height: 46px; box-shadow: 0 1px 2px rgba(15, 30, 36, .06); }
.pill.ent:hover { background: #fff; border-color: var(--accent); }
.pill.ent img { height: 22px; width: auto; max-width: 112px; object-fit: contain; display: block; }
.pill.ent img[alt^="Xenotechs"] { height: 30px; } .pill.ent img[alt^="Cifga"] { height: 28px; }
.pill.ent[aria-current="true"], .pill.grupo[aria-current="true"], .pill.ent[aria-pressed="true"], .pill.grupo[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px hsl(var(--h) 60% 50% / .22); }
.pill.grupo { min-height: 46px; padding: 9px 22px; }
.lhero .wctx { margin: 18px auto 0; color: var(--muted); max-width: 46em; font-size: .85em; }
.lsec { margin: 0 0 20px; padding: 20px 22px 22px; border: 1px solid var(--tl, var(--line)); border-radius: 18px; background: var(--tint, #fff); min-width: 0; }
#w-seg { --tint: hsl(215 30% 97.5%); --tl: hsl(215 22% 88%); }
#w-datos { --tint: hsl(38 80% 96.5%); --tl: hsl(38 45% 85%); }
#w-iso9001 { --tint: hsl(var(--h) 45% 96.5%); --tl: hsl(var(--h) 28% 86%); }
#w-iso14001 { --tint: hsl(150 32% 95.5%); --tl: hsl(150 22% 84%); }
.lg { padding: 2px 0; }
.lg + .lg { border-top: 1px solid var(--tl); margin-top: 14px; padding-top: 4px; }
.lsec .pill { border-color: var(--tl); background: #fff; }
.lsec a.pill:hover { border-color: var(--accent); background: #fff; }
.lsec > h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 1.05em; letter-spacing: -.01em; margin-bottom: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--tl, var(--line)); }
.lsec > h2 span { font-weight: 400; font-size: .8em; color: var(--muted); }
.lsec h3 { margin: 16px 0 9px; font-size: .68em; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.lpills { display: flex; flex-wrap: wrap; gap: 8px; }
.lcols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.pill.off { border-style: dashed; color: var(--muted); cursor: default; background: transparent; }
.pill.off:hover { background: transparent; border-color: var(--line); }
.pill .tag { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.pill .nbadge { margin-left: 2px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.emp { background: var(--accent); } .dot.com { background: #e0a040; } .dot.mix { background: linear-gradient(90deg, var(--accent) 50%, #e0a040 50%); }
.lley { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; font-size: .8em; color: var(--muted); margin-top: 8px; }
.lley span { display: inline-flex; align-items: center; gap: 7px; }
.lfoot { text-align: center; color: var(--muted); font-size: .75em; margin-top: 40px; }
#entLogo { height: 22px; background: #fff; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); }
@media (max-width: 860px) { .lcols { grid-template-columns: minmax(0, 1fr); gap: 0; } .lnav { justify-content: flex-start; } .lhero { padding-top: 44px; } .lhero h1 { font-size: 2.1em; } }
/* ---------- Uso en móvil para la toma de datos ---------- */
@media (max-width: 860px) {
  input[type=text], input[type=date], input[type=time], input[type=number], select, textarea { font-size: 16px; min-height: 46px; }
  textarea { min-height: 88px; }
  .btn { min-height: 46px; padding: 10px 16px; }
  .tabs button { min-height: 46px; }
  .nav a { min-height: 44px; display: flex; align-items: center; }
  .pill { min-height: 44px; }
  .formgrid { grid-template-columns: minmax(0, 1fr); }
  form .btn.primary { width: 100%; }
  .check { width: 32px; height: 32px; }
  .task { padding: 12px 0; }
  .calnav .btn { min-width: 46px; }
  .lquick .pill { flex: 1 1 calc(50% - 8px); justify-content: center; text-align: center; }
}
.lquick { margin-bottom: 30px; }
.lquick .pill { padding: 11px 18px; }

/* ---------- Uso en móvil para la toma de datos ---------- */
@media (max-width: 860px) {
  input[type=text], input[type=date], input[type=time], input[type=number], select, textarea { font-size: 16px; min-height: 46px; }
  textarea { min-height: 88px; }
  .btn { min-height: 46px; padding: 10px 16px; }
  .tabs button { min-height: 46px; }
  .nav a { min-height: 44px; display: flex; align-items: center; }
  .pill { min-height: 44px; }
  .formgrid { grid-template-columns: minmax(0, 1fr); }
  form .btn.primary { width: 100%; }
  .check { width: 32px; height: 32px; }
  .task { padding: 12px 0; }
  .calnav .btn { min-width: 46px; }
}

.lhero .lsub { max-width: 34em; }
.land .pill.grupo { text-decoration: none; }

/* ---------- Planes anuales: un color por plan (y su nombre siempre visible, el color no es la única pista) ---------- */
:root { --pl-CAL: #14688a; --pl-MEXT: #a85a00; --pl-MIT: #5b4bb0; --pl-FOR: #1b7a46; --pl-REC: #a8266b; --pl-AUD: #7a6a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pl-CAL: #6cc0d4; --pl-MEXT: #f0b36a; --pl-MIT: #b4a8f0; --pl-FOR: #7fd49f; --pl-REC: #f09ac6; --pl-AUD: #e3d26a; } }
:root[data-theme="dark"] { --pl-CAL: #6cc0d4; --pl-MEXT: #f0b36a; --pl-MIT: #b4a8f0; --pl-FOR: #7fd49f; --pl-REC: #f09ac6; --pl-AUD: #e3d26a; }
.pl-CAL { --pc: var(--pl-CAL); } .pl-MEXT { --pc: var(--pl-MEXT); } .pl-MIT { --pc: var(--pl-MIT); } .pl-FOR { --pc: var(--pl-FOR); } .pl-REC { --pc: var(--pl-REC); } .pl-AUD { --pc: var(--pl-AUD); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--pc); flex: none; margin-right: 7px; }
.pltabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.pltabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.pltabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.plfilters { align-items: flex-end; }
.plchips { display: flex; gap: 6px; flex-wrap: wrap; }
.plchip input { position: absolute; opacity: 0; }
.plchip span { display: inline-flex; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; font-size: .86em; background: var(--surface); }
.plchip input:checked + span { border-color: var(--pc); background: var(--accent-soft); font-weight: 700; }
.plchip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.resumen { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rs h2 { font-size: .95em; margin: 0; display: flex; align-items: center; }
.rs p { margin: 8px 0 0; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.bar span { display: block; height: 100%; background: var(--pc); }
.yeargrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mcard { padding: 12px; }
.mcard.hoy { outline: 2px solid var(--accent); outline-offset: -2px; }
.mcard h3 { margin: 0; font-size: 1em; } .mcard h3 a { color: inherit; text-decoration: none; } .mcard h3 a:hover { text-decoration: underline; }
.mrow { display: flex; align-items: center; gap: 4px; padding: 5px 8px; margin-top: 5px; border-radius: 5px; border-left: 4px solid var(--pc); background: var(--surface-2); color: var(--fg); text-decoration: none; font-size: .82em; }
.mrow:hover { background: var(--accent-soft); }
.mrow .sw { display: none; } .mrow .mn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mrow .mc { font-variant-numeric: tabular-nums; color: var(--muted); }
.plhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); border-left: 5px solid var(--pc); border-radius: var(--r) var(--r) 0 0; flex-wrap: wrap; margin: 0; }
.plhead h2 { margin: 0; font-size: 1em; display: flex; align-items: center; }
.pltabla td.pldesc { white-space: normal; min-width: 240px; max-width: 460px; }
.pltabla tr.venc td { background: var(--crit-bg); }
.pltabla input[type="date"] { width: auto; min-height: 0; padding: 3px 6px; margin-right: 6px; }
.pllista tbody tr { border-left: 4px solid var(--pc); }
.pllista th.mc, .pllista td.mc { text-align: center; padding-left: 3px; padding-right: 3px; min-width: 28px; }
.plbadge { display: inline-flex; align-items: center; font-size: .8em; font-weight: 700; color: var(--pc); white-space: normal; }
.pt { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 99px; border: 2px solid var(--pc); color: var(--fg); font-size: .66em; text-decoration: none; line-height: 1; }
.pt.hecha { background: var(--pc); color: var(--accent-fg); }
.pt.venc { border-color: var(--crit); background: var(--crit-bg); color: var(--crit); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.plform .meses { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px 12px; }
.plform .meses > div { display: contents; }
.plform .meses label { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.plform .errorlist { color: var(--crit); list-style: none; padding: 0; margin: 4px 0; }
.plform .ayuda { color: var(--muted); font-size: .85em; }
.baja summary { cursor: pointer; color: var(--muted); font-size: .85em; }
.baja form { display: flex; gap: 6px; margin-top: 4px; }
.plficha { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.plficha dt { color: var(--muted); font-size: .85em; } .plficha dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.plcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.plnotas li { grid-template-columns: 120px 1fr; }
.plform textarea, .plform input[type="file"], .plform input[type="text"] { width: 100%; }
.pltabla td.cod { white-space: normal; overflow-wrap: anywhere; min-width: 90px; max-width: 150px; }
