:root {
  --navy: #17233d;
  --teal: #58c9b9;
  --teal-dark: #0e7c72;
  --paper: #f4f7f9;
  --card: #ffffff;
  --ink: #0e1e38;
  --muted: #4a5568;
  --line: #d7e0e6;
  --accent: #58c9b9;
  --ok: #0e7c72;
  --grafito: #4a5568;
  --error: #c23b4a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(23, 35, 61, 0.08);
  --font: "Plus Jakarta Sans", Inter, "Segoe UI", sans-serif;
  --side-w: 200px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--font);
}
a { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.staff-shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
  align-items: start;
}
html.nav-ready body.staff-shell { transition: grid-template-columns 0.22s ease; }
html.nav-collapsed body.staff-shell { grid-template-columns: 0 minmax(0, 1fr); }
html.nav-collapsed body.staff-shell > .side {
  width: 0;
  max-width: 0;
  min-width: 0;
  overflow: hidden;
  visibility: hidden;
}
.side {
  background: var(--navy);
  color: #fff;
  min-height: 100vh;
  max-width: var(--side-w);
  width: var(--side-w);
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 2;
}
html.nav-ready .side { transition: width 0.22s ease, max-width 0.22s ease; }
.side .brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
  padding: 1rem 0.85rem 0.8rem;
}
.wordmark { display: block; line-height: 0; }
.wordmark img { display: block; height: 26px; width: auto; }
.wordmark .wm-dark { display: none; }
.side .wordmark .wm-light { display: none; }
.side .wordmark .wm-dark { display: block; }
.side-group { padding: 0.2rem 0.75rem 0.55rem; }
.side-group h2 {
  margin: 0.55rem 0.5rem 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
}
.side nav { padding: 0 0.35rem 1rem; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.side-user {
  flex: 0 0 auto;
  border-top: 2px solid var(--teal);
  padding: 0.4rem 0.35rem 0.65rem;
  background: var(--navy);
}
.side-user .side-fold > summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  position: relative;
  padding: 0.4rem 1.15rem 0.4rem 0.45rem;
  color: #fff;
  font-weight: 700;
}
.side-user .side-user-name {
  display: block;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.side-user .side-fold > summary::after {
  float: none;
  position: absolute;
  right: 0.4rem;
  top: 0.72rem;
  margin-top: 0;
  border-color: #fff transparent transparent transparent;
}
.side-user .side-fold[open] > summary::after {
  top: 0.85rem;
  margin-top: 0;
  border-width: 0 4px 5px 4px;
  border-color: transparent transparent #fff transparent;
}
.side-user .side-fold summary:hover { background: rgba(255, 255, 255, 0.08); }
.side-user .side-link { color: rgba(255, 255, 255, 0.9); }
.side-user .side-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.side-user .side-link.on { background: rgba(88, 201, 185, 0.22); color: #fff; }
.side-logout {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 0;
  padding: 0.32rem 0.5rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
}
.side-logout:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.role-chip {
  display: inline-block;
  margin: 0;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(88, 201, 185, 0.28);
  color: #fff;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.3;
}
.side-link {
  display: block;
  padding: 0.28rem 0.4rem;
  border-radius: 6px;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
}
.side-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.side-link.on { background: rgba(88, 201, 185, 0.18); color: var(--teal); }
.side-fold {
  margin: 0.15rem 0 0.35rem;
}
.side-fold summary {
  list-style: none;
  cursor: pointer;
  padding: 0.34rem 0.4rem;
  border-radius: 6px;
  color: rgba(255,255,255,0.92);
  font-size: 0.78rem;
  font-weight: 600;
}
.side nav .side-fold > summary {
  color: var(--teal);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.side-fold summary::-webkit-details-marker,
.top-menu > summary::-webkit-details-marker { display: none; }
.side-fold summary::marker,
.top-menu > summary::marker { content: ""; }
.side-fold summary::after {
  content: "";
  float: right;
  margin-top: 0.45rem;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 4px 0 4px;
  border-color: rgba(255,255,255,0.55) transparent transparent transparent;
}
.side nav .side-fold > summary::after {
  border-color: var(--teal) transparent transparent transparent;
}
.side nav .side-fold[open] > summary::after,
.side-fold[open] summary::after {
  margin-top: 0.2rem;
  border-width: 0 4px 5px 4px;
  border-color: transparent transparent var(--teal) transparent;
}
.side-fold summary:hover { background: rgba(255,255,255,0.06); }
.side nav .side-fold > summary:hover { background: rgba(22, 184, 166, 0.14); color: #7ee8db; }
.side-fold .side-link { margin-left: 0.2rem; font-size: 0.76rem; }
.side-label {
  margin: 0.7rem 0.45rem 0.1rem 0.85rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
}
.side-mobile { display: none; padding: 0.4rem 0.75rem 1rem; }
.side-mobile h2 {
  margin: 0.7rem 0.5rem 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
}
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.1rem;
  background: var(--navy);
  color: #fff;
  position: relative;
  z-index: 5;
}
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: #fff;
  margin: 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 6px;
  padding: 0;
}
.menu-btn svg { display: block; }
.company-chip {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: nowrap;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.quotes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.35rem;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.78);
  margin-right: auto;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.switcher { display: flex; gap: 0.5rem; align-items: center; }
.switcher select {
  width: auto;
  min-width: 14rem;
  max-width: 22rem;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.18);
}
.switcher select option { color: var(--ink); background: #fff; }
.topbar button {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: var(--radius-sm);
}
.topbar button:hover { border-color: var(--teal); color: var(--teal); }
.top-menu { position: relative; }
.top-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  color: var(--teal);
}
.top-menu > summary::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 4px 0 4px;
  border-color: var(--teal) transparent transparent transparent;
}
.top-menu[open] > summary::after {
  border-width: 0 4px 5px 4px;
  border-color: transparent transparent var(--teal) transparent;
  margin-top: 0;
}
.top-menu > summary:hover,
.top-menu[open] > summary {
  background: rgba(22, 184, 166, 0.14);
  color: #7ee8db;
}
.top-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.55rem 0.8rem 0.6rem;
  width: max-content;
  max-width: calc(100vw - 1rem);
  z-index: 30;
}
.top-panel-sm { width: max-content; min-width: 0; }
.top-col h3 {
  margin: 0.45rem 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-dark);
}
.top-col h3:first-child { margin-top: 0; }
.top-col a {
  display: block;
  padding: 0.22rem 0;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.86rem;
  white-space: nowrap;
}
.top-col a:hover { color: var(--teal-dark); }

