/* Portal SOS: barra de mando oscura, campo de trabajo claro, paneles planos
   con filetes finos, severidad como color + forma, cifras en mono tabular.
   Colores de marca tomados del logo de SOS. */
:root {
  --navy: #182D52; --navy-2: #2A4D84; --navy-ink: #EEF2F9; --navy-dim: #A8BAD3;
  --brand: #2A4D84; --brand-2: #213D6A; --brand-soft: #E6ECF5; --sky: #759FB8;
  --bg: #F6F8FB; --surface: #FFFFFF; --surface-2: #F2F5F9; --surface-3: #E7ECF3;
  --ink: #0F1A33; --ink-2: #2B3A55; --muted: #5C6B84; --faint: #8B98AE;
  --line: #DCE3ED; --line-2: #C7D2E0;
  --ok: #0F7A4F; --ok-soft: #E2F3EA; --warn: #96600A; --warn-soft: #FBF1DB;
  --crit: #B32A20; --crit-soft: #FBE7E4; --amber: #8B6200; --amber-soft: #FFF3CE;
  --orange: #BA3F0C; --orange-soft: #FDE7D9;
  --pub: #2A4D84; --pub-soft: #E6ECF5; --corp: #5A8DB0; --corp-soft: #E3EFF7; --corp-ink: #2F6283;
  --priv: #7A86A6; --priv-soft: #ECEEF4; --priv-ink: #4A5675;
  --sh-1: 0 1px 2px rgba(28,31,82,.06), 0 1px 1px rgba(28,31,82,.04);
  --sh-2: 0 2px 4px rgba(28,31,82,.06), 0 8px 20px -8px rgba(28,31,82,.14);
  --sh-3: 0 24px 60px -18px rgba(28,31,82,.35), 0 2px 8px rgba(28,31,82,.10);
  --ring: 0 0 0 3px color-mix(in srgb, var(--sky) 40%, transparent);
  --r-1: 6px; --r-2: 9px; --r-3: 13px;
  --f-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --t: 120ms cubic-bezier(.3,.7,.4,1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: 27px; font-weight: 700; line-height: 1.15; letter-spacing: -.022em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
p { margin: 0; }
.muted { color: var(--muted); }
.hint { font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.small { font-size: 13px; }
.num, .r { font-variant-numeric: tabular-nums; }
.num { font-family: var(--f-mono); letter-spacing: -.01em; }
.code { font-family: var(--f-mono); font-size: 13px; color: var(--brand); font-weight: 500; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ===== Barra de mando ===== */
.top { background: var(--navy); color: var(--navy-ink); position: sticky; top: 0; z-index: 20; box-shadow: inset 0 -1px 0 rgba(255,255,255,.08); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 4px 24px; min-height: 64px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy-ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 40px; width: auto; display: block; }
.brand-sep { width: 1px; height: 26px; background: rgba(255,255,255,.18); }
.brand small { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--navy-dim); font-weight: 500; }
.modules { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 6px 0; }
.modules a, .me > a { color: var(--navy-dim); font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: var(--r-1); white-space: nowrap;
  transition: background var(--t), color var(--t); }
.modules a:hover, .me > a:hover { background: rgba(255,255,255,.08); color: var(--navy-ink); text-decoration: none; }
.modules a.on, .me > a.on { background: rgba(255,255,255,.14); color: #fff; }
.me { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.me .who { display: flex; align-items: center; gap: 9px; }
.me .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--sky); color: var(--navy); }
.me .nm { color: var(--navy-ink); }

/* ===== Pestañas ===== */
.sub { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 64px; z-index: 19; }
.sub-in { max-width: 1320px; margin: 0 auto; padding: 0 24px; display: flex; gap: 2px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 0 13px; min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color var(--t), border-color var(--t); }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.spacer { flex: 1; }
.sync { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dot.live { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }

/* ===== Campo ===== */
.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 24px 56px; display: grid; gap: 22px; }
.wrap > * { min-width: 0; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% -10%, var(--navy-2), var(--navy) 60%); }
.foot { max-width: 1320px; margin: 0 auto; padding: 0 24px 32px; font-size: 12px; color: var(--faint); }
.lead { color: var(--muted); margin-top: 6px; max-width: 75ch; font-size: 14.5px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.migas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--faint); margin-bottom: -8px; }

.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 20px 22px; min-width: 0; box-shadow: var(--sh-1); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > .panel-h { padding: 18px 20px 0; }
.panel.flush > .hint, .panel.flush > .pad { padding: 0 20px 18px; }
.panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-h p { font-size: 13px; color: var(--muted); }

/* ===== Login ===== */
.login { width: 100%; max-width: 380px; padding: 0; overflow: hidden; box-shadow: var(--sh-3); border: 0; }
.login-h { background: var(--navy); padding: 22px 24px 18px; display: grid; gap: 6px; justify-items: start; border-bottom: 3px solid var(--sky); }
.login-h img { height: 52px; width: auto; }
.login-h span { color: var(--navy-dim); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; }
.login-b { padding: 22px 24px 24px; display: grid; gap: 14px; }

/* ===== Formularios ===== */
label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
label .req { color: var(--crit); }
input, select, textarea { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-2); padding: 9px 11px; font-size: 14px;
  width: 100%; min-width: 0; color: var(--ink); font-weight: 400; transition: border-color var(--t), box-shadow var(--t); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input[type=checkbox] { width: auto; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form .full { grid-column: 1 / -1; }
.fs { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; }
.fs + .fs { margin-top: 26px; }
.fs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; }
.fs-grid .full { grid-column: 1 / -1; }
.narrow { max-width: 480px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; }

/* ===== Botones planos ===== */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink);
  font-family: var(--f-body); font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: background var(--t), border-color var(--t), color var(--t); }
