@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap");

:root {
  --bg: #0b1220;
  --bg-soft: #121a2b;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;
}
* { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", Segoe UI, sans-serif;
  background: #e8eef6;
  color: var(--text);
  line-height: 1.4;
}
a { color: inherit; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: 220px;
  flex-shrink: 0;
  background: linear-gradient(165deg, #071018 0%, #0b1a2e 48%, #0a1628 100%);
  color: #dbe4f0;
  padding: 0;
  z-index: 40;
  overflow: hidden;
  border-right: 1px solid rgba(56, 189, 248, 0.12);
  transition: width .28s ease, transform .28s ease;
}
.sidebar-net {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: .9; z-index: 0;
}
.sidebar-glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(500px 220px at 10% -10%, rgba(14, 165, 233, .22), transparent 60%),
    radial-gradient(400px 260px at 110% 90%, rgba(45, 212, 191, .12), transparent 55%);
}
.sidebar-inner {
  position: relative; z-index: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px 18px;
  scrollbar-width: thin;
  scrollbar-color: #1e3a5f transparent;
}
.brand {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 12px; padding: 4px 4px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.brand-mark-img {
  width: 32px; height: 32px; flex-shrink: 0; display: block;
  filter: drop-shadow(0 0 10px rgba(14, 165, 233, .35));
}
.brand-text { flex: 1; min-width: 0; }
.brand-text strong {
  display: block; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: #f8fafc;
}
.brand-text small {
  display: block; color: #7dd3fc; font-weight: 500; margin-top: 3px; font-size: 10px;
  letter-spacing: .04em; text-transform: uppercase;
}
.sidebar-toggle {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
  border: 1px solid rgba(125, 211, 252, .25); background: rgba(15, 23, 42, .55);
  color: #7dd3fc; display: grid; place-items: center; padding: 0;
}
.sidebar-toggle span {
  display: block; width: 12px; height: 2px; background: currentColor; position: relative;
}
.sidebar-toggle span::before, .sidebar-toggle span::after {
  content: ""; position: absolute; left: 0; width: 12px; height: 2px; background: currentColor;
}
.sidebar-toggle span::before { top: -4px; }
.sidebar-toggle span::after { top: 4px; }
.sidebar-toggle:hover { background: rgba(14, 165, 233, .2); }

.nav-sep {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 4px 6px; color: #64748b;
}
.nav-sep::before, .nav-sep::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56,189,248,.35), transparent);
}
.nav-sep span {
  font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #94a3b8; white-space: nowrap;
}
.nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px; text-decoration: none;
  color: #cbd5e1; margin-bottom: 2px; font-size: 13px;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.nav a .ni {
  width: 18px; text-align: center; font-style: normal; font-size: 12px;
  color: #38bdf8; opacity: .85; flex-shrink: 0;
}
.nav a:hover {
  background: rgba(14, 165, 233, .12); color: #fff;
  border-color: rgba(56, 189, 248, .2);
}
.nav a.active {
  background: linear-gradient(90deg, rgba(14,165,233,.28), rgba(20,184,166,.12));
  color: #fff; font-weight: 600;
  border-color: rgba(56, 189, 248, .35);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, .12);
}
.nav a.active .ni { color: #5eead4; opacity: 1; }
.nav a.nav-out { margin-top: 10px; color: #94a3b8; }
.nav a.nav-out:hover { color: #fecaca; border-color: rgba(248,113,113,.25); }

.layout.nav-collapsed .sidebar {
  width: 64px;
}
.layout.nav-collapsed .brand-text,
.layout.nav-collapsed .nav-sep span,
.layout.nav-collapsed .nt {
  display: none;
}
.layout.nav-collapsed .nav-sep::after { display: none; }
.layout.nav-collapsed .nav a {
  justify-content: center; padding: 10px 0;
}
.layout.nav-collapsed .brand {
  flex-direction: column; align-items: center; gap: 8px;
}
.layout.nav-collapsed .nav a[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: 58px; top: 50%; transform: translateY(-50%);
  background: #0f172a; color: #fff; padding: 5px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap; z-index: 60;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.layout.nav-collapsed .nav a { position: relative; }
.sidebar-fab {
  position: fixed; left: 12px; bottom: 16px; z-index: 50;
  width: 44px; height: 44px; border-radius: 12px; border: 0; cursor: pointer;
  background: #0ea5e9; color: #fff; font-size: 18px; font-weight: 700;
  box-shadow: 0 10px 28px rgba(14,165,233,.45);
}
.sidebar-fab[hidden] { display: none !important; }

.content { flex: 1; padding: 14px 16px 32px; overflow: auto; min-width: 0; }
.page-head, .top, .ops-bar, .cov-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
h1 { margin: 0 0 2px; font-size: 18px; letter-spacing: -.02em; font-weight: 700; }
h2 { margin: 0 0 8px; font-size: 15px; }
h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
h4 { margin: 12px 0 6px; font-size: 12px; }
.muted { color: var(--muted); font-size: 12.5px; }
.page-head .muted, .top .muted, .ops-bar .muted { margin: 0; max-width: 72ch; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.card > :first-child { margin-top: 0; }
.kpi { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.btn {
  border: 0; border-radius: 6px; padding: 6px 11px; cursor: pointer;
  background: var(--brand-2); color: white; font-weight: 600; text-decoration: none;
  display: inline-block; font-size: 12.5px; line-height: 1.3;
}
.btn.secondary { background: #334155; }
.btn.ghost { background: transparent; color: var(--brand-2); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.ops-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reopt-box {
  display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 5px 9px; border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  border: 1px solid #cbd5e1;
  box-shadow: inset 0 1px 0 #fff;
}
.reopt-label { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: #334155; margin: 0; }
.reopt-label input[type="date"] { width: auto; padding: 4px 6px; font-size: 12px; }
.reopt-hasta { font-size: 12px; font-weight: 600; }
.flash { padding: 8px 10px; border-radius: 6px; margin-bottom: 10px; font-size: 13px; }
.flash.success { background: #dcfce7; }
.flash.error { background: #fee2e2; }
.busy-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(14,165,233,.18), transparent 55%),
    radial-gradient(700px 400px at 80% 90%, rgba(20,184,166,.12), transparent 50%),
    rgba(4, 10, 18, .82);
  backdrop-filter: blur(6px);
}
.busy-overlay[hidden] { display: none !important; }
.busy-card {
  position: relative;
  width: min(440px, 94vw);
  border-radius: 18px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(160deg, #071018 0%, #0b1a2e 55%, #0a1628 100%);
  border: 1px solid rgba(56, 189, 248, .28);
  box-shadow:
    0 0 0 1px rgba(14,165,233,.12),
    0 24px 60px rgba(0,0,0,.55),
    0 0 80px rgba(14,165,233,.15);
  color: #e2e8f0;
}
.busy-net {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: .95;
}
.busy-ui {
  position: relative; z-index: 1;
  padding: 28px 26px 24px;
}
.busy-radar {
  width: 72px; height: 72px; margin: 0 auto 14px;
  border-radius: 50%;
  border: 2px solid rgba(56,189,248,.35);
  position: relative;
  box-shadow: 0 0 0 8px rgba(14,165,233,.06), inset 0 0 20px rgba(14,165,233,.15);
}
.busy-radar::before {
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  border: 1px dashed rgba(94,234,212,.35);
  animation: spin 6s linear infinite;
}
.busy-radar::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 48%; height: 2px; transform-origin: left center;
  background: linear-gradient(90deg, #22d3ee, transparent);
  animation: radar-sweep 1.6s linear infinite;
}
.busy-core {
  position: absolute; left: 50%; top: 50%; width: 10px; height: 10px;
  margin: -5px 0 0 -5px; border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 12px #2dd4bf, 0 0 24px rgba(45,212,191,.5);
  animation: pulse-core 1.2s ease-in-out infinite;
}
@keyframes radar-sweep { to { transform: rotate(360deg); } }
@keyframes pulse-core {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: .7; }
}
.busy-card h2 {
  margin: 0 0 8px; font-size: 17px; font-weight: 700; color: #f8fafc;
  letter-spacing: -.01em; min-height: 1.3em;
}
.busy-card p {
  margin: 0; color: #94a3b8; font-size: 13px; line-height: 1.45;
}
.busy-steps {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin: 16px 0 10px;
}
.busy-steps span {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px;
  border: 1px solid rgba(148,163,184,.25); color: #64748b;
  background: rgba(15,23,42,.45);
}
.busy-steps span.on {
  color: #ecfeff;
  border-color: rgba(45,212,191,.45);
  background: rgba(14,165,233,.22);
  box-shadow: 0 0 12px rgba(14,165,233,.2);
}
.busy-meter {
  margin-top: 12px; height: 4px; border-radius: 999px;
  background: rgba(148,163,184,.2); overflow: hidden;
}
.busy-meter > i {
  display: block; height: 100%; width: 35%; border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9, #2dd4bf, #0ea5e9);
  background-size: 200% 100%;
  animation: meter-run 1.4s ease-in-out infinite;
}
@keyframes meter-run {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.busy-log {
  margin-top: 12px; font-family: "IBM Plex Mono", monospace;
  font-size: 10px; color: #38bdf8; letter-spacing: .02em;
  opacity: .85; min-height: 1.2em;
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: middle; }
th { background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #475569; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit;
}
input[type="checkbox"], input[type="file"] { width: auto; }
.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end;
  margin-bottom: 10px;
}
.toolbar .grow { flex: 1; min-width: 180px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.tag.HARD { background: #fee2e2; color: #991b1b; }
.tag.SOFT { background: #dbeafe; color: #1e3a8a; }
.tag.FT { background: #dbeafe; color: #1e3a8a; }
.tag.PT { background: #fef3c7; color: #92400e; }
.sw {
  border: 1px solid #cbd5e1; background: #f1f5f9; color: #475569;
  border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700;
  cursor: pointer; min-width: 72px;
}
.sw.on { background: #166534; border-color: #166534; color: #fff; }

.tog {
  --tog-w: 76px;
  --tog-h: 28px;
  --knob: 22px;
  position: relative;
  width: var(--tog-w); height: var(--tog-h);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  cursor: pointer; padding: 0; flex-shrink: 0;
  display: inline-flex; align-items: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
  vertical-align: middle;
}
.tog.is-off { background: #e11d48; }
.tog.is-on { background: #22c55e; }
.tog:disabled { opacity: .55; cursor: wait; }
.tog-knob {
  position: absolute; top: 2px; left: 2px;
  width: var(--knob); height: var(--knob);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .35);
  transition: transform .16s ease;
  pointer-events: none;
}
.tog.is-on .tog-knob {
  transform: translateX(calc(var(--tog-w) - var(--knob) - 6px));
}
.tog-lbl {
  flex: 1;
  color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: .12em; line-height: 1;
  pointer-events: none;
  padding: 0 8px 0 28px;
  text-align: right;
}
.tog.is-on .tog-lbl {
  padding: 0 28px 0 8px;
  text-align: left;
}
.tog-ev {
  --tog-w: 52px;
  --tog-h: 24px;
  --knob: 18px;
}
.tog-ev .tog-lbl { font-size: 9px; letter-spacing: .06em; padding: 0 6px 0 22px; }
.tog-ev.is-on .tog-lbl { padding: 0 22px 0 6px; }
.th-ev {
  font-size: 11px;
  letter-spacing: .04em;
  text-align: center;
  white-space: nowrap;
}
.td-ev { text-align: center; }
.evitar-masivo { display: flex; gap: 8px; flex-wrap: wrap; }
  text-align: left;
}

.nom-toolbar { align-items: end; }
.nom-tabla td { vertical-align: middle; }
.nom-tabla select.nom-set { min-width: 88px; max-width: 120px; font-size: 12px; }
.pat-cell { min-width: 220px; max-width: 280px; }
.pat-pills { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 4px; }
.pat-pill {
  display: inline-flex; align-items: center; gap: 2px;
  background: #e0f2fe; color: #075985;
  font-size: 11px; font-weight: 600;
  border-radius: 999px; padding: 2px 4px 2px 8px;
  line-height: 1.25; max-width: 100%;
}
.pat-x {
  border: 0; background: transparent; color: #0369a1;
  cursor: pointer; font-size: 13px; line-height: 1; padding: 0 3px;
  border-radius: 99px;
}
.pat-x:hover { background: #bae6fd; color: #0c4a6e; }
.pat-add { width: 100%; min-width: 180px !important; max-width: none !important; }
.eq-logic {
  margin: 0 0 12px; padding: 10px 12px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
}
.eq-logic ol { margin: 6px 0 0; padding-left: 18px; }
.eq-logic li { margin: 3px 0; font-size: 13px; color: #334155; }
table.sheet td.warn { color: #9a3412; font-weight: 700; }

/* —— Planificador: consola operativa —— */
.plan-deck {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 2px;
}
.plan-kpis .kpi-box {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
  padding: 8px 12px;
}
.plan-kpis .kpi-box b {
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px; letter-spacing: -.03em; color: #0f172a;
}
.plan-kpis .kpi-box.bad {
  border-color: rgba(220, 38, 38, .35);
  background: linear-gradient(180deg, #fff5f5, #fee2e2);
}
.plan-toolbar {
  display: grid; gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background:
    linear-gradient(165deg, #071018 0%, #0b1a2e 55%, #0a1628 100%);
  border: 1px solid rgba(56, 189, 248, .22);
  box-shadow: 0 10px 28px rgba(2, 8, 20, .18), inset 0 1px 0 rgba(125, 211, 252, .08);
}
.plan-filters, .plan-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.plan-bar-label {
  flex-shrink: 0;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #7dd3fc; min-width: 52px;
}
.plan-toolbar .chips { margin: 0; gap: 5px; }
.plan-toolbar .chip {
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(148, 163, 184, .28);
  color: #cbd5e1;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 11.5px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.plan-toolbar .chip:hover {
  border-color: rgba(56, 189, 248, .45);
  color: #f8fafc;
  background: rgba(14, 165, 233, .15);
}
.plan-toolbar .chip.on {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, .35), 0 6px 14px rgba(14, 165, 233, .25);
}
.plan-toolbar .chip.fam-m.on { background: linear-gradient(135deg, #0891b2, #0e7490); }
.plan-toolbar .chip.fam-t.on { background: linear-gradient(135deg, #ea580c, #c2410c); }
.plan-toolbar .chip.fam-r.on { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.plan-toolbar .legend { margin: 0; gap: 5px; }
.plan-toolbar .lg {
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 10px;
}
.plan-toolbar .chips-estados .chip.lg {
  text-decoration: none;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(15,23,42,.2);
  color: #fff;
}
.plan-toolbar .chips-estados .chip.lg.on {
  outline: 2px solid #f8fafc;
  outline-offset: 1px;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, .55), 0 6px 14px rgba(14, 165, 233, .25);
}
.mtx td.cell.filtro-off {
  opacity: 0.16;
  filter: grayscale(0.55);
}
.plan-hint {
  margin: 0; width: 100%;
  font-size: 11px; color: #94a3b8; line-height: 1.35;
}

.kpi-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0; }
table.sheet tfoot .tot-row td {
  background: #f1f5f9; border-top: 2px solid var(--line); font-weight: 600;
}
.table-scroll { overflow-x: auto; }
.resum-nomina th, .resum-nomina td { white-space: nowrap; font-size: 12px; }
.charts-card { margin-top: 12px; }
.charts-grid {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-bottom: 16px;
}
@media (max-width: 960px) {
  .charts-grid { grid-template-columns: 1fr; }
}
.chart-box {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.chart-box h4 { margin: 0 0 8px; font-size: 13px; color: #334155; }
.chart-wide { margin-top: 4px; }
.chart-tall { height: 320px; }
.chart-tall canvas, .chart-tall2 canvas { width: 100% !important; height: calc(100% - 28px) !important; }
.chart-tall2 { height: 300px; margin-top: 12px; }
.kpi-box { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 100px; flex: 1; text-align: left; font: inherit; color: inherit; }
button.kpi-box { cursor: pointer; }
button.kpi-box:hover { border-color: #93c5fd; background: #f8fbff; }
button.kpi-box.on { border-color: #1e3a8a; box-shadow: inset 0 0 0 1px #1e3a8a; background: #eff6ff; }
.kpi-box span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-box b { font-size: 18px; }
.kpi-box.bad { border-color: #fecaca; background: #fff1f2; }
.kpi-box.warn { border-color: #fcd34d; background: #fffbeb; }
button.kpi-box.bad.on { border-color: #b91c1c; background: #fee2e2; }
button.kpi-box.warn.on { border-color: #b45309; background: #fef3c7; }
table.sheet tr.warn td { background: #fffbeb; }
table.sheet td.warn { color: #9a3412; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.chip {
  text-decoration: none; background: white; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600;
}
.chip.on { background: #1e3a8a; color: white; border-color: #1e3a8a; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; font-size: 11px; }
.lg { padding: 1px 6px; border-radius: 4px; font-weight: 700; font-size: 10px; }

.matrix-shell {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: calc(100vh - 280px);
  max-height: calc(100vh - 168px);
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, .08),
    0 18px 40px rgba(15, 23, 42, .12);
}
.matrix-chrome {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 14px;
  background: linear-gradient(90deg, #0b1628, #0f2744 55%, #0b1a2e);
  border-bottom: 1px solid rgba(56, 189, 248, .2);
  color: #e2e8f0;
}
.matrix-chrome-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #f8fafc;
}
.matrix-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, .2), 0 0 12px rgba(45, 212, 191, .55);
  animation: pulse-core 1.8s ease-in-out infinite;
}
.matrix-chrome-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px; color: #7dd3fc; letter-spacing: .02em;
}
.matrix-scroll {
  flex: 1; min-height: 0;
  overflow: auto;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(180deg, #f1f5f9, #fff) border-box;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
}
.matrix-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.matrix-scroll::-webkit-scrollbar-thumb {
  background: #94a3b8; border-radius: 999px; border: 2px solid #e2e8f0;
}
.matrix-wrap { overflow: auto; }
table.mtx { border-collapse: separate; border-spacing: 0; font-size: 11px; width: max-content; min-width: 100%; }
.mtx th, .mtx td { padding: 0; border-right: 1px solid #e8eef5; border-bottom: 1px solid #e8eef5; }
.mtx thead th {
  position: sticky; top: 0; z-index: 5;
  background: #0f172a; color: #e2e8f0;
  text-align: center; font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 11px;
  box-shadow: 0 1px 0 rgba(56, 189, 248, .25);
}
.mtx tbody tr:nth-child(even):not(.ghead):not(.metric-row) td.sticky-l {
  background: #f8fafc;
}
.mtx tbody tr:hover:not(.ghead) td.cell {
  filter: brightness(0.97);
}
.mtx tbody tr:hover:not(.ghead) td.sticky-l {
  background: #eef6ff;
}
.mtx .sticky-l { position: sticky; left: 0; z-index: 4; background: #fff; }
.mtx thead .sticky-l { z-index: 8; background: #0f172a; }
.mtx .sticky-l.n { left: 0; min-width: 48px; width: 48px; padding: 4px 6px; font-variant-numeric: tabular-nums; color: #64748b; font-family: "IBM Plex Mono", monospace; font-size: 10px; }
.mtx .sticky-l.name { left: 0; min-width: 168px; max-width: 168px; padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #0f172a; }
.mtx .sticky-l.n + .sticky-l.name { left: 48px; border-right: 1px solid #cbd5e1; }
.mtx .ghead .sticky-l.n,
.mtx .ghead-title .sticky-l.n {
  color: #ffffff !important;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  min-width: 216px;
  width: auto;
  max-width: none;
}
.mtx .sticky-r { position: sticky; z-index: 4; background: #fff; text-align: center; border-left: 1px solid #e2e8f0; }
.mtx thead .sticky-r { z-index: 8; background: #0f172a; }
.mtx .k5 { right: 0; min-width: 168px; max-width: 220px; white-space: normal; }
.mtx .k4 { right: 168px; min-width: 38px; }
.mtx .k3 { right: 206px; min-width: 38px; }
.mtx .k2 { right: 244px; min-width: 38px; }
.mtx .k1 { right: 282px; min-width: 38px; }
.dcol { min-width: 34px; width: 34px; text-align: center; }
.dd { font-family: "IBM Plex Mono", monospace; font-size: 13px; font-weight: 800; color: inherit; }
.dw { font-size: 10px; font-weight: 700; opacity: 1; }
.dt { font-size: 9px; font-weight: 800; letter-spacing: .04em; margin-bottom: 1px; }
.mtx thead th.col-laboral,
.mtx td.metric-stack.col-laboral {
  background-color: #f8fafc;
  box-shadow: inset 4px 0 0 #cbd5e1;
}
.mtx thead th.col-sabado,
.mtx td.metric-stack.col-sabado {
  background-color: #c4b08a;
  box-shadow: inset 4px 0 0 #8b7355;
}
.mtx thead th.col-domingo,
.mtx td.metric-stack.col-domingo {
  background-color: #ea580c;
  box-shadow: inset 4px 0 0 #c2410c;
}
.mtx thead th.col-festivo,
.mtx td.metric-stack.col-domingo,
.mtx td.metric-stack.col-festivo { color: #fff; }
thead .dcol.col-laboral { background: #f1f5f9 !important; color: #0f172a; }
thead .dcol.col-sabado { background: #c4b08a !important; color: #44403c; }
thead .dcol.col-domingo { background: #ea580c !important; color: #fff7ed; }
thead .dcol.col-festivo { background: #b91c1c !important; color: #fef2f2; }
thead .dcol .dw { color: inherit; opacity: 1; }
.mtx .ghead td.col-laboral { background-color: #f8fafc; }
.mtx .ghead td.col-sabado { background-color: #c4b08a; }
.mtx .ghead td.col-domingo { background-color: #ea580c; }
.mtx .ghead td.col-festivo { background-color: #dc2626; }
.lg.col-laboral { background: #f1f5f9; color: #0f172a; }
.lg.col-sabado { background: #c4b08a; color: #44403c; }
.lg.col-domingo { background: #ea580c; color: #fff7ed; }
.lg.col-festivo { background: #b91c1c; color: #fef2f2; }
.cell {
  text-align: center; font-weight: 800; font-size: 12px; height: 28px; line-height: 28px;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: .02em;
}
.cell.editable { cursor: pointer; user-select: none; }
.cell.editable:hover { outline: 1px solid rgba(14, 165, 233, .55); outline-offset: -1px; }
.cell.manual { box-shadow: inset 0 0 0 1.5px #0ea5e9; }
.cell.horario-ped { box-shadow: inset 0 0 0 2px #d97706; }
.cell.horario-ped::after { content: "⏱"; font-size: 8px; position: relative; top: -6px; }
.cell.dragging { opacity: 0.35; }
.cell.drop-ok { outline: 2px solid #0ea5e9; }
.cell-menu {
  position: absolute; z-index: 40; background: #0f172a; color: #fff;
  border-radius: 8px; padding: 6px; min-width: 160px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  border: 1px solid rgba(56, 189, 248, .25);
}
.cell-menu button {
  display: block; width: 100%; text-align: left; background: transparent; color: #e2e8f0;
  border: 0; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.cell-menu button:hover { background: #0e7490; }
.TRABAJA { background: #e2e8f0; color: #334155; }
.LIBRE { background: #16a34a; color: #fff; }
.LM { background: #dc2626; color: #fff; }
.BAJA { background: #7f1d1d; color: #fecaca; }
.VAC { background: #2563eb; color: #fff; }
.LIBRE_SOLICITADO { background: #15803d; color: #dcfce7; }
.TRABAJO_SOLICITADO { background: #1d4ed8; color: #dbeafe; }
.CAPACITACION { background: #0d9488; color: #fff; }
.SINDICAL { background: #d97706; color: #fff; }
.PERMISO, .PCS { background: #7c3aed; color: #fff; }
.FUERA { background: #e2e8f0; color: transparent; }
.ghead td { vertical-align: top; }
.mtx td.cell {
  background-clip: padding-box;
}
.mtx td.cell.col-laboral { box-shadow: inset 3px 0 0 #cbd5e1; }
.mtx td.cell.col-sabado { box-shadow: inset 3px 0 0 #8b7355; }
.mtx td.cell.col-domingo { box-shadow: inset 3px 0 0 #c2410c; }
.mtx td.cell.col-festivo { box-shadow: inset 3px 0 0 #991b1b; }
.mtx td.cell.col-laboral.TRABAJA,
.mtx td.cell.col-laboral.FUERA { background-color: #ffffff !important; color: transparent !important; }
.mtx td.cell.col-sabado.TRABAJA,
.mtx td.cell.col-sabado.FUERA { background-color: #d6c4a8 !important; color: transparent !important; }
.mtx td.cell.col-domingo.TRABAJA,
.mtx td.cell.col-domingo.FUERA { background-color: #fb923c !important; color: transparent !important; }
.mtx td.cell.col-festivo.TRABAJA,
.mtx td.cell.col-festivo.FUERA { background-color: #ef4444 !important; color: transparent !important; }
.mtx td.cell.FUERA { opacity: .55; }
.mtx td.cell.LIBRE,
.mtx td.cell.LIBRE_SOLICITADO { background-color: #16a34a !important; color: #fff !important; }
.mtx td.cell.LIBRE_SOLICITADO { background-color: #15803d !important; color: #dcfce7 !important; }
.mtx td.cell.TRABAJO_SOLICITADO { background-color: #1d4ed8 !important; color: #dbeafe !important; }
.mtx td.cell.LM { background-color: #dc2626 !important; color: #fff !important; }
.mtx td.cell.VAC { background-color: #2563eb !important; color: #fff !important; }
.mtx td.cell.PCS,
.mtx td.cell.PERMISO { background-color: #7c3aed !important; color: #fff !important; }
.mtx td.cell.BAJA { background-color: #7f1d1d !important; color: #fecaca !important; }
.mtx td.cell.CAPACITACION { background-color: #0d9488 !important; color: #fff !important; }
.mtx td.cell.SINDICAL { background-color: #d97706 !important; color: #fff !important; }
.cell.manual.col-laboral { box-shadow: inset 4px 0 0 #cbd5e1, inset 0 0 0 2px #0ea5e9; }
.cell.manual.col-sabado { box-shadow: inset 4px 0 0 #8b7355, inset 0 0 0 2px #0ea5e9; }
.cell.manual.col-domingo { box-shadow: inset 4px 0 0 #c2410c, inset 0 0 0 2px #0ea5e9; }
.cell.manual.col-festivo { box-shadow: inset 4px 0 0 #991b1b, inset 0 0 0 2px #0ea5e9; }
.ghead .sticky-l {
  background: #0f172a; color: #fff !important; font-weight: 800; padding: 8px 12px; white-space: nowrap;
  letter-spacing: .01em;
}
.ghead-total .sticky-l {
  background: linear-gradient(90deg, #0c4a6e, #0f172a);
  box-shadow: inset 3px 0 0 #38bdf8;
}
.ghead-fam.fam-m .sticky-l { background: #164e63; box-shadow: inset 3px 0 0 #22d3ee; }
.ghead-fam.fam-t .sticky-l { background: #7c2d12; box-shadow: inset 3px 0 0 #fb923c; }
.ghead-fam.fam-r .sticky-l { background: #312e81; box-shadow: inset 3px 0 0 #a78bfa; }
.ghead .sticky-r {
  background: #0f172a !important; color: #e2e8f0; vertical-align: middle;
  padding: 4px 6px !important;
}
.chip.fam-m.on { background: #0e7490; }
.chip.fam-t.on { background: #c2410c; }
.chip.fam-r.on { background: #4f46e5; }
.metric-stack { padding: 3px 2px !important; font-family: "IBM Plex Mono", monospace; font-size: 10px; line-height: 1.3; color: #0f172a; font-weight: 700; }
.metric-stack .m { border-radius: 3px; margin: 1px 2px; padding: 1px 0; }
.mtx .ghead-title td.dcol,
.mtx .ghead-title td.dcol.col-laboral,
.mtx .ghead-title td.dcol.col-sabado,
.mtx .ghead-title td.dcol.col-domingo,
.mtx .ghead-title td.dcol.col-festivo {
  height: 36px;
  background: #0f172a !important;
  color: #fff;
  box-shadow: none !important;
  border-color: #1e293b;
}
.mtx .ghead-title.ghead-total td.dcol { background: #0c4a6e !important; }
.mtx .ghead-title.fam-m td.dcol { background: #164e63 !important; }
.mtx .ghead-title.fam-t td.dcol { background: #9a3412 !important; }
.mtx .ghead-title.fam-r td.dcol { background: #312e81 !important; }
.ext-sep td {
  height: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  background: #334155 !important;
  box-shadow: none !important;
}
.ext-sep td.sticky-l,
.ext-sep td.sticky-r {
  background: #1e293b !important;
}
.ghead-title .sticky-r { background: #0f172a !important; color: #f8fafc !important; }
.ghead-title .pill { font-size: 10px; }
.metric-row td { height: 22px; line-height: 22px; }
.metric-row .metric-lab {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 11px !important;
  font-family: inherit !important;
  text-align: left;
  padding: 2px 10px !important;
  white-space: nowrap;
  border-right: 1px solid #94a3b8;
}
.metric-row .metric-tail { background: #f8fafc !important; }
.metric-num {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 800;
  font-size: 12px;
  color: #0f172a;
  background: #ffffff;
}
.metric-num.col-laboral { background: #ffffff; color: #0f172a; }
.metric-num.col-sabado { background: #f5e6c8; color: #1c1917; }
.metric-num.col-domingo { background: #ffedd5; color: #9a3412; }
.metric-num.col-festivo { background: #fecaca; color: #7f1d1d; }
.metric-num.gap-neg { background: #fee2e2 !important; color: #b91c1c !important; }
.metric-num.gap-pos { color: #166534; }
.metric-num.c-lib { color: #15803d; }
.metric-num.c-lm { color: #b91c1c; }
.metric-num.c-vac { color: #1d4ed8; }
.metric-num.c-pe { color: #6d28d9; }
.metric-num.c-cap { color: #0f766e; }
.metric-num.c-ls { color: #166534; }
.ctrl-plain { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 10px 0 8px; }
.ctrl-hint {
  grid-column: 1 / -1; margin: 0;
  font-size: 12.5px; color: #334155; line-height: 1.45;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px;
}
.ctrl-col h4 { margin: 0 0 8px; font-size: 13px; color: #0f172a; }
.ctrl-item { margin: 0 0 8px; font-size: 12.5px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; }
.ctrl-item.is-ok { background: #f0fdf4; color: #14532d; border: 1px solid #bbf7d0; }
.ctrl-item.is-no { background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; }
.ctrl-item strong { display: block; margin-bottom: 2px; }
@media (max-width: 900px) {
  .ctrl-plain { grid-template-columns: 1fr; }
}
.nec { background: #cbd5e1; color: #0f172a; }
.ten { background: #166534; color: #fff; }
.gap { background: #e2e8f0; color: #0f172a; }
.gap-neg { background: #b91c1c; color: #fff; font-weight: 800; }
.gap-pos { background: #15803d; color: #fff; }
.lib { background: #1d4ed8; color: #fff; }
.lsol { background: #1e3a8a; color: #dbeafe; }
.lm { background: #b91c1c; color: #fff; }
.vac { background: #a16207; color: #fff; }
.pcs { background: #334155; color: #fff; }
.baja { background: #7f1d1d; color: #fecaca; }
.row-bad td.sticky-l { box-shadow: inset 3px 0 0 #dc2626; }
.fail { background: #fee2e2 !important; color: #991b1b; font-weight: 800; }
.rules { padding: 2px 4px !important; text-align: left !important; }
.pill { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px; margin: 0 1px 1px 0; }
.pill.ok { background: #d1fae5; color: #065f46; }
.pill.no { background: #fecaca; color: #7f1d1d; }
.pill.na { background: #e2e8f0; color: #475569; }
.foot-help {
  font-size: 11.5px; color: var(--muted); margin: 0;
  padding: 6px 2px 2px;
}
.mini-pat {
  display: inline-block; margin-left: 4px; padding: 0 4px;
  font-size: 9px; font-weight: 700; border-radius: 3px;
  background: #e0f2fe; color: #0369a1;
}
.control-reglas { margin: 0 0 14px; padding: 12px 14px; }
.control-reglas.ctrl-ok { border-left: 4px solid #16a34a; }
.control-reglas.ctrl-bad { border-left: 4px solid #dc2626; }
.ctrl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ctrl-head h3 { margin: 0 0 4px; }
.ctrl-head .muted { margin: 0; }
.ctrl-solo { font-size: 12px; font-weight: 600; color: #334155; white-space: nowrap; }
.ctrl-gen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 8px; }
.ctrl-lab { font-size: 11px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.ctrl-list { max-height: 360px; overflow: auto; border-top: 1px solid #e2e8f0; }
.ctrl-emp { border-bottom: 1px solid #f1f5f9; }
.ctrl-emp summary {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  cursor: pointer; padding: 6px 4px; font-size: 12px; list-style: none;
}
.ctrl-emp summary::-webkit-details-marker { display: none; }
.ctrl-who { font-weight: 700; }
.ctrl-who small { color: #64748b; font-weight: 600; }
.ctrl-emp.is-bad summary { background: #fef2f2; }
.ctrl-emp.is-ok summary { background: #f0fdf4; }
.ctrl-pills { padding: 0 4px 6px; }
.ctrl-fail { margin: 0 8px 6px; font-size: 12px; color: #7f1d1d; }
.control-reglas.solo-no .ctrl-emp.is-ok,
.control-reglas.solo-no .ctrl-emp.is-na { display: none; }
.cfg { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 18px; align-items: start; }
.cfg-nav {
  position: sticky; top: 12px;
  background: linear-gradient(180deg, #071018, #0b1a2e);
  border: 1px solid rgba(56, 189, 248, .16);
  border-radius: 14px;
  padding: 10px 8px 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
}
.cfg-nav-group { margin: 0 0 10px; }
.cfg-nav-group:last-child { margin-bottom: 0; }
.cfg-nav-label {
  display: block; margin: 4px 8px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #7dd3fc;
}
.cfg-nav a {
  display: block; text-decoration: none; color: #cbd5e1;
  padding: 8px 10px; border-radius: 9px; margin-bottom: 3px;
  border: 1px solid transparent;
}
.cfg-nav a:hover { background: rgba(30, 58, 138, .45); color: #fff; }
.cfg-nav a.on {
  background: linear-gradient(90deg, rgba(37, 99, 235, .95), rgba(14, 165, 233, .75));
  color: #fff;
  border-color: rgba(125, 211, 252, .25);
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}
.cfg-nav-title { display: block; font-size: 13px; font-weight: 700; line-height: 1.2; }
.cfg-nav-hint { display: block; margin-top: 2px; font-size: 11px; color: #94a3b8; font-weight: 500; }
.cfg-nav a.on .cfg-nav-hint { color: rgba(255,255,255,.78); }
.cfg-panel { min-width: 0; }
.cfg-panel h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.cfg-hero { margin-bottom: 16px; }
.cfg-kicker {
  margin: 0 0 4px; font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: #0369a1;
}
.cfg-lead { margin: 0; max-width: 72ch; color: #475569; font-size: 13.5px; line-height: 1.5; }
.cfg-legend {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.cfg-legend-txt { font-size: 12px; color: var(--muted); }
.cfg-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.cfg-badge.hard { background: #fee2e2; color: #991b1b; }
.cfg-badge.soft { background: #dbeafe; color: #1e3a8a; }
.cfg-badge.on { background: #dcfce7; color: #166534; }
.cfg-badge.off { background: #f1f5f9; color: #64748b; }
.cfg-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; margin: 0 0 14px;
  border-radius: 12px; border: 1px solid #bae6fd;
  background: linear-gradient(180deg, #f0f9ff, #fff);
  color: #0f172a; font-size: 13px; line-height: 1.45;
}
.cfg-note a { color: #1d4ed8; font-weight: 700; text-decoration: none; }
.cfg-note a:hover { text-decoration: underline; }
.cfg-note-ico {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: #0ea5e9; color: #fff; font-size: 12px; font-weight: 800;
}
.cfg-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.cfg-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cfg-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cfg-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 16px 14px; margin-bottom: 12px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}
.cfg-card > :first-child { margin-top: 0; }
.cfg-card h3 {
  margin: 0 0 4px; font-size: 15px; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cfg-card .hint { margin: 0 0 12px; color: #64748b; font-size: 12.5px; line-height: 1.45; }
.cfg-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.cfg-fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cfg-field label {
  display: block; margin-bottom: 4px;
  font-size: 12px; font-weight: 700; color: #334155;
}
.cfg-field .hint { margin: 4px 0 0; font-size: 11.5px; color: #64748b; line-height: 1.4; }
.cfg-field input, .cfg-field select {
  width: 100%;
}
.cfg-check {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; margin: 0 0 8px;
  border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc;
  cursor: pointer;
}
.cfg-check:hover { border-color: #93c5fd; background: #fff; }
.cfg-check input { margin-top: 3px; accent-color: #2563eb; }
.cfg-check strong { display: block; font-size: 13px; }
.cfg-check small { display: block; margin-top: 2px; color: #64748b; font-size: 12px; line-height: 1.4; }
.cfg-save {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 0 2px;
  background: linear-gradient(180deg, rgba(232,238,246,0), #e8eef6 38%);
}
.cfg-section-title {
  margin: 22px 0 8px; font-size: 13px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: #64748b;
}
.cfg-menu { background: #0f172a; border-radius: 10px; padding: 8px; }
.cfg-menu a { display: block; color: #cbd5e1; text-decoration: none; padding: 7px 10px; border-radius: 6px; margin-bottom: 2px; font-size: 12.5px; }
.cfg-menu a.on, .cfg-menu a:hover { background: #1e3a8a; color: #fff; }
.finde-help {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.finde-help-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finde-help-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.finde-help article {
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.finde-help h4 { margin: 0 0 6px; font-size: 13px; }
.finde-help p { margin: 0; font-size: 12.5px; color: #475569; line-height: 1.45; }
.pol-finde { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.finde-prev { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.finde-prev span {
  font-size: 12px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  padding: 4px 8px;
  background: #f1f5f9;
  color: #0f172a;
}
select.pol { min-width: 220px; }
@media (max-width: 1100px) {
  .finde-help-4, .finde-help-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .finde-help { grid-template-columns: 1fr; }
}
.week { display: flex; flex-wrap: wrap; gap: 4px; }
.daybox { background: #f1f5f9; border-radius: 6px; padding: 4px 7px; font-size: 12px; }

.evitar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 12px 0 8px;
}
.evitar-card {
  display: block;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.evitar-card:hover { border-color: #93c5fd; box-shadow: 0 8px 20px rgba(15, 23, 42, .06); }
.evitar-code {
  display: inline-block; margin-right: 6px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px; font-weight: 700; color: #0f172a;
  background: #f1f5f9; border-radius: 6px; padding: 1px 6px;
}
.evitar-card.on {
  border-color: #dc2626;
  background: linear-gradient(180deg, #fef2f2, #fff);
  box-shadow: 0 0 0 1px rgba(220,38,38,.12);
}
.evitar-head {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 6px;
}
.evitar-head input { margin-top: 3px; }
.semana-ej {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 10px 0;
}
.celda-ej {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 2px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
}
.celda-ej.malo {
  background: #fecaca;
  color: #991b1b;
  box-shadow: inset 0 0 0 1px #f87171;
}
.celda-ej small {
  display: block;
  font-size: 10px;
  font-weight: 700;
}
.evitar-seq {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 10px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 12px;
}
.evitar-seq span {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #0f172a;
}
.evitar-seq .seq-l { background: #dbeafe; color: #1d4ed8; }
.evitar-seq .seq-t { background: #fee2e2; color: #b91c1c; }
.evitar-seq .seq-mid { box-shadow: inset 0 0 0 2px #b91c1c; }
.evitar-seq i { color: #94a3b8; font-style: normal; }
.evitar-wins { display: grid; gap: 8px; margin: 8px 0 4px; }
.evitar-win small { display: block; color: #64748b; font-size: 11px; margin-bottom: 4px; }
.semana-ej-win { grid-template-columns: repeat(4, 1fr); }
  margin-top: 2px;
}
.evitar-opts {
  display: flex; gap: 8px; align-items: center;
}
.evitar-opts select, .evitar-opts input {
  font-size: 12px; padding: 4px 6px;
}
.evitar-opts input { width: 88px; }
.inline { display: inline-flex; gap: 5px; align-items: center; margin-right: 10px; font-size: 12.5px; }
.inline-edit { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.inline-edit input, .inline-edit select { width: auto; }
.inline-edit input[type="time"] { width: 104px; }
.cov-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.cov-tabs a { padding: 7px 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; }
.cov-tabs a.on { color: var(--brand-2); border-bottom-color: var(--brand); }
.cov-drop { display: flex; align-items: center; justify-content: center; min-height: 72px; border: 2px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; cursor: pointer; margin: 8px 0; }
.cov-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.cov-opt { flex-direction: column; align-items: stretch; }
.cov-opt .inline-edit { margin-bottom: 4px; }
.cit-params {
  display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end;
  margin: 8px 0 4px; padding: 8px 10px; background: #f8fafc; border-radius: 8px;
  border: 1px solid var(--line);
}
.cit-params label { margin: 0; font-size: 10px; }
.cit-params input[type="number"] { width: 72px; }
.cit-params-lbl {
  flex: 1 0 100%; font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 2px;
}
.opt-cal { max-width: 420px; }
.opt-cal-head, .opt-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.opt-cal-head span {
  text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 0;
}
.opt-cal-empty { min-height: 44px; }
.opt-cal-day {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  min-height: 48px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; padding: 4px 2px;
  font: inherit; color: inherit;
}
.opt-cal-day b { font-size: 14px; line-height: 1; }
.opt-cal-day small { font-size: 10px; color: var(--muted); }
.opt-cal-day.finde { background: #f8fafc; }
.opt-cal-day:hover { border-color: #93c5fd; background: #eff6ff; }
.opt-cal-day.in { background: #dbeafe; border-color: #93c5fd; }
.opt-cal-day.ini, .opt-cal-day.fin {
  background: #1e3a8a; color: #fff; border-color: #1e3a8a;
}
.opt-cal-day.ini small, .opt-cal-day.fin small { color: #bfdbfe; }
.inline-edit input[type="date"] { min-width: 150px; }
.almanaque-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 8px 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: #64748b;
  text-transform: uppercase;
}
.almanaque {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.alma-dia {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px;
  min-height: 108px;
}
.alma-dia.vacio { background: transparent; border-color: transparent; min-height: 0; }
.alma-dia.tipo-SABADO { background: #fff7ed; }
.alma-dia.tipo-DOMINGO { background: #f5f3ff; }
.alma-dia.tipo-FESTIVO, .alma-dia.fest { background: #fdf2f8; }
.alma-dia.tipo-ESPECIAL { background: #ecfeff; }
.alma-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.alma-dia .num { font-weight: 700; font-size: 16px; }
.alma-dia input, .alma-dia select { margin-top: 3px; font-size: 12px; padding: 3px 5px; }
table.sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: #fff;
}
table.sheet th, table.sheet td {
  border: 1px solid #cbd5e1;
  padding: 5px 8px;
  text-align: left;
  vertical-align: middle;
}
table.sheet th {
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  position: sticky;
  top: 0;
  z-index: 2;
}
table.sheet tbody tr:nth-child(even) { background: #f8fafc; }
table.sheet tr.hueco td { background: #fff1f2; }
table.sheet tr.ok td { background: #f0fdf4; }
table.sheet tr.disp-row { cursor: grab; }
table.sheet tr.dragging { opacity: .45; }
table.sheet tr.turno-row.drop-ok td { outline: 2px solid #2563eb; background: #dbeafe; }
table.sheet .inline-edit select { min-width: 140px; }
.cov-list { max-height: 620px; overflow: auto; }
.cov-turno { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 6px; }
.cov-turno.ok { border-left: 3px solid var(--ok); }
.cov-turno.no { border-left: 3px solid var(--bad); background: #fff7f7; }
.cov-turno-top { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 2px; }
.cov-asig { background: #eff6ff; border-radius: 6px; padding: 4px 7px; margin: 4px 0; font-size: 12.5px; }
.cov-disp { display: flex; justify-content: space-between; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding: 6px 0; }
.cell.HORA { background: #0f172a; color: #fde68a; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 800; }

/* —— Matriz de citaciones —— */
.cit-deck { display: flex; flex-direction: column; gap: 10px; }
.cit-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(165deg, #071018 0%, #0b1a2e 55%, #0a1628 100%);
  border: 1px solid rgba(56, 189, 248, .22);
  box-shadow: 0 10px 28px rgba(2, 8, 20, .16);
}
.cit-filter {
  display: inline-flex; gap: 8px; align-items: center; margin: 0;
}
.cit-filter select {
  width: auto; min-width: 96px; background: rgba(15,23,42,.65); color: #e2e8f0;
  border: 1px solid rgba(148,163,184,.35); border-radius: 7px; padding: 5px 8px;
}
.cit-mtx-search {
  display: inline-flex; gap: 8px; align-items: center; margin: 0;
  flex: 1 1 220px; min-width: 180px; max-width: 360px;
}
.cit-mtx-search input[type="search"] {
  flex: 1; min-width: 0; width: 100%;
  background: rgba(15,23,42,.65); color: #e2e8f0;
  border: 1px solid rgba(148,163,184,.35); border-radius: 7px;
  padding: 6px 10px; font-size: 13px;
}
.cit-mtx-search input[type="search"]::placeholder { color: #94a3b8; }
.cit-mtx-search input[type="search"]:focus {
  outline: none; border-color: rgba(56,189,248,.55);
  box-shadow: 0 0 0 2px rgba(56,189,248,.18);
}
.cit-mtx th.mtx-sort {
  cursor: pointer; user-select: none;
  white-space: nowrap;
}
.cit-mtx th.mtx-sort:hover { color: #7dd3fc; }
.cit-mtx th.mtx-sort.is-sorted { color: #38bdf8; }
.cit-mtx th.mtx-sort .mtx-sort-ind {
  display: inline-block; min-width: 0.9em; font-size: 9px; opacity: .85;
  margin-left: 2px;
}
.cit-legend { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.clg {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
  border: 1px solid rgba(255,255,255,.1);
}
.clg.LIBRE { background: #16a34a; color: #fff; }
.clg.LIBRE_SOLICITADO { background: #15803d; color: #dcfce7; }
.clg.TRABAJO_SOLICITADO { background: #1d4ed8; color: #dbeafe; }
.clg.LM { background: #dc2626; color: #fff; }
.clg.VAC { background: #2563eb; color: #fff; }
.clg.PCS { background: #ea580c; color: #fff; }
.clg.BAJA { background: #7f1d1d; color: #fecaca; }
.clg.CAPACITACION { background: #7c3aed; color: #fff; }
.clg.SINDICAL { background: #0d9488; color: #fff; }
.clg.HORA { background: #334155; color: #e2e8f0; }

.cit-matrix-shell {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: calc(100vh - 260px);
  max-height: calc(100vh - 160px);
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .08), 0 18px 40px rgba(15, 23, 42, .12);
}
.cit-matrix-scroll { flex: 1; min-height: 0; overflow: auto; }
.cit-mtx .sticky-l.ext {
  left: 216px; min-width: 52px; max-width: 52px; width: 52px;
  padding: 0 4px; text-align: center; background: #fff;
  border-right: 1px solid #cbd5e1; z-index: 4;
}
.cit-mtx thead .sticky-l.ext { z-index: 8; background: #0f172a; color: #7dd3fc; }
.cit-mtx .sticky-l.n { min-width: 48px; width: 48px; }
.cit-mtx .sticky-l.name {
  left: 48px; min-width: 168px; max-width: 168px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 600; padding: 0 8px; line-height: 34px; height: 34px;
}
.cit-mtx thead .sticky-l.name { left: 48px; }
.cit-mtx .dcol { min-width: 56px; width: 56px; }
.cit-mtx .cell {
  height: 34px; line-height: 1.15; white-space: pre-line;
  font-size: 11px; padding: 3px 2px; overflow: hidden; vertical-align: middle;
}
.cit-mtx .cell.HORA {
  background: #0f172a !important; color: #fde68a !important; font-weight: 800;
  font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0;
}
.cit-mtx .cell.TRABAJA { background: #15803d !important; color: #fff !important; }
.cit-mtx .cell.LIBRE { background: #16a34a !important; color: #fff !important; font-weight: 800; }
.cit-mtx .cell.LIBRE_SOLICITADO { background: #15803d !important; color: #dcfce7 !important; font-weight: 800; }
.cit-mtx .cell.TRABAJO_SOLICITADO { background: #1d4ed8 !important; color: #dbeafe !important; font-weight: 800; }
.cit-mtx .cell.LM { background: #dc2626 !important; color: #fff !important; font-weight: 800; }
.cit-mtx .cell.VAC { background: #2563eb !important; color: #fff !important; font-weight: 800; }
.cit-mtx .cell.PCS { background: #ea580c !important; color: #fff !important; font-weight: 800; }
.cit-mtx .cell.BAJA { background: #7f1d1d !important; color: #fecaca !important; font-weight: 800; }
.cit-mtx .cell.CAPACITACION { background: #7c3aed !important; color: #fff !important; font-weight: 800; }
.cit-mtx .cell.SINDICAL { background: #0d9488 !important; color: #fff !important; font-weight: 800; }
.cit-mtx tbody tr:nth-child(even):not(.ghead) td.sticky-l { background: #f8fafc; }
.cit-mtx tbody tr:hover:not(.ghead) td.sticky-l { background: #eef6ff; }
.cit-mtx .ext-badge {
  display: inline-block; font-family: "IBM Plex Mono", monospace;
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px;
  background: #e0f2fe; color: #0369a1;
}
.cit-ghead .sticky-l {
  background: linear-gradient(90deg, #0c4a6e, #0f172a) !important;
  color: #f8fafc; font-weight: 700; padding: 6px 10px; white-space: nowrap;
  box-shadow: inset 3px 0 0 #38bdf8;
}
.cit-ghead td.dcol { background: #0f172a; border-bottom: 1px solid rgba(56,189,248,.2); }
.cov-resumen td, .cov-resumen th { padding: 4px 6px; text-align: center; }
.cov-resumen .sticky-l { text-align: left; min-width: 140px; padding: 4px 8px; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.back { font-size: 12px; color: var(--brand-2); text-decoration: none; font-weight: 600; }
.back:hover { text-decoration: underline; }

/* UG + vigencia + versiones + histórico */
.ug-switch {
  margin: 0 12px 10px; padding: 8px 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
}
.ug-switch label {
  display: block; font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; color: #94a3b8; margin-bottom: 4px;
}
.ug-switch select {
  width: 100%; background: #0f172a; color: #e2e8f0;
  border: 1px solid #334155; border-radius: 6px; padding: 6px 8px; font-size: 13px;
}
.ug-switch a.ug-crud-link {
  display: block; margin-top: 6px; font-size: 11px; color: #7dd3fc; text-decoration: none;
}
.ug-switch a.ug-crud-link:hover { text-decoration: underline; }
.vig-bands { display: flex; flex-wrap: wrap; gap: 8px; }
.vig-band {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; min-width: 180px;
  background: linear-gradient(145deg, #f0f9ff, #fff);
  border: 1px solid #bae6fd; border-left: 3px solid #0284c7; border-radius: 8px;
  font-size: 13px;
}
.vig-import { align-items: end; flex-wrap: wrap; }
.hist-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px;
}
.hist-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px; text-decoration: none; color: inherit;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.hist-card:hover { border-color: #38bdf8; box-shadow: 0 4px 14px rgba(14,165,233,.12); transform: translateY(-1px); }
.hist-card.on { border-color: #0284c7; background: #e0f2fe; }
.ver-tree { display: flex; flex-direction: column; gap: 8px; }
.ver-node {
  padding: 10px 12px; border-radius: 8px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-left: 3px solid #94a3b8;
}
.ver-node.vigente {
  border-left-color: #16a34a;
  background: linear-gradient(90deg, #f0fdf4, #fff);
  box-shadow: 0 0 0 1px rgba(22,163,74,.15);
}
.ver-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.ver-kpis { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: #475569; margin-top: 4px; }

/* Árbol mes → última → Original → semanas */
.mes-hub-bar {
  display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end;
  margin-bottom: 8px;
}
.mes-hub-hint { margin: 0 0 14px; }
.mes-tree-list { display: flex; flex-direction: column; gap: 6px; }
.mes-tree {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.mes-tree[open] { border-color: #94a3b8; box-shadow: 0 2px 10px rgba(15,23,42,.06); }
.mes-tree-sum {
  list-style: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  background: #f8fafc;
}
.mes-tree-sum::-webkit-details-marker { display: none; }
.mes-tree-sum::before {
  content: "▸";
  color: #64748b;
  font-size: 12px;
  transition: transform .15s;
}
.mes-tree[open] > .mes-tree-sum::before { transform: rotate(90deg); }
.mes-tree-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  min-width: 7rem;
}
.mes-tree-body {
  padding: 8px 14px 14px;
  border-top: 1px solid #e2e8f0;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 13px;
}
.mes-tree-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 4px 0;
}
.mes-tree-ultima { margin-bottom: 6px; }
.mes-tree-empty { margin: 6px 0; font-family: inherit; }
.link-tree {
  background: none; border: none; padding: 0;
  color: #0369a1; cursor: pointer; text-align: left;
  font: inherit; text-decoration: underline;
  text-underline-offset: 2px;
}
.link-tree:hover { color: #0c4a6e; }
.link-tree.is-vigente { color: #166534; font-weight: 600; }
.link-tree:disabled { color: #94a3b8; cursor: not-allowed; text-decoration: none; }
.alma-pro .almanaque { gap: 6px; }
.pill.ok { background: #dcfce7; color: #166534; }
.row-muted td { opacity: .72; }

/* —— Centro de mando (Inicio) —— */
.hub {
  --hub-ink: #e8f1ff;
  --hub-muted: #8ba3c7;
  --hub-line: rgba(125, 211, 252, 0.18);
  position: relative;
  margin: -18px -20px -24px;
  padding: 28px 28px 40px;
  min-height: calc(100vh - 24px);
  overflow: hidden;
  color: var(--hub-ink);
  background:
    radial-gradient(1200px 500px at 12% -10%, rgba(14, 165, 233, 0.22), transparent 55%),
    radial-gradient(900px 420px at 92% 8%, rgba(34, 211, 238, 0.12), transparent 50%),
    linear-gradient(165deg, #061018 0%, #0a1628 42%, #0c1b33 100%);
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}
.hub-net {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: 0.55;
}
.hub-glow {
  position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none;
}
.hub-glow-a {
  width: 280px; height: 280px; top: 8%; right: 12%;
  background: rgba(14, 165, 233, 0.2);
  animation: hubFloat 9s ease-in-out infinite;
}
.hub-glow-b {
  width: 220px; height: 220px; bottom: 12%; left: 8%;
  background: rgba(56, 189, 248, 0.12);
  animation: hubFloat 11s ease-in-out infinite reverse;
}
@keyframes hubFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(18px, -14px); }
}
.hub-hero {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px;
  align-items: stretch; margin-bottom: 22px;
}
.hub-kicker {
  margin: 0 0 10px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: #7dd3fc; font-family: "IBM Plex Mono", monospace;
}
.hub-brand {
  margin: 0 0 12px; line-height: 1.02;
}
.hub-brand img {
  display: block; width: min(100%, 360px); height: auto;
  border-radius: 10px;
}
.hub-brand span {
  display: block; font-weight: 500; color: #7dd3fc;
  font-size: 1.15rem; letter-spacing: 0.04em; margin-top: 8px;
}
.hub-lead {
  margin: 0 0 18px; max-width: 46ch; color: var(--hub-muted); font-size: 15px; line-height: 1.55;
}
.hub-cta { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border: none !important; color: #fff !important;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
}
.hub-btn-ghost {
  background: rgba(15, 23, 42, 0.45) !important;
  border: 1px solid var(--hub-line) !important;
  color: #e2e8f0 !important;
}
.hub-btn-ghost:hover { border-color: rgba(56, 189, 248, 0.5) !important; }
.hub-hero-panel {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: rgba(8, 18, 32, 0.72);
  border: 1px solid var(--hub-line);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(125, 211, 252, 0.08);
  animation: hubIn 0.7s ease both;
}
.hub-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: #86efac; margin-bottom: 14px; font-family: "IBM Plex Mono", monospace;
}
.hub-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: hubPulse 1.8s ease-out infinite;
}
@keyframes hubPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.hub-live {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0;
}
.hub-live dt {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: #64748b; margin: 0 0 2px; font-family: "IBM Plex Mono", monospace;
}
.hub-live dd { margin: 0; font-size: 14px; font-weight: 600; color: #f1f5f9; }
.hub-period-chips { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.hub-period-chips .chip {
  background: rgba(15, 23, 42, 0.6); border-color: rgba(148, 163, 184, 0.25); color: #cbd5e1;
}
.hub-period-chips .chip.on {
  background: linear-gradient(135deg, #0ea5e9, #0284c7); border-color: transparent; color: #fff;
}

.hub-kpis {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  margin-bottom: 28px;
}
.hub-kpi {
  padding: 14px 12px; border-radius: 12px;
  background: rgba(8, 18, 32, 0.65);
  border: 1px solid var(--hub-line);
  animation: hubIn 0.55s ease both;
  animation-delay: calc(var(--d) * 0.06s);
}
.hub-kpi span {
  display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: #7dd3fc; font-family: "IBM Plex Mono", monospace; margin-bottom: 4px;
}
.hub-kpi b { display: block; font-size: 1.65rem; font-weight: 700; color: #f8fafc; line-height: 1.1; }
.hub-kpi small { color: var(--hub-muted); font-size: 11px; }
@keyframes hubIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.hub-section { position: relative; z-index: 1; margin-bottom: 26px; }
.hub-sec-head { margin-bottom: 14px; }
.hub-sec-head h2, .hub-panel h2, .hub-foot h2 {
  margin: 0 0 6px; font-size: 1.25rem; font-weight: 650; color: #f8fafc;
}
.hub-sec-head p, .hub-muted { margin: 0; color: var(--hub-muted); font-size: 13.5px; }
.hub-flow {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
}
.hub-flow li {
  animation: hubIn 0.55s ease both;
  animation-delay: calc(var(--i) * 0.07s);
}
.hub-flow a {
  display: block; height: 100%; text-decoration: none; color: inherit;
  padding: 14px 12px; border-radius: 14px;
  background: rgba(8, 18, 32, 0.7);
  border: 1px solid var(--hub-line);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.hub-flow a:hover {
  border-color: rgba(56, 189, 248, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(2, 12, 28, 0.35);
}
.hub-step {
  display: inline-block; margin-bottom: 8px;
  font-family: "IBM Plex Mono", monospace; font-size: 11px; color: #38bdf8; letter-spacing: .08em;
}
.hub-flow strong { display: block; margin-bottom: 6px; font-size: 14px; color: #f1f5f9; }
.hub-flow p { margin: 0; font-size: 12px; line-height: 1.4; color: var(--hub-muted); }

.hub-grid-2 {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 14px;
}
.hub-panel {
  padding: 18px; border-radius: 16px;
  background: rgba(8, 18, 32, 0.7);
  border: 1px solid var(--hub-line);
}
.hub-engine { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hub-engine li { display: flex; gap: 12px; align-items: flex-start; }
.hub-engine strong { display: block; color: #f1f5f9; font-size: 13.5px; margin-bottom: 2px; }
.hub-engine p { margin: 0; font-size: 12.5px; color: var(--hub-muted); line-height: 1.4; }
.hub-tag {
  flex-shrink: 0; min-width: 54px; text-align: center;
  font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 600;
  padding: 5px 7px; border-radius: 6px;
  background: rgba(14, 165, 233, 0.18); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.25);
}
.hub-tag.soft { background: rgba(34, 197, 94, 0.12); color: #86efac; border-color: rgba(34, 197, 94, 0.25); }
.hub-tag.graph { background: rgba(251, 146, 60, 0.12); color: #fdba74; border-color: rgba(251, 146, 60, 0.25); }
.hub-tag.ver { background: rgba(125, 211, 252, 0.1); color: #bae6fd; border-color: rgba(125, 211, 252, 0.25); }

.hub-mods {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px;
}
.hub-mod {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 10px; row-gap: 1px; align-items: center;
  text-decoration: none; color: inherit;
  padding: 11px 12px; border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  transition: border-color .15s, background .15s, transform .15s;
}
.hub-mod:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.1);
  transform: translateY(-1px);
}
.hub-mod i {
  grid-row: 1 / span 2; font-style: normal; font-size: 16px; color: #38bdf8;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; background: rgba(14, 165, 233, 0.12);
}
.hub-mod span { font-weight: 600; font-size: 13px; color: #f1f5f9; }
.hub-mod small { color: var(--hub-muted); font-size: 11px; }

.hub-foot {
  display: flex; justify-content: space-between; align-items: end; gap: 16px;
  padding-top: 8px; border-top: 1px solid rgba(125, 211, 252, 0.12);
}
.hub-cierres { margin: 10px 0 0; padding: 0; list-style: none; color: var(--hub-muted); font-size: 12.5px; }
.hub-cierres li { margin-bottom: 4px; }
.hub-cierres a { color: #7dd3fc; text-decoration: none; }
.hub-cierres a:hover { text-decoration: underline; }

@media (max-width: 1100px) {
  .hub-hero, .hub-grid-2, .hub-flow, .hub-kpis { grid-template-columns: 1fr 1fr; }
  .hub-flow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .hub { margin: -12px -12px -16px; padding: 18px 14px 28px; }
  .hub-hero, .hub-grid-2, .hub-flow, .hub-kpis, .hub-mods, .hub-live { grid-template-columns: 1fr; }
  .hub-foot { flex-direction: column; align-items: stretch; }
}

@media (max-width: 1100px) {
  .cov-grid, .split-2, .cards, .form-grid, .cfg, .cfg-grid-2, .cfg-grid-3, .cfg-fields, .cfg-fields-3 { grid-template-columns: 1fr; }
  .cfg-nav { position: static; }
  .sidebar { width: 64px; }
  .brand-text, .nav-sep span, .nt { display: none; }
  .nav a { justify-content: center; padding: 9px 0; }
  .brand { justify-content: center; }
}

/* —— Login cinematográfico (presentación) —— */
body.login-body {
  margin: 0;
  min-height: 100vh;
  background: #03070f url("/static/img/login-poster.jpg") center / cover no-repeat;
  color: #e8f1ff;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  overflow: hidden;
}
.login-stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.login-net {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 0;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  background: #03070f;
}
.login-vignette {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3,7,15,.78) 0%, rgba(3,7,15,.38) 36%, rgba(3,7,15,.08) 62%, rgba(3,7,15,.22) 100%),
    linear-gradient(180deg, rgba(3,7,15,.35) 0%, transparent 24%, transparent 72%, rgba(3,7,15,.7) 100%);
}
.login-top {
  position: relative; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px 0;
}
.login-brand-mini {
  display: flex; align-items: center;
}
.login-brand-mini img {
  display: block; height: 44px; width: auto;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(2, 8, 20, .45);
}
.login-live {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #86efac;
}
.login-live i {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.5);
  animation: hubPulse 1.8s ease-out infinite;
}
.login-hero {
  position: relative; z-index: 3;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 7vw 48px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.login-panel {
  width: min(100%, 380px);
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: rgba(8, 18, 32, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.22);
  backdrop-filter: blur(16px);
  box-shadow:
    0 24px 60px rgba(2, 8, 20, .45),
    inset 0 1px 0 rgba(186, 230, 253, .12);
}
.login-panel-head { margin-bottom: 14px; }
.login-panel-logo {
  display: block; width: min(100%, 220px); height: auto;
  margin-bottom: 10px; border-radius: 8px;
}
.login-panel-head strong {
  display: block;
  font-size: 18px; color: #f8fafc; font-weight: 600;
}
.login-panel label {
  display: block; margin: 0 0 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: #94a3b8;
}
.login-panel input {
  margin-top: 6px;
  width: 100%;
  background: rgba(2, 8, 20, .55);
  border: 1px solid rgba(125, 211, 252, .22);
  color: #f8fafc;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
}
.login-panel input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56,189,248,.18);
}
.login-go {
  width: 100%;
  margin-top: 6px;
  text-align: center;
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border: none !important;
  box-shadow: 0 10px 28px rgba(14,165,233,.38);
  font-weight: 700;
  letter-spacing: .04em;
}
.login-hint {
  margin: 14px 0 0;
  font-size: 11px;
  color: #64748b;
  text-align: center;
}
.login-panel .flash {
  margin-bottom: 12px;
  border-radius: 10px;
}
@media (max-width: 900px) {
  body.login-body { overflow: auto; }
  .login-hero { padding: 20px 22px 36px; }
  .login-panel { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  video.login-net { visibility: hidden; }
}

/* Equilibrio de plantilla por extremo */
.eq-nomina { margin: 0 0 14px; }
.eq-estados-tot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.eq-st {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 7px; border-radius: 99px; background: #e2e8f0; color: #334155;
}
.eq-st.st-TRABAJA, .eq-st.st-ACTIVO { background: #dcfce7; color: #166534; }
.eq-st.st-LIBRE, .eq-st.st-LIBRE_SOLICITADO { background: #e2e8f0; color: #475569; }
.eq-st.st-TRABAJO_SOLICITADO { background: #dbeafe; color: #1e40af; }
.eq-st.st-LM { background: #fee2e2; color: #991b1b; }
.eq-st.st-VAC { background: #fef3c7; color: #92400e; }
.eq-st.st-PCS, .eq-st.st-PERMISO { background: #ede9fe; color: #5b21b6; }
.eq-st.st-BAJA, .eq-st.st-INACTIVO { background: #334155; color: #f8fafc; }
.eq-st.st-SINDICAL, .eq-st.st-CAPACITACION { background: #e0f2fe; color: #075985; }
.eq-table td, .eq-table th { font-size: 12px; white-space: nowrap; }
.eq-est-cell { white-space: normal !important; min-width: 140px; }
.eq-cell-bad { color: #991b1b; font-weight: 800; background: #fef2f2; }
.eq-cell-warn { color: #92400e; font-weight: 700; background: #fffbeb; }
.eq-cell-ok { color: #166534; font-weight: 700; }
tr.eq-bad td { background: #fff7f7; }
tr.eq-warn td { background: #fffdf5; }
tr.eq-ok td { background: #f8fff9; }
tr.eq-pool td { background: #f8fafc; }
tr.eq-ver td {
  font-size: 11px; color: #475569; font-weight: 500; white-space: normal;
  padding-top: 0; border-top: 0; background: inherit;
}
.eq-bars { width: 120px; display: flex; flex-direction: column; gap: 3px; }
.eq-bars i { display: block; height: 6px; border-radius: 3px; background: #cbd5e1; }
.eq-bars i.nec { background: #b91c1c; }
.eq-bars i.neto { background: #2563eb; }
.eq-bars i.obj { background: #0d9488; }
.eq-legend { margin: 8px 0 0; }
.eq-leg { display: inline-block; width: 12px; height: 8px; border-radius: 2px; vertical-align: middle; margin: 0 2px 0 8px; }
.eq-leg.nec { background: #b91c1c; }
.eq-leg.neto { background: #2563eb; }
.eq-leg.obj { background: #0d9488; }
.eq-fase-peak { border-left: 4px solid #b91c1c; }
.eq-move { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: #fff; }
.eq-move-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eq-move p { margin: 6px 0; font-size: 13px; }
.eq-cands { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.eq-cand { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.eq-cand input { margin: 0; }

/* Encadenar ventana publicada (planificador) */
.chain-card { margin: 0 0 14px; border-left: 4px solid #0d9488; }
.chain-card h3 { margin: 0 0 6px; }
.chain-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-top: 10px;
}
@media (max-width: 960px) {
  .chain-grid { grid-template-columns: 1fr; }
}
.chain-block {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.chain-block strong { display: block; margin-bottom: 4px; }
.chain-block .toolbar { margin-top: 8px; flex-wrap: wrap; gap: 8px; align-items: end; }
.reopt-box {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 4px 8px; background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 8px;
}
.reopt-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.reopt-label input[type=date] { font: inherit; }

.hp-impacto {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 8px;
  background: #f8fafc; border: 1px solid #e2e8f0; font-size: 13px;
}
.hp-impacto.crit { background: #fff7ed; border-color: #fdba74; }
.hp-impacto .hp-critico { color: #9a3412; font-weight: 700; margin: 0 0 6px; }
.hp-impacto .hp-aviso { color: #9a3412; margin: 0 0 6px; }
.hp-impacto .hp-ok { color: #166534; margin: 0 0 6px; }
.hp-impacto .hp-info { color: #334155; margin: 0 0 6px; }
.hp-gap { width: 100%; margin-top: 8px; font-size: 12px; }
.hp-gap th, .hp-gap td { padding: 4px 6px; text-align: left; }
.hp-gap tr.orig td { font-weight: 700; }
.hp-gap tr.dest td { background: #fff7ed; }

/* Asistente de operación */
.vl-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 120;
  width: 56px; height: 56px; padding: 0; border-radius: 18px; border: 0; cursor: pointer;
  background: linear-gradient(165deg, #071018 0%, #0b1a2e 100%);
  box-shadow: 0 10px 28px rgba(14, 165, 233, .35), 0 0 0 1px rgba(125, 211, 252, .28);
  display: flex; align-items: center; justify-content: center;
}
.vl-fab img { width: 36px; height: 36px; display: block; }
.vl-fab:hover { filter: brightness(1.12); transform: translateY(-1px); }
.vl-chat {
  position: fixed; right: 18px; bottom: 84px; z-index: 121;
  width: min(420px, calc(100vw - 24px)); height: min(580px, calc(100vh - 110px));
  display: flex; flex-direction: column;
  background: #0b1628; color: #e2e8f0; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(125, 211, 252, .28);
  box-shadow: 0 22px 50px rgba(2, 8, 23, .45);
}
.vl-chat[hidden] { display: none !important; }
.vl-chat-h {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.vl-chat-logo { width: 32px; height: 32px; flex-shrink: 0; }
.vl-chat-h strong { font-size: 13px; letter-spacing: .02em; }
.vl-chat-h small { display: block; color: #7dd3fc; font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.vl-chat-h .vl-x {
  margin-left: auto; border: 0; background: transparent; color: #94a3b8; cursor: pointer; font-size: 18px;
}
.vl-msgs { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.vl-row { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.vl-row.bot { align-self: flex-start; }
.vl-row.yo { align-self: flex-end; flex-direction: row-reverse; }
.vl-ava { width: 22px; height: 22px; flex-shrink: 0; margin-bottom: 2px; }
.vl-burbuja { max-width: 88%; padding: 9px 11px; border-radius: 14px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.vl-row.bot .vl-burbuja { background: #132238; border: 1px solid rgba(125, 211, 252, .16); border-bottom-left-radius: 4px; }
.vl-row.yo .vl-burbuja { background: #1d4ed8; color: #fff; border-bottom-right-radius: 4px; }
.vl-wait span {
  display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%;
  background: #7dd3fc; animation: vl-dot 1s infinite ease-in-out;
}
.vl-wait span:nth-child(2) { animation-delay: .15s; }
.vl-wait span:nth-child(3) { animation-delay: .3s; }
@keyframes vl-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.nav .ni-mark { display: inline-flex; align-items: center; justify-content: center; }
.nav .ni-mark img { width: 16px; height: 16px; display: block; }
.vl-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(148, 163, 184, .18); }
.vl-form textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 90px; border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, .25); background: #0a1220; color: #f8fafc;
  font: inherit; padding: 8px 10px;
}
.vl-form button {
  border: 0; border-radius: 10px; padding: 0 14px; cursor: pointer; font-weight: 700;
  background: #38bdf8; color: #0b1220;
}
.vl-form button:disabled { opacity: .5; cursor: wait; }
.vl-sugs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.vl-sugs button {
  border: 1px solid rgba(125, 211, 252, .25); background: transpar