* { box-sizing: border-box; }

:root {
  --bg: #f7f7f8;
  --paper: #ffffff;
  --ink: #17181c;
  --ink-soft: #62636b;
  --ink-faint: #9a9ba3;
  --line: #e7e7eb;

  --accent: #17181c;
  --accents: #2c6ba8, #c15a2e, #14907a, #ab7a10, #b8577a, #1f7a3a, #55488f, #b23c3a, #5c5d63, #17181c;

  --vencido: #dc2626;
  --proximo: #ca8a04;
  --ok: #16a34a;

  --shadow: 0 1px 2px rgba(20, 20, 25, 0.04), 0 8px 24px rgba(20, 20, 25, 0.05);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --sidebar-w: 248px;

  /* ---- Rediseño (catálogo de subasta) ----
     Tokens y clases nuevas conviven con las de arriba mientras se
     rehacen las pantallas una por una; al terminar se purga lo viejo. */
  --rd-canvas: #cfcfca;
  --rd-paper: #e8e8e5;
  --rd-paper-light: #d6d6d1;
  --rd-ink: #14161a;
  --rd-ink-rgb: 20, 22, 26;
  --rd-ink-deep: #0e1013;
  --rd-ink-2: #35373b;
  --rd-gray-text: #6d6f73;
  --rd-gray-dim: #8b8d90;
  --rd-paper-on-ink: #f2f2ef;
  --rd-paper-on-ink-rgb: 242, 242, 239;
  --rd-white: #ffffff;
  --rd-accent: #146b4e;
  --rd-accent-rgb: 20, 107, 78;
  --rd-accent-light: #7fd1b0;
  --rd-danger: #a3352f;
  --rd-danger-light: #e29a95;
  --rd-sans-2: 'Archivo', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --rd-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 14.5px;
}

button { font-family: inherit; }
a { color: inherit; }

/* ---------- generic buttons / fields ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s, opacity 0.15s, background 0.15s;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); filter: brightness(0.97); }
.btn-accent {
  background: var(--vehcolor, var(--ink));
  box-shadow: 0 8px 18px -8px var(--vehcolor, rgba(23, 24, 28, 0.5));
}
.btn-ghost {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(20, 20, 25, 0.03);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--ink-faint); }
.btn-danger { background: #fff; color: var(--vencido); border: 1px solid #f3c9c9; }
.btn-danger:hover { background: #fef2f2; opacity: 1; }
.btn-text {
  background: none;
  border: none;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
}
.btn-text:hover { color: var(--ink); }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.field textarea { resize: vertical; min-height: 70px; }

.error {
  background: #fef2f2;
  color: var(--vencido);
  border: 1px solid #f3c9c9;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.info {
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

/* ---------- Login / registro / recuperar contraseña ---------- */

.login-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  border: 1px solid var(--rd-ink);
  background: var(--rd-ink-deep);
}
.login-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-veil {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(14, 16, 19, .96) 0%, rgba(14, 16, 19, .9) 42%, rgba(14, 16, 19, .25) 100%);
}
.login-content {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 44px 48px;
}

.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand .mark { width: 19px; height: 19px; background: var(--rd-accent); flex-shrink: 0; }
.login-brand .word {
  font-family: var(--rd-sans-2); font-size: 34px; font-weight: 800;
  letter-spacing: .30em; color: var(--rd-paper-on-ink);
}

.login-center { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 460px; }
.login-eyebrow {
  font-family: var(--rd-mono); font-size: 11px; letter-spacing: .16em;
  color: var(--rd-accent-light); margin-bottom: 14px;
}
.login-title {
  font-family: var(--rd-sans-2); font-size: 42px; font-weight: 800;
  letter-spacing: -.03em; line-height: 1.05; color: var(--rd-paper-on-ink);
  margin: 0 0 34px; text-wrap: pretty;
}
.login-error {
  font-family: var(--rd-mono); font-size: 12px; color: var(--rd-paper-on-ink);
  background: var(--rd-ink); padding: 7px 10px; margin: -12px 0 24px;
}
.login-info {
  font-family: var(--rd-mono); font-size: 12px; color: var(--rd-paper-on-ink);
  background: rgba(var(--rd-paper-on-ink-rgb), .12); padding: 7px 10px; margin: -12px 0 24px;
}

