.app-body { background: #efeae0; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 268px;
  background: var(--forest);
  color: white;
  padding: 1.1rem .9rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 40;
}
.sidebar .brand { color: white; padding: .2rem .45rem; }
.side-nav { display: grid; gap: .25rem; align-content: start; }
.proc-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .2rem;
  background: rgba(255, 255, 255, .06);
  border-radius: 16px;
  padding: .22rem;
  margin-bottom: .45rem;
}
.side-nav .proc-tabs a {
  justify-content: center;
  gap: .35rem;
  padding: .55rem .35rem;
  border-radius: 12px;
  font-weight: 800;
}
.page-tabs {
  display: inline-flex;
  gap: .25rem;
  background: white;
  border-radius: 999px;
  padding: .25rem;
  margin: .15rem 0 1rem;
  box-shadow: inset 0 0 0 1px rgba(21, 36, 30, .06);
}
.page-tabs a {
  text-decoration: none;
  font-weight: 800;
  color: var(--forest);
  border-radius: 999px;
  padding: .55rem 1rem;
}
.page-tabs a.is-active { background: var(--forest); color: white; }
.nav-label {
  padding: .7rem .8rem .15rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .46);
}
.nav-group { display: grid; gap: .2rem; }
.nav-group a { padding-left: 1.05rem; }
.nav-config { display: grid; gap: .2rem; }
.nav-config summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, .82);
  font-weight: 750;
  border-radius: 14px;
  padding: .72rem .8rem;
}
.nav-config summary::-webkit-details-marker { display: none; }
.nav-config summary::after {
  content: "";
  width: .4rem;
  height: .4rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  margin-right: .15rem;
}
.nav-config[open] summary::after { transform: rotate(225deg); margin-top: .2rem; }
.nav-config summary:hover { background: rgba(255, 255, 255, .06); color: white; }
.nav-config a { padding-left: 1.15rem; }
.side-nav a, .side-foot a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  text-decoration: none;
  color: rgba(255,255,255,.82);
  font-weight: 750;
  border-radius: 14px;
  padding: .72rem .8rem;
}
.side-nav a:hover, .side-foot a:hover { background: rgba(255,255,255,.06); color: white; }
.side-nav a.is-active, .side-foot a.is-active { background: var(--citrus); color: var(--forest); }
.badge {
  min-width: 1.3rem;
  text-align: center;
  background: #ffb020;
  color: #3a2500;
  border-radius: 999px;
  font-size: .75rem;
  padding: .05rem .35rem;
}
.side-foot { margin-top: auto; display: grid; gap: .25rem; }
.company-pill {
  margin: .2rem .4rem 0;
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding: .75rem .8rem;
}
.company-pill strong, .company-pill span { display: block; }
.company-pill span { color: rgba(255,255,255,.65); font-size: .82rem; }

.main { margin-left: 268px; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .85rem 1.3rem;
  background: rgba(239, 234, 224, .9);
  backdrop-filter: blur(14px);
}
.search { flex: 1; min-width: 0; }
.search input { background: white; border-radius: 999px; }
.icon-btn, .nav-toggle {
  border: 0;
  background: white;
  border-radius: 14px;
  padding: .75rem .85rem;
  font-weight: 800;
  cursor: pointer;
}
.nav-toggle { display: none; }
.user-menu { position: relative; }
.user-menu summary {
  list-style: none;
  cursor: pointer;
  background: white;
  border-radius: 999px;
  padding: .45rem .8rem .45rem .45rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 800;
}
.user-menu summary::-webkit-details-marker { display: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--forest); color: var(--citrus); font-size: .85rem;
}
.menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + .4rem);
  background: white;
  min-width: 200px;
  border-radius: 16px;
  padding: .4rem;
  box-shadow: var(--shadow);
}
.menu-pop a { display: block; text-decoration: none; font-weight: 750; padding: .65rem .7rem; border-radius: 12px; }
.menu-pop a:hover { background: var(--sand); }
.content { padding: 0 1.3rem 2.5rem; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin: .4rem 0 1rem; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(2rem, 3vw, 3rem); }
.page-head p { color: var(--muted); max-width: 40rem; }