main { padding: 1.5rem 1.6rem 3.2rem; max-width: 1240px; min-width: 0; }
@media (max-width: 1100px) {
  .top-panel { right: auto; left: 0; width: max-content; max-width: calc(100vw - 1rem); max-height: 70vh; overflow: auto; }
}
@media (max-width: 960px) {
  body.staff-shell,
  html.nav-collapsed body.staff-shell { grid-template-columns: 1fr; }
  html.nav-ready body.staff-shell > .side,
  body.staff-shell > .side,
  html.nav-collapsed body.staff-shell > .side {
    display: flex;
    position: fixed;
    z-index: 20;
    width: var(--side-w);
    max-width: var(--side-w);
    min-width: 0;
    visibility: visible;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  html.nav-open body.staff-shell > .side { transform: none; }
  .topbar { position: sticky; top: 0; z-index: 30; }
  body.staff-shell > .side,
  html.nav-collapsed body.staff-shell > .side {
    top: 3.25rem;
    height: calc(100vh - 3.25rem);
    min-height: 0;
    max-height: none;
  }
  html.nav-collapsed .side nav { display: block; }
  html.nav-collapsed .side .side-user { display: block; }
  html.nav-collapsed .side .brand-name { display: inline; }
  html.nav-collapsed .side .brand {
    justify-content: flex-start;
    padding: 1.1rem 1.15rem 0.85rem;
  }
  .top-menu { position: relative; }
  .top-panel {
    position: absolute;
    left: 0;
    right: auto;
    top: calc(100% + 0.35rem);
    width: max-content;
    max-width: calc(100vw - 1rem);
    max-height: 70vh;
    overflow: auto;
  }
  .top-col a { white-space: normal; }
  .quotes { margin-right: 0; }
}
h1 { font-size: 1.55rem; letter-spacing: -0.03em; margin: 0.2rem 0 0.6rem; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 0.4rem; color: var(--navy); }
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem 1rem;
  margin: 0 0 0.35rem;
}
.page-head h1 { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1.2rem; }
.table-wrap table { margin: 0; }
.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-dark);
  font-weight: 600;
}