.login-field { margin-bottom: 26px; }
.login-field label {
  display: block; font-family: var(--rd-mono); font-size: 10.5px; letter-spacing: .14em;
  color: rgba(var(--rd-paper-on-ink-rgb), .45); margin-bottom: 8px;
}
.login-field input {
  width: 100%; background: none; border: none;
  border-bottom: 1px solid rgba(var(--rd-paper-on-ink-rgb), .40);
  font-family: var(--rd-mono); font-size: 19px; color: var(--rd-paper-on-ink);
  padding: 0 0 9px; border-radius: 0; transition: border-color .12s ease;
}
.login-field input:focus { outline: none; border-bottom-color: var(--rd-accent-light); }
.login-field input::placeholder { color: var(--rd-gray-dim); }
.login-field.pass input { letter-spacing: .2em; }

.login-actions { display: flex; align-items: center; gap: 22px; margin-top: 4px; }
.login-btn {
  font-family: var(--rd-mono); font-size: 12.5px; letter-spacing: .12em; font-weight: 500;
  background: var(--rd-accent); color: #fff; border: none; border-radius: 0;
  padding: 14px 30px; cursor: pointer; transition: background-color .12s ease;
}
.login-btn:hover { background: #0f5640; }
.login-link {
  font-family: var(--rd-mono); font-size: 11.5px; letter-spacing: .10em;
  background: none; border: none; cursor: pointer; padding: 0;
  color: rgba(var(--rd-paper-on-ink-rgb), .60); transition: color .12s ease;
}
.login-link:hover { color: var(--rd-paper-on-ink); }
.login-forgot { margin-top: 18px; align-self: flex-start; }

/* ---------- Diseño viejo ("catálogo de subasta"), en retirada ----------
   Lo que todavía usan las pantallas que no pasaron al diseño nuevo (style.css): se borra
   pantalla por pantalla y, al final, el archivo entero. No sumar nada acá. */

.rd-app { min-height: 100vh; background: var(--rd-canvas); }

.rd-page { max-width: 1360px; margin: 0 auto; }

.rd-page-title {
  background: var(--rd-paper);
  padding: 30px 30px 12px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.rd-page-title .eyebrow { font-family: var(--rd-mono); font-size: 11px; letter-spacing: .16em; color: var(--rd-gray-text); margin-bottom: 6px; }
.rd-page-title h1 { font-family: var(--rd-sans-2); font-size: 40px; font-weight: 800; letter-spacing: -.03em; margin: 0; }
.rd-page-title .aside { text-align: right; font-family: var(--rd-mono); font-size: 12px; color: var(--rd-gray-text); line-height: 1.7; }
.rd-page-title .aside .accent { color: var(--rd-accent); font-weight: 600; }

/* Las pantallas viejas, dentro del marco nuevo: un panel con el fondo claro de antes. */
.pc-viejo { background: var(--rd-canvas); color: var(--ink); font-family: var(--sans); font-size: 14.5px; line-height: normal; font-variant-numeric: normal; overflow: hidden; }
.pc-viejo.rd-app-gastos { display: flex; flex-direction: column; height: calc(100vh - 60px); }
.ga-page-fit { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 16px; }

.ga-page-title { padding: 18px 30px 7px; flex-shrink: 0; }
.ga-page-title h1 { font-size: 30px; }

.rd-empty { font-family: var(--rd-mono); font-size: 12px; color: var(--rd-gray-dim); padding: 40px 30px; }

/* ---- Nuevo / editar registro (modal) ---- */
.modal.nr-modal {
  max-width: 1000px; width: 100%; padding: 0; border-radius: 0; box-shadow: none;
  background: var(--rd-paper); border: 1px solid var(--rd-ink);
}
.nr-titlebar {
  background: var(--rd-ink-deep); padding: 18px 26px;
  display: flex; align-items: center; gap: 10px;
}
.nr-titlebar .mark { width: 13px; height: 13px; background: var(--rd-accent); flex-shrink: 0; }
.nr-title-word { font-family: var(--rd-mono); font-size: 12px; letter-spacing: .16em; color: var(--rd-paper-on-ink); flex: 1; }
.nr-close {
  font-family: var(--rd-mono); font-size: 11.5px; letter-spacing: .1em;
  background: none; border: none; padding: 0; cursor: pointer;
  color: rgba(var(--rd-paper-on-ink-rgb), .6); transition: color .12s ease;
}
.nr-close:hover { color: var(--rd-paper-on-ink); }

.nr-body { padding: 26px; max-height: calc(100vh - 140px); overflow-y: auto; }
.nr-field-group { margin-bottom: 22px; }
.nr-label { font-family: var(--rd-mono); font-size: 10px; letter-spacing: .13em; color: var(--rd-gray-text); margin-bottom: 10px; }
.nr-vehiculo-fija { font-family: var(--rd-mono); font-size: 14px; color: var(--rd-ink); }

.nr-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.nr-chip {
  font-family: var(--rd-mono); font-size: 12.5px; letter-spacing: .02em;
  border: 1px solid rgba(var(--rd-ink-rgb), .35); border-radius: 0; background: none; color: var(--rd-ink-2);
  padding: 8px 14px; cursor: pointer; transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.nr-chip.active { background: var(--rd-ink); border-color: var(--rd-ink); color: var(--rd-paper-on-ink); }
.nr-chip-cerrado { color: var(--rd-gray-dim); border-color: rgba(var(--rd-ink-rgb), .2); }
.nr-chip-cerrado.active { background: var(--rd-danger); border-color: var(--rd-danger); color: #fff; }
.nr-chip-tipo { border-color: rgba(var(--rd-ink-rgb), .35); }
.nr-chip-tipo.active { background: rgba(var(--rd-accent-rgb), .08); border-color: var(--rd-accent); color: var(--rd-accent); }

.nr-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 26px; margin-bottom: 22px; }
.nr-field label {
  display: block; font-family: var(--rd-mono); font-size: 10px; letter-spacing: .13em;
  color: var(--rd-gray-text); margin-bottom: 8px;
}
.nr-field input, .nr-field textarea {
  width: 100%; background: none; border: none; border-radius: 0;
  border-bottom: 1px solid rgba(var(--rd-ink-rgb), .3);
  font-family: var(--rd-mono); font-size: 19px; color: var(--rd-ink);
  padding: 0 0 7px; transition: border-color .12s ease;
}
.nr-field input::placeholder, .nr-field textarea::placeholder { color: var(--rd-gray-dim); }
.nr-field input:focus, .nr-field textarea:focus { outline: none; border-bottom-color: var(--rd-ink); }
.nr-select {
  width: 100%; background: var(--rd-paper); border: none; border-radius: 0;
  border-bottom: 1px solid rgba(var(--rd-ink-rgb), .3);
  font-family: var(--rd-mono); font-size: 15px; color: var(--rd-ink);
  padding: 0 0 9px; cursor: pointer;
}
.nr-select:focus { outline: none; border-bottom-color: var(--rd-ink); }
.nr-field-calc label, .nr-field-calc input { color: var(--rd-accent); }
.nr-field-calc input { border-bottom-color: rgba(var(--rd-accent-rgb), .3); cursor: default; }

.nr-textarea { min-height: 108px; resize: vertical; font-family: var(--rd-sans-2); font-size: 17px; }

.nr-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 22px; align-items: start; }
.nr-row2 .nr-field-group { margin-bottom: 0; }

.nr-fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.nr-fotos-grid:empty { display: none; }
.nr-foto { position: relative; height: 84px; overflow: hidden; background: var(--rd-paper-light); }
.nr-foto img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nr-foto-rm {
  position: absolute; top: 4px; right: 4px; border-radius: 0;
  background: rgba(20, 22, 26, .7); color: #fff; border: none;
  width: 20px; height: 20px; line-height: 18px; font-size: 12px; cursor: pointer;
}
.nr-fotos-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.nr-fotos-head .nr-label { margin-bottom: 0; }
.nr-foto-add-btn {
  font-family: var(--rd-mono); font-size: 11px; letter-spacing: .1em; color: var(--rd-gray-text);
  border: 1px solid rgba(var(--rd-ink-rgb), .35); border-radius: 0; padding: 6px 12px;
  cursor: pointer; transition: border-color .12s ease, color .12s ease; flex-shrink: 0;
}
.nr-foto-add-btn:hover { border-color: var(--rd-ink); color: var(--rd-ink); }
.nr-fotos-scroll { max-height: 220px; overflow-y: auto; }

.nr-actions { display: flex; align-items: center; gap: 20px; border-top: 2px solid var(--rd-ink); padding-top: 20px; }
.nr-spacer { flex: 1; }
.nr-context { font-family: var(--rd-mono); font-size: 11.5px; color: var(--rd-gray-text); white-space: nowrap; }
.nr-btn-primary {
  font-family: var(--rd-mono); font-size: 12.5px; letter-spacing: .12em; font-weight: 500;
  background: var(--rd-ink); color: var(--rd-paper-on-ink); border: none; border-radius: 0;
  padding: 13px 26px; cursor: pointer; transition: background-color .12s ease;
}
.nr-btn-primary:hover { background: #000; }
.nr-btn-text {
  font-family: var(--rd-mono); font-size: 11.5px; letter-spacing: .08em;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--rd-gray-text); transition: color .12s ease;
}
.nr-btn-text:hover { color: var(--rd-ink); }
.nr-btn-danger {
  font-family: var(--rd-mono); font-size: 11.5px; letter-spacing: .08em;
  background: none; border: 1px solid var(--rd-danger); color: var(--rd-danger); border-radius: 0;
  padding: 8px 14px; cursor: pointer; transition: background-color .12s ease, color .12s ease;
}
.nr-btn-danger:hover { background: var(--rd-danger); color: #fff; }

/* ---- Vencimientos ---- */
.ve-table { padding: 16px 30px 40px; }
.ve-head {
  display: grid; grid-template-columns: 150px 1fr 210px 190px 150px; gap: 22px;
  padding-bottom: 10px; border-bottom: 1px solid rgba(var(--rd-ink-rgb), .2);
  font-family: var(--rd-mono); font-size: 10px; letter-spacing: .13em; color: var(--rd-gray-text);
}
.ve-row {
  display: grid; grid-template-columns: 150px 1fr 210px 190px 150px; gap: 22px; align-items: center;
  padding: 15px 0; border-bottom: 1px solid rgba(var(--rd-ink-rgb), .14); cursor: pointer;
}
.ve-row:last-child { opacity: .6; border-bottom: 2px solid var(--rd-ink); }
.ve-row.ve-row-lejos { opacity: .6; }
.ve-faltan { font-family: var(--rd-mono); font-size: 18px; font-weight: 500; letter-spacing: -.02em; color: var(--rd-ink-2); white-space: nowrap; }
.ve-faltan-proximo { color: var(--rd-accent); }
.ve-obligacion .ve-tipo { font-family: var(--rd-sans-2); font-size: 18px; font-weight: 700; }
.ve-obligacion .ve-sub { font-family: var(--rd-mono); font-size: 11px; color: var(--rd-gray-text); margin-top: 2px; }
.ve-unidad { font-family: var(--rd-mono); font-size: 13px; color: var(--rd-ink-2); }
.ve-vence { font-family: var(--rd-mono); font-size: 13px; color: var(--rd-ink-2); }
.ve-importe { text-align: right; font-family: var(--rd-mono); font-size: 17px; white-space: nowrap; }
.ve-importe-usd { font-size: 11px; color: var(--rd-gray-text); }

.ve-row-vencida {
  background: var(--rd-ink); padding: 16px 20px; margin: 0 -20px;
  border-bottom: none; border-radius: 0;
}
.ve-row-vencida .ve-faltan { font-size: 30px; font-weight: 600; color: #fff; }
.ve-row-vencida .ve-obligacion .ve-tipo,
.ve-row-vencida .ve-unidad, .ve-row-vencida .ve-vence, .ve-row-vencida .ve-importe { color: var(--rd-paper-on-ink); }
.ve-row-vencida .ve-obligacion .ve-sub { color: rgba(var(--rd-paper-on-ink-rgb), .6); }
.ve-row-vencida .ve-importe-usd { color: rgba(var(--rd-paper-on-ink-rgb), .6); }

/* ---- Gastos ---- */
.ga-periodo-selector { display: flex; align-items: center; gap: 18px; }
.ga-periodo-btn {
  font-family: var(--rd-mono); font-size: 12px; letter-spacing: .08em;
  background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 6px 2px; cursor: pointer;
  color: var(--rd-gray-text); transition: color .12s ease, border-color .12s ease;
}
.ga-periodo-btn.active { color: var(--rd-ink); border-bottom-color: var(--rd-ink); font-weight: 600; }
.ga-periodo-btn:hover { color: var(--rd-ink); }

.ga-scope-row { padding: 0 30px 14px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; flex-shrink: 0; }
.ga-scope-select-wrap { border-bottom: 2px solid transparent; }
.ga-scope-select-wrap.active { border-bottom-color: var(--rd-ink); }
.ga-scope-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236d6f73' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 2px center;
  border: none; outline: none; border-radius: 0;
  font-family: var(--rd-mono); font-size: 12px; letter-spacing: .08em;
  color: var(--rd-gray-text); padding: 6px 20px 6px 2px; cursor: pointer;
}
.ga-scope-select-wrap.active .ga-scope-select { color: var(--rd-ink); font-weight: 600; }
.ga-scope-select:hover { color: var(--rd-ink); }

.ga-summary {
  flex-shrink: 0;
  display: flex; padding: 0 30px; margin-top: 10px;
  border-bottom: 2px solid var(--rd-ink);
}
.ga-summary > div { padding: 10px 30px 10px 0; margin-right: 30px; border-right: 1px solid rgba(var(--rd-ink-rgb), .2); }
.ga-summary > div:last-child { border-right: none; margin-right: 0; }
.ga-summary .label { display: block; font-family: var(--rd-mono); font-size: 10px; letter-spacing: .13em; color: var(--rd-gray-text); margin-bottom: 5px; }
.ga-summary .label.accent { color: var(--rd-accent); }
.ga-summary .val { display: block; font-family: var(--rd-mono); font-size: 20px; white-space: nowrap; }
.ga-summary .val.accent { color: var(--rd-accent); font-weight: 600; }
.ga-summary .val small { display: block; font-family: var(--rd-mono); font-size: 11px; font-weight: 400; color: var(--rd-gray-text); }
.ga-summary > div.ga-moneda-cell { margin-left: auto; margin-right: 0; padding-right: 0; border-right: none; display: flex; align-items: center; }
.ga-moneda-toggle { display: flex; gap: 3px; flex-shrink: 0; }
.ga-moneda-btn {
  font-family: var(--rd-mono); font-size: 11px; letter-spacing: .06em; padding: 3px 9px;
  border: 1px solid rgba(var(--rd-ink-rgb), .3); background: none; color: var(--rd-gray-text);
  cursor: pointer; transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.ga-moneda-btn:hover:not(.active) { color: var(--rd-ink); }
.ga-moneda-btn.active { background: rgba(var(--rd-accent-rgb), .1); border-color: var(--rd-accent); color: var(--rd-accent); }

.ga-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.ga-chart-wrap { padding: 12px 30px 0; flex-shrink: 0; }
.ga-legend { display: flex; justify-content: flex-end; gap: 18px; margin-bottom: 8px; }
.ga-legend-item { display: flex; align-items: center; gap: 6px; font-family: var(--rd-mono); font-size: 11px; color: var(--rd-gray-text); }
.ga-legend-dot { width: 11px; height: 11px; flex-shrink: 0; }
.ga-bar-a { background: rgba(var(--rd-ink-rgb), .85); }
.ga-bar-b { background: var(--rd-accent); }
.ga-bar-c { background: rgba(var(--rd-ink-rgb), .35); }

.ga-chart {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 20px;
  height: clamp(60px, 15vh, 150px); align-items: end; border-bottom: 2px solid var(--rd-ink);
}
.ga-bargroup { display: flex; align-items: end; justify-content: center; gap: 5px; height: 100%; }
.ga-bar { flex: 1; max-width: 26px; min-height: 0; }

.ga-chart-labels { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 20px; margin-top: 6px; }
.ga-chart-labels span { text-align: center; font-family: var(--rd-mono); font-size: 11px; color: var(--rd-gray-text); }
.ga-chart-labels span.current { color: var(--rd-accent); }

.ga-tipos { display: flex; margin-top: 14px; flex: 1; min-height: 0; overflow: hidden; }
.ga-tipo-col { flex: 1; padding: 0 30px; border-right: 1px solid rgba(var(--rd-ink-rgb), .2); min-width: 0; overflow: hidden; }
.ga-tipo-col:last-child { border-right: none; }
.ga-tipo-col-title { font-family: var(--rd-mono); font-size: 11.5px; letter-spacing: .1em; color: var(--rd-gray-text); margin-bottom: 8px; }
.ga-tipo-row { display: grid; grid-template-columns: 100px 1fr 150px; gap: 16px; align-items: center; padding: 3px 0; }
.ga-tipo-nombre { font-family: var(--rd-mono); font-size: 11.5px; color: var(--rd-ink-2); }
.ga-tipo-barra { height: 10px; background: rgba(var(--rd-ink-rgb), .14); }
.ga-tipo-barra-fill { height: 100%; background: rgba(var(--rd-ink-rgb), .75); }
.ga-tipo-col:nth-child(2) .ga-tipo-barra { background: rgba(var(--rd-accent-rgb), .16); }
.ga-tipo-col:nth-child(2) .ga-tipo-barra-fill { background: var(--rd-accent); }
.ga-tipo-importe { text-align: right; font-family: var(--rd-mono); font-size: 12.5px; white-space: nowrap; }
.ga-tipo-total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--rd-ink); margin-top: 6px; padding-top: 6px;
  font-family: var(--rd-mono); font-size: 11px; letter-spacing: .1em; color: var(--rd-gray-text);
}
.ga-tipo-total span:last-child { font-size: 17px; letter-spacing: normal; color: var(--rd-ink); }
.ga-tipo-total small { display: block; font-size: 11.5px; color: var(--rd-gray-text); }

/* ---------- App shell (sidebar layout) ---------- */

.page { display: flex; flex-direction: column; min-height: 100vh; }

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  height: 123px;
  flex-shrink: 0;
  background-image: linear-gradient(90deg, rgba(8, 9, 12, 0.8) 0%, rgba(8, 9, 12, 0.45) 40%, rgba(8, 9, 12, 0.1) 68%), url('Header.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 5;
}
.app-logo { height: 60%; width: auto; flex-shrink: 0; }
.app-header .brand-text { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: 0.01em; }
.app-brand {
  display: flex; align-items: center; gap: 16px;
  height: 100%;
  border: none; background: none; padding: 0; margin: 0; cursor: pointer; text-align: left;
}

.shell { display: flex; flex: 1; min-height: 0; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 123px);
  position: sticky;
  top: 123px;
}

.sidebar-section-label {
  padding: 4px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 10px;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding-bottom: 12px; }

.veh-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 20px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
}
.veh-item:hover { background: var(--bg); color: var(--ink); }
.veh-item.active { background: var(--bg); color: var(--ink); box-shadow: inset 3px 0 0 var(--vehcolor, var(--ink)); }
.veh-item.vendido { opacity: 0.55; }
.veh-item.vendido.active { opacity: 0.85; }