.kpis, .card-grid, .split, .cat-grid { display: grid; gap: 1rem; }
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 1rem; }
.kpi, .card, .panel {
  background: var(--paper);
  border-radius: 22px;
  padding: 1rem 1.05rem;
  box-shadow: inset 0 0 0 1px rgba(21,36,30,.05);
}
.kpi span, .kpi strong { display: block; }
.kpi span { color: var(--muted); font-weight: 700; font-size: .86rem; }
.kpi strong { font-family: var(--display); font-size: 1.8rem; margin-top: .25rem; }
.split { grid-template-columns: 1.4fr .8fr; align-items: start; }
.card h2, .panel h2 { font-size: 1.55rem; margin-bottom: .7rem; }
.list { display: grid; gap: .65rem; }
.list a.item, .item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3rem .8rem;
  text-decoration: none;
  padding: .8rem .85rem;
  border-radius: 16px;
  background: #f7f3ea;
}
.item b { font-weight: 800; }
.item small { color: var(--muted); }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; min-width: 160px; background: white; }
.table-wrap { overflow-x: auto; background: var(--paper); border-radius: 22px; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: .9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data a { font-weight: 800; text-decoration: none; }
table.data a:hover { text-decoration: underline; }

.expense-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
.expense-fields, .expense-side, .auth-card, .soft {
  background: var(--paper);
  border-radius: 24px;
  padding: 1.1rem;
}
.expense-fields { display: grid; gap: .9rem; }
fieldset.fiscal-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: .9rem;
  display: grid;
  gap: .8rem;
  margin: 0;
}
legend { font-weight: 800; padding: 0 .3rem; }
.expense-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: .7rem; flex-wrap: wrap; }
.drop {
  border: 1.5px dashed #b7c3ba;
  border-radius: 18px;
  padding: 1rem;
  text-align: center;
  background: #f7f4ec;
  cursor: pointer;
}
.drop.is-over { background: #f3f8d8; border-color: var(--leaf); }
.drop input { display: none; }
.preview-photo, .receipt {
  width: 100%;
  border-radius: 16px;
  max-height: 280px;
  object-fit: cover;
  background: #efe8d8;
  margin-top: .7rem;
}
.live {
  margin-top: .8rem;
  background: var(--forest);
  color: white;
  border-radius: 20px;
  padding: 1rem;
}
.live p { color: rgba(255,255,255,.72); }
.live h3 { font-size: 1.7rem; margin: .35rem 0; }
.live strong { font-family: var(--display); font-size: 1.8rem; }
.insights { display: grid; gap: .4rem; margin-top: .8rem; }
.insight { background: rgba(255,255,255,.08); border-radius: 12px; padding: .55rem .7rem; font-size: .88rem; }
.insight.bad { background: rgba(255, 176, 32, .18); }
.insight.good { background: rgba(228, 245, 106, .16); }

.detail { display: grid; grid-template-columns: 340px 1fr; gap: 1rem; align-items: start; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1rem; margin-top: .5rem; }
.meta span { display: block; color: var(--muted); font-size: .8rem; font-weight: 800; }
.check-list { display: grid; gap: .55rem; }
.check-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .7rem;
  align-items: center;
  background: #f7f3ea;
  border-radius: 16px;
  padding: .75rem .8rem;
}
.cat-grid { grid-template-columns: repeat(3, 1fr); }
.cat-card h3 { font-size: 1.45rem; margin-bottom: .25rem; }
.people { display: grid; gap: .7rem; }
.person {
  display: grid;
  grid-template-columns: 1.2fr .8fr auto;
  gap: .7rem;
  align-items: center;
  background: var(--paper);
  border-radius: 18px;
  padding: .85rem;
}
.auth-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--sand);
}
.auth-brand {
  background: var(--forest);
  color: white;
  padding: 2rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}
