/* NEXO Suite Demo — tipografía formal corporativa (IBM Plex + Source Serif) */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&display=swap');

:root {
  --navy-dark: #1A1D21;
  --navy: #3A3F47;
  --gray: #6B7280;
  --silver: #C5CAD1;
  --gold: #00B8A9;
  --gold-hover: #009E90;
  --gold-text: #008A7F;
  --gold-rgb: 0, 184, 169;
  --accent-2: #5B8DEF;
  --accent-2-rgb: 91, 141, 239;
  --btn-on-gold: #1A1D21;
  --navy-dark-rgb: 26, 29, 33;
  --navy-rgb: 58, 63, 71;
  --white: #ffffff;
  --bg-light: #F3F4F6;
  --bg: #F3F4F6;
  --surface: #ffffff;
  --line: #D1D5DB;
  --text: #1A1D21;
  --muted: #6B7280;
  --ok: #16875c;
  --warn: #b7791f;
  --err: #c53030;
  --info: #5B8DEF;
  --sidebar-w: 268px;
  --sidebar-c: 78px;
  --top-h: 58px;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(26, 29, 33, 0.12);
  /* UI institucional + títulos de informe + cifras tabulares */
  --font: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --display: 'Source Serif 4', 'Georgia', 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --leading: 1.55;
  --tracking-label: 0.06em;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--text-md);
  font-weight: 400;
  line-height: var(--leading);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* —— Login —— */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--navy-dark);
  color: var(--white);
}
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; } }
.login-hero {
  position: relative;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(13,27,42,.35), rgba(13,27,42,.92)),
    url('https://images.unsplash.com/photo-1503387762-592deb58ef4e?w=1400&q=80') center/cover;
}
.login-hero h1 {
  font-family: var(--display);
  font-size: clamp(1.85rem, 3.6vw, 2.85rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  max-width: 16ch;
}
.login-hero p { margin: 0; max-width: 42ch; color: rgba(255,255,255,.72); line-height: 1.6; font-weight: 400; }
.login-brand { position: absolute; top: 40px; left: 48px; display: flex; gap: 12px; align-items: center; }
.login-mark {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--gold); color: var(--navy-dark);
  display: grid; place-items: center; font-family: var(--font); font-weight: 700;
  letter-spacing: 0.02em;
}
.login-panel {
  display: grid; place-items: center; padding: 32px;
  background: linear-gradient(160deg, #122536, #0d1b2a);
}
.login-card { width: min(400px, 100%); }
.login-card h2 {
  font-family: var(--display); font-weight: 600; letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.login-card > p { color: rgba(255,255,255,.6); margin: 0 0 20px; font-size: var(--text-sm); line-height: 1.55; }
.login-error {
  display: none; background: rgba(197,48,48,.2); border: 1px solid rgba(197,48,48,.45);
  padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; color: #fecaca; font-size: var(--text-sm);
}
.login-error.on { display: block; }
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: var(--text-xs); font-weight: 600;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  margin-bottom: 6px; opacity: .72; font-family: var(--font);
}
.field input, .field select, .field textarea,
.input, .select {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.07); color: #fff;
}
.app-page .field input, .app-page .field select, .app-page .field textarea,
.app-page .input, .app-page .select {
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
.profiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.profile-btn {
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.05);
  color: #fff; border-radius: 10px; padding: 10px; cursor: pointer; text-align: left; font-size: .85rem;
}
.profile-btn:hover, .profile-btn.active { border-color: var(--gold); background: rgba(201,162,39,.15); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 8px; padding: 11px 18px;
  font-family: var(--font); font-weight: 600; font-size: var(--text-sm);
  letter-spacing: 0.01em; cursor: pointer;
}
.btn-gold { background: var(--gold); color: var(--navy-dark); width: 100%; }
.btn-gold:hover { background: var(--gold-hover); }
.btn-navy { background: var(--navy-dark); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-sm { padding: 8px 12px; font-size: .85rem; }
.btn-danger { background: #fee2e2; color: var(--err); }
.login-meta { margin-top: 16px; font-size: .8rem; color: rgba(255,255,255,.45); line-height: 1.5; }
.login-meta a { color: var(--gold); }

/* —— App shell —— */
.app-page { min-height: 100vh; }
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
}
.app-shell.collapsed { grid-template-columns: var(--sidebar-c) 1fr; }
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; transform: translateX(-110%); transition: .25s; width: var(--sidebar-w); }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
  .sidebar-backdrop.on { display: block; }
}

