/* Radar SECOP — dirección visual "Consola" (sitio) + "Editorial" (lecturas con IA). Tokens tomados del diseño Radar Contratos. */
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

/* Consola: oscuro por defecto */
:root {
  --bg: #0b0d10; --panel: #11151a; --panel-2: #0e1216; --line: #1f252d; --ink: #e8eaed; --mute: #8a929e;
  --acc: oklch(0.87 0.19 128); --acc-ink: #0b0d10; --sel: rgba(190, 240, 80, .07); --acc-soft: rgba(190, 240, 80, .14);
  --ok: oklch(0.82 0.16 150); --warn: oklch(0.82 0.15 75); --bad: oklch(0.7 0.19 25);
  --ok-soft: rgba(80, 220, 140, .1); --warn-soft: rgba(240, 180, 60, .1); --bad-soft: rgba(240, 90, 80, .1);
  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --radius: 10px; --side-w: 208px; --nav-h: 62px; --top-h: 56px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f2; --panel: #ffffff; --panel-2: #f8f9f6; --line: #e2e4df; --ink: #14171a; --mute: #5d646d;
  --acc: oklch(0.55 0.16 135); --acc-ink: #ffffff; --sel: rgba(90, 140, 20, .07); --acc-soft: rgba(90, 140, 20, .12);
  --ok: oklch(0.5 0.13 150); --warn: oklch(0.55 0.13 65); --bad: oklch(0.52 0.19 25);
  --ok-soft: rgba(30, 140, 80, .09); --warn-soft: rgba(200, 130, 20, .1); --bad-soft: rgba(200, 50, 40, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
svg[aria-hidden="true"] { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
body { min-height: 100dvh; overflow-x: hidden; }
a { color: inherit; }
a:hover { opacity: .85; }
h1, h2, h3 { font-family: var(--font); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.35rem; } h2 { font-size: 1rem; } h3 { font-size: .92rem; }
p { margin: 0 0 .6rem; }
small, .muted { color: var(--mute); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.label { font: 500 10.5px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.acc { color: var(--acc); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
::selection { background: var(--acc); color: var(--acc-ink); }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--acc-soft); } 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sk { to { background-position: -200% 0; } }

.boot { display: grid; place-items: center; gap: 12px; min-height: 100dvh; color: var(--mute); font-family: var(--mono); font-size: 12px; }
.boot img { border-radius: 12px; }

/* ---------- Estructura: barra lateral (escritorio) / barra superior + navegación inferior (móvil) ---------- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
.shell > * { min-width: 0; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 0 14px; padding-top: env(safe-area-inset-top);
  height: calc(var(--top-h) + env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand .sq { width: 22px; height: 22px; border-radius: 5px; background: var(--acc); flex: none; display: grid; place-items: center; }
.brand .sq img { width: 16px; height: 16px; filter: brightness(0); }
:root[data-theme="light"] .brand .sq img { filter: brightness(0) invert(1); }
.brand b { font-weight: 600; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand small { display: block; font: 400 10.5px var(--mono); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 16px; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); width: 100%; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.main > * { min-width: 0; }
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mute); text-decoration: none; font: 500 10.5px var(--mono); position: relative; }
.nav a svg { width: 20px; height: 20px; }
.nav a.active { color: var(--acc); }
.nav a.active::before { content: ''; position: absolute; top: 0; left: 32%; right: 32%; height: 2px; background: var(--acc); }
.nav .dot, .sidebar .dot { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--acc); color: var(--acc-ink); font: 600 10px/17px var(--mono); text-align: center; }
.nav .dot { position: absolute; top: 7px; left: 56%; }
.only-desk { display: none !important; }
@media (min-width: 900px) { .only-desk { display: inline-flex !important; } }

@media (min-width: 900px) {
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .topbar, .nav { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100dvh; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--bg); }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
  .sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: var(--mute); text-decoration: none; }
  .sidebar nav a svg { width: 16px; height: 16px; }
  .sidebar nav a:hover { color: var(--ink); background: var(--sel); opacity: 1; }
  .sidebar nav a.active { background: var(--sel); color: var(--ink); }
  .sidebar nav .dot { margin-left: auto; }
  .side-status { margin-top: auto; font: 400 11px/1.75 var(--mono); color: var(--mute); }
  .side-status .live { display: flex; align-items: center; gap: 8px; }
  .side-status .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); animation: pulse 2s infinite; }
  .main { padding: 22px 26px 40px; gap: 18px; }
}

/* Barra de comandos (buscador estilo terminal) + selector de fuentes + tema */
.cmdbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cmd { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); font: 13px var(--mono); color: var(--mute); }
.cmd b { color: var(--acc); font-weight: 500; }
.cmd input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; color: var(--ink); font: 13px var(--mono); padding: 0; }
.cmd input::placeholder { color: var(--mute); }
.cmd kbd { font: 11px var(--mono); border: 1px solid var(--line); padding: 2px 6px; border-radius: 4px; }
.seg { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg a { white-space: nowrap; border: 0; cursor: pointer; font: 500 12px var(--mono); padding: 7px 11px; border-radius: 5px; background: transparent; color: var(--mute); text-decoration: none; }
.seg .on { background: var(--acc); color: var(--acc-ink); }
.seg .n { opacity: .7; margin-left: 4px; }

/* ---------- Componentes base ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card, .stack > * + * { margin-top: 12px; }
.main > .card + .card { margin-top: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 0; flex-wrap: wrap; }
.section-title h2, .section-title h1 { margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 500 12.5px var(--mono); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: color-mix(in srgb, var(--acc) 50%, var(--line)); opacity: 1; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-family: var(--font); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--mute); }
.btn.ghost:hover { color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 6px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

label.field { display: grid; gap: 5px; font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--mute); }
label.field small { text-transform: none; letter-spacing: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  font: 400 14px var(--font); text-transform: none; letter-spacing: 0; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 0 3px var(--acc-soft); }
input[type=file] { font: 12px var(--mono); color: var(--mute); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--acc); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 5px; font: 500 11px var(--mono); background: transparent; border: 1px solid var(--line); color: var(--mute); white-space: nowrap; }
.chip.blue { border-color: color-mix(in srgb, var(--acc) 45%, transparent); color: var(--acc); background: var(--sel); }
.chip.ok { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.chip.warn { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.chip.bad { border-color: transparent; background: var(--bad-soft); color: var(--bad); }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font-size: 1rem; line-height: 1; }
button.chip { cursor: pointer; }
button.chip.on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 14px 16px; text-align: left; cursor: pointer; color: inherit; text-decoration: none; min-width: 0; }
.kpi .label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b { display: block; font: 500 clamp(22px, 2.3vw, 30px)/1.1 var(--font); letter-spacing: -.02em; margin-top: 8px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi span.delta { display: block; font: 11px var(--mono); margin-top: 4px; color: var(--acc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Barra de coincidencia (match) */
.match { display: flex; align-items: center; gap: 7px; min-width: 0; }
.match .track { flex: 1; height: 4px; border-radius: 2px; background: var(--line); min-width: 24px; }
.match .track i { display: block; height: 4px; border-radius: 2px; background: var(--acc); }
.match b { font: 500 11.5px var(--mono); min-width: 20px; text-align: right; }
.match.baja .track i { background: var(--mute); }
.match.media .track i { background: color-mix(in srgb, var(--acc) 60%, var(--mute)); }
.score { width: 46px; height: 46px; border-radius: 8px; display: grid; place-items: center; font: 500 16px var(--mono); border: 1px solid var(--line); background: var(--panel-2); color: var(--mute); flex: none; }
.score.alta { color: var(--acc-ink); background: var(--acc); border-color: var(--acc); }
.score.media { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 50%, var(--line)); }
.score.big { width: 64px; height: 64px; font-size: 22px; border-radius: 10px; }

/* ---------- Dashboard: barras, feed en vivo, tabla de procesos y panel IA ---------- */
.dash-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 1000px) { .dash-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } .dash-row.main-row { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1240px) { .dash-row.main-row { grid-template-columns: minmax(0, 1fr) 300px; } }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 16px; min-width: 0; display: flex; flex-direction: column; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.panel-head .mono { font-size: 11px; color: var(--mute); white-space: nowrap; }
.bars { flex: 1 0 150px; min-height: 150px; display: flex; align-items: flex-end; gap: 6px; margin-top: 14px; }
.bars div { flex: 1; min-height: 2px; background: var(--line); border-radius: 3px 3px 0 0; cursor: pointer; transition: height .5s, background .2s; }
.bars div.on, .bars div:hover { background: var(--acc); }
.feed { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; font: 11.5px/1.45 var(--mono); max-height: 172px; overflow: hidden; }
.feed a, .feed div { display: flex; gap: 10px; text-decoration: none; animation: slidein .4s ease; min-width: 0; }
.feed .t { color: var(--mute); flex: none; white-space: nowrap; }
.feed .s { flex: none; white-space: nowrap; color: var(--acc); }
.feed .x { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { color: var(--acc); font: 11px var(--mono); white-space: nowrap; }

.rows { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.rows-head, .row-item { display: grid; grid-template-columns: 84px minmax(0, 1fr) 96px 64px 88px; gap: 12px; align-items: center; padding: 10px 16px; }
.rows-head { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--mute); border-bottom: 1px solid var(--line); }
.row-item { border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; text-decoration: none; color: inherit; transition: background .15s; }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: rgba(128, 128, 128, .07); opacity: 1; }
.row-item.sel { background: var(--sel); box-shadow: inset 2px 0 0 var(--acc); }
.row-item.unseen .obj::before { content: '●'; color: var(--acc); font-size: 9px; margin-right: 6px; vertical-align: 2px; }
.row-item .src { font: 11px var(--mono); color: var(--mute); }
.row-item .obj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .ent { font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .val, .row-item .cie { font: 12px var(--mono); white-space: nowrap; }
.row-item .cie.bad { color: var(--bad); } .row-item .cie.warn { color: var(--warn); }
.row-item .acts { grid-column: 2 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: -2px; }
@media (max-width: 760px) {
  .rows-head { display: none; }
  .row-item { grid-template-columns: minmax(0, 1fr) 84px; grid-template-areas: "obj match" "meta meta" "acts acts"; gap: 6px 10px; padding: 12px 14px; }
  .row-item > .src { display: none; }
  .row-item > .o { grid-area: obj; }
  .row-item > .match { grid-area: match; }
  .row-item > .val, .row-item > .cie { display: none; }
  .row-item .meta-m { grid-area: meta; display: flex !important; gap: 10px; flex-wrap: wrap; font: 11px var(--mono); color: var(--mute); }
  .row-item .obj { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .row-item .acts { grid-area: acts; grid-column: auto; }
}
.row-item .meta-m { display: none; }
.aside-ai { gap: 10px; }
.aside-ai .tag { font: 11px var(--mono); color: var(--acc); }
.aside-ai .ttl { font-size: 14px; font-weight: 500; line-height: 1.35; }
.aside-ai .txt { font-size: 12.5px; line-height: 1.55; color: var(--mute); }
.aside-ai .btns { margin-top: auto; display: flex; gap: 8px; padding-top: 6px; }
.aside-ai .btns .btn { flex: 1; }

/* Factores del puntaje */
.factor { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.factor:last-child { border-bottom: 0; }
.factor .num { font-size: 12px; }
.bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--acc); }

/* Pestañas */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); background: var(--bg); z-index: 10; margin: 0 -16px; padding: 0 16px; }
@media (min-width: 900px) { .tabs { top: 0; margin: 0; padding: 0; } }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 11px 12px; font: 500 12px var(--mono); color: var(--mute); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--acc); }

