/* Colores del logo Terra Nova: gris #333333, verde #4A9A2B, blanco.
   --brand es un verde un poco más oscuro que el del logo para que el texto blanco y los enlaces se lean bien. */
:root {
  --bg: #f4f5f3; --surface: #ffffff; --ink: #222222; --muted: #676b67; --line: #e0e3df;
  --brand: #3f8a24; --brand-2: #4a9a2b; --brand-soft: #eaf4e5; --accent: #555555;
  --chrome: #333333; --chrome-ink: #ececec;
  --ok: #3f8a24; --warn: #b7791f; --err: #b3392f; --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#1a1a1a; --surface:#242424; --ink:#ececec; --muted:#a3a3a3; --line:#383838;
    --brand:#6cc04a; --brand-2:#7fcf5d; --brand-soft:#26331f; --accent:#9a9a9a; --chrome:#2a2a2a; --shadow:none; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 1.45rem; margin: 0 0 .8rem; font-weight: 650; }
h2 { font-size: 1rem; margin: 0 0 .8rem; font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: .85rem; font-weight: 400; } .center { text-align: center; } .r { text-align: right; white-space: nowrap; }
.neg { color: var(--err); }

/* layout */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; background: var(--chrome); color: #fff; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; z-index: 30; overflow-y: auto; border-right: 3px solid var(--brand-2); }
.sidebar a.side-brand { display: block; padding: 2px 6px 14px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.12); border-radius: 0; }
.sidebar a.side-brand:hover { background: none; }
.side-brand img { display: block; width: 100%; height: auto; }
.sidebar a, .sidebar .link { display: flex; align-items: center; gap: 10px; color: var(--chrome-ink); padding: 9px 10px; border-radius: 8px; font-size: .93rem; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font: inherit; }
.sidebar a:hover, .sidebar .link:hover { background: rgba(255,255,255,.08); }
.sidebar a.on { background: rgba(255,255,255,.10); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-2); }
.sidebar a.on .ic { color: var(--brand-2); opacity: 1; }
.ic { width: 20px; text-align: center; opacity: .9; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); padding-top: 8px; }
.main { margin-left: 232px; padding: 24px 28px 60px; max-width: 1400px; }
.main.solo { margin: 0 auto; }
.topbar { display: none; }
.scrim { display: none; }
@media (max-width: 860px) {
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 10px; background: var(--chrome); color: #fff; border-bottom: 3px solid var(--brand-2); padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar .brand { color: #fff; font-weight: 650; display: flex; align-items: center; gap: 8px; }
  .topbar .brand img { width: 26px; height: 26px; }
  .topbar .who { margin-left: auto; font-size: .78rem; opacity: .85; text-align: right; }
  .menu-btn { background: none; border: 0; color: #fff; font-size: 1.4rem; padding: 2px 6px; cursor: pointer; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .main { margin-left: 0; padding: 16px 14px 70px; }
}

/* components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.narrow { max-width: 460px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.head-row h1 { margin: 0; }
.actions { display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #151a12; } }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.btn.big { padding: 12px 18px; font-size: 1rem; font-weight: 600; }
.btn.block { width: 100%; } .btn.small { padding: 5px 10px; font-size: .85rem; }
.alert { padding: 10px 14px; border-radius: 8px; background: var(--brand-soft); margin-bottom: 12px; }
.alert.err { background: color-mix(in srgb, var(--err) 14%, var(--surface)); color: var(--err); }
.alert.ok { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); }
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); border-color: var(--brand); }
input[type=checkbox] { width: auto; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
label > span { font-weight: 550; }
label small { font-size: .78rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.form-actions input { max-width: 240px; }
.danger-zone { margin-top: 8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters select, .filters input { width: auto; min-width: 150px; flex: 0 1 auto; }
.filters input[type=search] { flex: 1 1 200px; }
.sums { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; color: var(--muted); margin: 6px 0 10px; }
.sums b { color: var(--ink); }

/* tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card .table-wrap { border: 0; }
.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; }
.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t td.nw { white-space: nowrap; }
.t td.wide { min-width: 220px; max-width: 420px; }
.t tr:last-child td { border-bottom: 0; }
.t tr.clickable { cursor: pointer; } .t tr.clickable:hover td { background: var(--brand-soft); }
.t.compact td { padding: 6px 8px; }
.t.perm td { white-space: nowrap; } .ck { flex-direction: row; align-items: center; gap: 5px; color: var(--ink); font-size: .85rem; }
.t td input, .t td select { padding: 6px 8px; min-width: 120px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.tag.t-pendiente { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.tag.t-anulada, .tag.t-incobrable { background: color-mix(in srgb, var(--err) 14%, var(--surface)); color: var(--err); }
.ot-card .tag.t-app { margin-top: 6px; }
@media (max-width: 700px) {
  .t thead { display: none; }
  .t, .t tbody, .t tr, .t td { display: block; width: 100%; }
  .t tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .t td { border: 0; padding: 2px 8px; display: flex; justify-content: space-between; gap: 10px; text-align: right; }
  .t td::before { content: attr(data-l); color: var(--muted); font-size: .8rem; text-align: left; }
  .t td.nw { white-space: nowrap; }
.t td.wide { max-width: none; }
}

/* panel */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.kpi small { color: var(--muted); font-size: .8rem; } .kpi b { font-size: 1.45rem; font-weight: 650; font-variant-numeric: tabular-nums; } .kpi span { color: var(--muted); font-size: .8rem; }
.kpi:hover { border-color: var(--brand-2); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid2 .card { margin: 0; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; gap: 2px; justify-content: center; }
.bar { width: 42%; max-width: 18px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.v, .dot.v { background: var(--brand-2); } .bar.g, .dot.g { background: var(--accent); }
.bar-col small { color: var(--muted); font-size: .72rem; }
.legend { font-size: .8rem; color: var(--muted); display: flex; gap: 12px; align-items: center; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -6px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li a { display: flex; flex-direction: column; padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.feed li a span { color: var(--muted); font-size: .82rem; }
.feed li.nueva { animation: flash 2.5s; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 30%, transparent); } to { background: transparent; } }
.live { color: var(--ok); font-size: .75rem; font-weight: 600; margin-left: 6px; }

/* OT */
.ot-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ot-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); box-shadow: var(--shadow); }
.ot-card:hover { border-color: var(--brand-2); }
.ot-card.nueva { animation: flash 3s; }
.ot-top { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; } .ot-top b { color: var(--brand); }
.ot-cli { font-weight: 600; margin: 2px 0; } .ot-meta, .ot-serv { font-size: .84rem; color: var(--muted); }
.ot-form { max-width: 620px; display: flex; flex-direction: column; gap: 14px; }
.ot-form input, .ot-form select, .ot-form textarea { font-size: 16px; padding: 11px 12px; }
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; max-height: 280px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.15); color: var(--ink); font-size: 1rem; }
.combo-list li { padding: 11px 12px; border-radius: 6px; cursor: pointer; }
.combo-list li:hover, .combo-list li.on { background: var(--brand-soft); }
.combo-list li.vacio { color: var(--muted); cursor: default; font-size: .88rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
legend { color: var(--muted); font-size: .88rem; font-weight: 550; padding: 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { flex-direction: row; } .chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { border: 1px solid var(--line); border-radius: 99px; padding: 8px 12px; color: var(--ink); font-size: .9rem; cursor: pointer; user-select: none; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--brand); }
/* agenda */
.semana-nav { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.semana { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: start; }
.dia { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.dia.hoy { border-color: var(--brand-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-2) 35%, transparent); }
.dia.pasado { opacity: .75; }
.dia header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.dia header .carga { flex: 1 0 100%; }
.carga { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 4px 0 2px; }
.carga i { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.carga i.sobre { background: var(--err); }
.visita { display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border-radius: 8px; color: var(--ink); background: var(--bg); border-left: 4px solid var(--accent); font-size: .88rem; }
.visita.fija { border-left-color: var(--brand-2); }
.visita.servicio { border-left-color: var(--warn); }
.visita:hover { background: var(--brand-soft); }
.visita .hora { font-weight: 700; font-variant-numeric: tabular-nums; } .visita .cli { font-weight: 600; } .visita .det { color: var(--muted); font-size: .8rem; }
.visita .tag { align-self: flex-start; margin-top: 3px; }
.visita.v-cancelada { opacity: .55; } .visita.v-cancelada .cli { text-decoration: line-through; }
.visita.hecha { background: color-mix(in srgb, var(--brand-2) 10%, var(--surface)); }
.visita.sin-agenda { border-left: 4px dashed var(--line); opacity: .8; }
.dia .vacio { margin: 6px 0; }
.leyenda { margin-top: 10px; } .ley { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.ley.fija { background: var(--brand-2); } .ley.servicio { background: var(--warn); }
.kpi .carga { margin: 6px 0 2px; }
tr.pausado td { opacity: .6; }
.plan-edit[open] { min-width: 300px; } .plan-edit summary { list-style: none; }
.plan-edit .form-grid { margin-top: 8px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .semana { grid-template-columns: 1fr; } .dia { min-height: 0; } }

/* rendiciones */
.tag.t-abierta { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--ink); }
.tag.t-enviada { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.tag.t-rechazado { background: color-mix(in srgb, var(--err) 14%, var(--surface)); color: var(--err); }
.kpi b.txt { font-size: 1.1rem; }
.foto-btn { position: relative; align-items: center; justify-content: center; min-height: 64px; border: 2px dashed var(--brand-2); border-radius: var(--radius);
  background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 1rem; padding: 12px; cursor: pointer; text-align: center; }
.foto-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.foto-btn img { max-width: 100%; max-height: 260px; border-radius: 6px; margin-top: 8px; }
.foto-btn.ok { border-style: solid; }
.rend-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin-bottom: 16px; }
.rend-item { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.rend-item.rechazado { opacity: .7; border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
.rend-foto { flex: 0 0 84px; height: 84px; border-radius: 6px; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.rend-foto img { width: 100%; height: 100%; object-fit: cover; }
.rend-foto.sin { color: var(--muted); font-size: .75rem; border: 1px dashed var(--line); }
.rend-info { flex: 1; min-width: 0; } .rend-info .ot-top b { color: var(--ink); }
.rend-acc { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.rend-rev { display: flex; gap: 6px; flex-wrap: wrap; } .rend-rev input { flex: 1 1 160px; width: auto; padding: 6px 8px; }
.rend-flujo { display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; } .dl dt { color: var(--muted); } .dl dd { margin: 0; }

/* login */
.login { max-width: 380px; margin: 9vh auto 0; text-align: center; padding: 0 16px; }
.login-logo { background: #333333; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border-bottom: 4px solid var(--brand-2); }
.login-logo img { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; }
.login .muted { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .login form { text-align: left; display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
details.add { margin-top: 12px; } details.add summary { list-style: none; display: inline-flex; } details.add[open] summary { margin-bottom: 12px; }

/* ---------- cotizaciones web y configuración del cotizador ---------- */
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
label.check input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--brand); }
.cot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cot-grid .card h2, #zonas h2 { margin-top: 0; }
.cot-mapa { height: 220px; border-radius: 8px; margin: 10px 0; z-index: 0; background: #e8ebe6; }
.cot-mapa.grande { height: 460px; }
@media (max-width: 700px) { .cot-mapa.grande { height: 340px; } }
table.mini { width: 100%; border-collapse: collapse; }
table.mini td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.mini .num { text-align: right; white-space: nowrap; }
table.mini tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); }
.cot-pasos { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: p; }
.cot-pasos li { padding: 6px 12px; border-radius: 99px; background: var(--bg); color: var(--muted); font-size: .85rem; }
.cot-pasos li.hecho { background: var(--brand-soft); color: var(--brand); }
.cot-pasos li.actual { background: var(--brand); color: #fff; font-weight: 600; }
.tag.t-cot-nueva { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.tag.t-cot-rechazada, .tag.t-cot-cancelada { background: color-mix(in srgb, var(--err) 14%, var(--surface)); color: var(--err); }
.tag.t-cot-finalizada { background: var(--brand); color: #fff; }
.cot-prueba { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.cot-prueba input { flex: 1 1 260px; width: auto; }
.zonas-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.zona-form { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface); }
.zona-form.inactiva { opacity: .7; border-style: dashed; }
.zona-form.nueva { border-color: var(--brand); }
.zona-form .actions { flex-wrap: wrap; }
.zona-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.zona-top input[type=color] { width: 40px; height: 36px; padding: 2px; flex: none; }
.zona-top .zona-nombre { flex: 1; min-width: 0; font-weight: 600; }
.zona-tip { background: rgba(255,255,255,.85); border: 0; box-shadow: none; font-weight: 600; font-size: .75rem; padding: 1px 4px; }
.serv-form { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.serv-form:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.serv-form h3 { margin: 0; }

.visita.v-por-confirmar { border-left: 4px dashed var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.ley.por-confirmar { background: transparent; border: 2px dashed var(--warn); width: 10px; height: 10px; }
.cot-fecha { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- contabilidad ---------- */
.cont-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 10px; scrollbar-width: none; }
.cont-tabs a { padding: 9px 14px; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; font-weight: 600; font-size: .92rem; }
.cont-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.cont-info { margin: 0 0 12px; }
label.inline { flex-direction: row; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); }
label.inline input { min-width: 0; width: auto; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 14px; }
.chip-link { padding: 5px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .85rem; }
.chip-link:hover, .chip-link.on { border-color: var(--brand); color: var(--brand); }
.cards-res { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card.kpi { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.card.kpi span { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.card.kpi b { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.card.kpi b.small-b { font-size: 1.05rem; }
.card.kpi small { color: var(--muted); font-size: .8rem; }
.card.kpi.destacado { background: var(--chrome); border-color: var(--chrome); color: #fff; }
.card.kpi.destacado span, .card.kpi.destacado small { color: #cfe5c6; }
.card.kpi.ok b { color: var(--brand); } .card.kpi.mal b { color: var(--err); }
.h2-sec { margin: 22px 0 10px; font-size: 1.1rem; }
table.tc { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; }
table.tc th { text-align: left; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .02em; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
table.tc th.c { text-align: center; }
table.tc td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tc td:first-child { white-space: normal; min-width: 220px; }
table.tc.compacta td { padding: 5px 10px; }
table.tc tr.seccion td { font-weight: 700; }
table.tc tr[data-toggle] { cursor: pointer; }
table.tc tr[data-toggle]:hover td { background: var(--brand-soft); }
table.tc .tg { display: inline-block; width: 16px; color: var(--muted); transition: transform .15s; }
table.tc tr.abierto .tg { transform: rotate(90deg); }
table.tc tr.det td { color: var(--muted); font-size: .85rem; }
table.tc tr.det td:first-child { padding-left: 34px; }
table.tc tr.subtotal td { background: var(--brand-soft); font-weight: 700; }
table.tc tr.total td { background: var(--chrome); color: #fff; font-weight: 800; }
table.tc tr.total .neg { color: #ffb4ab; }
table.tc tr.titulo td { color: var(--brand); font-weight: 800; letter-spacing: .05em; padding-top: 14px; }
table.tc tr.cierre td { background: #fff8e6; }
table.tc td.haber { padding-left: 34px; }
.asiento { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.asiento header { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: .9rem; }
.asiento.cierre header { background: #fff4d6; }
.asiento table.tc td:nth-child(2), .asiento table.tc td:nth-child(3) { width: 120px; }
.paginas { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }
form.card.cierre { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
form.card.cierre > div { flex: 1 1 260px; } form.card.cierre p { margin: 2px 0 0; }
form.card.cierre select { width: auto; }/* Clasificar banco (vista tributario vs real) */
.clasif-lista { display: grid; gap: 10px; margin-bottom: 16px; }
form.card.clasif { margin: 0; padding: 12px 14px; }
form.card.clasif.pend { border-left: 4px solid var(--err); }
.clasif-mov { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.clasif-mov b { font-variant-numeric: tabular-nums; min-width: 110px; }
.clasif-mov .desc { flex: 1 1 220px; }
.clasif-campos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.clasif-campos select, .clasif-campos input { flex: 1 1 180px; width: auto; }
.clasif-campos .btn { flex: 0 0 auto; }
form.card.clasif p { margin: 6px 0 0; }

/* Registro SII */
form.card.sii-carga { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
form.card.sii-carga > div { flex: 1 1 320px; } form.card.sii-carga p { margin: 4px 0 0; }
form.card.sii-carga input[type=file] { width: auto; flex: 0 1 280px; }
.cont-tabs.sub { margin-top: 4px; } .cont-tabs.sub a { font-size: .88rem; padding: 7px 12px; }
form.sii-cat { display: flex; gap: 6px; } form.sii-cat select { width: auto; min-width: 150px; } form.sii-cat input { width: 150px; } form.sii-cat .btn { padding: 4px 10px; }
form.sii-cat select.falta { border-color: var(--err); }
table.tc tr.anulado td { color: var(--muted); text-decoration: line-through; } table.tc tr.anulado td:last-child, table.tc tr.anulado td:nth-last-child(2) { text-decoration: none; }