.sidebar {
  background: var(--navy-dark); color: #fff;
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); min-height: var(--top-h);
}
.sidebar-head .login-mark { width: 34px; height: 34px; font-size: .85rem; }
.sidebar-head strong {
  font-family: var(--font); font-size: 0.9375rem; font-weight: 600;
  display: block; line-height: 1.2; letter-spacing: 0.01em;
}
.sidebar-head small {
  font-family: var(--font); font-size: 0.625rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; opacity: .5;
}
.app-shell.collapsed .sidebar-head span:not(.login-mark) { display: none; }
.sidebar-env {
  margin: 10px 12px; padding: 8px 10px; border-radius: 8px;
  background: rgba(201,162,39,.12); border: 1px solid rgba(201,162,39,.3);
  font-size: .72rem; color: var(--gold); text-align: center;
}
.app-shell.collapsed .sidebar-env { font-size: 0; padding: 6px; }
.app-shell.collapsed .sidebar-env::before { content: 'DEMO'; font-size: .65rem; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px; }
.nav-group { margin-bottom: 6px; }
.nav-group-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; color: rgba(255,255,255,.68);
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  font-family: var(--font); font-weight: 500; font-size: var(--text-sm);
  text-align: left; letter-spacing: 0.005em;
}
.nav-group-btn:hover, .nav-group-btn.active { background: rgba(255,255,255,.08); color: #fff; }
.nav-group-btn.active-parent { color: var(--gold); }
.nav-ico { width: 22px; text-align: center; opacity: .85; flex-shrink: 0; }
.app-shell.collapsed .nav-label, .app-shell.collapsed .nav-chevron { display: none; }
.nav-sub { display: none; padding-left: 12px; }
.nav-group.open .nav-sub { display: block; }
.nav-sub a {
  display: block; padding: 7px 12px 7px 34px; border-radius: 6px;
  font-size: var(--text-sm); font-weight: 400; color: rgba(255,255,255,.52);
  letter-spacing: 0.01em;
}
.nav-sub a:hover, .nav-sub a.active { background: rgba(201,162,39,.15); color: var(--gold); }
.app-shell.collapsed .nav-sub { display: none !important; }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.collapse-btn {
  width: 100%; background: rgba(255,255,255,.06); border: none; color: #fff;
  padding: 10px; border-radius: 8px; cursor: pointer; font-size: .8rem;
}

.main-col { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar {
  height: var(--top-h); background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 16px; position: sticky; top: 0; z-index: 40;
}
.topbar-menu { display: none; border: none; background: transparent; font-size: 1.3rem; cursor: pointer; }
@media (max-width: 960px) { .topbar-menu { display: inline-flex; } }
.breadcrumb {
  font-size: var(--text-xs); font-weight: 500; color: var(--muted);
  letter-spacing: 0.02em; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 160px;
}
.top-title {
  font-family: var(--font); font-weight: 600; font-size: var(--text-md);
  letter-spacing: -0.01em; margin-right: auto;
}
.top-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.top-filters select, .top-filters input {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; font-size: .82rem; max-width: 140px;
}
.top-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; position: relative;
}
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px; background: var(--err); color: #fff;
  font-size: .65rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 4px;
}
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: .8rem;
}
.user-av {
  width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: .7rem; font-weight: 700;
}