label { display: block; margin: 0.8rem 0 0.25rem; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  max-width: 22rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  border-radius: var(--radius-sm);
  color: var(--ink);
}
input[type="checkbox"], input[type="radio"] {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  max-width: none;
  padding: 0;
  accent-color: var(--teal-dark);
}
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  max-width: 100%;
  margin: 0.35rem 0;
  color: var(--ink);
  font-size: 0.95rem;
}
button, .btn {
  background: var(--navy);
  color: #fff;
  border: 0;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--teal-dark); }
.error { color: var(--error); }
.ok { color: var(--ok); }
.muted { color: var(--muted); }
p.ok, p.error {
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
}
p.ok { background: #e9f8f5; border-color: #b8e8e1; }
p.error { background: #fdecee; border-color: #f3c4c9; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
th, td { text-align: left; padding: 0.45rem 0.65rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.stmt-head { text-align: center; margin: 0.8rem 0 1rem; }
.stmt-head h2 { margin: 0.35rem 0 0.2rem; font-size: 1.35rem; letter-spacing: -0.01em; }
.stmt-head p { margin: 0.12rem 0; }
.stmt-company { font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.stmt-head .unit { font-style: italic; color: var(--muted); }
.sheet-note { color: var(--muted); font-size: 0.82rem; margin-top: 0.6rem; }
.esf-cuenta { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: stretch; }
.esf-cuenta > div { min-width: 0; }
table.esf-side { height: 100%; min-width: 0; }
table.esf-side td.head { font-weight: 700; border-bottom: 1px solid var(--ink); }
table.esf-side td.subtotal { font-weight: 700; border-top: 1px solid var(--ink); }
table.esf-side td.total,
table.esf-side th.total { font-weight: 700; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); }
table.esf-side td.category { padding-left: 0.9rem; }
table.esf-side td.account { padding-left: 1.5rem; }
@media (max-width: 960px) {
  .esf-cuenta { grid-template-columns: 1fr; }
}
.eerr-sheet { margin: 0.4rem 0 0.8rem; }
.eerr-sheet p { margin: 0.1rem 0; }
.eerr-title { text-align: center; font-weight: 700; letter-spacing: 0.03em; }
.eerr-scroll { overflow-x: auto; max-width: 100%; }
table.eerr { min-width: 36rem; }
table.balance {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
table.balance thead th:first-child,
table.balance tbody td:first-child {
  position: sticky;
  left: 0;
  width: 9rem;
  min-width: 9rem;
  white-space: nowrap;
  z-index: 2;
}
table.balance thead th:nth-child(2),
table.balance tbody td:nth-child(2) {
  position: sticky;
  left: 9rem;
  min-width: 16rem;
  max-width: 20rem;
  z-index: 2;
  box-shadow: 8px 0 8px -8px rgba(23, 35, 61, 0.28);
}
table.balance thead th:first-child,
table.balance thead th:nth-child(2) {
  top: 0;
  z-index: 4;
  background: #f7fbfb;
}
table.balance tbody td:first-child,
table.balance tbody td:nth-child(2) { background: var(--card); }
table.balance tbody tr:hover td:first-child,
table.balance tbody tr:hover td:nth-child(2) { background: #f8fbfb; }
table.balance td.num,
table.balance th.num { min-width: 7.5rem; }
@media (max-width: 960px) {
  table.balance thead th:first-child,
  table.balance tbody td:first-child,
  table.balance thead th:nth-child(2),
  table.balance tbody td:nth-child(2) {
    position: static;
    left: auto;
    width: auto;
    min-width: 8rem;
    max-width: none;
    box-shadow: none;
  }
}
table.eerr td.num, table.eerr th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.eerr tr.section td { font-weight: 700; background: #f4f7f9; }
table.eerr tr.subtotal td { font-weight: 700; border-top: 1px solid var(--ink); background: #e4eef2; }
table.eerr tr.total td { font-weight: 700; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); }
table.eerr tr.account td:first-child { padding-left: 1.6rem; }
table.eerr .col-hint { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; }
table.eerr.split {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
table.eerr.split thead th { z-index: 3; }
table.eerr.split thead th:first-child,
table.eerr.split tbody td:first-child {
  position: sticky;
  left: 0;
  min-width: 16rem;
  max-width: 22rem;
  z-index: 2;
  background: var(--card);
  box-shadow: 8px 0 8px -8px rgba(23, 35, 61, 0.28);
}
table.eerr.split thead th:first-child {
  top: 0;
  z-index: 4;
  background: #f7fbfb;
}
table.eerr.split th.num,
table.eerr.split td.num { min-width: 8.5rem; }
table.eerr.split tbody tr:hover td:first-child { background: #f8fbfb; }
table.eerr.split tr.section td:first-child,
table.eerr.split tr.section:hover td:first-child { background: #f4f7f9; }
table.eerr.split tr.subtotal td:first-child,
table.eerr.split tr.subtotal:hover td:first-child { background: #e4eef2; }
@media (max-width: 960px) {
  table.eerr.split thead th:first-child,
  table.eerr.split tbody td:first-child {
    position: static;
    left: auto;
    max-width: none;
    box-shadow: none;
  }
}
button[aria-pressed="true"] { outline: 2px solid var(--navy); outline-offset: 1px; }
th { font-weight: 600; color: var(--muted); background: #f7fbfb; position: sticky; top: 0; z-index: 1; }
td.muted { color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fbfb; }
.empty-hint {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.flag { font-size: 0.75rem; letter-spacing: 0.04em; color: var(--ok); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card b { display: block; font-size: 1.45rem; color: var(--navy); letter-spacing: -0.03em; }
a.card { text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--teal); }
a.card b { font-size: 1.05rem; margin-bottom: 0.25rem; }
.home-map section { margin: 1.15rem 0 1.4rem; }
.home-map .btn { margin: 0 0.4rem 0.4rem 0; }
.neg { color: var(--error); }
.dash-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.85rem 0 0.4rem;
}
.dash-tabs a {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--card);
}
.dash-tabs a.on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0 1rem;
}
.kpi-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.95rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.kpi span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.kpi b {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.kpi em {
  display: block;
  margin-top: 0.15rem;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--teal-dark);
  font-weight: 600;
}
.kpi.accent { border-color: var(--teal); }
.kpi.with-ico {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.15rem 0.8rem;
}
.kpi.with-ico span {
  flex: 1 0 100%;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  color: var(--navy);
}
.kpi.with-ico b { margin: 0; font-size: 1.35rem; }
.kpi.with-ico em { margin: 0 0 0.2rem auto; font-size: 1.05rem; color: var(--muted); }
.tm-title { margin: 0 0 0.45rem; font-weight: 700; color: var(--navy); }
.treemap { display: flex; gap: 6px; height: 320px; }
.tm-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tm-block {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  font-weight: 700;
  padding: 0.45rem;
  border-radius: 4px;
  min-height: 1.8rem;
  line-height: 1.2;
}
.tm-block.blue { background: #3b6fd8; }
.tm-block.blue-2 { background: #2a549f; }
.tm-block.green { background: #2f9e6b; }
.tm-block.green-2 { background: #1f7a52; }
.tm-block.red { background: #c23b4a; }
.dash-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem 1rem;
  box-shadow: var(--shadow);
  margin: 0 0 1.2rem;
}
.dash-panel h2 { margin-top: 0; }
.dash-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  height: 170px;
  overflow-x: auto;
}
.dash-bar-col {
  flex: 1 0 2.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 2.1rem;
}
.dash-bar-pair {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  width: 100%;
  justify-content: center;
}
.dash-bar {
  width: 42%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
}
.dash-bar.in { background: var(--teal); }
.dash-bar.out { background: var(--navy); }
.dash-bar-col span {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.legend { display: flex; align-items: center; gap: 0.55rem; }
.swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.2rem;
}
.swatch.in { background: var(--teal); }
.swatch.out { background: var(--navy); }
.dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  align-items: start;
}
.dash-actions { margin-top: 1.6rem; }
.dash-actions .btn { margin-right: 0.4rem; }
.chart-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1rem;
  margin: 0 0 1.1rem;
}
.chart-grid.flip { grid-template-columns: 1fr 1.45fr; }
.chart-grid.even { grid-template-columns: 1fr 1fr; }
.chart-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem 0.85rem;
  box-shadow: var(--shadow);
  min-height: 300px;
}
.chart-box.wide { grid-column: 1 / -1; min-height: 340px; }
.chart-box canvas { width: 100% !important; max-height: 320px; }
#chart-gastos-cuenta-box canvas { max-height: none; height: 100% !important; }
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.25rem 0.85rem;
  margin: 0.5rem 0 1rem;
  max-height: 14rem;
  overflow: auto;
  padding: 0.5rem 0.65rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.pick-grid label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
}
.pick-grid input { width: auto; min-width: 0; }
.pick-fold { margin: 0.15rem 0 0.9rem; }
.pick-fold summary {
  cursor: pointer;
  width: fit-content;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}
.pick-fold[open] summary { margin-bottom: 0.45rem; }
.pick-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.35rem; }
.pick-actions button {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  padding: 0.28rem 0.7rem;
  font-size: 0.82rem;
}
.pick-actions button:hover { background: var(--paper); color: var(--navy); }
.area-pick {
  border: 0;
  margin: 0.1rem 0 0.7rem;
  padding: 0;
}
.area-pick legend {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 0;
  margin-bottom: 0.35rem;
}
.pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
}
.pick-chips label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink);
}
.pick-chips input { width: auto; min-width: 0; }
.flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  align-items: center;
}
.flag-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink);
}
.flag-row input { width: auto; min-width: 0; }
table.cuentas { table-layout: auto; width: 100%; min-width: 62rem; }
table.cuentas td, table.cuentas th { vertical-align: middle; }
table.cuentas input[type="text"],
table.cuentas select { width: 100%; max-width: none; }
table.cuentas .flags { white-space: nowrap; }
table.cuentas .flags label {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0 0.55rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
table.cuentas .flags input { width: auto; min-width: 0; }
table.aging { table-layout: fixed; width: 100%; min-width: 48rem; }
table.aging th, table.aging td { vertical-align: middle; }
table.aging td:first-child, table.aging th:first-child { overflow-wrap: anywhere; }
table.aging .doc { width: 7.5rem; white-space: nowrap; }
table.aging .cuenta { width: 8.75rem; white-space: nowrap; }
table.aging .dias { width: 3.25rem; white-space: nowrap; text-align: right; }
table.aging .tramo { width: 4.25rem; white-space: nowrap; }
table.aging td.num, table.aging th.num { white-space: nowrap; text-align: right; width: 8rem; }
table.aging tr.settle td { background: #f7fbfb; }
table.aging tr.settle form { margin: 0; }
#chart-gastos-cuenta-box { min-height: 280px; max-height: 420px; }
#chart-gastos-cuenta-box canvas { max-height: 400px; height: 100% !important; }
@media (max-width: 960px) {
  .kpi-grid, .kpi-grid.cols-3, .kpi-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-split { grid-template-columns: 1fr; }
  .chart-grid, .chart-grid.flip, .chart-grid.even { grid-template-columns: 1fr; }
  .treemap { height: auto; min-height: 240px; flex-direction: column; }
  .chart-box.wide { grid-column: auto; }
}
@media (max-width: 560px) {
  .kpi-grid, .kpi-grid.cols-3, .kpi-grid.cols-4 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html.nav-ready body.staff-shell,
  html.nav-ready .side,
  html.nav-ready body.staff-shell > .side { transition: none; }
}
.row-search { display: block; max-width: 18rem; margin: 0.2rem 0 0.8rem; }
.doc-btn {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--navy);
  background: #fff;
}
.doc-btn:hover { border-color: var(--teal); color: var(--teal-dark); }
tr.no-match td:first-child { box-shadow: inset 3px 0 0 var(--error); }
.dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.3rem;
  border-radius: 50%;
  background: var(--error);
  vertical-align: middle;
}
.pill {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(194, 59, 74, 0.12);
  color: var(--error);
  font-size: 0.75rem;
  font-weight: 700;
}
.filters { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: flex-end; margin: 0.6rem 0 1rem; }
.filters label { margin: 0; min-width: 0; }
.filters input:not([type="checkbox"]):not([type="radio"]),
.filters select { width: auto; min-width: 8rem; max-width: 18rem; }
.filters label.check,
.filters label:has(> input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-weight: 500;
}
.filters label.check input,
.filters label:has(> input[type="checkbox"]) input {
  width: auto;
  min-width: 0;
  max-width: none;
}
.filter-actions { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0 0 0.15rem; }
form.inline input, form.inline select { width: auto; max-width: 16rem; }
form.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 22rem));
  gap: 0.75rem 1.25rem;
  align-items: end;
  margin: 0.4rem 0 1rem;
}
form.field-grid label { margin: 0; }
form.field-grid select,
form.field-grid input:not([type="checkbox"]):not([type="radio"]) { width: 100%; max-width: none; }
table.lines td input, table.lines td select { width: 100%; max-width: none; }
table input, table select { max-width: 22rem; }
table.cols td input:not([type="hidden"]) { width: 100%; max-width: none; min-width: 0; }
table.cols td .inline { display: inline-flex; }
table.bank-edit { min-width: 64rem; }
table.bank-edit td:nth-child(3) { min-width: 14rem; }
table.bank-edit td:nth-child(4) { min-width: 11rem; }
table.bank-edit td:nth-child(5) { min-width: 16rem; }
table.bank-edit td select { width: 100%; max-width: none; }
table.bank-edit td:last-child { white-space: nowrap; }
input.search-field { display: block; width: 100%; max-width: none; margin: 0.35rem 0 1rem; }
dialog.doc-dialog {
  width: min(960px, 96vw);
  height: min(88vh, 900px);
  max-width: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
dialog.doc-dialog::backdrop { background: rgba(23, 35, 61, 0.55); }
.doc-dialog-bar { display: flex; justify-content: flex-end; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); }
.doc-dialog-bar button { width: auto; }
dialog.doc-dialog iframe { width: 100%; height: calc(100% - 3rem); border: 0; background: #fff; }
.banner-warn {
  background: #fff6df;
  border: 1px solid #e2c56a;
  color: var(--ink);
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
}
tr.is-hidden { opacity: 0.55; }
table.lines td input, table.lines td select { max-width: none; }
form.compact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.25rem;
  margin: 0.4rem 0 1.4rem;
}
form.compact label { margin: 0; color: var(--muted); }
form.compact select { width: 7.5rem; }
form.compact input[type="text"],
form.compact input:not([type]),
form.compact input[type="password"] { width: 14rem; }
form.compact label.check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.45rem;
  color: var(--ink);
  font-size: 0.95rem;
}
form.compact label.check input { width: auto; min-width: 0; }
.sign-row { display: flex; gap: 4rem; margin: 2.5rem 0 1rem; }
.sign-row p { margin: 0; text-align: center; color: var(--navy); }