.sidebar-divider { height: 1px; background: var(--ink-faint); margin: 14px 20px; opacity: 0.5; }
.divider { height: 1px; background: var(--line); margin: 0 0 24px; }
.veh-item .swatch {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--vehcolor, var(--ink));
}
.veh-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.veh-add {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 20px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: var(--ink-faint);
  font-size: 13.5px;
  font-weight: 600;
}
.veh-add:hover { color: var(--ink); }
.veh-add .plus { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.veh-add .plus svg { width: 12px; height: 12px; }

.sidebar-user {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--line); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; flex-shrink: 0;
}
.sidebar-user .who { flex: 1; min-width: 0; }
.sidebar-user .name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .logout { font-size: 12px; }

/* ---------- Main ---------- */

.main { flex: 1; min-width: 0; }

.container { margin: 0; padding: 32px; }

/* ---------- Empty state ---------- */

.empty {
  border-radius: 16px;
  padding: 70px 32px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
}
.empty h2 { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.empty p { color: var(--ink-soft); margin-bottom: 22px; }

/* ---------- Modal ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 25, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  overflow-y: auto;
  z-index: 50;
}

.modal {
  width: 100%;
  max-width: 500px;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px 28px;
}

.modal h2 { font-size: 18px; font-weight: 700; margin: 0 0 18px; }
.modal .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.modal-wide { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-actions .spacer { flex: 1; }


/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; background: rgba(10, 10, 12, 0.92);
  display: flex; align-items: center; justify-content: center; z-index: 80; cursor: zoom-out; padding: 24px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.12); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.12); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ---------- misc ---------- */

.hidden { display: none !important; }

@media (max-width: 860px) {
  .app-header { height: 62px; padding: 0 20px; background-position: 68% center; }
  .app-header .brand-text { font-size: 16px; }
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar-nav { display: flex; overflow-x: auto; flex: 1; padding-bottom: 0; }
  .sidebar-section-label { display: none; }
  .veh-item, .veh-add { width: auto; white-space: nowrap; padding: 10px 14px; box-shadow: none !important; border-radius: 10px; }
  .veh-item.active { background: var(--bg); }
  .sidebar-user { border-top: none; }
  .container { padding: 20px 16px; }
  .modal .row2, .modal .row3, .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 22px 20px; }
}

