:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --ink: #16122b;
  --ink-2: #4b5363;
  --muted: #8a91a0;
  --line: #e4e6eb;
  --line-2: #eef0f3;
  --side: #0e0b1f;
  --side-ink: #c9c7d6;
  --accent: #ff3341;
  --accent-hover: #e62532;
  --accent-ink: #ffffff;
  --accent-soft: #fff0f1;
  --green: #1f7a4d; --green-soft: #e5f4ec;
  --amber: #a15c00; --amber-soft: #fff3dc;
  --red: #b42318; --red-soft: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* Lo marcado como oculto se oculta siempre, aunque su estilo diga otra cosa (p. ej. .btn) */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, .ph-name, .dh-figure, .stat-value { letter-spacing: -.015em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 16px; margin: 0 0 12px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-red { color: var(--red); font-weight: 600; }
.text-green { color: var(--green); font-weight: 600; }
.eyebrow { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.eyebrow a { color: var(--muted); }

/* ---------- Estructura ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: none; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 22px 20px 18px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
.brand:hover { text-decoration: none; }
.brand img { width: 168px; height: auto; display: block; }
.brand small { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding-left: 2px; }

.brand-text { font-weight: 700; line-height: 1.1; }
.brand-text small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; padding: 8px 10px; gap: 2px; flex: 1; }
.nav a, .me { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; color: var(--side-ink); }
.nav a:hover, .me:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav a.active, .me.active { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav svg, .me svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.count { margin-left: auto; background: var(--accent); color: #fff; font-size: 12px; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.me span { line-height: 1.2; }
.me small { display: block; color: var(--muted); font-size: 12px; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; padding: 6px 10px; cursor: pointer; }
.link-btn:hover { color: #fff; }

.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.scrim { display: none; }
.content { max-width: 1180px; margin: 0 auto; padding: 28px 28px 80px; }

/* ---------- Componentes ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.empty-state { max-width: 520px; margin: 40px auto; text-align: center; }
.empty-state h1 { justify-content: center; margin-bottom: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14px; padding: 9px 15px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; min-height: 40px; }
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #962015; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger-text { color: var(--red); }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.icon-btn:hover { background: var(--red-soft); color: var(--red); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; letter-spacing: .01em; vertical-align: middle; white-space: nowrap; }
.badge-gray { background: var(--line-2); color: var(--ink-2); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-muted { background: var(--line-2); color: var(--muted); text-decoration: line-through; }

.flash { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash-ok { background: var(--green-soft); border-color: #bfe3cf; color: #135c38; }
.flash-error { background: var(--red-soft); border-color: #f5c6c1; color: #8c1c13; }
.flash-warn { background: var(--amber-soft); border-color: #f3d79b; color: #7a4600; }

/* Estadísticas */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; color: var(--ink); box-shadow: var(--shadow); }
a.stat:hover { border-color: #cfd3da; text-decoration: none; }
.stat-label { font-size: 13px; color: var(--ink-2); }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value.small-value { font-size: 22px; padding-top: 6px; }
.stat-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat-alert { border-color: #ffb8bd; background: var(--accent-soft); }
.stat-alert .stat-value { color: var(--accent); }
.stat-warn .stat-value { color: var(--red); }

/* Tablas */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border: 0; padding: 6px 10px; color: var(--ink-2); }
.table tfoot tr.total td { font-weight: 700; font-size: 16px; color: var(--ink); border-top: 1px solid var(--line); padding-top: 10px; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #fafafb; }
.row-off td { opacity: .55; }
.table td.actions { display: flex; gap: 6px; justify-content: flex-end; }
.table td.actions form { margin: 0; }

.meter { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; min-width: 90px; }
.meter span { display: block; height: 100%; background: var(--green); }
.meter-amber span { background: #e09b1b; }
.meter-red span { background: var(--red); }

/* Pestañas y filtros */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; color: var(--ink-2); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; }
.filters .field { margin: 0; flex: 1 1 180px; }
.filters-actions { display: flex; gap: 6px; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid #d3d7de; border-radius: 8px; padding: 9px 11px; width: 100%; min-height: 42px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 51, 65, .16); }
input:disabled { background: var(--line-2); color: var(--ink-2); }
input.num { text-align: right; }
.has-error input, .has-error select { border-color: var(--red); }
.error { color: var(--red); font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin: 4px 0 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-narrow { max-width: 760px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.form-narrow h2 { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); }

/* Partidas de la orden */
.lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.line { display: grid; grid-template-columns: 130px 1fr 100px 130px 120px 36px; gap: 8px; align-items: center; }
.line-head { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.line label { margin: 0; }
.line-label { display: none; }
.line-total { font-weight: 600; padding-right: 4px; }
.totals { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.totals .check { max-width: 420px; color: var(--ink-2); }
.totals dl { display: grid; grid-template-columns: auto 140px; gap: 4px 20px; margin: 0; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--ink-2); text-align: right; }
.totals dd { margin: 0; text-align: right; }
.totals .total { font-size: 20px; font-weight: 700; color: var(--ink); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 14px; }

/* Detalle */
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 0; }
.facts dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.mini { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.mini dt { color: var(--muted); }
.mini dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mini.roles dd { text-align: left; }
.note { background: var(--line-2); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 14px 0 0; }
.decision { border-color: #ffb8bd; background: linear-gradient(var(--accent-soft), #fff 60%); }
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.decision-grid form { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.timeline li { padding: 0 0 12px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li:last-child { padding-bottom: 0; }
.danger-zone form { margin: 0; }

/* Login */
body.simple { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(ellipse at top, #1d1838 0%, var(--side) 60%); }
.simple-wrap { width: 100%; max-width: 400px; }
.simple-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 22px; }
.simple-brand img { width: 220px; height: auto; display: block; }
.simple-brand small { color: var(--muted); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.login-card { padding: 28px; }
.login-card h1 { margin-bottom: 18px; }
.login-card > .muted { margin: 0 0 20px; }

/* ---------- Celular y tableta ---------- */
@media (max-width: 960px) {
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%); 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,.4); z-index: 20; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 10; background: var(--side); color: #fff; padding: 8px 12px; }
  .menu-btn { width: 40px; height: 40px; border: 0; background: transparent; color: #fff; cursor: pointer; padding: 8px; }
  .menu-btn svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .topbar-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-logo { height: 26px; width: auto; display: block; margin-right: 4px; }
  .content { padding: 18px 16px 80px; }
  h1 { font-size: 21px; }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .decision-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .line-head { display: none; }
  .line { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; position: relative; }
  .line label:nth-child(2) { grid-column: 1 / -1; }
  .line-label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
  .line-total { grid-column: 1 / -1; text-align: right; }
  .line .js-remove { position: absolute; top: 4px; right: 4px; }
  .line label:first-child { padding-right: 36px; }
  .totals dl { width: 100%; grid-template-columns: 1fr auto; }
  .page-head .btn-primary { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 24px; }
}

/* ---------- Fase 2: facturas ---------- */
.badge-blue { background: #e6effc; color: #1d4f9c; }
.count-red { background: var(--red); }
.text-amber { color: var(--amber); font-weight: 600; }
.strong { font-weight: 700; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
.oc-strip { padding: 14px 20px; }
.upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.upload-box { border: 1.5px dashed #cfd3da; border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.upload-box.is-done { border-style: solid; border-color: #bfe3cf; background: var(--green-soft); }
.upload-box label.btn { cursor: pointer; }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.file-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.file-list .check { margin: 0; }
#xml-avisos p { margin: 0; }

.apply-all { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--line-2); border-radius: 8px; margin-bottom: 14px; }
.apply-all select, .apply-all input { width: auto; min-height: 36px; padding: 6px 10px; }
.apply-all input { width: 120px; }

.fline { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.fline-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.fline-head.editable { display: grid; grid-template-columns: 120px 1fr 90px 120px 110px 36px; gap: 8px; align-items: center; }
.fline-head.editable label { margin: 0; }
.fline-prod { font-weight: 600; }
.fline-amt { color: var(--ink-2); font-size: 14px; }
.dests { display: flex; flex-direction: column; gap: 6px; }
.dest { display: grid; grid-template-columns: 180px 1fr 100px 36px; gap: 8px; align-items: center; }
.dest select, .dest input { min-height: 38px; padding: 6px 10px; }
.dest.is-empty select { border-color: #e0a54a; background: #fffaf0; }
.dest-num { display: flex; align-items: center; border: 1px solid #d3d7de; border-radius: 8px; background: #fff; overflow: hidden; margin: 0; }
.dest-num:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 51, 65, .16); }
.dest-num input { border: 0; box-shadow: none !important; min-width: 0; }
.dest-pre { padding-left: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.dest-num[hidden] { display: none; }
.fline-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.dest-status { font-size: 13px; font-weight: 600; }
.dest-status.ok { color: var(--green); }
.dest-status.bad { color: var(--red); }
.dest-status.warn { color: var(--amber); }
.shake { animation: shake .5s; border-color: var(--red); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.dest-chip { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dest-chip.is-stock { color: var(--ink-2); }
.dest-line { margin-bottom: 2px; }
.ledger-line { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin: 0 0 16px; padding: 12px 14px; background: var(--line-2); border-radius: 8px; font-size: 15px; font-variant-numeric: tabular-nums; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.file-card { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; color: var(--ink); overflow: hidden; }
.file-card:hover { border-color: var(--accent); text-decoration: none; }
.file-card img { width: 100%; height: 120px; object-fit: cover; border-radius: 4px; background: var(--line-2); }
.file-card .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-ico { height: 120px; display: grid; place-items: center; background: var(--line-2); border-radius: 4px; font-weight: 800; color: var(--ink-2); letter-spacing: .05em; }

@media (max-width: 860px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .upload-row { grid-template-columns: 1fr; }
  .fline { padding: 12px; }
  .fline-head.editable { grid-template-columns: 1fr 1fr; position: relative; }
  .fline-head.editable label:nth-child(2) { grid-column: 1 / -1; }
  .fline-head.editable .js-remove-line { position: absolute; top: -6px; right: -6px; }
  .fline-head.editable label:first-child { padding-right: 36px; }
  .dest { grid-template-columns: 1fr 1fr 36px; }
  .dest select { grid-column: 1 / -1; }
  .dest-num[hidden] + input { grid-column: 1 / 3; }
  .apply-all input { flex: 1; }
}

/* ---------- Fase 3: pagos y antigüedad ---------- */
input.is-bad { border-color: var(--red); background: var(--red-soft); }
.aging-stats { grid-template-columns: repeat(5, 1fr); }
.aging-stats .stat { border-top: 4px solid var(--line); }
.aging-stats .aging-corriente { border-top-color: #2e8b57; }
.aging-stats .aging-d1_30 { border-top-color: #e0a54a; }
.aging-stats .aging-d31_60 { border-top-color: #e07a3a; }
.aging-stats .aging-d61_90 { border-top-color: #c9452b; }
.aging-stats .aging-d90 { border-top-color: #8c1c13; }
.aging-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: -4px 0 18px; background: var(--line-2); }
.aging-bar span { display: block; height: 100%; }
.aging-bar .aging-corriente { background: #2e8b57; }
.aging-bar .aging-d1_30 { background: #e0a54a; }
.aging-bar .aging-d31_60 { background: #e07a3a; }
.aging-bar .aging-d61_90 { background: #c9452b; }
.aging-bar .aging-d90 { background: #8c1c13; }
@media (max-width: 960px) { .aging-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .aging-stats { grid-template-columns: 1fr 1fr; } }

/* ---------- Gráficas del inicio ---------- */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.charts-grid .card { margin-bottom: 0; min-width: 0; }
.ch-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; padding: 0; font-size: 13px; color: var(--ink-2); }
.ch-legend li { display: flex; align-items: center; gap: 6px; }
.ch-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
/* Lista vertical como grid (no flex en columna con salto de línea: Safari anterior la desborda de la tarjeta) */
.ch-legend-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; flex-wrap: nowrap; margin: 14px 0 0; }
.ch-legend-rows li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 44px; gap: 10px; align-items: center; }
.ch-legend-rows li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-legend-rows b { font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
.ch-legend-rows small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Barras horizontales */
.ch-hbars { display: flex; flex-direction: column; gap: 10px; }
.ch-hrow { display: grid; grid-template-columns: minmax(80px, 30%) 1fr; gap: 10px; align-items: center; font-size: 13px; }
.ch-hlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.ch-hlabel a { color: var(--ink); }
.ch-htrack { display: flex; align-items: center; gap: 2px; min-height: 22px; }
.ch-hseg { height: 16px; display: block; }
.ch-hseg:first-child { border-radius: 0; }
.ch-htrack .ch-hseg:last-of-type { border-radius: 0 4px 4px 0; }
.ch-hval { font-weight: 600; font-size: 12.5px; padding-left: 6px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-hrow:hover .ch-hlabel { color: var(--ink); }

/* Columnas */
.ch-cols { --plot-h: 180px; }
.ch-plot { position: relative; height: var(--plot-h); margin-left: 44px; border-bottom: 1px solid #c3c2b7; }
.ch-grid { position: absolute; left: 0; right: 0; border-top: 1px solid #ecebe6; }
.ch-grid span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11.5px; color: #898781; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-groups { position: absolute; inset: 0; display: flex; }
.ch-group { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 6px; cursor: default; }
.ch-group:hover { background: rgba(20, 24, 31, .04); }
.ch-col { display: block; width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; min-height: 0; }
.ch-xlabels { display: flex; margin-left: 44px; padding-top: 6px; }
.ch-xlabels span { flex: 1; text-align: center; font-size: 11.5px; color: #898781; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Barra al 100% */
.ch-stack { display: flex; gap: 2px; height: 22px; border-radius: 4px; overflow: hidden; background: var(--line-2); }
.ch-stack span { display: block; height: 100%; }

.ch-table { margin-top: 10px; font-size: 13px; }
.ch-table summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.ch-table .table { margin-top: 6px; }

.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: #16122b; color: #fff; font-size: 12.5px; line-height: 1.45; padding: 7px 10px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.18); white-space: pre; font-variant-numeric: tabular-nums; }
.chart-tip b { display: block; }

@media (max-width: 960px) { .charts-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .ch-cols { --plot-h: 150px; } .ch-group { padding: 0 3px; } }
.row-focus td { background: var(--accent-soft); }
.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.danger-zone .muted.small { margin: 6px 0 0; }

/* ---------- Mi cuenta ---------- */
.ph {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center;
  padding: 28px 32px; margin-bottom: 18px; border-radius: 12px; color: #fff;
  background: #110d26;
}
/* símbolo GT de marca de agua, muy tenue */
.ph-mark {
  position: absolute; z-index: -1; right: -48px; top: 50%; transform: translateY(-50%);
  width: 420px; aspect-ratio: 1261 / 550;
  background: linear-gradient(100deg, #ff3341 0%, #a3176f 100%);
  -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat;
  opacity: .09;
}
.ph-main { min-width: 0; }
.ph-name { display: block; margin: 0; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: #fff; overflow-wrap: anywhere; }
.ph-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 6px 0 0; font-size: 14px; color: #a9a6bd; }
.ph-role { color: #fff; font-weight: 600; }
.ph-sep { width: 4px; height: 4px; border-radius: 50%; background: #ff3341; }

.ph-meta { margin: 0; display: flex; gap: 32px; position: relative; z-index: 1; }
.ph-meta dt { font-size: 12px; color: #8a879f; }
.ph-meta dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.profile-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.account-card { margin-bottom: 0; display: flex; flex-direction: column; }
.account-card .form-actions { margin-top: auto; padding-top: 6px; }
.account-head { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.account-head h2 { margin: 0; }
.account-head p { margin: 2px 0 0; }
.account-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.account-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.account-mini { margin-bottom: 16px; }
.account-card > .muted.small { margin: -4px 0 12px; }

.input-prefix { display: flex; align-items: stretch; border: 1px solid #d3d7de; border-radius: 8px; background: #fff; overflow: hidden; }
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 51, 65, .16); }
.input-prefix span { display: grid; place-items: center; padding: 0 12px; background: var(--line-2); color: var(--ink-2); font-weight: 600; font-size: 14px; border-right: 1px solid #d3d7de; }
.input-prefix input { border: 0; box-shadow: none !important; border-radius: 0; }
.has-error .input-prefix { border-color: var(--red); }

.input-eye { position: relative; }
.input-eye input { padding-right: 44px; }
.eye-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.eye-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.eye-btn:hover, .eye-btn.on { color: var(--ink); background: var(--line-2); }

.pw-meter { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 2px; }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .2s ease, background .2s ease; }
.pw-meter .pw-1 { background: var(--red); }
.pw-meter .pw-2 { background: #e0a54a; }
.pw-meter .pw-3 { background: #3aa76d; }
.pw-meter .pw-4 { background: var(--green); }

.account-logout { margin-top: 18px; text-align: center; }

@media (max-width: 860px) {
  .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .ph { grid-template-columns: 1fr; }
  .ph-meta { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
}
@media (max-width: 720px) {
  .ph { padding: 22px 20px; gap: 16px; }
  .ph-name { font-size: 20px; }
  .ph-mark { width: 280px; right: -70px; opacity: .08; }
  .ph-meta { gap: 24px; }
  .ph-sub { flex-direction: column; align-items: flex-start; gap: 2px; }
  .ph-sep { display: none; }
}
.hint.text-red { color: var(--red); }
.hint.text-green { color: var(--green); }
@media (max-width: 720px) { .profile-stats { grid-template-columns: 1fr 1fr; } .profile-stats .stat-value { font-size: 24px; } }

/* ---------- Inicio: resumen principal ---------- */
.dash-hero { grid-template-columns: 1fr auto; grid-template-areas: "main actions" "kpis kpis"; align-items: start; row-gap: 26px; padding: 30px 32px 0; }
.dh-main { grid-area: main; min-width: 0; }
.dh-greet { margin: 0 0 20px; font-size: 21px; font-weight: 600; letter-spacing: -.01em; color: #fff; }
.dh-greet span { font-size: 16px; font-weight: 400; letter-spacing: 0; color: #a9a6bd; }
.dh-label { margin: 0; font-size: 13px; color: #a9a6bd; }
.dh-figure { margin: 2px 0 4px; font-size: 48px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: #fff; }
.dh-note { margin: 0; font-size: 13.5px; color: #a9a6bd; }
.dh-note a { color: #ff8a92; font-weight: 600; }
.dh-actions { grid-area: actions; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; position: relative; z-index: 1; }
.btn-dark { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #fff; }
.btn-dark:hover { background: rgba(255,255,255,.12); }
.dh-kpis { grid-area: kpis; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 -32px; border-top: 1px solid rgba(255,255,255,.08); position: relative; z-index: 1; }
.dh-kpis a { display: flex; flex-direction: column; gap: 4px; padding: 16px 32px 18px; color: #fff; }
.dh-kpis a + a { border-left: 1px solid rgba(255,255,255,.08); }
.dh-kpis a:hover { background: rgba(255,255,255,.03); text-decoration: none; }
.dh-kpis span { font-size: 12.5px; color: #a9a6bd; }
.dh-kpis b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; }
.dh-kpis small { font-size: 13px; font-weight: 600; color: #a9a6bd; }
.dh-kpis .is-bad b { color: #ff6b75; }
.dh-kpis .is-warn b { color: #ffb24d; }
.dash-hero .ph-mark { top: 42%; }
@media (max-width: 860px) { .dash-hero { grid-template-columns: 1fr auto; } }

@media (max-width: 720px) {
  .dash-hero { grid-template-columns: 1fr; grid-template-areas: "main" "actions" "kpis"; padding: 22px 20px 0; row-gap: 18px; }
  .dh-figure { font-size: 38px; }
  .dh-greet { font-size: 19px; }
  .dh-greet span { display: block; font-size: 14px; margin-top: 2px; }
  .dh-actions { justify-content: flex-start; }
  .dh-actions .btn { flex: 1; }
  .dh-kpis { grid-template-columns: 1fr; margin: 0 -20px; }
  .dh-kpis a { flex-direction: row; justify-content: space-between; align-items: baseline; padding: 14px 20px; }
  .dh-kpis a + a { border-left: 0; border-top: 1px solid rgba(255,255,255,.08); }
  .dh-kpis b { font-size: 17px; }
}
.fline-prod { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 4px 12px; align-items: center; flex: 1; min-width: 0; }
.fline-code { min-height: 36px; padding: 6px 10px; font-weight: 600; }
.fline-desc { font-weight: 600; }
.fline-prov { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
@media (max-width: 720px) { .fline-prod { grid-template-columns: 1fr; } }

/* Archivos adjuntos con botón para quitar */
.file-rows li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; gap: 8px 12px; }
.file-rows li > span:first-child, .file-rows li > a:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-x { margin-left: auto; border: 0; background: transparent; color: var(--red); font: inherit; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.file-x:hover { background: var(--red-soft); }
.file-rows li.is-deleted { background: var(--red-soft); border-color: #f5c6c1; }
.file-rows li.is-deleted a, .file-rows li.is-deleted > span { text-decoration: line-through; color: var(--muted); }
.file-rows li.is-deleted .file-x { color: var(--ink-2); }
.upload-box .file-list { width: 100%; }
.login-forgot { margin: 16px 0 0; }
.login-forgot a { color: var(--ink-2); font-weight: 600; }
.login-forgot a:hover { color: var(--accent); }
.login-intro { margin: -10px 0 18px; font-size: 14px; }

/* =========================================================================
   TEMA OSCURO (Gova Trucks) — se aplica sobre todo lo anterior
   ========================================================================= */
:root {
  color-scheme: dark;
  --bg: #0b0a17;
  --surface: #14122a;
  --surface-2: #1b1934;
  --surface-3: #232046;
  --ink: #eceaf6;
  --ink-2: #b3b0c8;
  --muted: #7e7a98;
  --line: #262344;
  --line-2: #1d1b37;
  --side: #0e0c20;
  --side-ink: #a9a6c0;
  --accent: #ff3341;
  --accent-hover: #ff4c58;
  --accent-soft: rgba(255, 51, 65, .12);
  --green: #3ccf91; --green-soft: rgba(60, 207, 145, .12);
  --amber: #f3ad3d; --amber-soft: rgba(243, 173, 61, .12);
  --red: #ff6470; --red-soft: rgba(255, 100, 112, .12);
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 8px 24px rgba(0,0,0,.25);
}
body { background: var(--bg); }
a { color: #ff6b76; }
h1 { font-size: 26px; }

/* Menú lateral con íconos en círculo (como la referencia) */
.sidebar { background: var(--side); border-right: 1px solid var(--line-2); }
.brand { border-bottom-color: var(--line-2); }
.nav { gap: 4px; padding: 10px 12px; }
.nav a, .me { padding: 7px 10px; border-radius: 12px; color: var(--side-ink); font-weight: 500; }
.nav a svg, .me svg { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--surface-2); color: var(--side-ink); }
.nav a:hover { background: rgba(255,255,255,.03); color: #fff; }
.nav a.active { background: transparent; box-shadow: none; color: #fff; font-weight: 600; }
.nav a.active svg { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(255, 51, 65, .35); }
.sidebar-foot { border-top-color: var(--line-2); }
.me.active { background: transparent; box-shadow: none; }
.me.active svg { background: var(--accent); color: #fff; }

/* Superficies */
.card, .stat, .filters { background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--line); }
.stat-alert { border-color: rgba(255, 51, 65, .35); background: linear-gradient(180deg, rgba(255,51,65,.10), var(--surface) 70%); }
.decision { border-color: rgba(255, 51, 65, .35); background: linear-gradient(180deg, rgba(255,51,65,.10), var(--surface) 60%); }
.table th { color: var(--muted); border-bottom-color: var(--line); }
.table td { border-bottom-color: var(--line-2); }
.row-link:hover td { background: rgba(255,255,255,.025); }
.table tfoot tr.total td { border-top-color: var(--line); }
.note, .ledger-line { background: var(--surface-2); }
code { background: var(--surface-3); color: var(--ink); }
.tabs { border-bottom-color: var(--line); }
.tabs a { color: var(--muted); }
.tabs a:hover { color: var(--ink); }

/* Botones */
.btn { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: #d93a44; border-color: #d93a44; }
.btn-danger-text { color: var(--red); }

/* Formularios */
input, select, textarea, .input-prefix, .dest-num { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
input::placeholder, textarea::placeholder { color: #67638a; }
input:disabled { background: var(--line-2); color: var(--muted); }
input[readonly] { background: var(--line-2); }
.input-prefix span { background: var(--surface-3); border-right-color: var(--line); color: var(--ink-2); }
.dest.is-empty select { border-color: rgba(243,173,61,.6); background: rgba(243,173,61,.06); }
.upload-box { border-color: var(--line); }
.upload-box.is-done { border-color: rgba(60,207,145,.4); }
.file-rows li { background: var(--surface-2); border-color: var(--line); }
.file-rows li.is-deleted { border-color: rgba(255,100,112,.35); }
.fline { border-color: var(--line); }
.apply-all, .pw-meter, .meter, .ch-stack { background: var(--surface-2); }
.icon-btn:hover { background: var(--red-soft); }
.eye-btn:hover, .eye-btn.on { background: var(--surface-3); }
.account-head { border-bottom-color: var(--line-2); }
select option { background: var(--surface); }

/* Avisos y etiquetas */
.flash-ok { border-color: rgba(60,207,145,.35); color: #8be8bf; }
.flash-error { border-color: rgba(255,100,112,.35); color: #ffb0b6; }
.flash-warn { border-color: rgba(243,173,61,.35); color: #ffd28a; }
.badge-gray { background: var(--surface-3); color: var(--ink-2); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-blue { background: rgba(57,135,229,.16); color: #8dbdf5; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }

/* Gráficas */
.ch-plot { border-bottom-color: #3a3760; }
.ch-grid { border-top-color: #232044; }
.ch-grid span, .ch-xlabels span { color: var(--muted); }
.ch-group:hover { background: rgba(255,255,255,.035); }
.chart-tip { background: #232046; border: 1px solid #34305e; }

/* Encabezados oscuros dentro de un fondo oscuro: un poco más de profundidad */
.ph { background: linear-gradient(135deg, #1c1840 0%, #121027 60%); border: 1px solid var(--line); }

/* Barra superior en celular */
@media (max-width: 860px) {
  .topbar { background: var(--side); border-bottom: 1px solid var(--line-2); }
}

/* ---------- Inicio: columnas y actividad ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; margin-bottom: 18px; }
.dash-main > .card, .dash-main > .charts-grid { margin-bottom: 18px; }
.dash-main > :last-child { margin-bottom: 0; }
.dash-activity { position: sticky; top: 18px; margin-bottom: 0; max-height: calc(100vh - 36px); overflow: auto; }
.chip-muted { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.act-day { margin: 14px 0 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.act-day:first-of-type { margin-top: 2px; }
.act-list { list-style: none; margin: 0; padding: 0; }
.act-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 9px 6px; margin: 0 -6px; border-radius: 10px; color: var(--ink); }
.act-item:hover { background: rgba(255,255,255,.03); text-decoration: none; }
.act-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.act-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.act-ico.act-in { background: rgba(60,207,145,.12); color: var(--green); }
.act-ico.act-out { background: rgba(255,100,112,.12); color: var(--red); }
.act-ico.act-warn { background: rgba(243,173,61,.12); color: var(--amber); }
.act-text { min-width: 0; display: flex; flex-direction: column; }
.act-text b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-amt { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.act-amt.act-in { color: var(--green); }
.act-amt.act-out { color: var(--red); }
.act-amt.act-warn { color: var(--amber); }

/* Gráfica de líneas */
.ch-lines .ch-plot { --plot-h: 220px; }
.ch-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ch-dot { position: absolute; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.ch-lines .ch-group { padding: 0; }
.ch-lines .ch-group:hover { background: linear-gradient(to top, rgba(255,255,255,.05), rgba(255,255,255,0)); }

@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-activity { position: static; max-height: none; }
}

/* ---------- Inicio estilo panel (bienvenida, tarjetas con tendencia) ---------- */
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: -28px -28px 22px; padding: 26px 28px; background: var(--side); border-bottom: 1px solid var(--line-2); }
.welcome h1 { font-size: 32px; font-weight: 700; letter-spacing: -.02em; color: #fff; margin: 0; }
.welcome p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.welcome-date { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 15px; }
.welcome-date svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; }
.dash-subhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-subhead h2 { margin: 0; font-size: 20px; font-weight: 500; color: var(--ink-2); }
.dash-subhead h2 b { color: var(--ink); font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 230px; padding: 22px 22px 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--ink); }
a.kpi:hover { text-decoration: none; border-color: var(--line); }
.kpi-title { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi-value { margin-top: 18px; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-delta { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.kpi-spark { position: relative; margin: auto -22px 0; height: 78px; }
.kpi-spark svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.kpi-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.kpi-gauge { padding-bottom: 18px; }
.gauge { position: relative; width: 132px; height: 132px; margin: 14px auto 12px; }
.gauge svg { width: 100%; height: 100%; }
.gauge circle { fill: none; stroke-width: 9; }
.gauge-track { stroke: #2a2750; }
.gauge-fill { stroke-linecap: round; }
.gauge b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.kpi-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.kpi-list a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; color: var(--ink-2); }
.kpi-list a:hover { color: var(--ink); text-decoration: none; }
.kpi-list b { color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-list b.text-amber { color: var(--amber); }

@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .welcome { margin: -18px -16px 18px; padding: 20px 16px; }
  .welcome h1 { font-size: 26px; }
}
@media (max-width: 720px) {
  .kpis { grid-template-columns: 1fr; }
  .kpi { min-height: 0; }
  .kpi-value { font-size: 30px; }
  .welcome-date { font-size: 13.5px; padding: 8px 14px; }
  .dash-subhead .head-actions { width: 100%; }
  .dash-subhead .head-actions .btn { flex: 1; }
}

/* ---------- Menú lateral minimalista (Manrope) ---------- */
.sidebar { --nav-font: "Manrope", "Inter", system-ui, sans-serif; width: 248px; font-family: var(--nav-font); background: #0c0a1b; }
.brand { padding: 24px 22px 20px; gap: 6px; }
.brand img { width: 136px; }
.brand small { font-size: 10px; letter-spacing: .22em; color: #6f6b8c; font-weight: 600; }
.nav { padding: 6px 14px 14px; gap: 1px; overflow-y: auto; }
.nav-title { margin: 18px 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #5f5b7d; }
.nav-title:first-child { margin-top: 6px; }
.nav a { position: relative; gap: 12px; padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; letter-spacing: -.005em; color: #a19dba; }
.nav a svg { width: 19px; height: 19px; padding: 0; border-radius: 0; background: none; color: #77739a; stroke-width: 1.6; }
.nav a:hover { background: rgba(255,255,255,.035); color: #ecebf5; }
.nav a:hover svg { color: #c9c6dc; }
.nav a.active { background: rgba(255,255,255,.055); color: #fff; font-weight: 600; box-shadow: none; }
.nav a.active svg { background: none; box-shadow: none; color: var(--accent); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.count { min-width: 20px; height: 20px; border-radius: 6px; font-size: 11px; font-weight: 700; font-family: "Inter", sans-serif; background: rgba(255, 51, 65, .14); color: #ff6b76; }
.count-red { background: rgba(255, 100, 112, .16); color: #ff8a92; }

.sidebar-foot { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-foot form { margin: 0; }
.me { flex: 1; min-width: 0; gap: 10px; padding: 8px; border-radius: 8px; }
.me svg { width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: #1b1934; color: #a19dba; stroke-width: 1.6; }
.me span { min-width: 0; font-size: 13.5px; font-weight: 600; color: #ecebf5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { font-size: 11.5px; font-weight: 500; color: #6f6b8c; overflow: hidden; text-overflow: ellipsis; }
.me:hover { background: rgba(255,255,255,.035); }
.me.active svg { background: rgba(255, 51, 65, .14); color: var(--accent); }
.logout-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #77739a; cursor: pointer; }
.logout-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.logout-btn:hover { background: rgba(255, 100, 112, .12); color: var(--red); }
.topbar-title { font-family: "Manrope", "Inter", sans-serif; }

/* =========================================================================
   PALETA DE MARCA CLARA — área de trabajo clara; menú, bienvenida y
   encabezados en azul marino Gova Trucks; acento rojo #FF3341
   ========================================================================= */
:root {
  color-scheme: light;
  --bg: #f4f3f9;
  --surface: #ffffff;
  --surface-2: #f4f3f9;
  --surface-3: #eae8f3;
  --ink: #16122b;
  --ink-2: #4b4766;
  --muted: #8a87a1;
  --line: #e3e1ed;
  --line-2: #efeef5;
  --side: #0e0c20;
  --accent: #ff3341;
  --accent-hover: #e62532;
  --accent-soft: #fff0f1;
  --green: #1d8a59; --green-soft: #e7f6ee;
  --amber: #a86400; --amber-soft: #fff4e0;
  --red: #c92a3a; --red-soft: #fdecee;
  --shadow: 0 1px 2px rgba(22, 18, 43, .05), 0 8px 24px rgba(22, 18, 43, .04);
}
a { color: #d91e36; }
.card, .stat, .filters, .kpi { border-color: var(--line-2); }
.row-link:hover td, .act-item:hover, .ch-group:hover, .kpi-list a:hover { background: rgba(22, 18, 43, .03); }
.ch-lines .ch-group:hover { background: linear-gradient(to top, rgba(22,18,43,.05), rgba(22,18,43,0)); }
.btn { background: #fff; border-color: var(--line); color: var(--ink); }
.btn:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; border-color: transparent; }
input, select, textarea, .input-prefix, .dest-num { background: #fff; border-color: #d9d7e5; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #a6a3b8; }
input:disabled, input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.input-prefix span { background: var(--surface-2); border-right-color: #d9d7e5; }
.file-rows li { background: #fff; }
.flash-ok { background: var(--green-soft); border-color: #bfe3cf; color: #135c38; }
.flash-error { background: var(--red-soft); border-color: #f5c6cb; color: #8c1c26; }
.flash-warn { background: var(--amber-soft); border-color: #f3d79b; color: #7a4600; }
.badge-blue { background: #e6effc; color: #1d4f9c; }
.stat-alert, .decision { border-color: #ffc2c8; background: linear-gradient(180deg, var(--accent-soft), #fff 70%); }
.ch-plot { border-bottom-color: #d6d4e2; }
.ch-grid { border-top-color: #eeedf4; }
.chart-tip { background: #16122b; border-color: #16122b; }
.gauge-track { stroke: #eeedf4; }
.kpi-dot { background: #fff; box-shadow: 0 0 0 2px #16122b, 0 0 0 5px rgba(22,18,43,.10); }
.ch-dot { box-shadow: 0 0 0 2px #fff; }
.kpi-delta { color: var(--muted); }
.act-ico { background: var(--surface-2); color: var(--ink-2); }
.act-ico.act-in { background: var(--green-soft); color: var(--green); }
.act-ico.act-out { background: var(--red-soft); color: var(--red); }
.act-ico.act-warn { background: var(--amber-soft); color: var(--amber); }
.act-amt { color: var(--ink); }
.text-amber { color: var(--amber); }
.kpi-list b.text-amber { color: var(--amber); }
.nav a.active::before { background: var(--accent); }

/* Bloques en azul marino de la marca */
.welcome { background: var(--side); border-bottom: 0; }
.welcome-date { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #fff; }
.ph { background: linear-gradient(135deg, #1c1840 0%, #0e0c20 70%); border: 0; color: #fff; }
.topbar { background: var(--side); }

/* Logo centrado en la barra lateral */
.brand { align-items: center; text-align: center; }
.brand img { margin: 0 auto; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: #d93a44; border-color: #d93a44; color: #fff; }
.btn-danger:hover { background: #b92f38; }
.btn-danger-text { color: var(--red); }
/* Bordes de la barra lateral siempre oscuros (no dependen del tema claro) */
.sidebar { border-right: 1px solid #1c1a33; }
.brand { border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.06); }

/* Encabezado del Inicio: limpio, sobre fondo claro */
.welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin: 0 0 24px; padding: 4px 0 22px; background: none; border-bottom: 1px solid var(--line); }
.welcome h1 { margin: 2px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.welcome-date { margin: 0; padding: 0; border: 0; background: none; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: block; }
.welcome-sub { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
@media (max-width: 860px) { .welcome { margin: 0 0 18px; padding: 0 0 18px; } .welcome h1 { font-size: 25px; } }
@media (max-width: 720px) { .welcome .head-actions { width: 100%; } .welcome .head-actions .btn { flex: 1; } }
/* Marca de agua GT en el encabezado del Inicio */
.welcome { position: relative; isolation: isolate; overflow: hidden; }
.welcome-mark { z-index: -1; right: -30px; top: 50%; width: 360px; opacity: .08; }
@media (max-width: 720px) { .welcome-mark { width: 240px; right: -60px; top: 30%; opacity: .07; } }
/* GT más pequeña y completa (sin recortes que la hagan ver estirada) */
.welcome-mark { width: 190px; right: 8px; top: 50%; transform: translateY(-50%); opacity: .09; }
@media (max-width: 720px) { .welcome-mark { width: 150px; right: -10px; top: 34%; opacity: .07; } }
/* GT en el espacio libre entre el saludo y los botones, más visible */
.welcome-mark { left: 54%; right: auto; top: 50%; transform: translate(-50%, -50%); width: 200px; opacity: .16; }
@media (max-width: 1180px) { .welcome-mark { left: auto; right: 8px; top: 18px; transform: none; width: 150px; opacity: .12; } }
@media (max-width: 720px) { .welcome-mark { width: 130px; right: 0; top: 6px; opacity: .12; } }
@media (min-width: 1181px) { .welcome-mark { left: 47%; } }
/* GT detrás de los botones: asoma por arriba de ellos */

.welcome-mark { left: auto !important; right: 60px; top: 50%; transform: translateY(-50%); width: 220px; opacity: .16; }
@media (max-width: 1180px) { .welcome-mark { right: 20px; width: 180px; opacity: .14; } }
@media (max-width: 720px) { .welcome-mark { right: 0; top: 30%; width: 140px; opacity: .12; } }

/* Menú lateral: que quepa completo en pantallas de poca altura */
.nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a2748 transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent); }
@media (max-height: 820px) {
  .brand { padding: 16px 18px 14px; gap: 4px; }
  .brand img { width: 116px; }
  .nav-title { margin: 12px 10px 4px; }
  .nav-title:first-child { margin-top: 2px; }
  .nav a { padding: 7px 10px; font-size: 13.5px; }
  .sidebar-foot { padding: 8px 12px; }
  .me { padding: 6px; }
  .me svg { width: 28px; height: 28px; padding: 6px; }
}
@media (max-height: 640px) {
  .brand small { display: none; }
  .brand img { width: 100px; }
  .nav-title { margin: 8px 10px 2px; font-size: 10px; }
  .nav a { padding: 5px 10px; }
  .nav a svg { width: 17px; height: 17px; }
}

/* ---------- Entrega de la orden y cargos de envío ---------- */
.entrega-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.entrega-opt { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line, #e2e0ea); border-radius: 8px; cursor: pointer; font-size: 14px; background: #fff; }
.entrega-opt input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent); }
.entrega-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.entrega-extra .field[hidden] { display: none !important; }
.entrega-edit { margin-top: 10px; }
.entrega-edit summary { list-style: none; display: inline-flex; }
.entrega-edit summary::-webkit-details-marker { display: none; }
.entrega-edit[open] summary { margin-bottom: 12px; }
.cargo-check { margin: 0; font-size: 13px; color: var(--ink-2); align-items: center; }
.fline.is-cargo { background: #f7f6fb; border-style: dashed; }
.fline-iva { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.input-suffix { display: flex; align-items: stretch; border: 1px solid #d3d7de; border-radius: 8px; background: #fff; overflow: hidden; }
.input-suffix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 51, 65, .16); }
.input-suffix span { display: grid; place-items: center; padding: 0 12px; background: var(--line-2); color: var(--ink-2); font-weight: 600; font-size: 14px; border-left: 1px solid #d3d7de; }
.input-suffix input { border: 0; box-shadow: none !important; border-radius: 0; flex: 1; min-width: 0; }
.pp-cond { margin: -6px 0 18px; color: var(--ink-2); }
.pp-tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--green); white-space: nowrap; }
.inline-upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pp-aviso { margin-bottom: 14px; }
.pp-cell { white-space: nowrap; }
.pp-check { margin: 0 0 4px; justify-content: flex-end; font-size: 12.5px; align-items: center; }
.pp-check input { width: 16px; height: 16px; margin: 0; }
.copy-uri { display: block; word-break: break-all; user-select: all; padding: 6px 8px; }
.legal { max-width: 720px; line-height: 1.6; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { font-size: 16px; margin: 20px 0 6px; }
.legal ul { padding-left: 20px; }

/* ---------- Finanzas ---------- */
.fin-head { align-items: center; }
.fin-head p { margin: 2px 0 0; }
.fin-mes { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.fin-mes a { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); font-size: 20px; line-height: 1; text-decoration: none; }
.fin-mes a:hover { background: var(--surface-3); text-decoration: none; }
.fin-mes span { min-width: 120px; text-align: center; font-weight: 700; font-size: 13.5px; }
.fin-mes-dark { background: var(--surface-2); }
.fin-hero { position: relative; overflow: hidden; background: var(--side); color: #f1f0f8; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.fin-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: repeating-linear-gradient(90deg, var(--accent) 0 26px, transparent 26px 44px); opacity: .9; }
.fin-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fin-eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #a9a6c0; font-weight: 600; }
.fin-hero-amt { font-size: clamp(32px, 6vw, 44px); font-weight: 800; letter-spacing: -.03em; margin: 6px 0 16px; font-variant-numeric: tabular-nums; }
.fin-hero-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding-bottom: 6px; }
.fin-hero-row div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fin-hero-row span { font-size: 12px; color: #a9a6c0; }
.fin-hero-row b { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.fin-pos { background: var(--green-soft); color: var(--green); }
.fin-neg { background: var(--red-soft); color: var(--red); }
.fin-warn { background: var(--amber-soft); color: var(--amber); }
.fin-info { background: #e6effc; color: #1d4f9c; }
.fin-mute { background: var(--surface-3); color: var(--ink-2); }
.fin-hero .fin-mute { background: rgba(255,255,255,.08); color: #c9c6dc; }
.fin-big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.fin-big .small { font-weight: 500; letter-spacing: 0; }
.fin-bar { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 6px 0 10px; }
.fin-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.fin-bar.pos > i { background: var(--green); }
.fin-av { font-size: 11.5px; font-weight: 800; letter-spacing: .02em; }
.fin-kpis2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.fin-kpi { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--ink); }
a.fin-kpi:hover { text-decoration: none; border-color: var(--line); }
.fin-kpi span { font-size: 12px; color: var(--muted); }
.fin-kpi b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-list { display: flex; flex-direction: column; gap: 14px; }
.fin-ins { display: flex; gap: 12px; align-items: flex-start; }
.fin-ins h3 { margin: 0 0 2px; font-size: 14.5px; }
.fin-ins p { margin: 0; color: var(--ink-2); font-size: 13.5px; max-width: 70ch; }
.fin-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.fin-dot.fin-alerta { background: var(--red); } .fin-dot.fin-aviso { background: #e09b1b; } .fin-dot.fin-bien { background: var(--green); } .fin-dot.fin-idea { background: #2a78d6; }
.fin-cats { display: flex; flex-direction: column; gap: 4px; }
.fin-cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; font-size: 13.5px; }
.fin-cat .fin-bar { grid-column: 1 / -1; height: 7px; margin: 4px 0 6px; }
.fin-meta { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.fin-meta-top, .fin-meta-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fin-meta-lg { padding-bottom: 14px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; }
.fin-meta-lg:last-child { border-bottom: 0; margin-bottom: 0; }
.fin-aporte { display: flex; gap: 6px; align-items: center; }
.fin-aporte input { width: 120px; }
.fin-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.fin-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.fin-chip:hover { text-decoration: none; border-color: var(--ink-2); }
.fin-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fin-form { max-width: 640px; }
.fin-money { font-size: 26px !important; font-weight: 800; }
.fin-seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; max-width: 320px; }
.fin-seg label { margin: 0; cursor: pointer; }
.fin-seg input { position: absolute; opacity: 0; pointer-events: none; }
.fin-seg span { display: block; text-align: center; padding: 9px; border-radius: 9px; font-weight: 700; color: var(--ink-2); }
.fin-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.fin-seg input:focus-visible + span { outline: 2px solid var(--accent); }
.fin-del { max-width: 640px; margin-top: -6px; }
.fin-nota { margin: -6px 0 16px; }
.fin-acc { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.fin-cards .card { margin-bottom: 0; }
.fin-cards .fin-acc { justify-content: flex-start; }
.fin-ul { margin: 6px 0 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.dash-side > .card { margin-bottom: 18px; }
.act-item .act-text { color: var(--ink); }
a.act-text:hover b { text-decoration: underline; }
@media (max-width: 640px) {
  .fin-hero-row { grid-template-columns: 1fr 1fr; row-gap: 12px; }
  .fin-head .head-actions { width: 100%; }
}

/* ---------- Panel general: condición de la empresa y mes por mes ---------- */
.fin-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.fin-tabs a { padding: 8px 16px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.fin-tabs a:hover { text-decoration: none; background: var(--surface-2); }
.fin-tabs a.on { background: var(--ink); color: #fff; }
.fin-salud { border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); border-left: 6px solid var(--green); }
.fin-salud-atencion { border-left-color: #e09b1b; }
.fin-salud-riesgo { border-left-color: var(--red); }
.fin-salud-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.fin-salud .fin-eyebrow { color: var(--muted); }
.fin-salud h2 { margin: 2px 0 2px; font-size: 26px; letter-spacing: -.02em; }
.fin-salud-bien h2 { color: var(--green); }
.fin-salud-atencion h2 { color: var(--amber); }
.fin-salud-riesgo h2 { color: var(--red); }
.fin-salud-head p { margin: 0; color: var(--ink-2); }
.fin-ind { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.fin-ind-item { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.fin-ind-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.fin-ind-top i { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--green); }
.fin-ind-top small { margin-left: auto; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--green); }
.fin-ind-warn .fin-ind-top i { background: #e09b1b; } .fin-ind-warn .fin-ind-top small { color: var(--amber); }
.fin-ind-bad .fin-ind-top i { background: var(--red); } .fin-ind-bad .fin-ind-top small { color: var(--red); }
.fin-ind-item b { font-size: 19px; font-variant-numeric: tabular-nums; }
.fin-ind-item > small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.fin-comp { list-style: none; margin: 0 0 10px; padding: 0; }
.fin-comp li a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); color: var(--ink); font-size: 13.5px; }
.fin-comp li:first-child a { border-top: 0; }
.fin-comp li a:hover { text-decoration: none; }
.fin-comp li a:hover span { text-decoration: underline; }
.fin-comp small { display: block; color: var(--muted); font-size: 12px; }
.fin-mes-titulo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.fin-mes-titulo h2 { margin: 0; }
.fin-tabla-meses tr.fin-sel td { background: var(--accent-soft); }
.fin-tabla-meses tr.fin-sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.fin-tabla-meses td:first-child, .fin-tabla-meses th { white-space: nowrap; }