form.inline { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
form.inline select, form.inline input:not([type="checkbox"]):not([type="radio"]) { width: auto; min-width: 7rem; max-width: 16rem; }
form.inline button { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
form.payer { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-top: 0.45rem; }
form.payer input[type="text"] { width: 11rem; max-width: 100%; }
form.payer select { width: auto; min-width: 14rem; max-width: 28rem; }
form.payer button { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
form.payer label.check { display: flex; align-items: center; gap: 0.35rem; margin: 0; font-size: 0.85rem; color: var(--ink); }
form.payer label.check input { width: auto; min-width: 0; }
@media (max-width: 560px) {
  form.payer { align-items: stretch; }
  form.payer input[type="text"], form.payer select { width: 100%; min-width: 0; max-width: 100%; }
}
.sp-hint { font-size: 0.8rem; color: var(--muted); }
.sp-warn { font-size: 0.8rem; color: var(--error); }
tfoot th, tfoot td { font-weight: 600; }

/* Login — split from the branding board */
body.login-page { background: var(--card); }
.login-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 4rem;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}
.login-form .brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 2.2rem;
}
.login-form .wordmark img { height: 42px; }
.login-form h1 { font-size: 1.8rem; margin: 0 0 0.35rem; }
.login-form .lead { margin: 0 0 1.6rem; color: var(--muted); }
.login-form button { width: 100%; padding: 0.7rem 1rem; margin-top: 0.8rem; }
.login-panel {
  position: relative;
  background: var(--navy);
  overflow: hidden;
}
.login-panel::before,
.login-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.login-panel::before {
  width: 140%;
  height: 90%;
  right: -35%;
  top: -10%;
  background: linear-gradient(160deg, rgba(88, 201, 185, 0.62) 0%, rgba(88, 201, 185, 0.22) 48%, transparent 62%);
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 72%);
}
.login-panel::after {
  width: 48%;
  aspect-ratio: 1;
  right: 8%;
  bottom: 16%;
  background: rgba(255, 255, 255, 0.08);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.login-copy {
  position: absolute;
  z-index: 1;
  left: 2.6rem;
  right: 2.6rem;
  bottom: 2.8rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.7rem;
  max-width: 24rem;
}
.login-panel .motto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.5;
}
.login-panel .motto span + span::before {
  content: "·";
  margin: 0 0.95rem;
  letter-spacing: 0;
  color: #fff;
}
.login-panel .caption {
  margin: 0;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.5;
  max-width: 17rem;
}
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-panel { min-height: 300px; }
  .login-form { padding: 2rem 1.4rem; }
  .login-copy { left: 1.4rem; right: 1.4rem; bottom: 1.6rem; gap: 1.05rem; }
  .login-panel .caption { font-size: 1.05rem; }
  header.app .switcher { margin-left: 0; }
}

