/* ============================================================
   ARCA · Sistema de Gestión Aerovales
   Estética oficial/institucional — azul marino
   ============================================================ */

:root {
  /* Institucional ARCA */
  --navy-900: #0b2544;
  --navy-800: #0f2d52;
  --navy-700: #13386a;
  --navy-600: #1d4a86;
  --navy-500: #2a5fa8;
  --navy-100: #e6ecf5;
  --navy-50:  #f2f5fa;

  --gold: #c9a227;
  --gold-soft: #f3e7b6;

  --ok: #1e7e34;
  --ok-soft: #d9ead3;
  --warn: #b07b00;
  --warn-soft: #fff0c7;
  --err: #b3261e;
  --err-soft: #fcdede;
  --info: #1565c0;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --border: #d7dce3;
  --border-strong: #b8c1cf;
  --ink: #111827;
  --ink-2: #374151;
  --ink-3: #6b7280;
  --ink-4: #9ca3af;

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

  --font-ui: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Source Serif 4", "Georgia", serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --density-py: 8px;
  --density-px: 12px;

  --shadow-sm: 0 1px 0 rgba(15, 45, 82, 0.04), 0 1px 2px rgba(15, 45, 82, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 45, 82, 0.08);
}

/* Dark */
[data-theme="dark"] {
  --bg: #0a1323;
  --surface: #0f1c35;
  --surface-2: #152643;
  --border: #1f3560;
  --border-strong: #2a4575;
  --ink: #e8edf5;
  --ink-2: #c7cfdc;
  --ink-3: #8695ae;
  --ink-4: #5a6a85;
  --navy-100: #152643;
  --navy-50:  #0f1c35;
}

/* Density */
[data-density="compact"] {
  --density-py: 4px;
  --density-px: 8px;
}

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

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "brand topbar"
    "sidebar main";
  height: 100vh;
  background: var(--bg);
}

.brand {
  grid-area: brand;
  background: var(--navy-900);
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--navy-700);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold);
  display: grid; place-items: center;
  color: var(--navy-900); font-weight: 800; font-size: 13px;
  font-family: var(--font-serif);
  box-shadow: inset 0 0 0 2px var(--navy-900);
  outline: 1.5px solid var(--gold);
}
.brand-titles { line-height: 1.1; }
.brand-titles .t1 { font-size: 11px; opacity: 0.75; letter-spacing: 0.08em; text-transform: uppercase; }
.brand-titles .t2 { font-size: 14px; font-weight: 700; font-family: var(--font-serif); letter-spacing: 0.01em; }

.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: relative;
}
.topbar-title { font-weight: 600; font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.topbar-title .crumb { color: var(--ink-3); font-weight: 400; }
.topbar-title .sep { color: var(--ink-4); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; font-size: 11px; font-weight: 500;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--ink-2);
}
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px;
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface);
  cursor: pointer;
}
.user-chip:hover { border-color: var(--border-strong); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  color: white; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
}
.user-chip .who { line-height: 1.1; }
.user-chip .who .n { font-size: 12px; font-weight: 600; }
.user-chip .who .r { font-size: 10px; color: var(--ink-3); }

.sidebar {
  grid-area: sidebar;
  background: var(--navy-800);
  color: #cfd7e6;
  padding: 14px 0;
  overflow-y: auto;
}
.side-section { padding: 8px 12px 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: #7b8aa6; text-transform: uppercase; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px; color: #cfd7e6; cursor: pointer;
  border-left: 3px solid transparent; font-size: 13px;
}
.side-item:hover { background: rgba(255,255,255,0.04); color: white; }
.side-item.active { background: rgba(201, 162, 39, 0.08); color: white; border-left-color: var(--gold); }
.side-item .ico { width: 16px; font-size: 14px; opacity: 0.8; text-align: center; }
.side-item .count { margin-left: auto; font-size: 10px; font-weight: 600; background: rgba(255,255,255,0.08); padding: 1px 7px; border-radius: 10px; }