.content { padding: 20px; flex: 1; }
.page-head {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px;
}
.page-head h1 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 6px;
  color: var(--navy-dark);
}
.page-head p {
  margin: 0; color: var(--muted); font-size: var(--text-sm);
  line-height: 1.55; font-weight: 400; max-width: 62ch;
}
.section-head {
  margin: 8px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--navy-dark);
}
.section-head p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.45;
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; position: relative; overflow: hidden;
}
.kpi.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.kpi.clickable:hover { border-color: var(--gold); transform: translateY(-1px); }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.kpi.ok::before { background: var(--ok); }
.kpi.warn::before { background: var(--warn); }
.kpi.err::before { background: var(--err); }
.kpi-label {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font);
}
.kpi-value {
  font-family: var(--mono);
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  line-height: 1.2;
  color: var(--navy-dark);
}
.kpi-unit {
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.kpi-sub { font-size: var(--text-xs); color: var(--muted); margin-top: 4px; line-height: 1.4; font-weight: 400; }
.kpi.has-tip { cursor: help; }
.kpi.has-tip:hover, .kpi.has-tip:focus-visible {
  border-color: rgba(var(--gold-rgb), .55);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .12);
}
.tip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); opacity: .7; flex-shrink: 0;
}

.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; margin-bottom: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 1000px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.card h3 {
  margin: 0 0 12px;
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--navy-dark);
}
.card-chart {
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.card-chart h3 { flex-shrink: 0; }
.chart-wrap {
  position: relative;
  width: 100%;
  height: 260px !important;
  flex: 1 1 auto;
  min-height: 220px;
  background: #fafbfc;
  border-radius: 8px;
}
.chart-wrap--sm { height: 200px !important; min-height: 180px; }
.chart-wrap--tall { height: 320px !important; min-height: 280px; }
.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  max-height: none !important;
}
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.charts-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 1000px) {
  .charts-grid, .charts-grid-3 { grid-template-columns: 1fr; }
  .chart-wrap--tall { height: 260px; }
}

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-family: var(--font); }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th {
  background: #f4f7fa; font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: var(--tracking-label); color: var(--muted); font-weight: 600;
  position: sticky; top: 0; font-family: var(--font);
}
table.data tr:hover td { background: rgba(var(--gold-rgb), .06); }
table.data tr.clickable { cursor: pointer; }
table.data td.num, table.data th.num,
table.data .num {
  text-align: right;
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.01em;
  color: var(--navy-dark);
}
table.data td.date {
  font-family: var(--mono);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}
