/* EON Contabilidad — ERP denso azul corporativo */

/* ---------- Login ---------- */
.login-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; background: #fff; }
.login-brand { background: linear-gradient(150deg, #0b1d3a 0%, #13316b 55%, #1d4ed8 130%); color: #fff; position: relative; overflow: hidden; display: flex; }
.login-brand::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 20% 18%, rgba(255,255,255,0.08) 0, transparent 36%), radial-gradient(circle at 88% 82%, rgba(96,165,250,0.18) 0, transparent 40%); pointer-events: none; }
.login-brand-inner { position: relative; padding: 48px 52px; display: flex; flex-direction: column; gap: 36px; width: 100%; max-width: 540px; margin: auto; }
.login-logo { display: flex; align-items: center; gap: 12px; }
.login-logo-mark { width: 44px; height: 44px; border-radius: 11px; background: linear-gradient(135deg, #2563eb, #60a5fa); display: grid; place-items: center; font-weight: 800; font-size: 20px; box-shadow: 0 6px 18px rgba(37,99,235,0.4); }
.login-logo-name { font-weight: 700; font-size: 18px; letter-spacing: 0.06em; }
.login-logo-sub { font-size: 11px; color: #94a3c0; text-transform: uppercase; letter-spacing: 0.14em; }
.login-tagline h1 { font-size: 30px; line-height: 1.18; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 14px; }
.login-tagline p { font-size: 14px; color: #b9c5dd; line-height: 1.55; margin: 0; max-width: 420px; }
.login-features { display: flex; flex-direction: column; gap: 16px; }
.login-feature { display: flex; gap: 12px; align-items: flex-start; }
.login-feature-check { width: 22px; height: 22px; border-radius: 50%; background: rgba(34,197,94,0.18); color: #4ade80; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.login-feature-t { font-weight: 600; font-size: 13.5px; }
.login-feature-d { font-size: 12px; color: #94a3c0; margin-top: 1px; line-height: 1.4; }
.login-foot { display: flex; align-items: center; gap: 16px; font-family: var(--font-mono); font-size: 12px; color: #cbd5ec; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 18px; }
.login-foot .dim { color: #7f8db0; margin-right: 4px; }

.login-form-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 24px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em; }
.login-form-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 26px; }
.login-error { display: flex; align-items: center; gap: 8px; background: var(--danger-soft); color: var(--danger); padding: 9px 12px; border-radius: 6px; font-size: 12.5px; margin-bottom: 16px; }
.login-form .field label { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 500; margin-bottom: 5px; }
.login-form .input { padding: 9px 11px; font-size: 13.5px; }
.login-submit { width: 100%; justify-content: center; padding: 10px; font-size: 14px; height: 42px; }
.login-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: login-spin 0.6s linear infinite; }
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.login-quick-chip { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--border-input); border-radius: 8px; background: #fff; cursor: pointer; transition: all .12s ease; text-align: left; }
.login-quick-chip:hover:not(:disabled) { border-color: var(--primary); background: var(--bg-subtle); transform: translateY(-1px); }
.login-quick-chip:disabled { opacity: 0.6; cursor: default; }
.login-quick-avatar { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 11.5px; flex-shrink: 0; }
.login-quick-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-quick-rol { font-size: 10.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-legal { margin-top: 22px; text-align: center; font-size: 11px; color: var(--text-dim); line-height: 1.5; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-brand { display: none; } }

:root {
  --bg: #f4f6fa;
  --bg-elev: #ffffff;
  --bg-sidebar: #0b1d3a;
  --bg-sidebar-hover: #112a55;
  --bg-sidebar-active: #1d4ed8;
  --bg-topbar: #ffffff;
  --bg-row-hover: #f5f8fd;
  --bg-row-zebra: #fafbfc;
  --bg-subtle: #eef2f8;
  --bg-tag: #eef2ff;

  --border: #e3e7ee;
  --border-strong: #cbd2dc;
  --border-input: #d4dae3;

  --text: #0b1320;
  --text-muted: #5b6577;
  --text-dim: #8590a3;
  --text-on-dark: #e6ecf5;
  --text-on-dark-dim: #94a3c0;

  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --primary-soft: #dbe5fb;

  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --info: #0369a1;
  --info-soft: #e0f2fe;
  --neutral-soft: #eef0f4;

  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 2px rgba(11,29,58,0.06);
  --shadow-md: 0 4px 12px rgba(11,29,58,0.08);
  --shadow-lg: 0 16px 40px rgba(11,29,58,0.18);

  --sidebar-w: 220px;
  --topbar-h: 52px;

  --font-sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
input:focus, select:focus, textarea:focus, button:focus { outline: none; }

.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar { background: var(--bg-sidebar); color: var(--text-on-dark); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; gap: 10px; }
.sidebar-logo { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%); display: grid; place-items: center; color: white; font-weight: 700; font-size: 13px; letter-spacing: 0.02em; }
.sidebar-name { font-weight: 600; font-size: 13px; letter-spacing: 0.04em; }
.sidebar-sub { font-size: 10px; color: var(--text-on-dark-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1px; }
.sidebar-section { padding: 14px 12px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-on-dark-dim); }
.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 7px 12px; margin: 1px 8px; border-radius: 5px; color: var(--text-on-dark); text-decoration: none; font-size: 13px; cursor: pointer; border: 0; background: transparent; width: calc(100% - 16px); text-align: left; }
.sidebar-item:hover { background: var(--bg-sidebar-hover); }
.sidebar-item.active { background: var(--bg-sidebar-active); color: white; }
.sidebar-item .icon { width: 16px; height: 16px; opacity: 0.9; flex-shrink: 0; }
.sidebar-item .count { margin-left: auto; font-size: 11px; color: var(--text-on-dark-dim); font-variant-numeric: tabular-nums; }
.sidebar-item.active .count { color: rgba(255,255,255,0.9); }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.06); font-size: 11px; color: var(--text-on-dark-dim); flex-shrink: 0; }

/* Scrollable nav area */
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 0 10px; min-height: 0; }
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); background-clip: padding-box; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }

