/* =====================================================================
   NAVARRO MOTORS — hoja de estilos
   Paleta: asfalto / acero / papel / ámbar de señalética / óxido / pino
   ===================================================================== */

:root {
  --negro:   #0b0b0e;
  --acero:   #1e1f23;
  --papel:   #f2f2f0;
  --tarjeta: #ffffff;
  --linea:   #d7d7d4;
  --plata:   #c9c9c7;
  --rojo:    #e31e24;
  --alerta:  #b3261e;
  --ambar:   #c8842a;
  --pino:    #2e7d5b;
  --azul:    #2f6ea8;
  --humo:    #6b6d72;
  --tinta:   #17181b;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --cuerpo:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  --radio: 3px;
  --sombra: 0 1px 2px rgba(22, 25, 29, .08), 0 4px 12px rgba(22, 25, 29, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--cuerpo);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--tinta); }

:focus-visible {
  outline: 2px solid var(--rojo);
  outline-offset: 2px;
}

/* ------------------------------ Barra ------------------------------ */

.barra {
  background: var(--negro);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.marca {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.marca span { color: var(--rojo); }

.barra nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }

.barra nav a {
  color: #c9ccd1;
  text-decoration: none;
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.barra nav a:hover, .barra nav a.activo { color: #fff; border-bottom-color: var(--rojo); }

.quien {
  font-size: 12px;
  color: #9a9c9f;
  text-align: right;
  line-height: 1.25;
  border-left: 1px solid #34353a;
  padding-left: 16px;
}
.quien b { color: #fff; display: block; font-weight: 600; }

/* ------------------------------ Lienzo ----------------------------- */

.lienzo { padding: 22px 20px 60px; max-width: 1560px; margin: 0 auto; }

h1 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

h2 {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 12px;
  color: var(--acero);
}

.rotulo {
  font-family: var(--display);
  font-size: 12.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--humo);
  display: block;
  margin-bottom: 2px;
}

/* -------------------------- Placa (firma) -------------------------- */
/* Chip con forma de placa vehicular: identifica cada unidad */

.placa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  background: #fff;
  color: var(--negro);
  border: 2px solid var(--negro);
  border-radius: 4px;
  padding: 2px 8px;
  box-shadow: inset 0 0 0 1px #fff;
  white-space: nowrap;
}
.placa::before {
  content: "";
  width: 3px;
  height: 13px;
  background: var(--rojo);
  border-radius: 1px;
}
.placa.oscura { background: var(--negro); color: #fff; box-shadow: inset 0 0 0 1px #3a3b40; }

/* ---------------------------- Pizarrón ----------------------------- */

.pizarron {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 14px;
  align-items: start;
}

.carril {
  background: #eae8e2;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.carril > header {
  padding: 9px 12px 8px;
  border-top: 3px solid var(--humo);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: #f6f5f1;
}

.carril[data-e="por_llegar"]  > header { border-top-color: #7b8794; }
.carril[data-e="preparacion"] > header { border-top-color: var(--ambar); }
.carril[data-e="en_venta"]    > header { border-top-color: var(--rojo); }
.carril[data-e="apartada"]    > header { border-top-color: var(--azul); }
.carril[data-e="vendida"]     > header { border-top-color: var(--pino); }

.carril h3 {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 0;
}
.carril .cuenta { font-family: var(--mono); font-size: 12px; color: var(--humo); }

.carril .lista { padding: 10px; display: grid; gap: 10px; }

.ficha-mini {
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: var(--sombra);
  transition: transform .12s ease, box-shadow .12s ease;
}
.ficha-mini:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(22,25,29,.14); }

.ficha-mini .foto {
  aspect-ratio: 4 / 3;
  background: #d8d6d0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23aaa7a0'%3E%3Cpath d='M5 11l1.5-4h11L19 11h1a1 1 0 011 1v4h-2a2 2 0 11-4 0H9a2 2 0 11-4 0H3v-4a1 1 0 011-1h1z'/%3E%3C/svg%3E") center/40px no-repeat;
  background-size: cover;
  display: block;
  width: 100%;
  object-fit: cover;
}
.ficha-mini .cuerpo { padding: 9px 10px 10px; }
.ficha-mini .titulo {
  font-family: var(--display);
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.1;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ficha-mini .cifras {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--linea);
}
.ficha-mini .cifras .costo { color: var(--humo); }
.ficha-mini .cifras .precio { font-weight: 600; }
.dias { font-family: var(--mono); font-size: 11px; color: var(--humo); }
.dias.alto { color: var(--alerta); font-weight: 600; }

/* --------------------------- Tira franjeada ------------------------ */
/* Único uso del rayado: dinero pendiente. */

.alerta-saldo {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #fff;
  background: repeating-linear-gradient(-45deg, var(--alerta) 0 8px, #1e1f23 8px 16px);
  padding: 3px 8px;
  border-radius: 2px;
  display: inline-block;
  margin-top: 6px;
}

/* ----------------------------- Tablero ----------------------------- */

.tira {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.dato {
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-left: 3px solid var(--acero);
  border-radius: var(--radio);
  padding: 10px 13px;
}
.dato .cifra {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.dato.bueno { border-left-color: var(--pino); }
.dato.bueno .cifra { color: var(--pino); }
.dato.malo { border-left-color: var(--alerta); }
.dato.malo .cifra { color: var(--alerta); }
.dato.acento { border-left-color: var(--rojo); }

/* ----------------------------- Paneles ----------------------------- */

.panel {
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 16px 18px 18px;
  margin-bottom: 16px;
  box-shadow: var(--sombra);
}

.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 18px;
}

.campo { display: flex; flex-direction: column; }

input[type=text], input[type=number], input[type=date], input[type=password],
input[type=email], select, textarea {
  font-family: var(--cuerpo);
  font-size: 14.5px;
  padding: 7px 9px;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  background: #fcfcfa;
  color: var(--tinta);
  width: 100%;
}
input[type=number], .mono { font-family: var(--mono); }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--acero); background: #fff; }

/* ------------------------------ Botones ---------------------------- */

.btn {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--negro);
  color: #fff;
  border: 1px solid var(--negro);
  border-radius: var(--radio);
  padding: 7px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.35;
}
.btn:hover { background: #000; }
.btn.rojo { background: var(--rojo); border-color: var(--rojo); color: #fff; font-weight: 600; }
.btn.rojo:hover { background: #c4161c; }
.btn.hueco { background: transparent; color: var(--negro); }
.btn.hueco:hover { background: #e7e5df; }
.btn.chico { font-size: 13.5px; padding: 3px 10px; }
.btn.peligro { background: var(--alerta); border-color: var(--alerta); }

/* ------------------------------ Tablas ----------------------------- */

table.datos { width: 100%; border-collapse: collapse; font-size: 14px; }
table.datos th {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--humo);
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1.5px solid var(--acero);
  white-space: nowrap;
}
table.datos td { padding: 5px 8px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
table.datos td.n, table.datos th.n { text-align: right; font-family: var(--mono); }
table.datos tr:last-child td { border-bottom: none; }
table.datos tfoot td { font-weight: 600; border-top: 1.5px solid var(--acero); }

/* ---------------------------- Pestañas ----------------------------- */

.pestanas {
  display: flex;
  gap: 2px;
  border-bottom: 1.5px solid var(--acero);
  margin-bottom: 16px;
  overflow-x: auto;
}
.pestanas a {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 7px 15px;
  text-decoration: none;
  color: var(--humo);
  background: #e7e5df;
  border: 1px solid var(--linea);
  border-bottom: none;
  border-radius: var(--radio) var(--radio) 0 0;
  white-space: nowrap;
}
.pestanas a.activa { background: var(--acero); color: #fff; border-color: var(--acero); }

/* ---------------------------- Etiquetas ---------------------------- */

.etiqueta {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 2px;
  background: var(--humo);
  color: #fff;
  display: inline-block;
}
.etiqueta[data-e="por_llegar"]  { background: #7b8794; }
.etiqueta[data-e="preparacion"] { background: var(--ambar); color: #fff; }
.etiqueta[data-e="en_venta"]    { background: var(--rojo); }
.etiqueta[data-e="apartada"]    { background: var(--azul); }
.etiqueta[data-e="vendida"]     { background: var(--pino); }

/* ------------------------------ Fotos ------------------------------ */

.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.galeria figure { margin: 0; position: relative; }
.galeria img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border: 1px solid var(--linea); border-radius: var(--radio); display: block; }
.galeria figcaption { display: flex; gap: 6px; margin-top: 4px; font-size: 12px; }

/* ------------------------------ Avisos ----------------------------- */

.aviso {
  padding: 9px 14px;
  border-radius: var(--radio);
  margin-bottom: 14px;
  border-left: 3px solid var(--pino);
  background: #e6f0ea;
  font-size: 14px;
}
.aviso.error { border-left-color: var(--alerta); background: #f6e6e2; }

.vacio {
  padding: 30px 20px;
  text-align: center;
  color: var(--humo);
  font-size: 14px;
}

/* ------------------------------ Acceso ----------------------------- */

.acceso {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--negro);
  padding: 20px;
}
.acceso .caja {
  background: var(--tarjeta);
  border-radius: var(--radio);
  padding: 34px 32px;
  width: 100%;
  max-width: 370px;
  border-top: 4px solid var(--rojo);
}
.acceso .marca { color: var(--negro); font-size: 32px; display: block; margin-bottom: 3px; }
.acceso p.sub { margin: 0 0 22px; color: var(--humo); font-size: 13px; }
.acceso .campo { margin-bottom: 14px; }
.acceso .btn { width: 100%; text-align: center; margin-top: 6px; }

/* ---------------------------- Responsivo --------------------------- */

@media (max-width: 1100px) {
  .pizarron { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .lienzo { padding: 16px 12px 50px; }
  .pizarron { grid-template-columns: 1fr; }
  .barra { gap: 12px; padding: 0 12px; height: auto; flex-wrap: wrap; padding-bottom: 8px; padding-top: 8px; }
  .barra nav { margin-left: 0; width: 100%; gap: 14px; overflow-x: auto; }
  .quien { border-left: none; padding-left: 0; margin-left: auto; }
  h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .barra, .pestanas, .btn { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; page-break-inside: avoid; }
}

/* ============================ Crédito ============================== */

.panel.credito table.datos td:first-child { font-weight: 600; white-space: nowrap; }

/* ============================ Logo ================================= */

.barra .identidad { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: 0 0 auto; }
.barra .identidad img.logo {
  height: 36px !important;
  width: auto !important;
  max-width: 170px;
  display: block;
}

.acceso .logo-grande {
  display: block;
  width: auto !important;
  max-width: 240px !important;
  max-height: 150px;
  margin: 0 auto 16px;
}

/* ======================= Modo lectura / edición ==================== */

.solo-lectura .campo .valor {
  font-size: 15px;
  padding: 6px 0 7px;
  border-bottom: 1px solid var(--linea);
  min-height: 32px;
  word-break: break-word;
}
.solo-lectura .campo .valor:empty::before { content: "—"; color: var(--plata); }

.cinta-modo {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdf1f1;
  border-left: 3px solid var(--rojo);
  padding: 8px 14px;
  border-radius: var(--radio);
  margin-bottom: 14px;
  font-size: 13.5px;
}
.cinta-modo b { font-family: var(--display); letter-spacing: .06em; text-transform: uppercase; font-size: 15px; }

/* ====================== Pizarrón: bloque de cifras ================== */

.reng {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  align-items: baseline;
}
.reng.principal { font-size: 15px; font-weight: 600; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--linea); }
.reng.secundaria { font-size: 11.5px; color: var(--humo); margin-top: 2px; }
.reng.costo { font-size: 11px; color: var(--humo); margin-top: 5px; padding-top: 5px; border-top: 1px dotted var(--linea); }
.reng .et { font-family: var(--cuerpo); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--humo); }
.reng.principal .et { font-size: 11.5px; }

/* ============================ Folio ================================ */

.folio {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  background: var(--acero);
  color: #fff;
  padding: 2px 8px;
  border-radius: 2px;
  display: inline-block;
}

/* ========================= Adjuntos / visor ======================== */

.adjuntos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.adjunto {
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  overflow: hidden;
  background: #fbfbfa;
  display: flex;
  flex-direction: column;
}
.adjunto .vista {
  height: 130px;
  background: #ececea;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.adjunto .vista img { width: 100%; height: 100%; object-fit: cover; display: block; }
.adjunto .vista .pdf {
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: .1em;
  color: var(--alerta);
}
.adjunto .pie { padding: 8px 10px; font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; }
.adjunto .pie .nom { font-weight: 600; line-height: 1.25; }
.adjunto .acciones { display: flex; gap: 6px; flex-wrap: wrap; }

/* ==================== Expediente imprimible ======================== */

.hoja {
  background: #fff;
  background-image: url("marca-agua.png");
  background-repeat: repeat;
  background-size: 300px auto;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  max-width: 880px;
  margin: 0 auto 40px;
  padding: 26px 30px 34px;
  border: 1px solid var(--linea);
  box-shadow: 0 2px 14px rgba(0,0,0,.10);
}

.hoja .membrete {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--negro);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  padding: 12px 18px;
  border-radius: 3px;
}
.hoja .membrete img { height: 62px; width: auto; }
.hoja .membrete .tit { margin-left: auto; text-align: right; color: #fff; }
.hoja .membrete .tit .clase {
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hoja .membrete .tit .ref { font-family: var(--mono); font-size: 12px; color: var(--plata); }
.hoja .membrete .tit .cuando { font-size: 10.5px; color: #8d8f94; letter-spacing: .04em; }

/* Cintillo con la unidad */
.hoja .cintillo {
  border: 1.5px solid var(--negro);
  border-top: none;
  background: rgba(255,255,255,.86);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.hoja .cintillo .nombre {
  font-family: var(--display);
  font-size: 27px;
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* Bloque enmarcado */
.bloque {
  border: 1px solid var(--negro);
  background: rgba(255,255,255,.86);
  margin-bottom: 14px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.bloque > h3 {
  font-family: var(--display);
  font-size: 14.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: var(--negro);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  color: #fff;
  margin: 0;
  padding: 5px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.bloque > h3 .apunte {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--plata);
  text-transform: none;
}
.bloque .contenido { padding: 12px 14px; }

/* Pares rótulo / valor con línea de puntos */
.pares { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 22px; }
.pares.dos { grid-template-columns: repeat(2, 1fr); }
.pares .par {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dotted #c4c4c0;
  font-size: 12.5px;
  min-width: 0;
}
.pares .par .r {
  font-family: var(--display);
  font-size: 11.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--humo);
  white-space: nowrap;
}
.pares .par .v {
  margin-left: auto;
  text-align: right;
  font-weight: 500;
  word-break: break-word;
}
.pares .par .v.num { font-family: var(--mono); }
.pares .par.ancho { grid-column: 1 / -1; }

.bloque table.datos { font-size: 12px; }
.bloque table.datos th { padding: 4px 6px; }
.bloque table.datos td { padding: 4px 6px; }

.tot-hoja {
  display: flex;
  justify-content: flex-end;
  gap: 26px;
  border-top: 1.5px solid var(--negro);
  margin-top: 10px;
  padding-top: 7px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

.hoja .galeria { grid-template-columns: repeat(3, 1fr); }
.hoja .galeria img { aspect-ratio: 4/3; }

.hoja .firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin: 42px 10px 0; }
.hoja .firmas div { border-top: 1px solid var(--negro); padding-top: 6px; font-size: 11.5px; text-align: center; letter-spacing: .04em; }

.hoja .legal {
  margin-top: 22px;
  font-size: 10px;
  color: var(--humo);
  text-align: center;
  letter-spacing: .03em;
}

/* ============================ Impresión ============================ */

@media print {
  html, body { background: #fff !important; }
  .no-imprimir, .barra, .pestanas { display: none !important; }
  .hoja {
    border: none;
    box-shadow: none;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .panel { box-shadow: none; page-break-inside: avoid; }
  .btn { display: none !important; }
  a { text-decoration: none; color: inherit; }
  @page { margin: 12mm; }
}