.side-footer { margin-top: auto; padding: 12px 16px; font-size: 10.5px; color: #7b8aa6; border-top: 1px solid var(--navy-700); }

.main { grid-area: main; overflow: auto; padding: 18px 22px 40px; }
.main-inner { max-width: 1500px; margin: 0 auto; }

/* ============================================================
   CARDS / SECTIONS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-h {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13px;
}
.card-h .spacer { flex: 1; }
.card-h .sub { color: var(--ink-3); font-weight: 400; font-size: 12px; margin-left: 6px; }

.page-h {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 4px 0 16px;
  gap: 16px;
}
.page-h h1 {
  margin: 0 0 4px; font-size: 20px; font-family: var(--font-serif); font-weight: 700; letter-spacing: 0.005em;
}
.page-h .desc { color: var(--ink-3); font-size: 12.5px; }

.section-strip {
  background: var(--navy-900); color: white; padding: 6px 12px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--radius); cursor: pointer; font-size: 12.5px; font-weight: 500;
  transition: background 120ms;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--navy-700); color: white; border-color: var(--navy-800); }
.btn.primary:hover { background: var(--navy-800); }
.btn.gold { background: var(--gold); color: #3a2f06; border-color: #a2811a; }
.btn.danger { background: var(--err); color: white; border-color: #8a1d17; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { height: 24px; font-size: 11.5px; padding: 0 8px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   FORM
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.02em; text-transform: uppercase; }
.input, .select, .textarea {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 6px 9px; height: 30px;
  border-radius: var(--radius); color: var(--ink);
  font-size: 12.5px; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--navy-500); box-shadow: 0 0 0 3px rgba(42, 95, 168, 0.14); }
.textarea { height: auto; min-height: 64px; resize: vertical; }

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.filters .field { gap: 3px; }
.filters label { font-size: 10px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow: auto; max-height: calc(100vh - 300px); }
table.data {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--navy-100);
  color: var(--navy-900);
  font-weight: 600; text-align: left;
  padding: var(--density-py) var(--density-px);
  border-bottom: 1.5px solid var(--navy-500);
  font-size: 11px; letter-spacing: 0.03em; text-transform: uppercase;
  white-space: nowrap;
}
table.data tbody td {
  padding: var(--density-py) var(--density-px);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
table.data tbody tr:hover { background: var(--navy-50); }
table.data tbody tr.sel { background: var(--navy-100); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 11.5px; }
table.data .mono { font-family: var(--font-mono); font-size: 11.5px; }

.row-actions { display: flex; gap: 4px; opacity: 0; }
tr:hover .row-actions { opacity: 1; }
.icon-btn {
  width: 24px; height: 24px; border: 1px solid transparent; border-radius: 3px;
  background: transparent; cursor: pointer; color: var(--ink-3);
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--ink); }
.icon-btn.danger:hover { color: var(--err); border-color: var(--err-soft); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 10px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; }
.badge.ok    { background: var(--ok-soft); color: #145523; }
.badge.warn  { background: var(--warn-soft); color: #6b4d00; }
.badge.err   { background: var(--err-soft); color: var(--err); }
.badge.info  { background: #dce7f5; color: var(--navy-700); }
.badge.mut   { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--border); }
.badge.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 2px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.kpi .kpi-label { font-size: 10.5px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; }
.kpi .kpi-value { font-size: 22px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; font-family: var(--font-serif); color: var(--navy-900); }
.kpi .kpi-unit { color: var(--ink-3); font-weight: 500; font-size: 12px; margin-left: 4px; font-family: var(--font-ui); }
.kpi .kpi-delta { font-size: 11px; color: var(--ok); font-weight: 600; }
.kpi .kpi-delta.neg { color: var(--err); }
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--navy-600);
}
.kpi.gold::before { background: var(--gold); }
.kpi.green::before { background: var(--ok); }
.kpi.red::before { background: var(--err); }

/* ============================================================
   DRAWER / MODAL
   ============================================================ */
.overlay {
  position: fixed; inset: 0; background: rgba(8, 20, 40, 0.42);
  display: grid; place-items: center; z-index: 100;
  animation: fadeIn 160ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(720px, 94vw);
  background: var(--surface); box-shadow: -8px 0 32px rgba(0,0,0,0.15);
  z-index: 101; display: flex; flex-direction: column;
  animation: slideIn 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-h { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; background: var(--navy-900); color: white; }
.drawer-h .t { font-weight: 600; font-size: 14px; }
.drawer-h .s { font-size: 11px; color: #b8c6de; font-family: var(--font-mono); }
.drawer-b { flex: 1; overflow: auto; padding: 18px 22px; }
.drawer-f { border-top: 1px solid var(--border); padding: 10px 16px; display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }

/* Detail grid (official report layout) */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.detail-grid .cell { padding: 9px 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.detail-grid .cell:nth-child(3n) { border-right: 0; }
.detail-grid .cell .lbl { font-size: 10px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.detail-grid .cell .val { font-size: 13px; font-weight: 500; }
.detail-grid .cell .val.mono { font-family: var(--font-mono); font-size: 12.5px; }
.detail-grid .cell.full { grid-column: 1 / -1; }
.detail-grid .cell.span2 { grid-column: span 2; }

.section-bar {
  background: var(--navy-800); color: white; padding: 5px 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  margin: 14px 0 0;
  border-radius: 3px 3px 0 0;
}

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); padding: 0 14px; background: var(--surface); }
.tab {
  padding: 10px 14px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--navy-700); border-bottom-color: var(--navy-600); font-weight: 600; }

/* ============================================================
   CHART
   ============================================================ */
.chart-wrap { padding: 14px; height: 240px; display: flex; flex-direction: column; }
.chart-axis { color: var(--ink-4); font-size: 10px; }

/* Tweaks panel */
.tweaks {
  position: fixed; bottom: 20px; right: 20px; width: 300px;
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md); border-radius: var(--radius-lg);
  z-index: 90; overflow: hidden;
}
.tweaks-h { background: var(--navy-900); color: white; padding: 8px 12px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.tweaks-b { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.tweak-row { display: flex; flex-direction: column; gap: 4px; }
.tweak-row label { font-size: 10.5px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }
.tweak-row .seg { display: flex; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; }
.tweak-row .seg button { flex: 1; border: 0; background: var(--surface); padding: 4px 6px; cursor: pointer; font-size: 11.5px; color: var(--ink-2); }
.tweak-row .seg button.on { background: var(--navy-700); color: white; }
.tweak-row .seg button + button { border-left: 1px solid var(--border-strong); }

/* ============================================================
   Dashboard — ranchos + aerovales
   ============================================================ */
.ops-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: #fff7db;
  border: 1px solid #e5c660;
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: #5a4300;
  margin: 0 0 14px;
  cursor: pointer;
}
.ops-alert .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.ops-alert .spacer { flex: 1; }
.ops-alert .link { font-weight: 600; color: var(--navy-700); }
.ops-alert:hover { background: #fff3c1; }

.ranchos-main { margin-bottom: 14px; }
.ranchos-table tbody tr { height: 40px; }
.ranchos-table tbody tr:hover { background: var(--navy-50); }
.rchip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: 9.5px; font-weight: 700;
  border-radius: 8px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.rchip.pend { background: var(--warn-soft); color: #6b4d00; }
.rchip.anul { background: var(--err-soft); color: var(--err); }

.ultimos-wrap { margin-bottom: 14px; }
.ultimos-list { max-height: 360px; overflow: auto; }
.ultimo-row {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.ultimo-row:last-child { border-bottom: 0; }
.ultimo-row:hover { background: var(--navy-50); }
.ultimo-row .u-main { flex: 1; min-width: 0; }

.ops-alert.cupo { background: #ffe9e0; border-color: #e8a78a; border-left-color: #c05a1e; color: #6e2c0a; }
.ops-alert.cupo .dot { background: #c05a1e; }
.ops-alert.venc { background: #fce8e8; border-color: #e58585; border-left-color: var(--err); color: #6e0a0a; }
.ops-alert.venc .dot { background: var(--err); }

/* Ranchos full table */
.ranchos-full tbody tr.row-venc { background: #fff0f0; }
.ranchos-full tbody tr.row-venc:hover { background: #ffe5e5; }
.ranchos-full tbody tr.row-pvenc { background: #fffbe8; }
.ranchos-full tbody tr.row-pvenc:hover { background: #fff5c8; }
.ranchos-full tbody tr { height: 56px; }

.cupo-bar-wrap { display: flex; align-items: center; gap: 6px; }
.cupo-bar { flex: 1; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.cupo-bar > div { height: 100%; transition: width 0.3s; }

.chip-mat {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 4px 3px 8px;
  background: var(--navy-100); border: 1px solid var(--navy-600);
  border-radius: 3px; font-size: 11px;
}
.chip-mat button {
  background: transparent; border: 0; cursor: pointer; padding: 2px;
  display: flex; color: var(--navy-700);
}
.chip-mat button:hover { color: var(--err); }

.alerta-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.alerta-row:hover { background: var(--navy-50); }
.alerta-row:last-child { border-bottom: 0; }

.brand-mark-img {
  width: 36px; height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex: 0 0 auto;
}

/* Utility */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.grow { flex: 1; }
.tright { text-align: right; }
.mono { font-family: var(--font-mono); }
.small { font-size: 11px; }
.dim { color: var(--ink-3); }
.strong { font-weight: 600; }
.hr { height: 1px; background: var(--border); margin: 12px 0; border: 0; }

/* Toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--navy-900); color: white; padding: 8px 14px; border-radius: 4px;
  font-size: 12.5px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px;
  animation: slideUp 200ms ease;
}
.toast.ok { background: #145523; }
.toast.err { background: var(--err); }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Empty / placeholders */
.placeholder {
  border: 1px dashed var(--border-strong); border-radius: 4px;
  background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(15, 45, 82, 0.04) 8px 10px);
  padding: 32px 16px; text-align: center; color: var(--ink-3); font-family: var(--font-mono); font-size: 11px;
}

/* ============================================================
   ARCA Report — replica exacta del PDF
   ============================================================ */
.arca-doc { display: flex; flex-direction: column; gap: 28px; }
.arca-report {
  background: white;
  color: #000;
  font-family: "Arial", "Helvetica", sans-serif;
  font-size: 11px;
  line-height: 1.4;
  padding: 36px 44px 28px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}
.arca-header {
  display: flex; align-items: center; gap: 14px;
  padding: 0 0 16px;
  border-bottom: 0;
}
.arca-logo { flex: 0 0 auto; }
.arca-logo img { display: block; border-radius: 4px; }
.arca-title-txt {
  flex: 1; text-align: center;
  font-size: 17px; font-weight: 700;
  color: #000;
  font-family: "Arial", sans-serif;
}
.arca-subtitle {
  background: transparent;
  border: 1.2px solid #000;
  padding: 6px 10px;
  font-size: 11.5px; font-weight: 700;
  color: #000;
  margin: 6px 0 12px;
  font-family: "Arial", sans-serif;
  letter-spacing: 0.01em;
}
.arca-subtitle .sep { color: #000; font-weight: 700; }
.arca-subtitle.anulado { color: #c00; border-color: #c00; }

.arca-grid {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  table-layout: fixed;
}
.arca-grid td { padding: 4px 6px; vertical-align: baseline; font-size: 11px; }
.arca-grid td.lbl { font-weight: 700; white-space: nowrap; color: #000; width: 13%; }
.arca-grid td.val { color: #000; }
.arca-grid td.val.strong { font-weight: 700; }
.arca-grid .result-row td { padding-top: 8px; padding-bottom: 8px; }

.arca-band {
  background: #003366;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 5px 0;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  margin: 12px 0 4px;
  font-family: "Arial", sans-serif;
}

.arca-page-num {
  margin-top: 24px;
  text-align: center;
  color: #666;
  font-size: 10px;
  font-family: "Arial", sans-serif;
}

/* Página 2: resumen */
.arca-report.page-2 { padding-top: 44px; }
.arca-summary {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 8px;
}
.arca-summary th {
  background: #f0f0f0;
  border-bottom: 1.5px solid #000;
  padding: 6px 8px;
  text-align: left;
  font-weight: 700;
  font-size: 10.5px;
}
.arca-summary td {
  padding: 5px 8px;
  border-bottom: 1px solid #ddd;
}
.arca-summary th.num, .arca-summary td.num { text-align: right; font-variant-numeric: tabular-nums; }
.arca-summary tr.current td { background: #fff8d6; font-weight: 600; }
.arca-summary tr.totales td {
  border-top: 1.5px solid #000;
  border-bottom: 1.5px double #000;
  font-weight: 700;
  padding-top: 8px; padding-bottom: 8px;
}

.arca-viewer {
  background: #e7eaef;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  min-height: 500px;
}
.arca-toolbar {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 8px 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-bottom: 0; border-radius: 4px 4px 0 0;
}

@media print {
  body * { visibility: hidden; }
  .arca-report, .arca-report *,
  .reporte-ficha, .reporte-ficha *,
  .reporte-print, .reporte-print * { visibility: visible; }
  .arca-report, .reporte-ficha, .reporte-print {
    position: absolute; left: 0; top: 0; width: 100%;
    box-shadow: none; border: 0;
  }
  @page { size: A4; margin: 12mm; }
}

/* Print-ready reporte */
.reporte-ficha {
  background: white;
  border: 2px solid var(--navy-900);
  padding: 0;
  font-family: var(--font-serif);
  color: #000;
}
.reporte-ficha .rf-head {
  background: var(--navy-900); color: white; padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
}
.reporte-ficha .rf-head .rf-logo {
  width: 52px; height: 52px; border-radius: 6px;
  background: #fff; padding: 3px;
  flex: 0 0 auto;
  object-fit: contain;
}
.reporte-ficha .rf-head h2 { margin: 0; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-ui); }
.reporte-ficha .rf-head .sub { margin-top: 2px; font-size: 11px; opacity: 0.8; font-family: var(--font-mono); letter-spacing: 0.04em; }
.reporte-ficha .rf-stripe { background: var(--gold); color: #3a2f06; padding: 4px 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--font-ui); }
.reporte-ficha .rf-body { padding: 18px 20px; }

