/* MOTRIRED · sistema de diseño (Fases 1 a 5). Colores, tipografía y componentes. */
:root {
  --ink: #12232e;
  --muted: #44606f;
  --bg: #f3f6f8;
  --card: #ffffff;
  --line: #d5dee4;
  --primary: #1b6a8f;
  --primary-dark: #1b5e80;
  --side: #0f3b4f;
  --side-text: #cfe0ea;
  --warn-bg: #fff7ed;
  --warn-line: #b45309;
  --warn-ink: #7c2d12;
  --ok-bg: #ecf7f1;
  --ok-line: #2f7d55;
  --ok-ink: #1d5138;
  --soft: #e8f1f6;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---- Estructura de la aplicación ---- */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side {
  flex: 1 1 240px; max-width: 100%; background: var(--side); color: #fff;
  padding: 24px 16px; display: flex; flex-direction: column; gap: 8px;
}
.main { flex: 999 1 560px; min-width: 0; padding: 32px 24px; }
@media (min-width: 900px) {
  .side { flex: 0 0 260px; position: sticky; top: 0; height: 100vh; }
  .main { padding: 32px 40px; }
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; color: #fff; text-decoration: none; }
.brand-name { font-size: 18px; font-weight: 600; letter-spacing: .08em; }
.brand-tag { font-size: 12px; color: #9cc3d6; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; min-height: 44px; padding: 10px 14px; border-radius: 8px;
  color: #fff; text-decoration: none; font-size: 15px; font-weight: 600;
}
.nav a:hover { background: rgba(255, 255, 255, .08); }
.nav a[aria-current="page"] { background: var(--primary); }
.side :focus-visible { outline-color: #fff; }

.side-foot { margin-top: auto; border-top: 1px solid #2c5b72; padding-top: 16px; color: var(--side-text); font-size: 13px; }
.side-foot strong { display: block; color: #fff; margin-bottom: 8px; }

/* ---- Componentes ---- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; line-height: 1.2; }
.lead { color: var(--muted); font-size: 15px; margin-top: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.empty { text-align: center; padding: 56px 24px; }
.empty h2 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 52ch; margin: 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 6px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--primary-dark); }
.btn-ghost {
  min-height: 44px; padding: 10px 14px; border: 1px solid #6f9ab1; background: none; color: #fff;
  border-radius: 6px; font: inherit; font-size: 14px; cursor: pointer;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #8aa2af; border-radius: 6px;
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
}
.pw { position: relative; }
.pw .input { padding-right: 84px; }
.pw-toggle {
  position: absolute; right: 4px; top: 4px; min-height: 36px; padding: 0 12px; border: 0; background: none;
  color: var(--primary-dark); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 6px;
}
.alert {
  border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-ink);
  border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px;
}
.src { background: #e6ebee; color: #33505f; border-radius: 6px; padding: 8px 12px; font-size: 12px; margin-top: 20px; }

/* ---- Pantalla de ingreso ---- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box { width: 100%; max-width: 420px; }
.auth .card { padding: 32px; }
.auth h1 { font-size: 24px; margin: 16px 0 4px; }
.auth .lead { margin-bottom: 24px; }
.auth .btn { width: 100%; }

/* ---- Fase 2: utilidades ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: 13px; margin-top: 16px; }
.code { font-family: var(--mono); letter-spacing: .02em; }
.link { color: var(--primary-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; }
.link:hover { color: var(--ink); }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--primary-dark); font-weight: 600; text-decoration: none; margin-bottom: 4px; }
.back:hover { text-decoration: underline; }
.btn-secondary { background: #fff; color: var(--primary-dark); }
.btn-secondary:hover { background: var(--soft); color: var(--primary-dark); }
a.btn { text-decoration: none; }

.messages { margin-bottom: 16px; }
.msg { border-radius: 8px; padding: 12px 14px; font-size: 14px; border: 1px solid var(--line); background: var(--card); }
.msg-success { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.alert p + p { margin-top: 6px; }

.note { background: var(--soft); border-left: 4px solid var(--primary); border-radius: 8px; padding: 14px 16px; margin-bottom: 20px; font-size: 14px; color: #23404f; }
.note p + p { margin-top: 8px; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.4; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--primary-dark); vertical-align: middle; }
.tag-warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #f3c99b; }

/* Búsqueda y tabla */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar .input { flex: 1 1 220px; max-width: 360px; }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #f8fafb; font-weight: 600; }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8fbfd; }
.code-link { font-family: var(--mono); font-weight: 600; color: var(--primary-dark); text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.code-link:hover { text-decoration: underline; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 16px; color: var(--muted); font-size: 14px; }
.empty-action { margin-top: 16px !important; }

/* Ficha */
.section { margin-bottom: 16px; }
.section h2, .section legend { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px 24px; margin: 0; }
.facts-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.facts dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.section > .help { margin-top: 14px; }

/* Formularios */
fieldset.card { min-width: 0; }
legend { padding: 0; float: left; width: 100%; }
legend + * { clear: both; }
.fieldset-help { margin: -6px 0 14px; }
.grid-2, .grid-3 { display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
textarea.input { min-height: 72px; resize: vertical; line-height: 1.45; }
.req { color: var(--warn-line); }
.help { font-size: 13px; color: var(--muted); margin-top: 6px; }
.help-warn { color: var(--warn-ink); font-weight: 600; }
.error { font-size: 13px; color: #b42318; font-weight: 600; margin-top: 6px; }
.has-error .input { border-color: #b42318; box-shadow: 0 0 0 1px #b42318; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 8px; }

/* Evaluaciones: acceso al catálogo */
.card-link { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin-top: 16px; text-decoration: none; color: inherit; align-items: center; }
.card-link:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(15, 59, 79, .08); }
.card-link-title { font-weight: 600; font-size: 16px; color: var(--primary-dark); }
.card-link-text { grid-column: 1; color: var(--muted); font-size: 14px; }
.card-link-go { grid-column: 2; grid-row: 1 / span 2; font-size: 22px; color: var(--primary); }

/* Catálogo de habilidades */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.jump a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--primary-dark); font-weight: 600; font-size: 14px; text-decoration: none; }
.jump a:hover { border-color: var(--primary); }
.subtest { margin-bottom: 32px; scroll-margin-top: 16px; }
.subtest > h2 { font-size: 20px; margin-bottom: 14px; }
.subtest .num { color: var(--primary); font-family: var(--mono); font-size: 16px; margin-right: 4px; }
.skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.skill { scroll-margin-top: 16px; }
.skill:target { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(27, 106, 143, .25); }
.skill-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.skill-head h3 { font-size: 17px; }
.skill-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--soft); color: var(--primary-dark); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.skill-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px 24px; margin: 0; }
.skill-body dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.skill-body dd { margin: 0; font-size: 14px; }
.skill-codes { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.skill-codes-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; }
.skill-codes h4 { font-size: 14px; margin: 0; }
.skill-codes h4 .muted { font-weight: 400; }
.skill-codes > .muted { font-size: 14px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; }
.chip { font-family: var(--mono); font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 6px; background: var(--soft); color: var(--primary-dark); border: 1px solid #c4dbe7; }
.chip-na { font-family: var(--font); font-weight: 400; background: #f3f5f6; color: var(--muted); border-style: dashed; border-color: var(--line); }
.chip-extra { background: var(--warn-bg); color: var(--warn-ink); border-color: #f3c99b; }

/* Edición de códigos */
.code-rows { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.code-row label { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input-code { font-family: var(--mono); text-transform: uppercase; letter-spacing: .03em; }

/* ---- Fase 3: evaluación ---- */
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.head-link { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.head-link:hover { color: var(--primary-dark); }
.section h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.legend-src { font-size: 13px; font-weight: 400; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.static { min-height: 44px; display: flex; align-items: center; font-size: 15px; padding: 0 2px; }
.table-inner th, .table-inner td { padding: 10px 12px; }
.table-inner thead th { background: none; }

.eval-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .eval-layout { grid-template-columns: 240px minmax(0, 1fr); align-items: start; } }
.eval-main, .steps { min-width: 0; }
.step-title { font-size: 20px; margin-bottom: 14px; }
.step-lead { margin: -8px 0 16px; }

.steps ol { position: relative; list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
@media (min-width: 1100px) {
  .steps { position: sticky; top: 16px; }
  .steps ol { flex-direction: column; overflow: visible; padding-bottom: 0; }
}
.step { flex: none; scroll-snap-align: start; }
.step a, .step-off { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px 6px 6px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; border: 1px solid transparent; white-space: nowrap; }
.step a:hover { background: var(--card); border-color: var(--line); }
.step.is-current a { background: var(--card); border-color: var(--primary); box-shadow: 0 1px 4px rgba(15, 59, 79, .08); font-weight: 600; }
.step-off { color: #7d929d; cursor: default; }
.step .step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: #e3eaee; color: var(--muted); }
.step-completo .step-n { background: var(--ok-line); color: #fff; }
.step-alerta .step-n { background: var(--warn-line); color: #fff; }
.step-bloqueado .step-n { background: #eef1f3; color: #8aa0ab; }
.step-consulta .step-n { background: var(--soft); color: var(--primary-dark); }
.step.is-current .step-n { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--primary); }
.step-off .step-n { background: transparent; border: 1px dashed #b9c7cf; color: #8aa0ab; }

.options { display: flex; flex-wrap: wrap; gap: 8px; }
.field .option { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px 8px 12px; border: 1px solid #8aa2af; border-radius: 8px; background: #fff; cursor: pointer; font-size: 15px; }
.field .option:hover { border-color: var(--primary); }
.option:has(input:checked) { border-color: var(--primary); background: var(--soft); font-weight: 600; box-shadow: inset 0 0 0 1px var(--primary); }
.option input, .check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); flex: none; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; border-bottom: 1px solid #edf1f3; cursor: pointer; font-size: 15px; line-height: 1.45; }
.check:last-of-type { border-bottom: 0; }
.check input { margin-top: 2px; }
.check:has(input:checked) span { color: var(--ink); }
.status { margin-top: 12px; font-size: 14px; font-weight: 600; border-radius: 6px; padding: 8px 12px; display: inline-block; }
.status-ok { background: var(--ok-bg); color: var(--ok-ink); }
.status-off { background: #f3f5f6; color: var(--muted); }

.recap summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.recap[open] summary { margin-bottom: 14px; }
.guide { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 15px; }
.guide li::marker { color: var(--primary); font-weight: 700; }
.guide-dl { margin: 0; display: grid; gap: 14px; }
.guide-dl dt { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.guide-dl dd { margin: 0; font-size: 15px; color: #23404f; }
.group-title { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.skill-guide { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.skill-guide summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; cursor: pointer; font-weight: 600; }
.skill-guide[open] summary { border-bottom: 1px solid var(--line); }
.skill-guide .skill-body, .skill-guide > .help { padding: 12px 16px 0; }
.skill-guide > .help { padding-bottom: 12px; }

/* ---- Fase 4: planillas de puntuación ---- */
.grid th, .grid td { white-space: nowrap; vertical-align: middle; }
.grid thead th { padding: 10px 10px; }
.grid thead .tag { margin-left: 6px; }
.grid .col-skill { position: sticky; left: 0; z-index: 1; background: var(--card); min-width: 160px; text-align: left; box-shadow: 1px 0 0 var(--line); }
.grid thead .col-skill { background: #f8fafb; }
.grid tbody tr:hover .col-skill { background: #f8fbfd; }
.skill-cell { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.grid tbody .col-skill { white-space: normal; width: 170px; max-width: 170px; }
@media (max-width: 600px) { .grid tbody .col-skill { width: 120px; max-width: 120px; min-width: 120px; } .grid thead .col-skill { min-width: 120px; } .skill-cell .skill-n { display: none; } }
.skill-cell .skill-n { width: 26px; height: 26px; font-size: 12px; }
.crit { text-align: center; padding: 8px 6px !important; }
.crit-code { display: block; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--primary-dark); margin-bottom: 6px; }
.crit-cells { display: inline-flex; gap: 6px; }
.crit-extra { background: var(--warn-bg); }
.crit-na { color: #8aa0ab; font-size: 13px; background: repeating-linear-gradient(135deg, #f6f8f9, #f6f8f9 6px, #fff 6px, #fff 12px); }
.cell-empty { font-size: 13px; }
.cell-input { min-height: 40px; min-width: 52px; font: inherit; border: 1px solid #8aa2af; border-radius: 6px; background: #fff; }
.cell-btn { width: 40px; height: 40px; border-radius: 8px; border: 1.5px dashed #9fb3bf; background: #fff; font: inherit; font-size: 16px; font-weight: 700; color: #8aa0ab; cursor: pointer; transition: background .12s, border-color .12s; }
.cell-btn:hover { border-color: var(--primary); }
.cell-btn[data-v="1"] { border: 1.5px solid var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.cell-btn[data-v="0"] { border: 1.5px solid #8aa2af; background: #eef2f4; color: var(--ink); }
.cell-btn[data-v="NA"] { border: 1.5px solid #f3c99b; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; }
.col-num { text-align: center !important; font-variant-numeric: tabular-nums; min-width: 56px; font-weight: 600; }
.col-sub { color: var(--primary-dark); font-size: 16px; }
.grid tfoot th { text-align: right; font-weight: 600; padding: 14px 16px; background: #f8fafb; }
.grid tfoot td { background: var(--soft); }
.col-total { font-size: 20px !important; color: var(--primary-dark); }
@media (min-width: 1100px) {
  .eval-wide { grid-template-columns: minmax(0, 1fr); }
  .eval-wide .steps { position: static; }
  .eval-wide .steps ol { flex-direction: row; flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
}
.grid-status { margin: 12px 0 16px; font-size: 14px; font-weight: 600; color: var(--muted); }

/* ---- Fase 5: pasos 7 a 11 ---- */
.msg-warning { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.msg-error { border-color: #b42318; background: #fef3f2; color: #7a271a; }
.msg + .msg { margin-top: 8px; }
.tag-ok { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid #a9d8bd; }
.small { font-size: 12px; }
.wrap { white-space: normal !important; min-width: 200px; }
.inline-form { display: inline; }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; font-size: 14px; font-weight: 600; color: #b42318; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.section > .btn, .section > .inline-form .btn { margin-top: 4px; }
.big-num { font-size: 22px; font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.conv th[scope="row"] { font-weight: 600; font-size: 14px; }
.conv td, .conv th { vertical-align: middle; }
.input-sm { min-height: 40px; padding: 6px 8px; font-size: 14px; width: 112px; }
.input-wide { width: 170px; }
.input-ini { width: 64px; text-transform: uppercase; }
.conv th[scope="row"] { white-space: normal; min-width: 170px; max-width: 220px; }
.conv th, .conv td { padding: 8px 8px; }
.table-incid td, .table-incid th { white-space: normal; }
.table-incid td:last-child { white-space: nowrap; text-align: right; }
.row-auto { background: #f8fafb; }
.row-pend th[scope="row"]::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn-line); margin-right: 8px; vertical-align: middle; }
fieldset[disabled] { opacity: .6; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.sign-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.sign-done { border-color: #a9d8bd; background: linear-gradient(0deg, #fff, #f6fbf8); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- Fase 6: paso 12, formato e informe ---- */
.list-tight { margin: 6px 0 0; padding-left: 20px; }
.list-tight li + li { margin-top: 3px; }
.doc-state { border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; font-size: 14px; }
.doc-state p + p { margin-top: 6px; }
.doc-state-ok { border-color: #a9d8bd; background: var(--ok-bg); color: var(--ok-ink); }
.doc-grid { display: grid; gap: 16px; margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.doc { display: flex; flex-direction: column; gap: 10px; }
.doc h3 { font-size: 17px; font-weight: 600; }
.doc p.muted { font-size: 14px; flex: 1; }
.doc-icon { width: 40px; height: 48px; border-radius: 4px 12px 4px 4px; background: var(--soft); border: 1px solid var(--line); color: var(--primary-dark); font-weight: 700; display: grid; place-items: center; font-size: 11px; letter-spacing: .04em; }
.doc-off { opacity: .65; }
.doc-state .link { display: inline; min-height: 0; }

/* ---- Fase 7: estado, avisos de duplicado ---- */
.estado { display: inline-block; vertical-align: middle; font-family: var(--font); font-size: 13px; font-weight: 600; line-height: 1.4; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: #f3f5f6; color: var(--muted); white-space: nowrap; }
h1 .estado { margin-left: 6px; position: relative; top: -3px; }
.estado-en_proceso { background: var(--soft); color: var(--primary-dark); border-color: #b9d3e2; }
.estado-finalizada { background: var(--ok-bg); color: var(--ok-ink); border-color: #a9d8bd; }
.estado-aplazada, .estado-suspendida { background: var(--warn-bg); color: var(--warn-ink); border-color: #f3c99b; }
.dup-links { margin-top: 8px; }
.alert .check { margin-top: 8px; }

/* ---- Fase 8: Intervención (adicional) ---- */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.cat-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--primary-dark); font-weight: 600; font-size: 14px; text-decoration: none; }
.cat-tabs a:hover { border-color: var(--primary); }
.cat-tabs a[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.cat-n { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--soft); color: var(--primary-dark); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.cat-tabs a[aria-current="page"] .cat-n { background: rgba(255, 255, 255, .2); color: #fff; }
.cat-title { font-size: 22px; margin-bottom: 4px; }
.cat-desc { color: var(--muted); max-width: 75ch; margin-bottom: 16px; }
.cat > .cat-title + .acts-fs, .cat > .cat-title + form, .cat > .cat-title + .card { margin-top: 16px; }
.guia { margin: 16px 0 20px; padding: 16px; }
.guia h3 { font-size: 15px; margin-bottom: 10px; }
.guia video { display: block; width: 100%; max-width: 720px; max-height: 420px; border-radius: 8px; background: #0b1c25; }
.acts-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.acts-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.acts-tools { display: inline-flex; align-items: center; gap: 12px; }
.acts-tools[hidden] { display: none; }
.link-plain { background: none; border: 0; padding: 0 4px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 600; color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.act { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: border-color .12s, box-shadow .12s; }
.act:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(27, 106, 143, .25); }
.act-label { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; cursor: pointer; flex: 1; }
.act-head { display: flex; align-items: center; gap: 10px; }
.act-head input { width: 22px; height: 22px; margin: 0; accent-color: var(--primary); flex: none; }
.act-n { font-size: 13px; font-weight: 700; color: var(--primary-dark); text-transform: uppercase; letter-spacing: .05em; }
.act-media { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.act-media img { display: block; width: 100%; height: 180px; object-fit: contain; background: #f8fafb; border: 1px solid #edf1f3; border-radius: 8px; }
.act-text { font-size: 15px; line-height: 1.5; }
.act-video { display: block; width: calc(100% - 32px); margin: 0 16px 16px; max-height: 220px; border-radius: 8px; background: #0b1c25; }
.send-bar { position: sticky; bottom: 0; z-index: 2; margin-top: 20px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(15, 59, 79, .08); }
.send-field { flex: 1 1 260px; max-width: 420px; }
.send-field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.send-field.has-error .input { border-color: #b42318; box-shadow: 0 0 0 1px #b42318; }
.send-go { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.send-count { font-size: 14px; font-weight: 600; color: var(--primary-dark); background: var(--soft); border-radius: 999px; padding: 4px 12px; }
.send-count[hidden] { display: none; }
@media (max-width: 600px) {
  /* En el celular la barra no se queda fija: taparía las actividades. */
  .send-bar { position: static; box-shadow: none; }
  .send-field { max-width: none; }
}
.alert[hidden], .error[hidden] { display: none; }