/* Tablas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 10.5px var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
td.num { font-size: 12px; }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 84%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
@media (min-width: 900px) { .kanban { grid-auto-columns: minmax(230px, 1fr); } }
.col { scroll-snap-align: start; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.col h3 { display: flex; justify-content: space-between; align-items: center; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin: 2px 4px 10px; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12.5px; }
.kcard + .kcard { margin-top: 8px; }
.kcard a { text-decoration: none; font-weight: 500; display: block; margin-bottom: 4px; line-height: 1.35; }
.kcard .row { margin-top: 6px; }
.kcard select { min-height: 32px; font: 12px var(--mono); padding: 4px 8px; }

/* Listas, estados, avisos */
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--mute); }
.status.vigente, .status.sin_vencimiento { background: var(--ok); }
.status.por_vencer { background: var(--warn); }
.status.vencido { background: var(--bad); }
.empty { text-align: center; padding: 30px 16px; color: var(--mute); }
.empty svg { width: 38px; height: 38px; opacity: .5; }
.notice { padding: 11px 14px; border-radius: 8px; background: var(--sel); border: 1px solid color-mix(in srgb, var(--acc) 30%, var(--line)); font-size: 13px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.notice.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
ul.clean li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: minmax(110px, 36%) 1fr; gap: 6px 12px; font-size: 13px; margin: 0; }
.kv dt { font: 11px var(--mono); color: var(--mute); padding-top: 2px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
details.card summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: '+'; font: 16px var(--mono); color: var(--acc); }
details.card[open] summary::after { content: '–'; }
details.card[open] summary { margin-bottom: 12px; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.skeleton { height: 76px; border-radius: var(--radius); background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border: 1px solid var(--line); }
.skeleton + .skeleton { margin-top: 10px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tools select { width: auto; min-height: 34px; font: 12px var(--mono); padding: 4px 10px; }

/* Login */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(circle at 20% 10%, var(--acc-soft), transparent 40%), var(--bg); }
.auth .card { width: 100%; max-width: 380px; padding: 26px 22px; }
.auth .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth .logo b { font-size: 18px; display: block; }
.auth .logo small { font: 11px var(--mono); }
.auth form { display: grid; gap: 12px; }

/* Avisos flotantes y modal */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 460px); padding: 10px 14px; border-radius: 8px; background: var(--ink); color: var(--bg); font: 12.5px var(--mono); transition: .2s; z-index: 100; }
@media (min-width: 900px) { #toast { bottom: 24px; } }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--bad); color: #fff; }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 90; display: grid; place-items: end center; }
@media (min-width: 700px) { .modal-bg { place-items: center; } }
.modal { width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px 14px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal { border-radius: 14px; } }
.modal h2 { display: flex; justify-content: space-between; align-items: center; }
.sheet a { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 15px; }
.sheet a svg { width: 18px; height: 18px; color: var(--acc); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Editorial: lecturas asistidas por IA (análisis de pliegos y convocatorias) ---------- */
.editorial {
  --e-bg: #161513; --e-side: #1c1b18; --e-soft: #2a2824; --e-line: #2c2a26; --e-ink: #efece5; --e-mute: #a19c92; --e-acc: oklch(0.74 0.14 50);
  background: var(--e-bg); color: var(--e-ink); border: 1px solid var(--e-line); border-radius: var(--radius); font: 14.5px/1.6 'Geist', var(--font);
  padding: 22px 18px; display: flex; flex-direction: column; gap: 24px; min-width: 0; transition: background .3s, color .3s;
}
:root[data-theme="light"] .editorial { --e-bg: #faf9f6; --e-side: #f3f1ec; --e-soft: #ebe8e1; --e-line: #e4e1da; --e-ink: #1b1a18; --e-mute: #6b675f; --e-acc: oklch(0.58 0.15 45); }
@media (min-width: 760px) { .editorial { padding: 34px 38px; } }
.editorial .ed-kicker { font: 500 11.5px 'Geist', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--e-mute); display: flex; align-items: center; gap: 8px; }
.editorial .ed-kicker i { width: 6px; height: 6px; border-radius: 50%; background: var(--e-acc); }
.editorial .ed-h1 { font: 400 clamp(32px, 6vw, 50px)/1.04 'Instrument Serif', Georgia, serif; letter-spacing: -.015em; margin: 6px 0 0; text-wrap: pretty; max-width: 760px; }
.editorial .ed-h1 em { font-style: italic; color: var(--e-acc); }
.editorial .ed-lead { font-size: 15.5px; color: var(--e-mute); max-width: 760px; margin: 0; }
.editorial .ed-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--e-ink); border-bottom: 1px solid var(--e-line); }
@media (min-width: 760px) { .editorial .ed-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.editorial .ed-kpi { padding: 14px 12px 16px 0; min-width: 0; }
.editorial .ed-kpi span { display: block; font-size: 12px; color: var(--e-mute); }
.editorial .ed-kpi b { display: block; font: 400 30px/1.1 'Instrument Serif', serif; margin-top: 4px; overflow-wrap: anywhere; }
.editorial .ed-kpi small { display: block; font-size: 12px; color: var(--e-acc); }
.editorial .ed-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
@media (min-width: 1000px) { .editorial .ed-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
.editorial .ed-sec { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.editorial .ed-sec h2 { font: 400 26px/1.15 'Instrument Serif', serif; margin: 0; letter-spacing: -.01em; }
.editorial .ed-sec h3 { font: 500 11.5px 'Geist', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--e-mute); margin: 0; }
.editorial .ed-list { list-style: none; margin: 0; padding: 0; }
.editorial .ed-list li { padding: 12px 0; border-bottom: 1px solid var(--e-line); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: baseline; }
.editorial .ed-list li > :only-child { grid-column: 1 / -1; }
.editorial .ed-list small, .editorial .ed-mute { color: var(--e-mute); font-size: 13px; }
.editorial .ed-mark { font: 500 11px 'Geist', sans-serif; padding: 3px 9px; border-radius: 20px; white-space: nowrap; background: var(--e-soft); }
.editorial .ed-mark.si { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.editorial .ed-mark.no { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.editorial .ed-mark.verificar { color: var(--e-acc); }
.editorial .ed-aside { background: var(--e-side); border: 1px solid var(--e-line); border-radius: 10px; padding: 22px; display: flex; flex-direction: column; gap: 18px; align-self: start; }
.editorial .ed-aside .ed-serif { font: 400 22px/1.2 'Instrument Serif', serif; }
.editorial .ed-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.editorial .ed-pills span { font-size: 12.5px; padding: 5px 11px; border-radius: 20px; background: var(--e-soft); }
.editorial .ed-ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.editorial .ed-ring > div { width: 44px; height: 44px; border-radius: 50%; background: var(--e-side); display: grid; place-items: center; font: 600 13px 'Geist', sans-serif; }
.editorial .ed-btn { height: 42px; border: 0; border-radius: 8px; background: var(--e-ink); color: var(--e-bg); font: 500 13.5px 'Geist', sans-serif; cursor: pointer; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.editorial .ed-btn.line { background: transparent; color: var(--e-ink); border: 1px solid var(--e-line); }
.editorial table th { font: 500 11px 'Geist', sans-serif; color: var(--e-mute); }
.editorial table td, .editorial table th { border-color: var(--e-line); }
.editorial a { color: var(--e-acc); }
.editorial .spinner { color: var(--e-acc); }
