:root {
  --navy: #2b292a; --navy-2: #c8252c; --amber: #e53138; --bg: #f4f6f9; --card: #fff; --ink: #1c2430; --muted: #6b7684;
  --line: #e2e7ee; --ok: #2f7d52; --ok-bg: #e7f4ec; --warn: #9a6a00; --warn-bg: #fff4d6; --bad: #b3372b; --bad-bg: #fde8e5;
  --r: 10px; --side: 248px;
  color-scheme: light;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 14px; margin: 0 0 10px; color: var(--navy); }
a { color: var(--navy-2); }
.muted { color: var(--muted); }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- botones y campos */
.btn { appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c5ceda; background: #f9fbfd; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger.ghost { background: #fff; color: var(--bad); border-color: #f0c9c4; }
.btn.block { width: 100%; padding: 11px; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.more { margin: 12px auto; display: block; }
.link { background: none; border: 0; color: var(--navy-2); font: inherit; cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { background: none; border: 0; font-size: 20px; cursor: pointer; padding: 6px 10px; color: inherit; border-radius: 8px; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid #cfd7e2; border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; min-height: 38px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, tr:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--navy); }
input:disabled, select:disabled, textarea:disabled { background: #f5f7fa; color: #3a4452; }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #3a3738 0%, #1c1b1b 100%); }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 28px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.25); display: grid; gap: 12px; }
.login-card .logo { width: 170px; height: auto; justify-self: center; margin-bottom: 4px; }
.login-card h1 { text-align: center; } .login-card > p.muted { text-align: center; margin-top: -6px; }
.login-card h1 { margin: 0; }
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.msg { margin: 0; min-height: 1em; font-size: 13px; }
.msg.bad { color: var(--bad); } .msg.ok { color: var(--ok); }

/* ---------- estructura */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: var(--navy); color: #e9e6e6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding-top: env(safe-area-inset-top); }
.brand { display: flex; gap: 10px; align-items: center; padding: 16px 16px 12px; }
.brand img { width: 42px; height: 42px; border-radius: 10px; background: #fff; padding: 3px; object-fit: contain; }
.brand b { color: #fff; display: block; font-size: 15px; } .brand small { color: #b9b3b3; }
.nav { flex: 1; padding: 4px 8px 12px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #a8a2a2; padding: 14px 10px 4px; display: flex; gap: 8px; }
.nav a { display: flex; align-items: center; gap: 8px; color: #ece9e9; text-decoration: none; padding: 7px 10px 7px 30px; border-radius: 7px; }
.nav a.top { padding-left: 10px; font-weight: 600; }
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a.on { background: rgba(229,49,56,.22); color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
.nav .ic { width: 16px; text-align: center; opacity: .8; }
.nav .ro { opacity: .6; font-size: 11px; margin-left: auto; }
.userbox { border-top: 1px solid rgba(255,255,255,.1); padding: 12px 16px 16px; display: grid; gap: 8px; font-size: 13px; }
.userbox .link { color: #f0d4d5; }
.userbox .row { display: flex; gap: 14px; }
.userbox .muted { color: #b9b3b3; }
.userbox select { background: #1c1b1b; color: #fff; border-color: #4a4647; }
.userbox .fld span { color: #b9b3b3; }
.demo-tag { background: var(--amber); color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .04em; padding: 4px 8px; border-radius: 6px; justify-self: start; }
.content { flex: 1; min-width: 0; }
.topbar { display: none; }
main { padding: 24px 28px 60px; max-width: 1400px; }
.scrim { display: none; }

/* ---------- páginas */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.help { color: var(--muted); margin: 2px 0 0; max-width: 780px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.filters input[type=search] { max-width: 260px; }
.filters select { width: auto; max-width: 220px; }
.filters .ftoggle { display: none; }
.totals { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.totals b { color: var(--ink); }
.notice { background: var(--warn-bg); color: #5c4300; border: 1px solid #f1dc9c; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--r); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- tablas */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-width: 100%; }
.card .table-wrap { border: 0; border-radius: 0; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.grid th { position: sticky; top: 0; background: #f7f9fc; text-align: left; font-weight: 600; color: #4a5565; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.grid td { padding: 8px 10px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover { background: #f6f9fd; }
.grid .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid tfoot td { font-weight: 700; background: #f7f9fc; border-top: 2px solid var(--line); }
.grid.compact td, .grid.compact th { padding: 6px 9px; }
tr.ok td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
tr.warn { background: var(--warn-bg); } tr.warn:hover { background: #ffedbd; }
tr.bad { background: var(--bad-bg); } tr.bad:hover { background: #fbd8d3; }
tr.sub td { font-weight: 700; background: #f3f6fa; }
tr.total td { font-weight: 800; background: #e8eef6; color: var(--navy); }
/* estados de viaje */
tr.st-asignado td:first-child { box-shadow: inset 4px 0 0 #8fa3b8; }
tr.st-cargado { background: #fff8e6; } tr.st-cargado td:first-child { box-shadow: inset 4px 0 0 #e0a526; }
tr.st-entregado td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.grid.perms select { min-width: 84px; padding: 5px 6px; min-height: 32px; }
.grid.perms th, .grid.perms td { padding: 8px 6px; }
.legend-areas { padding: 10px 14px; font-size: 12.5px; color: var(--muted); }
.legend-areas p { margin: 2px 0; }
label.inline { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
label.inline input { width: 16px; height: 16px; }

/* ---------- tarjetas, KPIs, gráficos */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis.small { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; }
.kpi .kl { font-size: 12px; color: var(--muted); }
.kpi b { font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.warn { border-color: #f1dc9c; background: #fffbef; }
.kpi.bad b { color: var(--bad); } .kpi.good b { color: var(--ok); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; min-width: 0; }
.cards2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .ax { font-size: 12px; fill: var(--muted); }
.chart .base { stroke: var(--line); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
ul.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ul.alerts li { padding: 8px 10px; border-radius: 8px; background: #f6f8fb; border-left: 3px solid var(--muted); }
ul.alerts li.warn { background: var(--warn-bg); border-color: #e0a526; }
ul.alerts li.bad { background: var(--bad-bg); border-color: var(--bad); }
ul.alerts a { color: inherit; text-decoration: none; }
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.unit { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.unit.warn { border-color: #f1dc9c; } .unit.muted { opacity: .7; }
.unit header { display: flex; justify-content: space-between; align-items: center; }
.unit header b { font-size: 17px; letter-spacing: .03em; }
.unit p { margin: 2px 0 8px; font-size: 12.5px; }
.unit dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 13px; }
.unit dt { color: var(--muted); } .unit dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.warn-t { color: var(--warn); font-weight: 700; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.muted { background: #eef1f5; color: var(--muted); }
ul.mini { list-style: none; padding: 8px 0 0; margin: 8px 0 0; border-top: 1px solid #eef1f5; font-size: 12px; display: grid; gap: 2px; }
ul.mini li.warn { color: var(--warn); font-weight: 600; } ul.mini li.bad { color: var(--bad); font-weight: 600; }

/* ---------- modal y formularios */
.modal-back { position: fixed; inset: 0; background: rgba(12,24,40,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(860px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal footer { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.modal footer .grow { flex: 1; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 14px; }
.fld { display: grid; gap: 4px; }
.fld > span { font-size: 12.5px; color: #4a5565; font-weight: 600; }
.fld.wide { grid-column: 1 / -1; }
.fld.chk { grid-template-columns: auto 1fr; align-items: center; align-self: end; min-height: 38px; }
.fld.chk > span { order: 2; }
.fld.err input, .fld.err select { border-color: var(--bad); background: #fff7f6; }
.req { color: var(--bad); font-style: normal; }
.meta { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
details { margin-top: 8px; } details ul { max-height: 200px; overflow: auto; font-size: 12.5px; }

.toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #1c2430; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 80; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); }

/* ---------- celular y tablet */
@media (max-width: 1100px) { .cards3 { grid-template-columns: 1fr; } .cards2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .side { position: fixed; z-index: 40; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; width: min(300px, 86vw); box-shadow: 4px 0 30px rgba(0,0,0,.3); }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; }
  .topbar b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  main { padding: 16px 12px 70px; }
  h1 { font-size: 19px; }
  .page-head .actions { width: 100%; } .page-head .actions .btn.primary { flex: 1; }
  .filters input[type=search], .filters select { max-width: none; flex: 1 1 140px; }
  .filters .ftoggle { display: inline-block; }
  .filters:not(.open) select.extra { display: none; }
  .quick { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 14px; padding: 0 12px 4px; scrollbar-width: none; }
  .quick .btn { flex: none; }
  /* tablas como tarjetas */
  .table-wrap { background: none; border: 0; overflow: visible; }
  .grid thead { display: none; }
  .grid, .grid tbody, .grid tr, .grid td, .grid tfoot { display: block; width: 100%; }
  .grid tr { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; padding: 8px 4px; display: grid; grid-template-columns: 1fr 1fr; }
  .grid td { display: block; border: 0; padding: 3px 10px; text-align: left; min-width: 0; overflow-wrap: anywhere; }
  .grid td::before { content: attr(data-l); display: block; color: var(--muted); font-size: 11px; line-height: 1.2; }
  .grid td:empty { display: none; }
  .grid td:first-child { font-weight: 700; }
  .grid.compact tr { grid-template-columns: 1fr 1fr 1fr; }
  .grid.compact td:first-child { grid-column: 1 / -1; }
  .grid td .btn { width: 100%; }
  .grid .n { white-space: normal; }
  .grid tfoot tr { background: #e8eef6; }
  .card .grid tr { border-color: #eef1f5; }
  .modal-back { padding: 0; place-items: end stretch; }
  .modal { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .form { grid-template-columns: 1fr 1fr; }
  .kpi b { font-size: 18px; }
}
@media (max-width: 480px) { .form { grid-template-columns: 1fr; } .kpis { grid-template-columns: 1fr 1fr; } .kpi { padding: 10px 12px; } .kpi b { font-size: 16px; } }
@media print { .side, .topbar, .page-head .actions, .filters, .quick { display: none !important; } main { padding: 0; } }

/* estados (pastillas y botones de resumen) */
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: #e6effa; color: #2a5a93; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; text-align: left; min-width: 110px; }
.chip b { font-size: 13px; } .chip span { font-size: 12px; color: var(--muted); }
.chip.t-ok { border-left: 4px solid var(--ok); } .chip.t-warn { border-left: 4px solid #e0a526; } .chip.t-bad { border-left: 4px solid var(--bad); }
.chip.t-info { border-left: 4px solid #2a5a93; } .chip.t-muted { border-left: 4px solid #b8c0cc; }
.chip.on { background: #2b292a; border-color: #2b292a; color: #fff; } .chip.on span { color: #d9d9d9; }

/* asistente */
.asistente { display: flex; flex-direction: column; min-height: calc(100vh - 60px); }
.chat { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 4px 0 12px; }
.chat-vacio { color: var(--muted); max-width: 640px; } .chat-vacio .ejemplos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chat-vacio .chip { min-width: 0; font-size: 13px; }
.msg-usuario, .msg-asistente { max-width: 760px; border-radius: 12px; padding: 10px 12px; }
.msg-usuario { align-self: flex-end; background: #2b292a; color: #fff; }
.msg-asistente { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.msg-asistente.err { border-color: var(--bad); background: var(--bad-bg); }
.msg-asistente.pensando { color: var(--muted); font-style: italic; }
.msg-t { white-space: pre-wrap; line-height: 1.45; }
.msg-img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; margin-bottom: 6px; }
.prop { border: 1px solid var(--line); border-left: 4px solid #2a5a93; border-radius: 10px; padding: 10px; margin-top: 10px; background: #fafcff; }
.prop-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.prop-f { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; }
.pf span { display: block; font-size: 11px; color: var(--muted); } .pf b { font-weight: 600; font-size: 13px; word-break: break-word; }
.prop-a { margin-top: 8px; display: flex; justify-content: flex-end; }
.composer { position: sticky; bottom: 0; background: var(--bg, #f4f6f9); padding: 10px 0 6px; border-top: 1px solid var(--line); }
.composer .row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: vertical; min-height: 44px; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.composer .btns { display: flex; gap: 6px; }
.adj { display: flex; align-items: center; gap: 6px; } .adj img { max-height: 70px; border-radius: 6px; margin-bottom: 6px; }
.ver-adj { margin-top: 6px; align-self: flex-start; }
@media (max-width: 700px) { .composer .row { flex-direction: column; align-items: stretch; } .composer .btns { justify-content: flex-end; } }
.msg-t.md { white-space: normal; } .msg-t.md p { margin: 0 0 6px; } .msg-t.md p:last-child { margin-bottom: 0; }
.msg-t.md ul { margin: 2px 0 8px; padding-left: 20px; } .msg-t.md li { margin: 2px 0; }
.btn.voz.rec { background: #c62828; border-color: #c62828; color: #fff; animation: latido 1.2s ease-in-out infinite; }
@keyframes latido { 50% { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .btn.voz.rec { animation: none; } }
/* ayuda de campo y color naranja de cheques vencidos todavía cobrables */
.fld-help { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
tr.late { background: #ffe6cc; } tr.late:hover { background: #ffdab3; }

/* ---------- cuentas corrientes de neumáticos ---------- */
.cc-main { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.cc-side { padding: 10px; display: grid; gap: 8px; }
.cc-side-head { display: flex; gap: 6px; } .cc-side-head input { flex: 1; min-width: 0; }
.cc-list { list-style: none; margin: 0; padding: 0; max-height: 66vh; overflow: auto; }
.cc-list button { all: unset; box-sizing: border-box; display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 8px; border-radius: 8px; cursor: pointer; }
.cc-list button:hover { background: #f6f9fd; } .cc-list button[aria-current="true"] { background: #fdecec; }
.cc-list .nm { flex: 1; min-width: 0; } .cc-list .nm b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-list .nm small, .cc-list .bal small { display: block; color: var(--muted); font-size: 11px; }
.cc-list .bal { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cc-list small.bad { color: var(--bad) !important; } .cc-list small.ok { color: var(--ok) !important; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line); }
.dot.debe { background: var(--warn); } .dot.vencido { background: var(--bad); } .dot.aldia { background: var(--ok); }
.cc-det { padding: 0; overflow: hidden; } .cc-det > .empty { padding: 48px 20px; }
.cc-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px; border-bottom: 1px solid var(--line); }
.cc-saldo { text-align: right; } .cc-saldo small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.cc-saldo b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.cc-acc { padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .cc-acc .grow { flex: 1; }
.cc-det .table-wrap { border: 0; border-radius: 0; }
.cc .back { display: none; }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.tag { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: #eef1f5; }
.tag.t-cobro, .tag.t-nota { background: var(--ok-bg); color: var(--ok); }
small.sub { display: block; color: var(--muted); font-size: 12px; }
td.rowact { white-space: nowrap; width: 1%; }
button.mini { all: unset; cursor: pointer; color: var(--muted); font-size: 12px; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line); }
button.mini:hover { color: var(--navy-2); border-color: #f0c9c4; } button.mini.done { color: var(--ok); border-color: #cfe8d9; }
.grid td.bad { color: var(--bad); font-weight: 600; }
@media (max-width: 900px) {
  .cc-main { grid-template-columns: minmax(0, 1fr); }
  .cc-main.has-sel .cc-side { display: none; } .cc-main:not(.has-sel) .cc-det { display: none; }
  .cc .back { display: inline-block; margin-bottom: 6px; } .cc-saldo { text-align: left; } .cc-list { max-height: none; }
}

/* ---------- formularios de comprobantes ---------- */
.docform { display: grid; gap: 12px; }
.docform h3.sub, h3.sub { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.items, .vals { display: grid; gap: 6px; }
.irow { display: grid; grid-template-columns: 80px minmax(0, 1fr) 140px 120px 32px; gap: 8px; align-items: start; }
.irow.ihead, .vrow.vhead { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ipcell { display: grid; gap: 4px; min-width: 0; }
.irow output { padding-top: 9px; font-variant-numeric: tabular-nums; }
.idisp { font-size: 11px; color: var(--muted); } .idisp.bad { color: var(--bad); font-weight: 600; }
.ifoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 8px; }
.tot { font-size: 16px; font-variant-numeric: tabular-nums; }
.vrow { display: grid; grid-template-columns: 170px minmax(0, 1fr) 140px 32px; gap: 8px; align-items: center; }
.vdet { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; min-width: 0; }
.vals-box { display: grid; gap: 6px; } .vals-box > .btn { justify-self: start; }
.vtot { display: flex; gap: 18px; flex-wrap: wrap; font-variant-numeric: tabular-nums; } .vtot .bad { color: var(--bad); font-weight: 600; }
.orow { display: grid; grid-template-columns: minmax(0, 1fr) 100px minmax(0, 220px) 32px; gap: 8px; align-items: center; }
.orow .row { display: flex; gap: 6px; } .orow .row select { width: 80px; }
.pname b { display: block; } .pname small { color: var(--muted); font-size: 12px; }
input.n { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .irow { grid-template-columns: 64px minmax(0, 1fr) 32px; } .irow .ipcell { grid-column: 2; grid-row: 1; } .irow > input.n:nth-of-type(2) { grid-column: 1 / 3; } .irow output { display: none; } .irow.ihead { display: none; }
  .vrow { grid-template-columns: minmax(0, 1fr) 110px 32px; } .vrow .vdet { grid-column: 1 / -1; grid-row: 2; } .vrow.vhead { display: none; }
  .orow { grid-template-columns: minmax(0, 1fr) 80px 32px; } .orow > :nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- calculador de importación ---------- */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 16px; align-items: start; }
.calc-res { position: sticky; top: 12px; }
.calc .rows { display: grid; gap: 6px; margin-bottom: 8px; }
.crow { display: grid; grid-template-columns: minmax(0, 2fr) repeat(auto-fit, minmax(80px, 1fr)) 32px; gap: 6px; align-items: center; }
.calc .chk { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 4px 0 4px 10px; border-bottom: 1px solid #eef1f5; border-left: 3px solid transparent; }
.lrow b { font-variant-numeric: tabular-nums; } .lrow small { color: var(--muted); min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.lrow.c { border-left-color: var(--navy-2); } .lrow.d { border-left-color: #e4de2d; }
.lg.c { color: var(--navy-2); } .lg.d { color: #c7c11f; }
.vep { background: var(--warn-bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: minmax(0, 1fr); } .calc-res { position: static; } }
.cc-tabs { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.cc-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.cc-tabs button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.cc-pend { padding: 10px 16px 0; } .cc-pend .table-wrap { border: 1px solid var(--line); border-radius: 8px; }
.cc-movh { padding: 12px 16px 6px; }
.ifoot .row { display: flex; gap: 6px; }
label.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.neum-page { padding: 0 !important; max-width: none !important; }
.neum-bar { display: flex; justify-content: flex-end; padding: 4px 12px 0; font-size: 13px; }
.neum-frame { display: block; width: 100%; height: calc(100vh - 92px); border: 0; background: #F2F3F5; }
@media (max-width: 900px) { .neum-frame { height: calc(100vh - 110px); } }

.prop-ok{margin:8px 0 0;padding:8px 12px;border-radius:8px;background:#E8F5EC;color:#1E6B3A;font-size:13px;font-weight:600}