table.data td.pct {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
}
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .84rem; font-weight: 500; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 4px; font-size: var(--text-xs);
  font-weight: 600; letter-spacing: 0.02em; font-family: var(--font);
}
.pill-ok { background: #e6f6ef; color: #0f6848; }
.pill-warn { background: #fef3c7; color: #92400e; }
.pill-err { background: #fee2e2; color: #9b1c1c; }
.pill-info { background: #e0f2fe; color: #075985; }
.pill-neutral { background: #eef2f6; color: #475569; }

.alert-item {
  display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px;
  border-left: 3px solid; background: #fff; cursor: pointer; border: 1px solid var(--line); border-left-width: 3px;
}
.alert-item.critical { border-left-color: var(--err); }
.alert-item.warning { border-left-color: var(--warn); }
.alert-item.info { border-left-color: var(--info); }
.alert-item strong { display: block; font-size: .88rem; }
.alert-item span { font-size: .78rem; color: var(--muted); }

.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius); background: #fff;
}

/* Modal / drawer */
.overlay {
  position: fixed; inset: 0; background: rgba(13,27,42,.45); z-index: 100;
  display: none; align-items: stretch; justify-content: flex-end;
}
.overlay.on { display: flex; }
.drawer {
  width: min(480px, 100%); background: #fff; height: 100%; overflow: auto;
  box-shadow: var(--shadow); padding: 20px; animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 12px; }
.drawer-head h2 {
  font-family: var(--display); font-size: 1.2rem; font-weight: 600;
  letter-spacing: -0.015em; margin: 0; line-height: 1.3;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 500px) { .form-grid { grid-template-columns: 1fr; } }
.drawer-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  background: var(--navy-dark); color: #fff; padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: .2s; max-width: 340px; font-weight: 600;
}
.toast.on { opacity: 1; transform: none; }
.toast.err { background: var(--err); }

/* Tour */
.tour-panel {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 150; background: var(--navy-dark); color: #fff; border-radius: 16px;
  padding: 16px 18px; width: min(520px, calc(100% - 32px)); box-shadow: var(--shadow);
  display: none;
}
.tour-panel.on { display: block; }
.tour-panel h4 {
  margin: 0 0 6px; font-family: var(--display); font-weight: 600;
  letter-spacing: -0.01em; font-size: 1.05rem;
}
.tour-panel p { margin: 0 0 12px; font-size: var(--text-sm); color: rgba(255,255,255,.72); line-height: 1.5; font-weight: 400; }
.tour-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tour-actions .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tab-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--muted);
}
.tab-btn.active { background: var(--navy-dark); color: #fff; border-color: var(--navy-dark); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input, .toolbar select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff;
}
.muted { color: var(--muted); font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.gantt { display: grid; gap: 6px; }
.gantt-row { display: grid; grid-template-columns: 160px 1fr; gap: 8px; align-items: center; font-size: .8rem; }
.gantt-bar-track { height: 18px; background: #eef2f6; border-radius: 6px; position: relative; overflow: hidden; }
.gantt-bar {
  position: absolute; top: 2px; bottom: 2px; border-radius: 4px; background: var(--navy);
}
.gantt-bar.critical { background: var(--err); }
.gantt-bar.done { background: var(--ok); }

.matrix { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-width: 360px; }
.matrix-cell {
  aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center;
  font-size: .7rem; font-weight: 700; color: #fff; cursor: default;
}

.demo-banner {
  background: rgba(var(--gold-rgb), 0.1);
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.35);
  color: var(--gold-text);
  font-family: var(--font);
  font-size: var(--text-xs); text-align: center; padding: 7px 12px;
  font-weight: 500; letter-spacing: 0.04em;
}

/* —— Entry —— */
.entry-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  position: relative; font-family: var(--font); color: var(--text);
}
.entry-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(var(--gold-rgb), .18), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(var(--accent-2-rgb), .12), transparent 45%),
    linear-gradient(160deg, #1A1D21 0%, #2C3038 45%, #3A3F47 100%);
}
.entry-card {
  position: relative; z-index: 1; width: min(560px, 100%);
  background: var(--white); border-radius: 20px; padding: 36px 32px;
  box-shadow: var(--shadow); border-top: 3px solid var(--gold);
}
.entry-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.entry-title {
  font-family: var(--font); font-size: 1.2rem; font-weight: 600;
  letter-spacing: 0.02em; display: block; color: var(--navy-dark);
}
.entry-sub {
  font-family: var(--font); font-size: 0.625rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.entry-card h1 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin: 0 0 12px;
  color: var(--navy-dark);
}
.entry-lead {
  margin: 0 0 24px; color: var(--muted); line-height: 1.6;
  font-size: var(--text-sm); font-weight: 400;
}
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
@media (max-width: 560px) { .entry-grid { grid-template-columns: 1fr; } }
.entry-page .field label { color: var(--muted); }
.entry-page .field select {
  border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 10px;
  width: 100%; padding: 12px 14px;
}
.entry-actions { display: flex; flex-direction: column; gap: 10px; }
.entry-actions .btn { width: 100%; }
.btn-outline-navy {
  background: transparent; border: 1.5px solid var(--navy-dark); color: var(--navy-dark);
  font-family: var(--font); font-weight: 600; font-size: var(--text-sm);
  letter-spacing: 0.01em; border-radius: 8px; padding: 11px 18px; cursor: pointer;
}
.btn-outline-navy:hover { background: var(--navy-dark); color: #fff; }
.entry-notice {
  margin: 18px 0 8px; font-size: .8rem; color: var(--muted); text-align: center;
  padding: 10px; background: var(--bg); border-radius: 8px; border-left: 3px solid var(--gold);
}
.entry-back { text-align: center; margin: 0; font-size: .85rem; }
.entry-back a { color: var(--gold-text); font-weight: 600; }

.logo-mark { width: 42px; height: 52px; display: block; }
.logo-mark--lg { width: 56px; height: 70px; }
.logo-mark--sm { width: 28px; height: 36px; }

/* Loader */
.nexo-loader {
  position: fixed; inset: 0; z-index: 999; background: rgba(26, 29, 33, .92);
  display: grid; place-items: center; color: #fff; gap: 16px;
}
.nexo-loader[hidden] { display: none !important; }
.nexo-loader p {
  margin: 0; letter-spacing: 0.08em; font-weight: 500;
  font-size: var(--text-sm); font-family: var(--font); text-transform: uppercase;
}
.logo-loader .logo-bar { transform-origin: bottom; animation: barPulse .7s ease infinite alternate; }
.logo-loader .b2 { animation-delay: .08s; }
.logo-loader .b3 { animation-delay: .16s; }
.logo-loader .b4 { animation-delay: .24s; }
@keyframes barPulse {
  from { opacity: .45; transform: scaleY(.85); }
  to { opacity: 1; transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-loader .logo-bar { animation: none; }
  .drawer { animation: none; }
}

/* Línea NEXO + propagación */
.nexo-line {
  height: 3px; width: 100%; background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 999px; margin: 8px 0 16px;
}
.toast.propagate {
  border-left: 3px solid var(--gold);
  background: var(--navy-dark);
}
.toast.propagate .toast-mods {
  display: block; font-size: .75rem; font-weight: 500; opacity: .75; margin-top: 4px;
}

.prop-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 220;
  background: var(--navy-dark); color: #fff; padding: 14px 18px; border-radius: 14px;
  border-left: 3px solid var(--gold); box-shadow: var(--shadow); max-width: 360px;
  opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none;
}
.prop-toast.on { opacity: 1; transform: none; pointer-events: auto; }
.prop-toast ul { margin: 8px 0 0; padding-left: 18px; font-size: .82rem; opacity: .9; }
.prop-toast-head { display: flex; align-items: center; gap: 8px; }
.linea-nexo {
  display: inline-block; height: 3px; width: 28px;
  background: linear-gradient(90deg, var(--gold), transparent); border-radius: 999px;
}
.nexo-loader.on { display: grid !important; }

/* Área cards Centro */
.area-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px;
}
@media (max-width: 1200px) { .area-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .area-grid { grid-template-columns: 1fr 1fr; } }
.area-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; cursor: pointer; position: relative; transition: border-color .15s, transform .15s;
}
.area-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.area-card::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  background: var(--gold); border-radius: 0 2px 2px 0;
}
.area-card h3 { margin: 0 0 6px; font-size: .92rem; }
.area-card .kpi-value { font-size: 1.2rem; }
.area-card .trend { font-size: .72rem; color: var(--muted); }