.auth-brand h1 { font-size: clamp(2.6rem, 4vw, 4.4rem); max-width: 10ch; }
.auth-brand p { color: rgba(255,255,255,.75); max-width: 32rem; font-size: 1.05rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.2rem; }
.auth-wrap { width: min(480px, 100%); display: grid; gap: .8rem; }
.auth-card { width: min(480px, 100%); display: grid; gap: .85rem; }
.remember { display: flex; align-items: center; gap: .6rem; font-size: .95rem; font-weight: 700; }
.remember input { width: 1.1rem; height: 1.1rem; accent-color: var(--forest); }
.auth-card h2 { font-size: 2.3rem; }
.demo-box { display: grid; gap: .45rem; background: #f6f3ea; border-radius: 16px; padding: .8rem; }
.demo-box form { margin: 0; }
.demo-box button {
  width: 100%;
  text-align: left;
  border: 0;
  background: white;
  border-radius: 12px;
  padding: .7rem .75rem;
  cursor: pointer;
  font-weight: 750;
}
.demo-box button:hover { background: var(--citrus); }
.scrim { display: none; }

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--paper);
  border-radius: 24px;
}
.empty h2 { font-size: 2rem; margin-bottom: .4rem; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.qr-box { width: 212px; min-height: 212px; background: white; padding: .4rem; border-radius: 16px; margin-bottom: .8rem; }
.qr-box img, .qr-box canvas { display: block; }
.sol-list { display: grid; gap: .7rem; margin-bottom: .9rem; }
.sol { display: grid; gap: .55rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.sol p { margin: .35rem 0; }
.sol-form { display: grid; gap: .7rem; justify-items: start; margin-top: .8rem; }
.panel .sol-form + h2 { margin-top: 1.3rem; }
.sol-form .field, .sol-form .link-row { width: 100%; }
.onb-home { margin-bottom: 1rem; }
.kpis.onb-kpis { grid-template-columns: repeat(3, 1fr); }
.link-row { display: flex; gap: .5rem; align-items: center; }
.link-row input { min-width: 0; background: #f7f3ea; }
.ask-row, .ficha {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: flex-start;
  background: #f7f3ea;
  border-radius: 16px;
  padding: .8rem .85rem;
}
.ficha p { margin: .35rem 0 0; }
.ficha-files { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-top: .45rem; }
.ficha-files a { font-weight: 800; }
.onb-archivo { margin-top: .4rem; }
.onb-archivo summary { cursor: pointer; font-weight: 800; }
.onb-archivo .sol-list { margin-top: .7rem; }
.onb-body { min-height: 100vh; background: var(--sand); }
.onb-body .auth-main { min-height: 100vh; padding: 1.4rem 1rem; }
.onb-form input[type="file"] {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  padding: .7rem .85rem;
  font-size: .92rem;
}
.folio-box {
  background: var(--forest);
  color: white;
  border-radius: 18px;
  padding: 1rem;
  text-align: center;
}
.folio-box span { color: rgba(255, 255, 255, .72); font-size: .82rem; font-weight: 800; }
.folio-box strong {
  display: block;
  margin-top: .25rem;
  font-family: var(--display);
  font-size: 2rem;
  letter-spacing: .08em;
}
.campo-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 220px) auto auto;
  gap: .6rem;
  align-items: center;
  background: #f7f3ea;
  border-radius: 16px;
  padding: .7rem .8rem;
}
.campo-row select { width: auto; background: white; }
.cfg-list { display: grid; gap: .45rem; margin: .9rem 0; }
.cfg-row {
  display: grid;
  grid-template-columns: 2rem minmax(140px, 1.3fr) minmax(150px, 190px) auto auto;
  gap: .55rem .7rem;
  align-items: center;
  background: white;
  border-radius: 14px;
  padding: .55rem .7rem;
  box-shadow: inset 0 0 0 1px var(--line);
}
.cfg-row-adj { grid-template-columns: 2rem minmax(160px, 1.4fr) auto auto auto; }
.cfg-row select, .cfg-row input[type="text"] { width: 100%; background: var(--white); }
.cfg-pos { font-weight: 800; color: var(--muted); text-align: center; }
.cfg-move { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.cfg-activar { display: flex; gap: .6rem; align-items: end; margin-top: .8rem; }
.cfg-activar .field { flex: 1; min-width: 0; }
#form-campos .btn-primary, #form-adjuntos .btn-primary { margin-top: .2rem; }
.onb-card {
  width: min(640px, 100%);
  max-width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}
.onb-card h1 { font-size: 2.15rem; }
.onb-lead { color: var(--muted); max-width: 42rem; }
.onb-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
.onb-grupo { margin: .35rem 0 0; font-weight: 800; }
.via-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem;
  min-width: 0;
  padding: .25rem;
  background: #efe8da;
  border-radius: 16px;
}
.via-opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: .7rem .5rem;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  box-shadow: none;
}
.via-opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.via-opt:has(input:checked) {
  background: white;
  color: var(--forest);
  box-shadow: 0 1px 2px rgba(16, 40, 31, .08);
}
.via-opt:focus-within { outline: 3px solid var(--citrus-2); outline-offset: 2px; }
.onb-sec { display: grid; gap: .75rem; }
.onb-sec + .onb-sec { border-top: 1px solid var(--line); padding-top: 1rem; }
.onb-sec h2 {
  margin: 0;
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.onb-sec .hint { margin-top: -.35rem; }
.onb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; align-items: start; }
.onb-pair > div { display: grid; gap: .75rem; }
.file-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .2rem;
  text-align: center;
  border: 1.5px dashed rgba(21, 36, 30, .22);
  border-radius: 18px;
  background: #f7f3ea;
  padding: 1.6rem 1rem;
  cursor: pointer;
}
.file-drop strong { font-size: 1.02rem; }
.file-drop span, .file-drop em { color: var(--muted); font-size: .86rem; font-style: normal; font-weight: 600; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.onb-card .kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  width: fit-content;
  background: white;
  border-radius: 999px;
  padding: .35rem .7rem .35rem .35rem;
  font-weight: 800;
  font-size: .82rem;
  box-shadow: inset 0 0 0 1px var(--line);
}
.onb-card .kicker i {
  background: var(--citrus);
  color: var(--forest);
  border-radius: 999px;
  padding: .2rem .5rem;
  font-style: normal;
}

