/* RADAR · Regulatorio (spec 048) — consola de operaciones: oscura, densa, tablas primero */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0a0e13; --panel: #10151c; --panel-2: #151b24; --panel-3: #1b2330; --line: #222b37; --line-2: #2c3746;
  --ink: #e6edf3; --ink-2: #b8c2cd; --muted: #7d8a99; --dim: #5b6776;
  --accent: #3b82f6; --accent-2: #60a5fa; --accent-bg: rgba(59,130,246,.14);
  --red: #f05252; --red-bg: rgba(240,82,82,.14); --amber: #f5a524; --amber-bg: rgba(245,165,36,.14);
  --violet: #a78bfa; --violet-bg: rgba(167,139,250,.15); --green: #34d399; --green-bg: rgba(52,211,153,.13);
  --gray-bg: rgba(125,138,153,.13);
  --sans: 'IBM Plex Sans', system-ui, 'Segoe UI', sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --r: 4px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 13px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.mono, code { font-family: var(--mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--panel); padding: 6px 10px; }
svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* Estructura */
.shell { display: grid; grid-template-columns: 224px 1fr; height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.brand .logo { width: 30px; height: 30px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.brand .logo svg { width: 18px; height: 18px; }
.brand b { display: block; font-size: 14px; letter-spacing: 2px; }
.brand small, .usuario small { display: block; color: var(--muted); font-size: 11px; }
.side nav { padding: 8px; flex: 1; overflow: auto; }
.side .grupo { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--dim); padding: 14px 10px 6px; font-weight: 600; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.side nav a:hover { background: var(--panel-2); color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--accent-bg); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.side nav a svg { color: var(--muted); } .side nav a[aria-current="page"] svg { color: var(--accent-2); }
.cnt { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
#n-analisis:not(:empty), .cnt.warn:not(:empty) { color: var(--amber); background: var(--amber-bg); padding: 0 6px; border-radius: 3px; }
.usuario { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.usuario .av { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--accent-2); }

.area { display: grid; grid-template-rows: 48px 1fr 26px; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.migas { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.migas b { color: var(--ink); font-weight: 600; }
.busca { margin-left: auto; display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 8px; height: 30px; color: var(--muted); }
.busca input { background: transparent; border: 0; color: var(--ink); font: inherit; width: 220px; outline: none; }
.estado-motor { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
main { overflow: auto; padding: 14px 16px 24px; min-height: 0; }
.statusbar { display: flex; gap: 18px; align-items: center; padding: 0 12px; border-top: 1px solid var(--line); background: var(--panel); font-size: 11px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; }
.statusbar .der { margin-left: auto; }
.statusbar .ult { overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--dim); vertical-align: 0; }
.led.ok { background: var(--green); box-shadow: 0 0 6px var(--green); } .led.run { background: var(--violet); animation: parpadea 1s infinite; }
@keyframes parpadea { 50% { opacity: .3; } }

/* Cabecera de vista */
.vh { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.vh h1 { font-size: 16px; margin: 0; font-weight: 600; }
.vh .sub { color: var(--muted); font-size: 12px; }
.vh .der { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Paneles */
.pnl { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.pnl > .ph { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.pnl > .ph h2 { white-space: nowrap; margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-2); font-weight: 600; }
.pnl > .ph .der { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.pnl > .pb { padding: 10px 12px; }
.grid { display: grid; gap: 12px; }
.c-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.c-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1200px) { .c-main, .c-2 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 12px; }

/* Tira de KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin-bottom: 12px; }
.kpi { padding: 10px 14px; border-right: 1px solid var(--line); position: relative; }
.kpi:last-child { border-right: 0; }
.kpi .et { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--mono); font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.kpi .s { font-size: 11px; color: var(--muted); }
.kpi.red .v { color: var(--red); } .kpi.amber .v { color: var(--amber); } .kpi.violet .v { color: var(--violet); } .kpi.blue .v { color: var(--accent-2); }
.kpi.red::before, .kpi.amber::before, .kpi.violet::before, .kpi.blue::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; }
.kpi.red::before { background: var(--red); } .kpi.amber::before { background: var(--amber); } .kpi.violet::before { background: var(--violet); } .kpi.blue::before { background: var(--accent); }

/* Etiquetas de estado */
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 3px; white-space: nowrap; line-height: 18px; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: currentColor; }
.e-incumple_ya, .p-crítica { color: var(--red); background: var(--red-bg); }
.e-requiere_accion, .p-alta { color: var(--amber); background: var(--amber-bg); }
.e-falta_dato { color: var(--violet); background: var(--violet-bg); }
.e-conforme, .ok-bg { color: var(--green); background: var(--green-bg); }
.e-no_aplica { color: var(--muted); background: var(--gray-bg); }
.p-media { color: var(--accent-2); background: var(--accent-bg); }
.sq { display: inline-block; width: 18px; height: 18px; border-radius: 2px; text-align: center; line-height: 18px; font-size: 10px; font-weight: 700; font-family: var(--mono); }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; font-size: 12px; transition: background .12s, border-color .12s; white-space: nowrap; }
.btn:hover { background: var(--panel-3); border-color: var(--dim); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover { background: #2563eb; }
.btn.ok { background: #059669; border-color: #059669; color: #fff; } .btn.ok:hover { background: #047857; }
.btn.sm { height: 24px; padding: 0 8px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Pestañas */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .cnt { margin-left: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { background: var(--panel-2); border: 0; border-right: 1px solid var(--line-2); padding: 0 12px; height: 28px; color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-bg); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }

/* Tablas densas */
.tbl-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; padding: 0 10px; height: 30px;
     border-bottom: 1px solid var(--line-2); background: var(--panel-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--panel-2); }
tr.clic { cursor: pointer; }
tr.sel { background: var(--accent-bg) !important; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.c, th.c { text-align: center; }
td .t2 { color: var(--muted); font-size: 11px; }
.code { font-family: var(--mono); font-size: 11.5px; color: var(--accent-2); white-space: nowrap; }
.barra { height: 6px; background: var(--panel-3); border-radius: 1px; overflow: hidden; display: flex; min-width: 80px; }
.barra span { height: 100%; }
.dias { font-family: var(--mono); font-size: 11px; }
.dias.vencido { color: var(--red); } .dias.pronto { color: var(--amber); }

/* Filtros */
.fbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.fbar input, .fbar select, .supuestos input { background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink); font: inherit; height: 28px; padding: 0 8px; }
.fbar input { min-width: 240px; }

/* Equipo de agentes (carril) */
.pipe { list-style: none; margin: 0; padding: 0; }
.pipe li { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); align-items: start; }
.pipe li:last-child { border-bottom: 0; }
.pipe .ico { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--dim); margin-top: 2px; }
.pipe li.hecho .ico { border-color: var(--green); background: var(--green); }
.pipe li.trabajando .ico { border-color: var(--violet); border-top-color: transparent; animation: gira .8s linear infinite; }
.pipe li.error .ico { border-color: var(--red); background: var(--red); }
.pipe li.omitido .ico { border-style: dashed; }
.pipe b { font-weight: 600; font-size: 12px; }
.pipe .res { color: var(--muted); font-size: 11px; margin-top: 2px; }
.pipe .t { font-family: var(--mono); font-size: 11px; color: var(--dim); }
@keyframes gira { to { transform: rotate(360deg); } }

/* Log */
.log { list-style: none; margin: 0; padding: 4px 0; font-family: var(--mono); font-size: 11px; max-height: 340px; overflow: auto; background: #080b0f; }
.log li { padding: 3px 12px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.log .h { color: var(--dim); } .log .s { color: var(--accent-2); } .log .s.c { color: var(--green); } .log .s.m { color: var(--amber); }
.log li:first-child { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: rgba(245,165,36,.18); } to { background: transparent; } }

/* Bloques de contenido */
.lead { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: grid; grid-template-columns: 22px 1fr; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.items li:last-child { border-bottom: 0; }
.items .n { font-family: var(--mono); font-size: 11px; color: var(--accent-2); }
.nota { display: flex; gap: 8px; padding: 8px 10px; border-radius: var(--r); font-size: 12px; border-left: 3px solid; }
.nota.info { background: var(--accent-bg); border-color: var(--accent); } .nota.warn { background: var(--amber-bg); border-color: var(--amber); }
.nota.bad { background: var(--red-bg); border-color: var(--red); } .nota.ok { background: var(--green-bg); border-color: var(--green); }
.fases { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 10px 0; }
.fase { border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 10px; background: var(--panel-2); }
.fase .fx { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.correo { border: 1px solid var(--line-2); border-radius: var(--r); margin-bottom: 10px; background: var(--panel-2); }
.correo .cm { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 12px; flex-wrap: wrap; }
.correo pre { margin: 0; padding: 10px; white-space: pre-wrap; font-family: var(--sans); font-size: 12px; color: var(--ink-2); max-height: 180px; overflow: auto; }
.correo .cf { display: flex; justify-content: flex-end; padding: 6px 10px; border-top: 1px solid var(--line); }
.aprob { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--panel-2); }
.aprob .der { margin-left: auto; }

/* Calendario */
.cal li { display: grid; grid-template-columns: 84px 104px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.cal { list-style: none; margin: 0; padding: 0; }

/* Maestro-detalle */
.md { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .md { grid-template-columns: 1fr; } }

/* Drawer (ficha) */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 96vw); background: var(--panel); border-left: 1px solid var(--line-2); z-index: 50;
          transform: translateX(100%); transition: transform .2s ease-out; display: flex; flex-direction: column; box-shadow: -20px 0 40px rgba(0,0,0,.4); }
.drawer.abierto { transform: none; }
.drawer .dh { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.drawer .db { overflow: auto; padding: 12px 14px; }
.drawer h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); }
.kv > div { padding: 8px 10px; border-right: 1px solid var(--line); } .kv > div:last-child { border-right: 0; }
.kv .k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; } .kv .v { font-family: var(--mono); font-size: 14px; }
.inci { font-family: var(--mono); font-size: 11.5px; line-height: 1.8; color: var(--ink-2); }
.inci mark { background: var(--amber-bg); color: var(--amber); padding: 0 3px; border-radius: 2px; }
.doc { background: #080b0f; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; font-family: var(--mono); font-size: 11px; white-space: pre; overflow: auto; max-height: 260px; color: var(--ink-2); }

/* Supuestos */
.supuestos { display: grid; grid-template-columns: 1fr 110px; gap: 6px 10px; align-items: center; }
.supuestos label { font-size: 12px; color: var(--ink-2); }
.supuestos input { width: 100%; text-align: right; font-family: var(--mono); }
.supuestos input.mod { border-color: var(--amber); color: var(--amber); }

.vacio { padding: 24px; text-align: center; color: var(--muted); }
.presentador { position: fixed; left: 236px; bottom: 32px; display: flex; gap: 4px; opacity: .18; transition: opacity .2s; z-index: 40; }
.presentador:hover, .presentador:focus-within { opacity: 1; }
.presentador button { font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 3px; border: 1px solid var(--line-2); background: var(--panel-3); color: var(--ink-2); }
.toast { position: fixed; right: 16px; top: 58px; z-index: 60; background: var(--panel-3); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); color: var(--ink);
         padding: 10px 14px; border-radius: var(--r); max-width: 420px; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Acciones desplegables y tareas */
tr.acc { cursor: pointer; } tr.acc td:first-child::before { content: "▸ "; color: var(--dim); } tr.acc.abierta td:first-child::before { content: "▾ "; color: var(--accent-2); }
tr.det > td { background: var(--bg); padding: 0; }
tr.det .tbl-wrap { max-height: 340px; }
tr.det table td { font-size: 11.5px; padding: 5px 10px; }
.paquetes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.paquete { border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px; background: var(--panel-2); }
.paquete b { display: block; font-size: 13px; }
.paquete .fx { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 4px 0; }
.chk { width: 18px; height: 18px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--bg); display: inline-grid; place-items: center; cursor: pointer; color: var(--green); font-size: 13px; padding: 0; }
.chk.si { background: var(--green-bg); border-color: var(--green); }
tr.hecha td { opacity: .45; } tr.hecha .tt { text-decoration: line-through; }
.origen { font-size: 10px; font-family: var(--mono); color: var(--violet); }

/* Alta de norma */
.alta-wrap { padding: 12px 12px 0; }
.alta-btn { width: 100%; justify-content: center; height: 34px; }
#dlg-alta.ancho { width: min(940px, 96vw); }
#dlg-alta .db { max-height: 70vh; overflow: auto; }
.expl { margin-top: 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel-2); }
.expl .eh { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.expl .eh b { font-size: 14px; }
.expl .meta { font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 6px 12px; border-bottom: 1px solid var(--line); }
.expl .eb { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.expl .eb > div { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.expl .eb > div:nth-child(odd) { border-right: 1px solid var(--line); }
.expl .eb .full { grid-column: 1 / -1; border-right: 0 !important; }
.expl h4 { margin: 0 0 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.expl ul { margin: 0; padding-left: 16px; } .expl li { margin: 2px 0; }
.expl .chips { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.expl .nota { margin: 10px 12px; }
#dlg-alta { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 6px; padding: 0; width: min(620px, 94vw); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
#dlg-alta::backdrop { background: rgba(0,0,0,.6); }
#dlg-alta .dh { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
#dlg-alta .db { padding: 16px; }
#dlg-alta .df { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel-2); }
#dlg-alta .lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
#dlg-alta input[type=text] { width: 100%; height: 36px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink); font-family: var(--mono); font-size: 12px; padding: 0 10px; }
#dlg-alta .o { text-align: center; color: var(--dim); margin: 10px 0; font-size: 11px; text-transform: uppercase; letter-spacing: 2px; }
.drop { display: flex; gap: 10px; align-items: center; justify-content: center; border: 1px dashed var(--line-2); border-radius: var(--r); padding: 18px; color: var(--muted); cursor: pointer; text-align: center; }
.drop:hover, .drop.sobre { border-color: var(--accent); color: var(--ink); background: var(--accent-bg); }
.drop.con { border-style: solid; border-color: var(--green); color: var(--green); }
#dlg-alta .err { color: var(--red); min-height: 18px; margin-top: 8px; font-size: 12px; }
#dlg-alta .ayuda { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.vacio-grande { padding: 56px 24px; text-align: center; color: var(--muted); }
.vacio-grande h2 { color: var(--ink); font-size: 16px; margin: 12px 0 6px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.vacio-grande > svg { width: 40px; height: 40px; color: var(--dim); }
.vacio-grande .btn { margin-top: 14px; }
.kpi.esperando .v { color: var(--dim); }
.leyendo { display: flex; gap: 10px; align-items: center; padding: 24px; color: var(--ink-2); }
.spin { width: 16px; height: 16px; border: 2px solid var(--violet-bg); border-top-color: var(--violet); border-radius: 50%; animation: gira .8s linear infinite; flex: none; }

/* ---- Datos de Planta (spec 049) ---- */
.filtros-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filtros-top select { background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink); font: inherit; height: 30px; padding: 0 8px; }
.chart-box { position: relative; height: 260px; padding: 10px 12px; }
.chart-box.alto { height: 320px; }
.chat { display: flex; flex-direction: column; gap: 12px; }
.qa { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.qa .q { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.qa .q b { font-size: 14px; }
.qa .a { padding: 12px 14px; }
.qa .a p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.cifras { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cifra { border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px 10px; background: var(--panel-2); }
.cifra .k { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.cifra .v { font-family: var(--mono); font-size: 15px; font-weight: 600; }
details.sql summary { cursor: pointer; color: var(--muted); font-size: 11px; font-family: var(--mono); margin-top: 6px; }
details.sql pre { background: #080b0f; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; font-family: var(--mono); font-size: 11px; white-space: pre-wrap; color: var(--ink-2); margin: 6px 0 0; }
.sugerencias { display: flex; gap: 6px; flex-wrap: wrap; }
.sug { border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.sug:hover { border-color: var(--accent); color: #fff; }
.entrada { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 2px; }
.entrada textarea { flex: 1; resize: none; height: 44px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink); font: inherit; padding: 10px 12px; }
.entrada textarea:focus { outline: 2px solid var(--accent-2); }
.imp { font-family: var(--mono); font-weight: 600; color: var(--green); }
.conf-alta { color: var(--green); } .conf-media { color: var(--amber); }