/* 360 */
.view360-head {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; position: relative; overflow: hidden;
}
.view360-head::after {
  content: ''; position: absolute; right: -20px; top: -30px; width: 120px; height: 140px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 100'%3E%3Crect x='8' y='12' width='14' height='76' fill='%231A1D21'/%3E%3Crect x='26' y='28' width='10' height='60' fill='%233A3F47'/%3E%3Crect x='38' y='20' width='10' height='68' fill='%236B7280'/%3E%3Crect x='50' y='36' width='10' height='52' fill='%23C5CAD1'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: .06; pointer-events: none;
}
.avatar360 {
  width: 64px; height: 64px; border-radius: 12px; background: var(--navy-dark); color: var(--gold);
  display: grid; place-items: center; font-family: var(--font); font-weight: 600;
  font-size: 1.1rem; flex-shrink: 0; letter-spacing: 0.02em;
}
.matrix-acred { width: 100%; overflow: auto; }
.matrix-acred table td.bad { color: var(--err); font-weight: 700; }
.matrix-acred table td.ok { color: var(--ok); font-weight: 700; }

/* Mapa relaciones */
.map-tree { list-style: none; margin: 0; padding: 0; }
.map-tree ul { list-style: none; margin: 0; padding-left: 22px; border-left: 2px solid rgba(var(--gold-rgb), .45); }
.map-node {
  margin: 6px 0; padding: 10px 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center;
}
.map-node:hover, .map-node.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(var(--gold-rgb), .15); }
.map-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  min-height: 280px;
}