/* Collapsible nav group (SAP-style) */
.nav-group { margin-bottom: 2px; }
.nav-group-head { display: flex; align-items: center; gap: 6px; width: calc(100% - 16px); margin: 1px 8px; padding: 8px 10px; border: 0; background: transparent; color: var(--text-on-dark-dim); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; border-radius: 5px; text-align: left; }
.nav-group-head:hover { background: var(--bg-sidebar-hover); color: var(--text-on-dark); }
.nav-group-head span { flex: 1; }
.nav-group-chevron { transition: transform 0.2s ease; opacity: 0.6; flex-shrink: 0; }
.nav-group.open .nav-group-chevron { transform: rotate(180deg); }
.nav-group-head.has-active { color: var(--text-on-dark); }
.nav-group-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bg-sidebar-active); flex-shrink: 0; }
.nav-group-items { overflow: hidden; transition: max-height 0.24s cubic-bezier(0.4,0,0.2,1); }

/* ---------- Main / Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--topbar-h); border-bottom: 1px solid var(--border); background: var(--bg-topbar); padding: 0 20px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; }
.topbar-title { font-weight: 600; font-size: 14px; }
.topbar-crumbs { color: var(--text-muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.topbar-crumbs .sep { color: var(--text-dim); }
.topbar-spacer { flex: 1; }
.fx-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; font-family: var(--font-mono); }
.fx-pill .label { color: var(--text-muted); }
.fx-pill .value { font-weight: 600; }
.fx-pill .up { color: var(--success); }
.fx-pill .down { color: var(--danger); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; }
.user-chip .avatar { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #1d4ed8, #60a5fa); color: white; display: grid; place-items: center; font-weight: 600; font-size: 11px; }
.user-chip .role { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- View container ---------- */
.view { padding: 18px 20px 32px; min-width: 0; }
.view-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.view-head h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.view-head .sub { color: var(--text-muted); font-size: 12px; }
.view-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 5px; border: 1px solid var(--border-strong); background: white; color: var(--text); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all .12s ease; }
.btn:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { color: var(--danger); border-color: #f3c7c7; background: white; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-subtle); }
.btn.sm { padding: 4px 8px; font-size: 11.5px; }
.btn .icon { width: 14px; height: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Inputs ---------- */
.input, .select, .textarea { padding: 6px 9px; border: 1px solid var(--border-input); border-radius: 5px; background: white; font-size: 12.5px; color: var(--text); width: 100%; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,0.12); }
.input.search { padding-left: 28px; background: white url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6577' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 8px center; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.field .hint { font-size: 11px; color: var(--text-dim); }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; position: relative; }
.kpi .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.kpi .value { font-family: var(--font-mono); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-top: 4px; }
.kpi .sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-family: var(--font-mono); }
.kpi .trend { position: absolute; top: 12px; right: 14px; font-size: 11px; font-family: var(--font-mono); padding: 2px 6px; border-radius: 4px; }
.kpi .trend.up { background: var(--success-soft); color: var(--success); }
.kpi .trend.down { background: var(--danger-soft); color: var(--danger); }
.kpi.accent { background: linear-gradient(135deg, #1e40af, #2563eb); border-color: #1e40af; color: white; }
.kpi.accent .label, .kpi.accent .sub { color: rgba(255,255,255,0.85); }

/* ---------- Card ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.card-head .sub { color: var(--text-muted); font-size: 11px; }
.card-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 12px 14px; }
.card-body.flush { padding: 0; }

/* ---------- Table ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 600; padding: 8px 10px; background: var(--bg-subtle); color: var(--text-muted); text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.tbl th.num, .tbl td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th.center, .tbl td.center { text-align: center; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-row-hover); }
.tbl tbody tr.selected { background: var(--primary-soft); }
.tbl tbody tr:nth-child(even) { background: var(--bg-row-zebra); }
.tbl tbody tr:nth-child(even):hover { background: var(--bg-row-hover); }
.tbl tbody tr:nth-child(even).selected { background: var(--primary-soft); }
.tbl .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tbl tfoot td { padding: 8px 10px; background: var(--bg-subtle); font-weight: 600; border-top: 2px solid var(--border-strong); }

/* ---------- Badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 1.5; letter-spacing: 0.02em; white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.neutral { background: var(--neutral-soft); color: var(--text-muted); }
.badge.primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Filters bar ---------- */
.filters { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.filters .search-wrap { width: 240px; position: relative; }
.seg { display: inline-flex; border: 1px solid var(--border-input); border-radius: 5px; overflow: hidden; }
.seg button { background: white; border: 0; padding: 5px 10px; font-size: 11.5px; color: var(--text-muted); cursor: pointer; border-right: 1px solid var(--border-input); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--primary); color: white; }
.seg button:hover:not(.on) { background: var(--bg-subtle); color: var(--text); }

/* ---------- Drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(11,29,58,0.4); z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 560px; max-width: 100vw; background: white; box-shadow: var(--shadow-lg); z-index: 51; transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.drawer-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.drawer-head .sub { color: var(--text-muted); font-size: 12px; font-family: var(--font-mono); }
.drawer-body { flex: 1; overflow: auto; padding: 16px 18px; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--bg-subtle); }
.icon-btn { width: 28px; height: 28px; border-radius: 5px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text-muted); }
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(11,29,58,0.5); z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-width: 720px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-body { flex: 1; overflow: auto; padding: 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Drop zone ---------- */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 36px 20px; text-align: center; background: var(--bg-subtle); transition: all 0.15s ease; cursor: pointer; }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .big { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.dropzone .small { color: var(--text-muted); font-size: 12px; }
.dropzone svg { color: var(--primary); margin-bottom: 8px; }

/* ---------- Detail rows ---------- */
.detail-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.detail-row .k { color: var(--text-muted); font-size: 11.5px; }
.detail-row .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.detail-row .v.text { font-family: var(--font-sans); }

.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; margin: 18px 0 8px; }

/* ---------- Bank account card ---------- */
.bank-card { background: linear-gradient(135deg, #0b1d3a 0%, #1e40af 100%); color: white; border-radius: var(--radius); padding: 14px; position: relative; overflow: hidden; }
.bank-card .bank-name { font-size: 11px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.06em; }
.bank-card .acct { font-family: var(--font-mono); font-size: 11px; opacity: 0.7; margin-top: 2px; }
.bank-card .bal { font-family: var(--font-mono); font-size: 22px; font-weight: 600; margin-top: 10px; }
.bank-card .ccy { font-size: 11px; opacity: 0.8; font-family: var(--font-mono); }
.bank-card.alt { background: linear-gradient(135deg, #134e4a 0%, #0e7490 100%); }
.bank-card.alt2 { background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%); }

/* ---------- Stepper / Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 8px 0; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 8px; top: 22px; bottom: -8px; width: 1px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); background: white; margin-top: 4px; }
.tl-dot.done { background: var(--success); border-color: var(--success); }
.tl-dot.pending { background: white; border-color: var(--warning); }
.tl-dot.overdue { background: var(--danger); border-color: var(--danger); }
.tl-content { font-size: 12px; }
.tl-content .when { color: var(--text-muted); font-size: 11px; }
.tl-content .what { font-weight: 500; }

/* ---------- Mini chart ---------- */
.spark { width: 100%; height: 60px; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: white; padding: 10px 14px; border-radius: var(--radius); font-size: 12.5px; box-shadow: var(--shadow-md); animation: slideIn 0.25s ease; max-width: 340px; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Misc ---------- */
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.row { display: flex; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* ---------- Empresa switcher (sidebar) ---------- */
.empresa-switcher {
  margin: 10px 12px 6px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.empresa-switcher:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}
.empresa-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.empresa-nombre {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-on-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empresa-ruc {
  font-size: 10.5px;
  color: var(--text-on-dark-dim);
  font-family: var(--font-mono);
  margin-top: 1px;
}

/* ---------- Reportes lateral ---------- */
.reportes-side {
  width: 220px;
  border-right: 1px solid var(--border);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.reportes-side-section {
  padding: 12px 14px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}
.reportes-side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 1px 8px;
  border-radius: 4px;
  border: 0;
  background: transparent;
  width: calc(100% - 16px);
  text-align: left;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}
.reportes-side-item:hover {
  background: var(--bg-subtle);
}
.reportes-side-item.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}

/* ---------- Reporte paper (formato hoja oficial) ---------- */
.reporte-paper {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.reporte-paper-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--text);
}
.reporte-paper-body {
  margin-top: 14px;
}
.reporte-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
  margin: 16px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-strong);
}
.tbl.compact th { padding: 5px 7px; font-size: 9.5px; }
.tbl.compact td { padding: 4px 7px; font-size: 11px; }
.tbl.compact .mono { font-size: 11px; }
.tbl.bordered td, .tbl.bordered th { border-right: 1px solid var(--border); }
.tbl.bordered td:last-child, .tbl.bordered th:last-child { border-right: 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd2dc; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #a8b2c0; }
::-webkit-scrollbar-track { background: transparent; }
