/* Odlix functional prototype, Ledger direction. One deliberate light look: every colour is set
   here, so the page reads the same whatever theme hosts it. */
:root {
  --tinta: #16233b; --papel: #fbfcfa; --renglon: #dde5df; --columnar: #eef4ef; --sello: #2b4acb;
  --suave: #4f5b6e; --verde: #1f7a4d; --rojo: #b3261e; --ambar: #8a5a00; --canvas: #f3f6f4;
  --soft: #e6ebfa; --borde: #c9d3cc; --blanco: #fff;
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--tinta); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, dl, dd, ol, ul { margin: 0; }
svg { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--sello); outline-offset: 2px; }
.icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: 0; top: 0; transform: translateY(-200%); background: var(--papel); padding: 10px; z-index: 30; }
.skip:focus { transform: none; }

/* shell */
.layout { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100%; }
.rail { background: var(--tinta); color: #c9d2e0; padding: 14px 8px 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--papel); font-size: 24px; font-weight: 600; letter-spacing: -0.06em; line-height: 1; padding: 2px 8px 14px; }
.brand svg { width: 24px; height: 24px; }
.grp { font-size: 12px; color: #93a0b6; padding: 14px 8px 4px; }
.nav { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 8px; border-radius: 4px; }
.nav:hover { background: rgba(251, 252, 250, 0.07); }
.nav[aria-current="page"] { background: rgba(251, 252, 250, 0.14); color: var(--papel); font-weight: 500; }
.nav:focus-visible { outline-color: var(--papel); }
.nav .n { margin-left: auto; font-size: 12px; background: #c9432f; color: #fff; border-radius: 99px; padding: 0 6px; line-height: 18px; font-weight: 500; }
.me { margin: auto -8px 0; padding: 10px 14px; border-top: 1px solid rgba(251, 252, 250, 0.14); display: flex; gap: 10px; align-items: center; color: var(--papel); }
.me small { display: block; color: #93a0b6; font-size: 12px; }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--sello); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.work { min-width: 0; display: flex; flex-direction: column; }
.top { height: 48px; background: var(--papel); border-bottom: 1px solid var(--renglon); display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.menu-btn { display: none; align-items: center; gap: 6px; font-weight: 500; height: 32px; padding: 0 8px; border-radius: 4px; }
.crumb { color: var(--suave); font-size: 13px; white-space: nowrap; }
.crumb b { color: var(--tinta); font-weight: 600; }
.crumb i { font-style: normal; margin: 0 8px; }
.find { margin-left: auto; position: relative; width: 390px; max-width: 100%; }
.find label { height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--borde); border-radius: 4px; background: var(--blanco); color: var(--suave); }
.find label:focus-within { outline: 2px solid var(--sello); outline-offset: 1px; }
.find input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; }
.find kbd { font: inherit; font-size: 12px; border: 1px solid var(--renglon); border-radius: 3px; padding: 0 5px; }
.hits { position: absolute; top: 36px; left: 0; right: 0; background: var(--blanco); border: 1px solid var(--borde); border-radius: 4px; box-shadow: 0 10px 30px rgba(22, 35, 59, 0.16); padding: 4px; z-index: 10; }
.hits a { display: flex; justify-content: space-between; gap: 12px; padding: 6px 8px; border-radius: 3px; }
.hits a:hover, .hits a:focus-visible { background: var(--columnar); outline: 0; }
.hits small { color: var(--suave); white-space: nowrap; }
.hits p { padding: 8px; color: var(--suave); }
.co { font-weight: 600; white-space: nowrap; }
main { padding: 24px 28px 40px; min-width: 0; flex: 1; max-width: 1500px; width: 100%; }
main:focus { outline: 0; }

/* pieces */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.sub { color: var(--suave); margin-top: 3px; }
.acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { height: 32px; padding: 0 12px; border: 1px solid var(--borde); background: var(--blanco); border-radius: 4px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--columnar); }
.btn.pri { background: var(--sello); border-color: var(--sello); color: #fff; }
.btn.pri:hover { background: #2440b3; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.lk { color: var(--sello); font-weight: 500; }
.lk:hover { text-decoration: underline; }
.panel { background: var(--blanco); border: 1px solid var(--renglon); min-width: 0; }
.ph { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--renglon); }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; color: var(--suave); margin-bottom: 4px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--verde); }
.badge.late { color: var(--rojo); } .badge.late::before { background: var(--rojo); }
.badge.now { color: var(--ambar); } .badge.now::before { background: #d49a1c; }
.badge.none { color: var(--suave); } .badge.none::before { background: #b5bfc9; }
.empty { padding: 28px 16px; color: var(--suave); text-align: center; }
.error { color: var(--rojo); font-weight: 500; }
.error:empty { display: none; }
.note { color: var(--suave); font-size: 13px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 20px; }
.stat { padding: 14px 18px 16px; display: grid; gap: 2px; border-left: 1px solid var(--renglon); margin-left: -1px; }
.stat:hover b { color: var(--sello); }
.stat span { color: var(--suave); }
.stat b { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.stat small { font-size: 13px; color: var(--suave); }
.stat.bad b { color: var(--rojo); }
.two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--renglon); }
.task:last-child { border-bottom: 0; }
.task:hover b { color: var(--sello); }
.task .ti { width: 32px; height: 32px; border-radius: 4px; background: var(--soft); color: var(--sello); display: grid; place-items: center; flex: none; }
.task small { display: block; color: var(--suave); font-size: 13px; }
.task .go { margin-left: auto; color: var(--sello); }
.task strong { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 14px; padding: 26px 16px 12px; height: 210px; }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.bars i { display: block; width: 100%; max-width: 64px; background: #b9c6ee; min-height: 2px; }
.bars .cur i { background: var(--sello); }
.bars span { font-size: 12px; color: var(--suave); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars small { font-size: 13px; color: var(--suave); }
.rank { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 9px 16px; border-bottom: 1px solid var(--renglon); }
.rank:last-child { border-bottom: 0; }
.rank b { font-variant-numeric: tabular-nums; }
.rank i { grid-column: 1 / -1; height: 4px; background: var(--columnar); display: block; }
.rank em { display: block; height: 100%; background: var(--sello); }
.aging { display: flex; height: 10px; margin: 14px 16px 8px; }
.aging i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 16px 14px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; display: block; }

/* lists */
.tools { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.segs { display: flex; gap: 2px; flex-wrap: wrap; }
.seg { height: 32px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border-radius: 4px; font-weight: 500; }
.seg:hover { background: var(--soft); }
.seg em { font-style: normal; color: var(--suave); font-weight: 400; font-variant-numeric: tabular-nums; }
.seg[aria-current="true"] { background: var(--sello); color: #fff; }
.seg[aria-current="true"] em { color: #cfd8fb; }
.q { margin-left: auto; width: 280px; max-width: 100%; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--borde); border-radius: 4px; background: var(--blanco); color: var(--suave); }
.q:focus-within { outline: 2px solid var(--sello); outline-offset: 1px; }
.q input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; }
.chip { display: inline-flex; gap: 6px; align-items: center; height: 26px; padding: 0 8px; border: 1px solid var(--borde); border-radius: 4px; background: var(--blanco); font-size: 13px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.split.open { grid-template-columns: minmax(0, 1fr) 380px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { background: var(--columnar); text-align: left; font-weight: 600; font-size: 13px; color: var(--suave); height: 32px; padding: 0 12px; border-bottom: 1px solid var(--renglon); white-space: nowrap; }
td { height: 32px; padding: 0 12px; border-bottom: 1px solid var(--renglon); white-space: nowrap; }
th.num { text-align: right; }
td.m { color: var(--suave); }
tbody tr:hover td { background: #f6f9f6; }
tr.sel td, tbody tr.sel:hover td { background: var(--soft); }
tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--sello); }
tr.total td { font-weight: 600; background: var(--columnar); border-bottom: 0; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; color: var(--suave); font-size: 13px; }
.foot b { color: var(--tinta); font-variant-numeric: tabular-nums; }

/* inspector */
.insp { border-top: 2px solid var(--sello); padding: 16px; display: grid; gap: 14px; position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto; }
.insp .t { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.insp h2 { font-size: 18px; line-height: 1.25; letter-spacing: -0.01em; }
.x { border: 1px solid var(--renglon); background: var(--blanco); border-radius: 4px; width: 28px; height: 28px; display: grid; place-items: center; color: var(--suave); flex: none; }
.x:hover { background: var(--columnar); }
.saldo { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--columnar); }
.saldo b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.facts { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 6px 10px; }
.facts dt { color: var(--suave); }
.facts dd { overflow-wrap: anywhere; }
.mini td, .mini th { height: 30px; padding: 0 6px; }
.mini td:first-child, .mini th:first-child { padding-left: 0; }
.mini td:last-child, .mini th:last-child { padding-right: 0; }
.mini th { background: none; }
.mini td { white-space: normal; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; justify-content: end; font-variant-numeric: tabular-nums; }
.totals dt { text-align: right; color: var(--suave); }
.totals dd { text-align: right; }
.totals .big { font-weight: 600; font-size: 16px; color: var(--tinta); }
.trail { list-style: none; padding: 0; display: grid; gap: 0; }
.trail li { padding: 5px 0 5px 16px; border-left: 2px solid var(--renglon); display: flex; justify-content: space-between; gap: 10px; position: relative; }
.trail li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--borde); }
.trail li[aria-current]::before { background: var(--sello); }
.trail li[aria-current] a { font-weight: 600; }
.trail small { color: var(--suave); white-space: nowrap; }
.links { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* dialogs and forms */
dialog { border: 0; border-radius: 6px; padding: 0; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--blanco); color: var(--tinta); box-shadow: 0 24px 70px rgba(22, 35, 59, 0.3); }
dialog.wide { width: min(860px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(22, 35, 59, 0.42); }
.dh { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--renglon); position: sticky; top: 0; background: var(--blanco); z-index: 1; }
.dh h2 { font-size: 18px; letter-spacing: -0.01em; }
.db { padding: 18px 20px 20px; display: grid; gap: 14px; }
.fg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.f { display: grid; gap: 4px; min-width: 0; }
.f.w { grid-column: 1 / -1; }
.f > span { font-size: 13px; color: var(--suave); }
.in { height: 32px; width: 100%; border: 1px solid var(--borde); border-radius: 4px; padding: 0 10px; background: var(--blanco); }
.in:focus-visible { outline-offset: 0; }
.with { display: flex; gap: 8px; }
.source { padding: 10px 12px; background: var(--columnar); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lines { display: grid; gap: 6px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 76px 110px 110px 28px; gap: 8px; align-items: start; }
.line .ro { height: 32px; display: flex; align-items: center; justify-content: flex-end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line small { display: block; color: var(--suave); font-size: 12px; margin-top: 2px; }
.line small.bad { color: var(--rojo); }
.lhead { font-size: 13px; color: var(--suave); }
.lhead span:nth-child(n + 3) { text-align: right; }
.calc { padding: 12px; background: var(--columnar); }
.fa { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.steps { list-style: none; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--suave); }
.steps li.done { color: var(--tinta); }
.steps li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--borde); flex: none; }
.steps li.run::before { border-color: var(--sello); border-top-color: transparent; animation: spin 0.7s linear infinite; }
.steps li.done::before { border-color: var(--verde); background: var(--verde); box-shadow: inset 0 0 0 3px var(--blanco); }
@keyframes spin { to { transform: rotate(360deg); } }
.cae { padding: 14px; background: #eaf5ee; border: 1px solid #c5e0cf; display: grid; gap: 4px; }
.cae b { font-size: 18px; letter-spacing: -0.01em; }
.guide { display: grid; gap: 0; counter-reset: g; }
.guide a { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--renglon); align-items: baseline; }
.guide a::before { counter-increment: g; content: counter(g); width: 22px; height: 22px; border-radius: 50%; background: var(--soft); color: var(--sello); font-weight: 600; font-size: 12px; display: grid; place-items: center; flex: none; }
.guide a:hover b { color: var(--sello); }
.guide small { display: block; color: var(--suave); }
.menu-list { display: grid; gap: 2px; padding: 12px; }
.menu-list .nav { color: var(--tinta); }
.menu-list .nav[aria-current="page"] { background: var(--soft); color: var(--sello); }

/* printed document */
.sheet { border: 1px solid var(--borde); padding: 22px; display: grid; gap: 16px; background: var(--blanco); }
.sheet .sh { display: grid; grid-template-columns: 1fr 56px 1fr; gap: 16px; align-items: start; padding-bottom: 14px; border-bottom: 2px solid var(--tinta); }
.sheet .letter { width: 56px; height: 56px; border: 2px solid var(--tinta); display: grid; place-items: center; font-size: 30px; font-weight: 600; line-height: 1; }
.sheet .letter small { font-size: 9px; font-weight: 400; display: block; text-align: center; }
.sheet .r { text-align: right; }
.sheet .big { font-size: 18px; font-weight: 600; }
.sheet .cust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.sheet .bottom { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.sheet .fiscal { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.qr { width: 84px; height: 84px; }

#message { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--tinta); color: var(--papel); padding: 10px 16px; border-radius: 4px; box-shadow: 0 10px 30px rgba(22, 35, 59, 0.3); z-index: 40; max-width: calc(100vw - 32px); }
#message:empty { display: none; }

@media (max-width: 1100px) {
  .split.open { grid-template-columns: minmax(0, 1fr); }
  .insp { position: static; max-height: none; order: -1; }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .menu-btn { display: inline-flex; }
  .top { padding: 0 16px; gap: 10px; }
  .crumb, .co { display: none; }
  .find { margin-left: 0; flex: 1; width: auto; }
  main { padding: 18px 16px 32px; }
  h1 { font-size: 24px; }
  .q { margin-left: 0; width: 100%; }
  .fg { grid-template-columns: minmax(0, 1fr); }
  .line { grid-template-columns: minmax(0, 1fr) 64px 28px; }
  .line .ro, .lhead span:nth-child(n + 3) { display: none; }
  .sheet .sh { grid-template-columns: 1fr; }
  .sheet .r { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* full-page detail */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--suave); font-weight: 500; margin-bottom: 10px; border-radius: 4px; }
.back:hover { color: var(--sello); }
.sub.line { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; margin-top: 5px; }
.pager { display: inline-flex; align-items: center; gap: 6px; color: var(--suave); font-size: 13px; margin-right: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sq { width: 32px; height: 32px; border: 1px solid var(--borde); background: var(--blanco); border-radius: 4px; display: grid; place-items: center; color: var(--tinta); }
.sq:hover { background: var(--columnar); }
.sq.off { opacity: 0.4; }
.btn.sm { height: 26px; padding: 0 8px; font-size: 13px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--renglon); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 0 0 9px; color: var(--suave); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--tinta); }
.tab[aria-current="true"] { color: var(--tinta); box-shadow: inset 0 -2px 0 var(--sello); }
.tab em { font-style: normal; font-weight: 400; margin-left: 5px; font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; min-width: 0; }
.pad { padding: 14px 16px; }
.pad .facts { grid-template-columns: 132px minmax(0, 1fr); gap: 7px 10px; }
.pad .note { margin-top: 10px; }
.note.pad { padding: 10px 2px; }
.narrow { max-width: 720px; }
.narrow.wide { max-width: 900px; }
@media (max-width: 1100px) { .cols { grid-template-columns: minmax(0, 1fr); } }
