/* Gobierno Digital – El Rosal · diseño claro con verdes orgánicos */
@font-face { font-family: "Work Sans"; font-weight: 400; font-display: swap; src: url("/fuentes/work-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Work Sans"; font-weight: 500; font-display: swap; src: url("/fuentes/work-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Work Sans"; font-weight: 600; font-display: swap; src: url("/fuentes/work-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Work Sans"; font-weight: 700; font-display: swap; src: url("/fuentes/work-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #f1f5ee;
  --paper: #ffffff;
  --side: #dae7d1;
  --side-line: #c8dabd;
  --ink: #17251b;
  --ink-2: #2e3f31;
  --muted: #55665a;
  --line: #dce5d6;
  --line-soft: #edf2ea;
  --green: #2f6b3e;
  --green-2: #24552f;
  --leaf: #5e9a4b;
  --pale: #eaf3e5;
  --link: #2f6b3e;
  --ok-bg: #e4f4e6;
  --ok-ink: #1f5a2c;
  --wait-bg: #fdf0d5;
  --wait-ink: #7a4a00;
  --amber: #e39b17;
  --danger: #a12b2b;
  --focus: #e3b505;
  --shadow-card: 0 1px 2px rgba(23, 37, 27, 0.05), 0 8px 22px rgba(23, 37, 27, 0.07);
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
html[data-font="sm"] { font-size: 14px; }
html[data-font="lg"] { font-size: 18px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Work Sans", "Segoe UI", Verdana, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

svg.i { width: 1.1em; height: 1.1em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: #fff; color: #000; padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

button, input, select { font: inherit; color: inherit; }
a { color: var(--link); }

/* ---------- Barra superior ---------- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 68px;
  padding: 0 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, #f2c200 0 33.3%, #3366cc 33.3% 66.6%, #e1251b 66.6%);
  opacity: 0.85;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 250px; color: var(--ink); text-decoration: none; }
.mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  color: var(--green);
  background: linear-gradient(180deg, #f4faf0, #dcebd3);
  box-shadow: inset 0 2px 2px #fff, inset 0 -2px 3px rgba(47, 107, 62, 0.18), 0 3px 8px rgba(47, 107, 62, 0.18);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1rem; font-weight: 700; }
.brand-text span { font-size: 0.78rem; color: var(--muted); }

.topnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; align-self: stretch; }
.topnav a {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; color: var(--muted); text-decoration: none; font-weight: 500;
  border-bottom: 3px solid transparent;
}
.topnav a:hover { color: var(--green); }
.topnav a[aria-current="page"] { color: var(--green); font-weight: 600; border-bottom-color: var(--leaf); }

.a11y { display: flex; gap: 8px; }

/* ---------- Botones tipo plastilina ---------- */
.clay {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid #d3e2cc; border-radius: 14px;
  font-weight: 600; color: var(--green); text-decoration: none; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ea 100%);
  box-shadow:
    0 6px 14px rgba(23, 37, 27, 0.08),
    0 2px 0 #cfdfc6,
    inset 0 2px 2px rgba(255, 255, 255, 0.95),
    inset 0 -3px 4px rgba(47, 107, 62, 0.1);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
.clay:hover { transform: translateY(-1px); box-shadow: 0 9px 18px rgba(23, 37, 27, 0.11), 0 3px 0 #cfdfc6, inset 0 2px 2px #fff, inset 0 -3px 4px rgba(47, 107, 62, 0.12); }
.clay:active { transform: translateY(2px) scale(0.98); box-shadow: 0 2px 4px rgba(23, 37, 27, 0.08), 0 0 0 #cfdfc6, inset 0 3px 6px rgba(47, 107, 62, 0.18); }

.clay-primary {
  color: #fff; border-color: #2a5f37;
  background: linear-gradient(180deg, #4f8d5c 0%, #2f6b3e 100%);
  box-shadow:
    0 8px 18px rgba(47, 107, 62, 0.3),
    0 3px 0 var(--green-2),
    inset 0 2px 3px rgba(255, 255, 255, 0.35),
    inset 0 -3px 5px rgba(0, 0, 0, 0.18);
}
.clay-primary:hover { box-shadow: 0 11px 22px rgba(47, 107, 62, 0.34), 0 4px 0 var(--green-2), inset 0 2px 3px rgba(255, 255, 255, 0.35), inset 0 -3px 5px rgba(0, 0, 0, 0.18); }
.clay-primary:active { box-shadow: 0 2px 5px rgba(47, 107, 62, 0.3), 0 0 0 var(--green-2), inset 0 3px 7px rgba(0, 0, 0, 0.28); }

.clay-sm { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 0.85rem; }
.clay-icon { width: 36px; min-height: 36px; padding: 0; border-radius: 11px; }
.clay-danger { color: var(--danger); border-color: #ecd3d3; background: linear-gradient(180deg, #fff, #fbefef); box-shadow: 0 4px 10px rgba(161, 43, 43, 0.08), 0 2px 0 #ecd3d3, inset 0 2px 2px #fff, inset 0 -2px 3px rgba(161, 43, 43, 0.1); }
.clay[aria-pressed="true"] { color: #fff; background: linear-gradient(180deg, #4f8d5c, #2f6b3e); border-color: #2a5f37; }
.clay:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

@media (prefers-reduced-motion: reduce) { .clay, .side-link, .collapse-btn, .sidebar-wrap { transition: none !important; } }

/* ---------- Estructura ---------- */
.shell { display: flex; min-height: calc(100vh - 68px); }

.sidebar-wrap {
  position: relative;
  width: 292px; flex: 0 0 292px;
  background: var(--side);
  border-right: 1px solid var(--side-line);
  transition: width 0.25s var(--ease), flex-basis 0.25s var(--ease);
}
.sidebar {
  position: sticky; top: 0;
  max-height: calc(100vh - 68px); overflow: auto;
  padding: 18px 12px 28px;
}
.collapse-btn {
  position: absolute; right: -16px; top: 20px; z-index: 5;
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--green);
  border: 1px solid #c9d9c1;
  background: linear-gradient(180deg, #fff, #eef5ea);
  box-shadow: 0 4px 10px rgba(47, 107, 62, 0.18), inset 0 2px 2px #fff, inset 0 -2px 3px rgba(47, 107, 62, 0.12);
  transition: transform 0.18s var(--ease);
}
.collapse-btn:hover { transform: scale(1.06); }
.collapse-btn:active { transform: scale(0.94); }

.group-title { margin: 18px 10px 8px; font-size: 0.78rem; font-weight: 600; color: #5f7a5f; letter-spacing: 0.02em; }
.group-title:first-child { margin-top: 4px; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin: 2px 0; border-radius: 11px;
  color: var(--ink-2); text-decoration: none; font-weight: 500; line-height: 1.25;
  transition: background 0.15s var(--ease);
}
.side-link .i { color: #4e6e52; width: 18px; height: 18px; }
.side-link:hover { background: rgba(255, 255, 255, 0.55); }
.side-link[aria-current="page"] {
  background: #fff; color: var(--green); font-weight: 600;
  box-shadow: 0 2px 8px rgba(47, 107, 62, 0.14), inset 3px 0 0 var(--leaf);
}
.side-link[aria-current="page"] .i { color: var(--green); }
.side-label { flex: 1; min-width: 0; }
.mini-bar { width: 36px; height: 5px; border-radius: 3px; background: #c3d6b9; overflow: hidden; flex: none; }
.mini-bar span { display: block; height: 100%; background: var(--leaf); }
.mini-bar span.low { background: var(--amber); }
.side-legend { display: flex; gap: 14px; margin: 18px 10px 0; font-size: 0.75rem; color: #5f7a5f; flex-wrap: wrap; }
.side-legend i { display: inline-block; width: 10px; height: 5px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* menú recogido */
.shell.recogido .sidebar-wrap { width: 76px; flex-basis: 76px; }
.shell.recogido .sidebar { padding: 60px 10px 20px; overflow-x: hidden; }
.shell.recogido .collapse-btn { right: auto; left: 22px; top: 16px; }
.shell.recogido .group-title,
.shell.recogido .side-label,
.shell.recogido .mini-bar,
.shell.recogido .side-legend { display: none; }
.shell.recogido .side-link { justify-content: center; padding: 11px 0; }
.shell.recogido .side-link .i { width: 20px; height: 20px; }

main { flex: 1; min-width: 0; padding: 26px 40px 56px; }

h1, h2, h3 { color: var(--ink); font-weight: 700; }
h1 { margin: 8px 0 10px; font-size: 2rem; line-height: 1.15; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 1.08rem; font-weight: 600; color: #1f3a26; }

.crumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; font-size: 0.85rem; color: var(--muted); }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--green); text-decoration: underline; }
.crumb strong { color: var(--ink); font-weight: 600; }
.crumb .i { width: 14px; height: 14px; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--pale); color: var(--green); font-size: 0.78rem; font-weight: 600; }
.tag .i { width: 14px; height: 14px; }
.lead { max-width: 72ch; margin: 0 0 10px; font-size: 1rem; line-height: 1.6; color: #3a4a3e; }
.source { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px;
  background: linear-gradient(180deg, #f6faf3, #ffffff);
  border-bottom: 1px solid #e3ebde;
  box-shadow: inset 0 3px 0 var(--leaf);
}
.card-head .count { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.card-body { padding: 18px 20px; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: center; }
.prog {
  display: flex; align-items: center; gap: 18px; padding: 20px;
  background: linear-gradient(135deg, #ffffff 55%, #eef6e9);
}
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.ring strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.35rem; color: var(--green); }
.prog h2 { font-size: 1rem; }
.prog p { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.4; }
.next { display: inline-flex; align-items: flex-start; gap: 6px; margin-top: 10px; padding: 6px 10px; border-radius: 9px; background: var(--pale); color: var(--green); font-size: 0.8rem; font-weight: 600; line-height: 1.3; border: 0; cursor: pointer; text-align: left; }
.next:hover { background: #dfeed8; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; margin-top: 24px; align-items: start; }
.col-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.col-side { position: sticky; top: 16px; }

/* Segmento de filtro (hundido) */
.seg { display: inline-flex; margin-left: auto; padding: 4px; gap: 2px; border-radius: 12px; background: #eef3eb; box-shadow: inset 0 2px 4px rgba(23, 37, 27, 0.08); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-size: 0.8rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(23, 37, 27, 0.12), inset 0 -1px 2px rgba(47, 107, 62, 0.08); }

/* Requisitos */
.req-list { list-style: none; margin: 0; padding: 0; }
.req-list li { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line-soft); }
.req-list li:last-child { border-bottom: 0; }
.req-list li:hover { background: #fafcf8; }
.st { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; }
.st.listo { background: var(--ok-bg); color: var(--ok-ink); }
.st.pendiente { background: var(--wait-bg); color: var(--wait-ink); }
.req-copy { flex: 1; min-width: 0; font-weight: 600; line-height: 1.35; }
.req-copy small { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge.listo { background: var(--ok-bg); color: var(--ok-ink); }
.badge.pendiente { background: var(--wait-bg); color: var(--wait-ink); }

/* Documentos con desplazamiento */
.filters { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 1fr; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.field { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border: 1px solid #cfdac9; border-radius: 11px; background: #fff; color: var(--muted); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.filters select, .uploader select, .uploader input[type="text"], .uploader input[type="url"] {
  min-height: 42px; width: 100%; padding: 8px 12px; border: 1px solid #cfdac9; border-radius: 11px; background: #fff;
}
.scroll {
  max-height: 440px; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #b9cfae transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 24px), transparent);
}
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: #b9cfae; border-radius: 8px; }
.doc-list { list-style: none; margin: 0; padding: 4px 0 18px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line-soft); }
.doc-row:hover { background: #fafcf8; }
.doc-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; }
.doc-ico.pdf { background: #fdecec; color: #b42323; }
.doc-ico.xls { background: #e3f3e6; color: #1e6b33; }
.doc-ico.doc { background: #e6eefb; color: #2b5cb8; }
.doc-ico.url { background: var(--pale); color: var(--green); }
.doc-ico.otro { background: #f0f2ee; color: var(--muted); }
.doc-main { flex: 1; min-width: 0; }
.doc-main a { display: block; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-main a:hover { color: var(--green); text-decoration: underline; }
.doc-meta { margin-top: 2px; font-size: 0.8rem; color: var(--muted); }
.cat { flex: none; padding: 3px 9px; border-radius: 7px; background: #f1f4ef; font-size: 0.75rem; font-weight: 500; color: #3a4a3e; }
.empty { margin: 0; padding: 20px; color: var(--muted); }

/* Carga */
.uploader form { display: flex; flex-direction: column; gap: 14px; }
.uploader label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.uploader .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 20px; border: 1.5px dashed #a9c4a2; border-radius: 14px; background: #fafcf8;
  text-align: center; cursor: pointer; font-weight: 400;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.drop:hover, .uploader.drag .drop { background: #eef6e9; border-color: var(--leaf); }
.drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop-ico { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 13px; color: var(--green); background: linear-gradient(180deg, #fff, #e3efdc); box-shadow: inset 0 2px 2px #fff, inset 0 -2px 3px rgba(47,107,62,.15), 0 3px 8px rgba(47,107,62,.15); }
.drop-ico .i { width: 22px; height: 22px; }
.drop b { font-weight: 600; }
.drop u { color: var(--green); text-underline-offset: 3px; }
.drop small, .drop [data-nombre] { color: var(--muted); font-size: 0.8rem; }
.drop [data-nombre].tiene { color: var(--green); font-weight: 600; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.8rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hint { display: flex; gap: 6px; margin: 0; font-size: 0.8rem; font-weight: 400; color: var(--muted); line-height: 1.4; }
.uploader .clay-primary { width: 100%; min-height: 48px; font-size: 1rem; }
.aviso { margin: 0; min-height: 1.2em; font-size: 0.9rem; color: var(--ok-ink); }
.aviso:empty { display: none; }
.aviso.error { color: var(--danger); }
.pulse { animation: pulse 0.9s var(--ease); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(94, 154, 75, 0.5), var(--shadow-card); } 100% { box-shadow: 0 0 0 14px rgba(94, 154, 75, 0), var(--shadow-card); } }

/* Inicio y mediciones */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 20px 0 24px; }
.stat { padding: 18px 20px; }
.stat strong { display: block; font-size: 1.9rem; color: var(--green); }
.stat span { color: var(--muted); font-size: 0.88rem; }
.tema-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tema-link { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
.tema-link:last-child { border-bottom: 0; }
.tema-link:hover { background: #fafcf8; }
.tema-link .i { color: var(--green); }
.tema-link .t { flex: 1; min-width: 0; }
.tema-link strong { display: block; font-weight: 600; }
.tema-link small { color: var(--muted); font-size: 0.8rem; }
.bar { display: block; width: 100%; height: 8px; margin-top: 6px; border-radius: 99px; background: #e5ede0; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--leaf); border-radius: 99px; }
.bar span.low { background: var(--amber); }
.recent-card { margin-top: 24px; }
.med-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.med-table th, .med-table td { text-align: left; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.med-table tr:last-child td { border-bottom: 0; }
.med-table th { font-size: 0.8rem; font-weight: 600; color: var(--muted); background: #f6f9f3; }
.med-table td a { font-weight: 600; text-decoration: none; }
.med-table th:nth-child(1) { width: 38%; } .med-table th:nth-child(2) { width: 16%; } .med-table th:nth-child(3) { width: 20%; }

/* ---------- Alto contraste ---------- */
body.contraste {
  --bg: #fff; --paper: #fff; --side: #fff; --side-line: #000; --ink: #000; --ink-2: #000; --muted: #000;
  --line: #000; --line-soft: #000; --green: #000; --leaf: #000; --pale: #fff; --link: #000;
  --ok-bg: #fff; --ok-ink: #000; --wait-bg: #fff; --wait-ink: #000; --amber: #000; --shadow-card: none;
}
body.contraste .clay, body.contraste .collapse-btn, body.contraste .mark, body.contraste .drop-ico { background: #fff; color: #000; border: 2px solid #000; box-shadow: none; }
body.contraste .clay-primary, body.contraste .clay[aria-pressed="true"] { background: #000; color: #fff; }
body.contraste .card-head { background: #fff; box-shadow: none; }
body.contraste .badge, body.contraste .st, body.contraste .cat, body.contraste .tag { border: 1px solid #000; }
body.contraste a { text-decoration: underline; }
body.contraste .scroll { -webkit-mask-image: none; mask-image: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .cols { grid-template-columns: 1fr; }
  .col-side { position: static; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; padding: 12px; gap: 12px; }
  .topnav { order: 3; width: 100%; }
  .topnav a { padding: 10px 8px; }
  .shell { flex-direction: column; }
  .sidebar-wrap, .shell.recogido .sidebar-wrap { width: 100%; flex-basis: auto; }
  .sidebar { position: static; max-height: 40vh; }
  .collapse-btn { display: none; }
  main { padding: 20px 16px 48px; }
  .filters, .tema-grid, .stats, .uploader .row2 { grid-template-columns: 1fr; }
  .req-list li { flex-wrap: wrap; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-wrap { display: block; }
.field input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Ajustes de controles ---------- */
.filters select, .uploader select, .uploader input[type="text"], .uploader input[type="url"], .field input {
  font-weight: 400; font-size: 0.92rem; color: var(--ink);
}
.filters select, .uploader select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; text-overflow: ellipsis;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2355665a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.filters select:hover, .uploader select:hover, .uploader input:hover { border-color: #a9c4a2; }
.uploader input:focus, .uploader select:focus, .filters select:focus, .field:focus-within { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(94, 154, 75, 0.18); outline: none; }
.filters { grid-template-columns: minmax(0, 1fr) minmax(0, 190px) minmax(0, 190px); }
.uploader .row2 { grid-template-columns: 1fr; gap: 14px; }
body.contraste .filters select, body.contraste .uploader select { background-color: #fff; }

@media (max-width: 800px) {
  .brand { min-width: 0; flex: 1; }
  .topnav { order: 3; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto; align-self: auto; }
  .topnav a { white-space: nowrap; padding: 10px 10px 8px; }
  .a11y .clay-sm { padding: 0 10px; }
  .filters { grid-template-columns: 1fr; }
}
body.contraste .group-title, body.contraste .side-legend, body.contraste .side-link .i { color: #000; }
body.contraste .mini-bar, body.contraste .bar { background: #fff; border: 1px solid #000; }
body.contraste .topbar::after { display: none; }

/* ---------- Tablero de entes de control ---------- */
.ctl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ctl-upd { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin: 18px 0 22px; }
.kpi { padding: 16px 16px 14px; position: relative; }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--leaf); }
.kpi.warn::before { background: var(--amber); }
.kpi.bad::before { background: #c0392b; }
.kpi.muted::before { background: #b9c4b5; }
.kpi-h { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; color: var(--muted); line-height: 1.25; }
.kpi-h .i { color: var(--green); width: 16px; height: 16px; }
.kpi strong { display: block; margin: 10px 0 6px; font-size: 1.9rem; line-height: 1; color: var(--ink); letter-spacing: -0.01em; }
.kpi strong small { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.kpi.muted strong { font-size: 1.25rem; color: var(--muted); }
.kpi-s { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); }
.kpi-d { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-weight: 700; font-size: 0.75rem; }
.kpi-d .i { width: 13px; height: 13px; }
.kpi-d.pos { background: var(--ok-bg); color: var(--ok-ink); }
.kpi-d.neg { background: #fbe3e0; color: #a12b2b; }

.ctl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ctl-grid .span2 { grid-column: span 2; }
.ctl-grid .span3 { grid-column: span 3; }
.ctl-grid .card-head h2 { font-size: 1rem; }
.ctl-grid .card-head .count { font-size: 0.78rem; max-width: 60%; text-align: right; }

.ch { width: 100%; height: auto; display: block; }
.ch-grid { stroke: #e7ede4; stroke-width: 1; }
.ch-ax { font-size: 11px; fill: #6b7b6e; font-family: inherit; }
.ch-end { font-size: 12px; font-weight: 700; font-family: inherit; }
.ch-leg { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.ch-leg i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.dn-c { font-size: 24px; font-weight: 700; fill: var(--ink); font-family: inherit; }
.dn-s { font-size: 10.5px; fill: #6b7b6e; font-family: inherit; }
.dn-leg { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 130px; }
.dn-leg li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 0.85rem; }
.dn-leg i { width: 12px; height: 12px; border-radius: 4px; }
.dn-leg b { font-size: 0.95rem; }

.hb { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.hb li { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 92px; gap: 10px; align-items: center; font-size: 0.85rem; }
.hb-n { color: var(--ink-2); line-height: 1.2; }
.hb-t { position: relative; height: 12px; border-radius: 99px; background: #edf2ea; }
.hb-b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--leaf); }
.hb-b.ambar { background: var(--amber); }
.hb-b.rojo { background: #c0392b; }
.hb-p, .mk { position: absolute; top: -4px; width: 3px; height: 20px; border-radius: 2px; background: #2e3f31; transform: translateX(-1px); }
.mk { position: relative; display: inline-block; top: 4px; height: 14px; margin-right: 4px; }
.hb-v { text-align: right; font-weight: 700; white-space: nowrap; }
.hb-v em { display: inline-block; margin-left: 6px; font-style: normal; font-size: 0.75rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.hb-v em.pos { background: var(--ok-bg); color: var(--ok-ink); }
.hb-v em.neg { background: #fbe3e0; color: #a12b2b; }
.card-body .donut + .hb { margin-top: 18px; }

.rings { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ring-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px; }
.ring-card b { margin-top: 4px; }
.ring-card small { color: var(--muted); font-size: 0.78rem; }
.ring-card .rg-m { color: var(--green); font-weight: 600; }
.rg-v { font-size: 17px; font-weight: 700; fill: var(--ink); font-family: inherit; }

.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: #dbe6d4; }
.tl li { position: relative; display: flex; gap: 14px; padding: 6px 0 12px; }
.tl-i { position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--pale); color: var(--green); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(47,107,62,.15); }
.tl li.alerta .tl-i { background: #fbe3e0; color: #a12b2b; }
.tl li.medicion .tl-i { background: #eef2fb; color: #2b5cb8; }
.tl time { font-size: 0.78rem; font-weight: 700; color: var(--green); }
.tl p { margin: 2px 0 0; font-weight: 500; }
.cal { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cal li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.cal-f { padding: 6px 8px; border-radius: 10px; background: var(--pale); color: var(--green); font-weight: 700; font-size: 0.78rem; text-align: center; }
.cal b { display: block; font-size: 0.9rem; }
.cal small { color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.pend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pend li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.ctl-src { margin-top: 18px; }

@media (max-width: 1300px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rings { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .ctl-grid { grid-template-columns: 1fr; } .ctl-grid .span2, .ctl-grid .span3 { grid-column: auto; } .pend { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .kpis { grid-template-columns: 1fr 1fr; } .rings { grid-template-columns: 1fr 1fr; } .hb li { grid-template-columns: 1fr; gap: 4px; } .hb-v { text-align: left; } }
body.contraste .hb-b, body.contraste .kpi::before { background: #000; }
body.contraste .tl-i, body.contraste .cal-f { background: #fff; color: #000; border: 1px solid #000; }
.idi-big { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0 18px; text-align: center; }
.idi-big strong { font-size: 2.6rem; line-height: 1; color: var(--green); }
.idi-big span { font-size: 0.8rem; color: var(--muted); }
.meci { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: center; }
.meci .hb + .hb { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
@media (max-width: 1000px) { .meci { grid-template-columns: 1fr; } }