/* Review 3 cols */
.review-grid {
  display: grid; grid-template-columns: 1fr 1.2fr .9fr; gap: 12px; min-height: 420px;
}
@media (max-width: 1100px) { .review-grid { grid-template-columns: 1fr; } }
.review-list { max-height: 520px; overflow: auto; }
.review-list button {
  width: 100%; text-align: left; border: 1px solid var(--line); background: #fff;
  padding: 10px; border-radius: 8px; margin-bottom: 6px; cursor: pointer;
}
.review-list button.active { border-color: var(--gold); background: rgba(var(--gold-rgb), .08); }
.preview-box {
  border: 1px dashed var(--line); border-radius: 12px; min-height: 280px;
  display: grid; place-items: center; background: var(--bg); color: var(--muted); padding: 20px; text-align: center;
}

/* Presentation */
.present-mode .sidebar, .present-mode .demo-banner, .present-mode .top-filters,
.present-mode #btnResetTop, .present-mode .sidebar-foot { display: none !important; }
.present-mode .app-shell { grid-template-columns: 1fr; }
.present-hud {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 120;
  display: none; gap: 8px; background: var(--navy-dark); color: #fff; padding: 12px 16px;
  border-radius: 14px; box-shadow: var(--shadow); align-items: center; flex-wrap: wrap;
  max-width: calc(100% - 24px);
}
.present-mode .present-hud { display: flex; }
.present-hud span { font-size: .8rem; opacity: .85; margin-right: 8px; }

.timeline { border-left: 2px solid rgba(var(--gold-rgb), .5); padding-left: 16px; margin: 8px 0; }
.timeline-item { margin-bottom: 14px; position: relative; }
.timeline-item::before {
  content: ''; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--gold);
}

.insight-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; margin-bottom: 10px;
  border-left: 3px solid var(--gold);
}
.insight-card h4 {
  margin: 0 0 6px; font-family: var(--font); font-size: var(--text-sm);
  font-weight: 600; letter-spacing: 0.005em; color: var(--navy-dark);
}
.insight-card p { margin: 0; font-size: var(--text-sm); color: var(--muted); line-height: 1.5; font-weight: 400; }

.nav-section-label {
  font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,.38); padding: 12px 12px 4px; font-weight: 600;
  font-family: var(--font);
}
.app-shell.collapsed .nav-section-label { display: none; }
.sidebar-nav .nav-group-btn.active-parent {
  background: rgba(var(--gold-rgb), .12);
  box-shadow: inset 3px 0 0 var(--gold);
}
.nav-sub a.active { box-shadow: inset 3px 0 0 var(--gold); }

.empty.watermark {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 100'%3E%3Crect x='8' y='12' width='14' height='76' fill='%231A1D21'/%3E%3Crect x='26' y='28' width='10' height='60' fill='%233A3F47'/%3E%3Crect x='38' y='20' width='10' height='68' fill='%236B7280'/%3E%3Crect x='50' y='36' width='10' height='52' fill='%23C5CAD1'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center 30%; background-size: 80px;
}