button:hover, .btn:hover { background: var(--surface-2); border-color: var(--faint); text-decoration: none; }
button:focus-visible, .btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
button[type=submit], .btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
button[type=submit]:hover, .btn.pri:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.danger, button.danger { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 34%, var(--line-2)); background: var(--surface); }
.btn.danger:hover, button.danger:hover { background: var(--crit-soft); border-color: var(--crit); }
.btn.sm { min-height: 30px; padding: 0 11px; font-size: 13px; }
button.link { background: none; border: 0; min-height: 0; padding: 0; color: var(--brand); font-weight: 600; font-size: 13px; }
button.link:hover { text-decoration: underline; }
.btn[aria-disabled=true], button:disabled { background: var(--surface-2); border-color: var(--line); color: var(--faint); cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.segctl { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); overflow: hidden; }
.segctl a { padding: 0 14px; min-height: 36px; display: inline-flex; align-items: center; font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); }
.segctl a:first-child { border-left: 0; }
.segctl a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.segctl a.on { background: var(--brand); color: #fff; }

/* ===== Filtros ===== */
.toolbar { display: grid; gap: 11px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { width: auto; max-width: 260px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.count { font-size: 13px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

/* ===== Cifras ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 16px 18px; display: grid; gap: 3px; min-width: 0;
  box-shadow: var(--sh-1); position: relative; overflow: hidden; color: var(--ink); font-weight: 400; }
a.kpi { transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
a.kpi:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.kpi .v { font-family: var(--f-display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin-top: 2px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--faint); line-height: 1.35; }
.kpi .go { font-size: 12px; font-weight: 700; color: var(--brand); opacity: 0; transition: opacity var(--t); font-family: var(--f-display); }
a.kpi:hover .go { opacity: 1; }
.kpi.alert::before, .kpi.warnk::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--crit); }
.kpi.alert { border-color: color-mix(in srgb, var(--crit) 45%, var(--line)); }
.kpi.alert .v { color: var(--crit); }
.kpi.warnk { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.kpi.warnk::before { background: var(--warn); }
.band { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); overflow: hidden; box-shadow: var(--sh-1); }
.band > div { padding: 14px 18px; border-right: 1px solid var(--line); display: grid; gap: 3px; min-width: 0; }
.band > div:last-child { border-right: 0; }
.band span { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.band b { font-family: var(--f-display); font-size: 19px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.band small { font-size: 11.5px; color: var(--faint); font-weight: 500; line-height: 1.3; }

/* ===== Barras ===== */
.bars { display: grid; gap: 11px; }
.bar { display: grid; grid-template-columns: minmax(118px, 220px) 1fr 92px; gap: 12px; align-items: center; font-size: 14px; }
.bar .t { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar .f { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar .f.warn { background: var(--warn); } .bar .f.crit { background: var(--crit); } .bar .f.ok { background: var(--ok); } .bar .f.muted { background: var(--faint); }
.bar .f.s-verde { background: var(--ok); } .bar .f.s-n1 { background: var(--amber); } .bar .f.s-n2 { background: var(--orange); }
.bar .f.s-n3, .bar .f.s-crit { background: var(--crit); } .bar .f.s-sf { background: var(--faint); }
.bar .n { text-align: right; font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.bar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .bar { grid-template-columns: 104px 1fr 72px; gap: 9px; } }
.cols { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.cols i { flex: 1; min-width: 3px; background: var(--brand); border-radius: 3px 3px 0 0; opacity: .85; position: relative; }
.cols i:hover { opacity: 1; background: var(--sky); }
.cols-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 6px; font-family: var(--f-mono); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; }
.spark i { display: block; width: 7px; background: var(--brand); border-radius: 1px 1px 0 0; }

/* ===== Pastillas, semáforo, etiquetas ===== */
.pill, .sem, .tag, .flag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-open { background: var(--brand-soft); color: var(--brand); } .p-docs { background: var(--warn-soft); color: var(--warn); }
.p-ok { background: var(--ok-soft); color: var(--ok); } .p-crit { background: var(--crit-soft); color: var(--crit); }
.p-muted { background: var(--surface-2); color: var(--muted); }
.sem { padding: 3px 9px; border-radius: var(--r-1); font-size: 12px; font-family: var(--f-mono); }
.sem::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-ok { background: var(--surface-2); color: var(--muted); } .s-verde { background: var(--ok-soft); color: var(--ok); }
.s-n1 { background: var(--amber-soft); color: var(--amber); } .s-n2 { background: var(--orange-soft); color: var(--orange); }
.s-n3 { background: var(--crit-soft); color: var(--crit); } .s-crit { background: var(--crit); color: #fff; }
.s-sf { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line-2); }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: var(--r-1); letter-spacing: .02em; background: var(--surface-2); color: var(--muted); }
.tag.pub { background: var(--pub-soft); color: var(--pub); } .tag.corp { background: var(--corp-soft); color: var(--corp-ink); }
.tag.priv { background: var(--priv-soft); color: var(--priv-ink); } .tag.crit { background: var(--crit-soft); color: var(--crit); font-weight: 700; }
.tag.amber { background: var(--amber-soft); color: var(--amber); font-weight: 700; } .tag.ok { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.tag.neutro { background: var(--surface-2); color: var(--muted); }
.tag.vigente { background: var(--ok-soft); color: var(--ok); } .tag.en_tramite { background: var(--warn-soft); color: var(--warn); }
.tag.vencida { background: var(--crit-soft); color: var(--crit); } .tag.cancelada { background: var(--surface-2); color: var(--faint); }
.flag { font-size: 11px; padding: 2px 8px; border-radius: var(--r-1); }
.flag.c { background: var(--crit-soft); color: var(--crit); } .flag.w { background: var(--warn-soft); color: var(--warn); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 0 6px; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sw.pub { background: var(--pub); } .sw.corp { background: var(--corp); } .sw.priv { background: var(--priv); }

/* ===== Tablas ===== */
.table, .tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--sh-1); }
.panel.flush .tbl-wrap, .panel.flush .table { border: 0; border-radius: 0; box-shadow: none; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
th { text-align: left; font-family: var(--f-display); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
th a { color: inherit; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.r, th.r { text-align: right; }
td .sub2 { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; font-weight: 400; }
td.det { min-width: 220px; max-width: 380px; }
tfoot td { font-weight: 700; background: var(--surface-2); color: var(--ink); border-top: 1px solid var(--line-2); border-bottom: 0; }
tr.off td, tr.parcial td { color: var(--faint); }
td.inline { display: grid; gap: 6px; }
td.inline form { display: flex; gap: 6px; margin-top: 6px; }
td.inline input { width: 170px; }
td.inline summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 13px; }
a.rowlink { color: var(--ink); }

/* ===== Ficha ===== */
.details, .kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 22px; margin: 0; }
.details > div, .kv > div { min-width: 0; overflow-wrap: anywhere; }
.details span, .kv dt { display: block; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 2px; }
.kv dd { margin: 0; color: var(--ink); }
.details .full, .kv .full { grid-column: 1 / -1; }
.money { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }
.money div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px 14px; }
.money span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.money b { font-family: var(--f-display); font-size: 18px; letter-spacing: -.02em; display: block; margin-top: 2px; }
.ficha-h { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 20px 22px; box-shadow: var(--sh-1); display: grid; gap: 10px; }
.ficha-h .estado { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl { display: grid; border-left: 2px solid var(--line); margin-left: 7px; padding-left: 18px; }
.tl-i { position: relative; padding: 0 0 16px; }
.tl-i::before { content: ""; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.tl-i.st::before { background: var(--brand); border-color: var(--brand); }
.tl-m { font-size: 11.5px; color: var(--faint); font-weight: 600; letter-spacing: .02em; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tl-t { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }

/* ===== Tablero por sector y cliente ===== */
.split { display: flex; height: 36px; border-radius: var(--r-2); overflow: hidden; gap: 2px; margin-bottom: 18px; }
.split span { display: flex; align-items: center; padding: 0 13px; color: #fff; font-size: 13px; font-weight: 600; min-width: 0; }
.split-pub { background: var(--pub); } .split-corp { background: var(--corp); } .split-priv { background: var(--priv); }
.sector-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(262px, 1fr)); gap: 14px; }
.sector-col, .ccard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 16px 18px; display: grid; gap: 12px;
  align-content: start; box-shadow: var(--sh-1); color: var(--ink); font-weight: 400; min-width: 0;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
.sector-col:hover, .ccard:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.sector-col.zero { opacity: .62; }
.sector-h { display: flex; align-items: center; gap: 9px; font-weight: 700; font-family: var(--f-display); font-size: 14px; }
.sector-n, .cc-n { display: flex; align-items: baseline; gap: 11px; }
.sector-n b, .cc-n b { font-family: var(--f-display); font-size: 36px; line-height: 1; letter-spacing: -.035em; }
.sector-n span, .cc-n span { color: var(--muted); font-size: 13px; line-height: 1.3; }
.mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.mini dt { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.mini dd { margin: 2px 0 0; font-family: var(--f-mono); font-weight: 600; }
.mini dd.c { color: var(--crit); } .mini dd.w { color: var(--warn); }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 14px; }
.cc-h { display: flex; justify-content: space-between; gap: 9px; align-items: flex-start; }
.cc-name { font-family: var(--f-display); font-weight: 700; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.stack { display: flex; height: 7px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.stack i, .legend i { display: block; }
.seg-curso { background: var(--brand); } .seg-validar { background: var(--amber); } .seg-pausado { background: var(--faint); } .seg-gestion { background: var(--orange); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 12px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend b { color: var(--ink); font-family: var(--f-mono); font-weight: 600; }
.cc-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-flags:empty { display: none; }
.cc-f { display: flex; justify-content: space-between; gap: 9px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); padding-top: 10px; flex-wrap: wrap; }
.att { display: grid; }
.att-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 10px; margin-inline: -10px;
  border-bottom: 1px solid var(--line); border-radius: var(--r-1); color: var(--ink); font-weight: 400; }
.att-row:last-child { border-bottom: 0; }
.att-row:hover { background: var(--surface-2); text-decoration: none; }
.att-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att > div { min-width: 0; }

/* ===== Avisos ===== */
.flash, .error, .notice { border-radius: var(--r-2); padding: 12px 15px; font-size: 14px; border: 1px solid var(--line); border-left: 3px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); }
.flash, .notice.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); border-left-color: var(--ok); }
.error, .notice.crit { background: var(--crit-soft); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 30%, transparent); border-left-color: var(--crit); }
.notice.warn { background: var(--warn-soft); color: var(--ink-2); border-color: color-mix(in srgb, var(--warn) 30%, transparent); border-left-color: var(--warn); }
.empty { border: 1px dashed var(--line-2); border-radius: var(--r-3); padding: 44px 24px; text-align: center; display: grid; gap: 12px; justify-items: center; background: var(--surface); }
.empty p { color: var(--muted); max-width: 58ch; }

/* ===== Importar ===== */
.stepper { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.stepper b { font-family: var(--f-mono); margin-right: 7px; color: var(--faint); }
.stepper .on { color: var(--brand); font-weight: 700; } .stepper .on b { color: var(--brand); }
.drop { border: 2px dashed var(--line-2); border-radius: var(--r-3); padding: 36px 24px; text-align: center; display: grid; gap: 10px; justify-items: center;
  background: var(--surface); cursor: pointer; color: var(--ink); font-weight: 400; font-size: 14px; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.progress { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width 200ms; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.map-grid select.hit { border-color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }

/* ===== Angosto ===== */
@media (max-width: 680px) {
  .top-in { padding: 8px 16px; gap: 10px; }
  .brand img { height: 34px; }
  .brand-sep, .brand small, .me .nm { display: none; }
  .sub { position: static; }
  .sub-in { padding: 0 12px; }
  .wrap { padding: 20px 16px 48px; }
  .foot { padding: 0 16px 24px; }
  h1 { font-size: 22px; }
  .form { grid-template-columns: 1fr; }
  .band > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .band > div:last-child { border-bottom: 0; }
  .mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Menú de teléfono (3 barras) ===== */
.menu-btn { display: none; width: 44px; height: 44px; min-height: 0; padding: 0; margin-left: auto; border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px; background: transparent; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.35); }
.menu-btn span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--navy-ink); transition: transform var(--t), opacity var(--t); }
.menu-btn[aria-expanded=true] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded=true] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded=true] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu-scrim { position: fixed; inset: 0; background: rgba(10,20,40,.45); z-index: 30; }
.menu-movil { position: absolute; top: calc(100% + 8px); right: 12px; width: min(320px, calc(100vw - 24px)); max-height: calc(100vh - 90px); overflow-y: auto;
  background: var(--surface); color: var(--ink); border-radius: var(--r-3); box-shadow: var(--sh-3); z-index: 31; padding: 8px; display: grid; gap: 4px;
  animation: mm-in 160ms cubic-bezier(.3,.7,.4,1); }
.menu-movil[hidden] { display: none; }
@keyframes mm-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mm-user { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: var(--r-2); color: var(--ink); font-weight: 400; }
.mm-user:hover { background: var(--surface-2); text-decoration: none; }
.mm-user .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--brand); color: #fff; flex: none; }
.mm-user b { display: block; font-size: 14px; } .mm-user small { color: var(--muted); font-size: 12px; }
.mm-grupo { display: grid; border-top: 1px solid var(--line); padding: 6px 0; }
.mm-titulo { font-family: var(--f-display); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.mm-grupo.on .mm-titulo { color: var(--brand); }
.mm-grupo a { padding: 11px 10px; border-radius: var(--r-1); color: var(--ink-2); font-size: 15px; font-weight: 500; min-height: 44px; display: flex; align-items: center; }
.mm-grupo a:hover { background: var(--surface-2); text-decoration: none; }
.mm-grupo a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand); }
body.menu-abierto { overflow: hidden; }
@media (max-width: 820px) {
  .top-in { flex-wrap: nowrap; min-height: 60px; position: relative; }
  .modules, .me { display: none; }
  .menu-btn { display: inline-flex; }
  .top { position: sticky; }
  .sub { top: 60px; }
}

/* ===== Filtros en teléfono: buscador + botón "Filtros" que despliega el resto ===== */
.filtros-btn { display: none; }
@media (max-width: 680px) {
  .toolbar { gap: 10px; }
  .toolbar .filters { gap: 8px; }
  .toolbar input[type=search] { flex: 1 1 calc(100% - 130px); min-width: 0; }
  .toolbar select { flex: 1 1 calc(50% - 4px); max-width: none; min-width: 0; font-size: 14px; }
  .filtros-btn { display: inline-flex; flex: none; gap: 6px; padding: 0 12px; }
  .filtros-btn svg { width: 16px; height: 16px; }
  .toolbar.abierto .filtros-btn { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
  .toolbar.js-col:not(.abierto) select,
  .toolbar.js-col:not(.abierto) button[type=submit] { display: none; }
  .toolbar.js-col:not(.abierto) .filters + .filters { display: none; }
  .toolbar.js-col.abierto button[type=submit] { flex: 1 1 100%; }
  .chips { gap: 6px; }
  .chips a { white-space: nowrap; }
  .chip { flex: none; }
  .count { margin-left: 0; flex: 1 0 100%; font-size: 12.5px; }
  .filters .count { order: 9; }
  .head-row { align-items: stretch; }
  .head-actions { width: 100%; }
  .head-actions .btn, .head-actions .segctl { flex: 1 1 auto; }
  .segctl { display: flex; overflow-x: auto; }
  .segctl a { flex: 1 0 auto; justify-content: center; }
}

/* ===== Selector de idioma ES | EN ===== */
.lang { display: inline-flex; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; overflow: hidden; margin-right: 6px; }
.lang a { padding: 4px 9px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--navy-dim); }
.lang a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.lang a.on { background: rgba(255,255,255,.18); color: #fff; }
.mm-lang { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; }
.mm-lang > span:first-child { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.mm-lang .lang { border-color: var(--line-2); margin: 0; }
.mm-lang .lang a { color: var(--muted); padding: 6px 14px; font-size: 13px; }
.mm-lang .lang a.on { background: var(--brand); color: #fff; }
.login-lang { display: flex; justify-content: center; }
.login-lang .lang { border-color: var(--line-2); margin: 0; }
.login-lang .lang a { color: var(--muted); }
.login-lang .lang a.on { background: var(--brand); color: #fff; }