.clase-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 1rem; }
.chip {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.badge {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge.memoria { background: #e7f8f5; color: var(--teal-dark); }
.badge.ia { background: #e7eef8; color: #1d4e89; }
.badge.sin { background: #fff4e5; color: #9a5b00; }

.workspace:has(main.bandeja) { min-height: 100vh; }
main.bandeja {
  max-width: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.8rem 1rem 1rem;
}
.review {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 1fr);
  gap: 0.8rem;
  min-height: 0;
  flex: 1;
}
.review-doc, .review-side {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 70vh;
}
.review-doc iframe {
  width: 100%;
  height: 78vh;
  border: 0;
  border-radius: var(--radius);
  background: #e7eef2;
}
.review-side { padding: 1rem 1.1rem 1.2rem; overflow: auto; }
.review-side select { max-width: none; }
.review-side .memorize {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 500;
  color: var(--ink);
}
.review-side .memorize input { width: auto; max-width: none; margin-top: 0.2rem; }
.review-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
}
table.asiento { width: 100%; }
table.asiento th, table.asiento td { text-align: left; }
table.asiento td:nth-child(n+2), table.asiento th:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 960px) {
  .review { grid-template-columns: 1fr; }
  .review-doc, .review-side { min-height: 0; }
  .review-doc iframe { height: 50vh; }
}