.card .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.card .step { background: #f7f3ea; border-radius: 16px; padding: 1rem; }
.card .step em { font-style: normal; font-weight: 800; color: var(--leaf); font-size: .82rem; }
.card .step h3 { font-size: 1.35rem; margin: .35rem 0; }
.card .step p { color: var(--muted); }
.card .step a { font-weight: 800; }

@media (max-width: 1100px) {
  .kpis, .cat-grid { grid-template-columns: 1fr 1fr; }
  .detail, .split, .expense-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .user-menu summary .who { display: none; }
  .list a.item, .item { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
  .auth-card .spread { flex-direction: column; align-items: flex-start; }
  .auth-main { width: 100%; padding: 1rem; }
  .auth-wrap, .auth-card, .demo-box { width: 100% !important; max-width: 100%; }
  .auth-brand, .auth-main, .auth-wrap, .main, .content { min-width: 0; max-width: 100%; }
  .spread { align-items: flex-start; }
  .nav-toggle { display: inline-flex; }
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; border: 0; }
  .main { margin-left: 0; }
  .person { grid-template-columns: 1fr; }
  .kpis, .kpis.onb-kpis, .cat-grid, .auth-body, .card .steps { grid-template-columns: 1fr; }
  .onb-body .auth-main { display: block; width: auto; padding: 1rem; }
  .onb-body .onb-card { width: auto !important; max-width: 100%; }
  .onb-card h1 { font-size: 1.85rem; }
  .onb-lead { overflow-wrap: anywhere; }
  .via-opt { font-size: .92rem; }
  .onb-pair { grid-template-columns: 1fr; }
  .cfg-row, .cfg-row-adj { grid-template-columns: 2rem 1fr; }
  .cfg-row > select, .cfg-row > .remember, .cfg-row-adj > input[type="text"] { grid-column: 2; }
  .cfg-move { grid-column: 1 / -1; justify-content: flex-start; }
  .cfg-activar { flex-direction: column; align-items: stretch; }
  .link-row, .campo-row { flex-direction: column; align-items: stretch; }
  .campo-row { display: grid; grid-template-columns: 1fr; }
  .auth-brand { min-height: auto; padding: 1.3rem; }
  .auth-brand h1 { font-size: 2.4rem; }
  .filters input, .filters select { width: 100%; }
}
@media (max-width: 720px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.data td { border: 0; display: flex; justify-content: space-between; gap: 1rem; }
  table.data td::before { content: attr(data-label); color: var(--muted); font-weight: 800; }
}
.onb-body { scrollbar-gutter: stable; }
.onb-body .onb-card { width: min(640px, calc(100% - 2.5rem)) !important; margin-inline: auto; }
