:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --accent: #1e6fd9;
  --muted: #6b7a90;
  --bg: #f3f5f9;
  --line: #dfe5ee;
  --alta: #c62828;
  --media: #e8a317;
  --baja: #2a9fd6;
}
body { background: var(--bg); font-size: .875rem; color: #1d2733; }
a { text-decoration: none; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 238px; background: var(--navy); color: #c9d6ea; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 1.1rem 1.2rem; color: #fff; font-weight: 700; letter-spacing: .3px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand small { display: block; font-weight: 400; color: #8fa6c8; font-size: .72rem; letter-spacing: 0; }
.sidebar .nav-link { color: #c9d6ea; padding: .55rem 1.2rem; display: flex; gap: .65rem; align-items: center; border-left: 3px solid transparent; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar .nav-link.active { background: var(--navy-2); color: #fff; border-left-color: #4ea1ff; }
.sidebar .sec { font-size: .68rem; text-transform: uppercase; color: #6f87ab; padding: 1rem 1.2rem .3rem; letter-spacing: .6px; }
.main { flex: 1; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1.4rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 20; }
.content { padding: 1.2rem 1.4rem 3rem; }
.card { border: 1px solid var(--line); border-radius: .6rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; }
.kpi { padding: 1rem 1.1rem; }
.kpi .v { font-size: 1.55rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .4px; }
.table { font-size: .8rem; margin-bottom: 0; }
.table thead th { background: #f7f9fc; color: #44546a; font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); cursor: pointer; }
.table td.n, .table th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { max-height: 70vh; overflow: auto; }
.table-wrap.short { max-height: 420px; }
tr.row-bad td { background: #fdecec !important; }
tr.row-warn td { background: #fff7e3 !important; }
tr.row-ok td { background: #eefaf1 !important; }
.diff-pos { color: var(--alta); font-weight: 600; }
.diff-neg { color: #1b7f3b; font-weight: 600; }
.case-head { background: #fff; border: 1px solid var(--line); border-radius: .6rem; padding: .9rem 1.1rem .2rem; margin-bottom: 1rem; }
.case-head .nav-tabs { border-bottom: 0; margin-top: .6rem; flex-wrap: wrap; }
.case-head .nav-tabs .nav-link { color: #44546a; border: 0; border-bottom: 3px solid transparent; padding: .5rem .8rem; white-space: nowrap; }
.case-head .nav-tabs .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); background: transparent; font-weight: 600; }
.badge.bg-alta { background: var(--alta); }
.sev-ALTA { border-left: 4px solid var(--alta); }
.sev-MEDIA { border-left: 4px solid var(--media); }
.sev-BAJA { border-left: 4px solid var(--baja); }
.sev-INFO { border-left: 4px solid #9aa7b8; }
.alert-item { background: #fff; border: 1px solid var(--line); border-radius: .5rem; padding: .6rem .8rem; margin-bottom: .5rem; }
.alert-item .det { white-space: pre-line; color: #4a5a70; font-size: .78rem; }
.alert-item.revisada { opacity: .6; }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: .25rem .8rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }
.dropzone { border: 2px dashed #9db6d8; border-radius: .7rem; background: #f8fbff; padding: 2rem; text-align: center; cursor: pointer; transition: .15s; }
.dropzone.drag { background: #e8f1ff; border-color: var(--accent); }
.risk { display: inline-block; min-width: 48px; text-align: center; border-radius: 1rem; padding: .1rem .5rem; font-weight: 700; color: #fff; }
.risk.ALTO { background: var(--alta); } .risk.MEDIO { background: var(--media); } .risk.BAJO { background: #2e9e5b; }
.chip { display: inline-block; background: #eef3fa; border: 1px solid #d6e2f3; border-radius: 1rem; padding: 0 .5rem; font-size: .72rem; margin: 1px; color: #2b4a75; }
.chip.red { background: #fdecec; border-color: #f5c2c2; color: #a01c1c; }
.chip.amber { background: #fff4dc; border-color: #f4dc9f; color: #8a5a00; }
.filter-input { max-width: 320px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.small-muted { color: var(--muted); font-size: .75rem; }
details summary { cursor: pointer; }
.progress { height: 1.1rem; }
@media (max-width: 992px) { .sidebar { display: none; } .kv { grid-template-columns: 1fr; } }
@media print {
  .sidebar, .topbar, .no-print, .case-head .nav-tabs { display: none !important; }
  .content { padding: 0; } .table-wrap { max-height: none; overflow: visible; }
  body { background: #fff; }
}