/* ---------- Modal de invitaciones (solo admin) ---------- */
.inv-help { font-family: var(--rd-sans-2); font-size: 15px; line-height: 1.45; color: var(--rd-ink-2); margin: 0 0 22px; }
.inv-nuevo { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(var(--rd-ink-rgb), .15); }
.inv-nuevo label, .inv-lista > label {
  display: block; font-family: var(--rd-mono); font-size: 10px; letter-spacing: .13em;
  color: var(--rd-gray-text); margin-bottom: 8px;
}
.inv-link-row { display: flex; gap: 12px; align-items: end; }
.inv-link-row input {
  flex: 1; min-width: 0; background: none; border: none; border-radius: 0;
  border-bottom: 1px solid var(--rd-accent);
  font-family: var(--rd-mono); font-size: 13px; color: var(--rd-accent); padding: 0 0 7px;
}
.inv-link-row input:focus { outline: none; }
.inv-lista:not(:empty) { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(var(--rd-ink-rgb), .15); }
.inv-item { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid rgba(var(--rd-ink-rgb), .08); }
.inv-quien { flex: 1; font-family: var(--rd-sans-2); font-size: 15px; color: var(--rd-ink); }
.inv-estado { font-family: var(--rd-mono); font-size: 11px; letter-spacing: .06em; color: var(--rd-gray-text); }
.inv-estado.inv-pendiente { color: var(--rd-accent); }
.inv-envio { font-family: var(--rd-sans-2); font-size: 14px; margin-bottom: 14px; }
.inv-envio.ok { color: var(--rd-accent); }
.inv-envio.error { color: var(--rd-danger); }
.inv-mail { font-family: var(--rd-mono); font-size: 11px; color: var(--rd-gray-text); margin-left: 8px; }
.modal.nr-modal.inv-modal { max-width: 640px; }

/* ---------- Avisos de estadísticas (ADR 0001): sin dólar del día ---------- */
.aviso-sin-dolar { font-family: var(--rd-mono); font-size: 10px; letter-spacing: .06em; color: var(--rd-gray-text); margin-top: 4px; }