table.data tr:hover td { background: rgba(var(--gold-rgb), .06); }
.sidebar-env {
  background: rgba(var(--gold-rgb), .12); border: 1px solid rgba(var(--gold-rgb), .35); color: var(--gold);
}
.profile-btn:hover, .profile-btn.active { border-color: var(--gold); background: rgba(var(--gold-rgb), .15); }
.nav-sub a:hover, .nav-sub a.active { background: rgba(var(--gold-rgb), .15); color: var(--gold); }

/* Prop toast + línea NEXO connector */
.prop-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 210;
  background: var(--navy-dark); color: #fff; padding: 14px 18px; border-radius: 14px;
  box-shadow: var(--shadow); max-width: 360px; opacity: 0; transform: translateY(10px);
  transition: .25s; pointer-events: none;
}
.prop-toast.on { opacity: 1; transform: none; pointer-events: auto; }
.prop-toast-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.prop-toast ul { margin: 0; padding-left: 18px; font-size: .82rem; line-height: 1.45; color: rgba(255,255,255,.8); }
.linea-nexo {
  display: inline-block; width: 28px; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--accent-2));
  box-shadow: 0 0 8px rgba(var(--gold-rgb), .5);
}
.nexo-loader.on { display: grid !important; }
.nexo-loader-inner { text-align: center; }
.nexo-loader .lb { transform-origin: bottom; animation: barPulse .65s ease infinite alternate; }
.nexo-loader .lb2 { animation-delay: .07s; }
.nexo-loader .lb3 { animation-delay: .14s; }
.nexo-loader .lb4 { animation-delay: .21s; }

.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%; animation: sk 1.2s ease infinite; border-radius: 8px; height: 14px; margin: 8px 0;
}
@keyframes sk { to { background-position: -200% 0; } }

.tabs-360 { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tabs-360 .tab-btn { border-radius: 8px; }
.conflict-warn {
  background: #fef3c7; border: 1px solid #f0d48a; color: #92400e;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; font-size: .88rem;
}
.dotacion-matrix th { font-size: .65rem; }

/* —— Tipografía numérica + tooltips —— */
.area-card .kpi-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.03em;
}
.area-card.has-tip { cursor: help; }
.area-card.has-tip:focus-visible,
.area-card.has-tip:hover {
  border-color: rgba(var(--gold-rgb), .6);
  box-shadow: 0 6px 20px rgba(var(--navy-dark-rgb), .08);
}

.nexo-tooltip {
  position: fixed;
  z-index: 400;
  transform: translateX(-50%);
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(26, 29, 33, 0.96);
  color: #fff;
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(26, 29, 33, 0.28);
  border: 1px solid rgba(255,255,255,.08);
  border-top: 2px solid var(--gold);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.nexo-tooltip.on { opacity: 1; }
.nexo-tooltip[data-place="bottom"] { transform: translateX(-50%); }
.nexo-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px; height: 10px;
  background: rgba(26, 29, 33, 0.96);
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nexo-tooltip[data-place="bottom"]::after {
  bottom: auto; top: -6px;
  border: none;
  border-left: 1px solid rgba(255,255,255,.08);
  border-top: 1px solid rgba(255,255,255,.08);
}

.tip-label { display: inline-flex; align-items: center; gap: 6px; }
.tip-i {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: .65rem; font-weight: 600; padding: 0; cursor: help;
  display: inline-grid; place-items: center; line-height: 1;
  font-family: var(--font);
}
.tip-i:hover, .tip-i:focus-visible {
  border-color: var(--gold); color: var(--gold-text); background: rgba(var(--gold-rgb), .08);
}

.pill[data-tip] { cursor: help; }
table.data td.num, table.data th.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .nexo-tooltip { transition: none; }
}
