/* SGA · Gestión Automotriz — negro, rojo y plateado (colores del logo).
   Las variables conservan el nombre "verde" histórico: hoy son el rojo de la marca. */
:root {
  --siga-verde: #d71920;      /* rojo marca */
  --siga-verde-osc: #121212;  /* negro */
  --siga-burdeo: #8e0e13;     /* rojo oscuro */
  --siga-plata: #c9ccd1;
  --siga-fondo: #f1f2f4;
}
body { background: var(--siga-fondo); font-size: .93rem; }

.siga-nav { background: linear-gradient(90deg, #000, #1c1c1c); border-bottom: 3px solid var(--siga-verde); }
.logo-nav { height: 46px; width: auto; display: block; }
.logo-login { max-width: 100%; box-shadow: 0 6px 22px rgba(0,0,0,.35); }
.siga-nav .navbar-brand, .siga-nav .nav-link, .siga-nav .navbar-text { color: #fff; }
.siga-nav .navbar-brand small { font-size: .65rem; letter-spacing: .08em; opacity: .8; text-transform: uppercase; }
.siga-nav .nav-link { color: #e6e7ea; }
.siga-nav .nav-link:hover, .siga-nav .nav-link.active { color: #fff; background: var(--siga-verde); border-radius: 8px; }
.siga-nav .navbar-toggler { border-color: rgba(255,255,255,.5); }
.siga-nav .navbar-toggler-icon { filter: invert(1); }
.siga-logo { color: #fff; }
.card .siga-logo, .row .siga-logo { color: var(--siga-verde); }

.siga-card { border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-radius: 12px; }
.siga-seccion { background: #fff; color: #1c1c1c; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; border-bottom: 2px solid var(--siga-verde); }

.btn-siga { background: var(--siga-verde); color: #fff; border: 0; }
.btn-siga:hover, .btn-siga:focus { background: var(--siga-burdeo); color: #fff; }
.btn-retirar { background: #2b2b2b; color: #fff; }
.btn-retirar:hover { background: #000; color: #fff; }
.btn-eliminar { background: var(--siga-burdeo); color: #fff; }
.btn-eliminar:hover { background: #6d1622; color: #fff; }

.patente-chip { display: inline-block; background: #121212; color: #fff; border: 2px solid var(--siga-plata); padding: .1rem .6rem; border-radius: 6px; letter-spacing: .12em; font-family: ui-monospace, Consolas, monospace; }
input.patente { font-family: ui-monospace, Consolas, monospace; letter-spacing: .12em; font-weight: 700; }

.siga-tabs .nav-link { color: #1c1c1c; font-weight: 600; padding: .3rem .8rem; }
.siga-tabs .nav-link.active { background: var(--siga-verde); color: #fff; }

.tabla-stock { font-size: .82rem; }
.tabla-stock thead th { background: var(--siga-verde-osc); color: #fff; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tabla-stock tbody tr:nth-child(even) { background: #f6f8f6; }
.leyenda { display: inline-block; width: 14px; height: 14px; vertical-align: middle; border-radius: 3px; }
.leyenda-reciente { background: #28a745; }

.tarjeta-resumen:hover { transform: translateY(-2px); transition: transform .15s; }

@media print {
  .no-print, .siga-nav, footer { display: none !important; }
  body { background: #fff; font-size: 11px; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  .col-xl-9 { width: 100% !important; }
}

/* Inicio de sesión: fondo oscuro con brillo rojo, como el logo */
body.login-oscuro { background: radial-gradient(circle at 50% 30%, #2a0607 0%, #0b0b0b 55%, #000 100%); min-height: 100vh; }
body.login-oscuro .siga-nav { display: none; }
body.login-oscuro footer { color: #8a8d93 !important; }
body.login-oscuro .siga-card { background: #161616; color: #e6e7ea; box-shadow: 0 10px 40px rgba(215,25,32,.18); border: 1px solid #2a2a2a; }
body.login-oscuro .form-control { background: #0f0f0f; color: #fff; border-color: #333; }
body.login-oscuro .form-control:focus { border-color: var(--siga-verde); box-shadow: 0 0 0 .2rem rgba(215,25,32,.25); }
body.login-oscuro .logo-login { box-shadow: none; }

/* Negocio (compra / resumen / gastos / pagos / observaciones) */
.encabezado-negocio div { line-height: 1.75; }
.selector-estado { width: auto; display: inline-block; }
.pestanas-negocio .nav-link { color: #1c1c1c; font-weight: 600; background: #e4e5e8; margin-right: 4px; border-radius: 10px 10px 0 0; }
.pestanas-negocio .nav-link.active { background: #fff; color: var(--siga-verde); border-color: #dee2e6 #dee2e6 #fff; }
.cuerpo-pestana { border-top-left-radius: 0; }
.titulo-tabla { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; color: #1c1c1c; border-left: 4px solid var(--siga-verde); padding-left: 8px; }
.tabla-dinero thead th { background: #121212; color: #fff; font-size: .78rem; white-space: nowrap; }
.tabla-dinero .fila-agregar td { background: #fafafa; }
.tabla-dinero .fila-agregar input { min-width: 90px; }
dl.resumen dt { font-weight: 500; }
dl.resumen dd { text-align: right; margin-bottom: .35rem; }
dl.resumen dd input { max-width: 170px; margin-left: auto; }
.contribucion-final { background: #121212; color: #fff; border-radius: 10px; padding: .7rem 1rem; font-weight: 800; font-size: 1.1rem; border-left: 6px solid var(--siga-verde); }
.contribucion-final small { color: #ff6b6b; font-size: 1rem; }
.control-item { min-width: 190px; }
.tabla-dinero tr.fila-anulada td { text-decoration: line-through; color: #9aa0a6; }

/* Logo de la automotora (Empresa) */
.logo-empresa-nav { display: inline-flex; align-items: center; margin-left: .6rem; padding-left: .8rem; border-left: 1px solid #444; }
.logo-empresa-nav img { height: 40px; width: auto; max-width: 160px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 6px; }
.logo-empresa-muestra { background: #f4f4f4; border-radius: 8px; padding: 8px; }
.logo-empresa-muestra img { max-height: 90px; max-width: 240px; object-fit: contain; }
.solo-impresion { display: none; }
@media print {
  .solo-impresion { display: flex !important; }
  .encabezado-impresion { align-items: center; gap: 12px; margin-bottom: 10px; border-bottom: 2px solid #000; padding-bottom: 6px; }
  .encabezado-impresion img { height: 50px; width: auto; }
}
.leyenda-observaciones { background: #dc3545; }

/* Botones de cada fila del stock (con texto, no solo íconos) */
.btn-fila { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; padding: 1px 7px; border: 1px solid #c9ccd1; border-radius: 6px; color: #1c1c1c; background: #fff; text-decoration: none; margin-right: 3px; }
.btn-fila:hover { background: #1c1c1c; color: #fff; border-color: #1c1c1c; }
.btn-fila-negocio { border-color: var(--siga-verde); color: var(--siga-verde); }
.btn-fila-negocio:hover { background: var(--siga-verde); color: #fff; border-color: var(--siga-verde); }
.tabla-stock .celda-id a { font-size: .95rem; }

/* Foto del vehículo en la ficha */
.foto-previa { width: 200px; height: 140px; border: 2px dashed #c9ccd1; border-radius: 10px; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; background: #fafafa; }
.foto-previa img { width: 100%; height: 100%; object-fit: cover; }
.foto-previa.foto-nueva { border-color: var(--siga-verde); border-style: solid; }
/* Galería de fotos: se ordenan hacia el lado */
.galeria { display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.galeria-item { position: relative; flex: 0 0 170px; height: 120px; border-radius: 10px; overflow: hidden; background: #fafafa; border: 2px solid #e2e3e6; }
.galeria-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galeria-item.principal { border-color: var(--siga-verde); }
.galeria-item.nueva { border-color: #28a745; border-style: dashed; }
.galeria-item.vacia { border-style: dashed; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #b0b3b8; }
.galeria-item.vacia i { font-size: 1.8rem; }
.galeria-etiqueta { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.75); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 6px; }
.galeria-acciones { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 4px; }
.galeria-acciones .btn { padding: 0 6px; line-height: 1.5; }
/* Panel de resumen de la ficha */
.resumen-vehiculo { overflow: hidden; }
.resumen-foto { position: relative; aspect-ratio: 16 / 10; background: #111; }
.resumen-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.resumen-sin-foto { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #9aa0a6; text-decoration: none; background: radial-gradient(circle at 50% 40%, #2a2a2a, #111); }
.resumen-sin-foto i { font-size: 3rem; color: #5f6368; }
.resumen-sin-foto small { color: var(--siga-verde); font-weight: 600; }
.resumen-estado { position: absolute; left: 10px; top: 10px; font-size: .75rem; letter-spacing: .05em; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.resumen-nfotos { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.7); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 20px; text-decoration: none; }
.resumen-titulo { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.resumen-precio { margin: .8rem 0 .6rem; padding: .6rem .8rem; border-radius: 10px; background: #121212; color: #fff; display: flex; justify-content: space-between; align-items: center; border-left: 5px solid var(--siga-verde); }
.resumen-precio span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #c9ccd1; }
.resumen-precio strong { font-size: 1.35rem; }
.resumen-datos { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .8rem; font-size: .85rem; }
.resumen-datos span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: #8a8d93; }

/* Acciones */
.acciones-titulo { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: #8a8d93; font-weight: 700; margin-top: .4rem; }
.acciones-estado { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.acciones-estado form:only-child { grid-column: span 2; }
.btn-accion { width: 100%; display: flex; align-items: center; gap: .45rem; justify-content: center; background: #fff; border: 1px solid #d8dade; font-weight: 600; font-size: .85rem; padding: .45rem .5rem; }
.btn-accion:hover { background: #f4f5f7; border-color: #b9bcc2; }
.acciones-peligro { border-top: 1px dashed #e2e3e6; margin-top: .4rem; padding-top: .5rem; text-align: center; font-size: .85rem; }

/* Historial en línea de tiempo */
.linea-tiempo { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid #e2e3e6; }
.linea-tiempo li { position: relative; padding: .35rem 0 .55rem .5rem; font-size: .85rem; }
.linea-tiempo li::before { content: ''; position: absolute; left: -23px; top: .65rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--siga-verde); }
.linea-tiempo li:first-child::before { background: var(--siga-verde); }
/* Encabezado profesional del negocio */
.encabezado-pro { border-top: 4px solid var(--siga-verde); }
.encabezado-foto { width: 108px; height: 76px; border-radius: 10px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #2a2a2a, #111); display: flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; }
.encabezado-foto img { width: 100%; height: 100%; object-fit: cover; }
.encabezado-foto i { font-size: 2.2rem; color: #5f6368; }
.encabezado-principal h4 { font-size: 1.25rem; }
.encabezado-etiquetas { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.encabezado-etiquetas span { display: inline-flex; align-items: center; gap: .35rem; background: #f1f2f4; border: 1px solid #e2e3e6; border-radius: 20px; padding: .15rem .65rem; font-size: .8rem; font-weight: 600; }
.encabezado-etiquetas i { color: #8a8d93; }
.encabezado-kpis { display: flex; gap: .5rem; flex-wrap: wrap; }
.encabezado-kpis .kpi { min-width: 125px; padding: .45rem .7rem; border-radius: 10px; background: #f6f7f8; border: 1px solid #e6e7ea; }
.encabezado-kpis .kpi span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: #8a8d93; }
.encabezado-kpis .kpi strong { font-size: 1.05rem; }
.encabezado-kpis .kpi-destacado { background: #121212; border-color: #121212; color: #fff; border-left: 4px solid var(--siga-verde); }
.encabezado-kpis .kpi-destacado span { color: #c9ccd1; }
.encabezado-estado { min-width: 150px; }
.selector-estado.estado-stock { color: #198754; border-color: #198754; }
.selector-estado.estado-reservado { color: #b8860b; border-color: #e0a800; }
.selector-estado.estado-vendido { color: #0d6efd; border-color: #0d6efd; }
.selector-estado.estado-retirado { color: #6c757d; }
.selector-estado.estado-eliminado { color: #dc3545; border-color: #dc3545; }
/* Estado de pago del comprador */
.estado-pago { border-radius: 12px; padding: .9rem 1rem; margin-bottom: .5rem; border: 1px solid; }
.estado-pago-pendiente { background: #fff5f5; border-color: #f1aeb5; }
.estado-pago-completo { background: #f0faf3; border-color: #a3cfbb; }
.estado-pago-excedido { background: #fffbea; border-color: #ffe69c; }
.estado-pago-titulo { font-weight: 800; letter-spacing: .05em; font-size: 1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.estado-pago-pendiente .estado-pago-titulo { color: #b02a37; }
.estado-pago-completo .estado-pago-titulo { color: #146c43; }
.estado-pago-excedido .estado-pago-titulo { color: #997404; }
.estado-pago-titulo small { font-weight: 500; letter-spacing: 0; color: #146c43; }
.estado-pago-cifras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: .6rem; }
.estado-pago-cifras div { background: #fff; border-radius: 8px; padding: .45rem .7rem; font-weight: 700; font-size: 1.05rem; border: 1px solid rgba(0,0,0,.06); }
.estado-pago-cifras span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: #8a8d93; font-weight: 600; }
.estado-pago-pendiente .saldo { color: #b02a37; font-size: 1.25rem; }
.kpi-saldo { color: inherit; }
.kpi-saldo-pendiente { background: #fff5f5 !important; border-color: #f1aeb5 !important; }
.kpi-saldo-pendiente strong { color: #b02a37; }
.kpi-saldo-completo { background: #f0faf3 !important; border-color: #a3cfbb !important; }
.kpi-saldo-completo strong { color: #146c43; }
.kpi-saldo-excedido { background: #fffbea !important; border-color: #ffe69c !important; }
/* Parte de pago */
.parte-pago { border: 1px dashed #b9bcc2; background: #fafbfc; border-radius: 12px; }
.parte-pago-chip { display: inline-flex; align-items: center; gap: .35rem; background: #eef4ff; color: #0b3d91; border: 1px solid #b6ccf5; border-radius: 20px; padding: .2rem .7rem; font-size: .8rem; text-decoration: none; }
.parte-pago-chip:hover { background: #dbe7ff; }
/* ── Celular (pantallas angostas) ── */
.estado-pago-cifras div { white-space: nowrap; }
@media (max-width: 576px) {
  /* Pendiente de pago: las cifras una bajo otra, sin partir los montos */
  .estado-pago-cifras { grid-template-columns: 1fr; }
  .estado-pago-cifras div { display: flex; justify-content: space-between; align-items: baseline; }
  .estado-pago-cifras span { display: inline; }
  .contribucion-final { font-size: 1rem; }
  .encabezado-kpis .kpi { min-width: 0; flex: 1 1 45%; }
  main.container-fluid { padding-left: .6rem; padding-right: .6rem; }
}
/* Días en stock: punto de color (semáforo) */
.punto-dias { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; box-shadow: 0 0 0 2px rgba(0,0,0,.06); }
.punto-verde { background: #28a745; }
.punto-amarillo { background: #ffc107; }
.punto-rojo { background: #dc3545; }
/* Días alineados: puntos en columna y números a la derecha con dígitos del mismo ancho */
.dias-celda { display: inline-flex; align-items: center; justify-content: space-between; min-width: 52px; }
.dias-celda .punto-dias { margin-right: 0; }
.dias-num { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }

/* Vehículo recién registrado: fila completa resaltada */
.tabla-stock tr.fila-nueva > td { background-color: #e3f7e9 !important; }
.tabla-stock tr.fila-nueva:hover > td { background-color: #d2f0dc !important; }
.etiqueta-nuevo { background: #198754; color: #fff; font-size: .62rem; letter-spacing: .05em; vertical-align: middle; animation: latido 1.6s ease-in-out infinite; }
@keyframes latido { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* Ventana emergente de nuevos autos */
.modal-nuevo { border: 0; border-radius: 14px; overflow: hidden; }
.modal-nuevo .modal-header { background: #121212; color: #fff; border-bottom: 3px solid var(--siga-verde); }
.nuevo-item { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid #eee; }
.nuevo-item:last-child { border-bottom: 0; }
/* Barra de vistas del stock (segmentada y agrupada) */
.barra-vistas { display: flex; align-items: stretch; gap: 0; background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.08); overflow-x: auto; scrollbar-width: thin; }
.grupo-vistas { display: flex; align-items: center; gap: 4px; padding: 0 8px; border-left: 1px solid #e6e7ea; flex-shrink: 0; }
.grupo-vistas:first-child { border-left: 0; padding-left: 0; }
.grupo-titulo { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #a0a4aa; margin-right: 2px; writing-mode: horizontal-tb; }
.barra-vistas .vista { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 9px; color: #2b2b2b; text-decoration: none; font-weight: 600; font-size: .86rem; white-space: nowrap; transition: background .15s, color .15s; }
.barra-vistas .vista i { font-size: .95rem; color: #8a8d93; }
.barra-vistas .vista b { min-width: 22px; padding: 1px 7px; border-radius: 20px; background: #f1f2f4; color: #1c1c1c; font-size: .72rem; text-align: center; }
.barra-vistas .vista:hover { background: #f4f5f7; }
.barra-vistas .vista.vacia { color: #9aa0a6; }
.barra-vistas .vista.vacia b { background: transparent; color: #b0b3b8; }
.barra-vistas .vista.activa { background: #121212; color: #fff; box-shadow: inset 0 -3px 0 var(--siga-verde); }
.barra-vistas .vista.activa i { color: #fff; }
.barra-vistas .vista.activa b { background: var(--siga-verde); color: #fff; }
@media (max-width: 576px) { .grupo-titulo { display: none; } }/* En pantallas anchas la barra baja de línea si no cabe; el deslizamiento queda para el celular */
@media (min-width: 768px) { .barra-vistas { flex-wrap: wrap; row-gap: 6px; overflow-x: visible; } }
/* Barra más compacta para que quepa en una línea en pantallas de computador */
.barra-vistas .vista { padding: 5px 9px; gap: 5px; font-size: .84rem; }
.barra-vistas .vista b { min-width: 20px; padding: 1px 6px; }
.grupo-vistas { gap: 2px; padding: 0 6px; }
/* Títulos de grupo solo en pantallas muy anchas; los separadores ya agrupan */
@media (max-width: 1599px) { .grupo-titulo { display: none; } }

/* Control del negocio en los listados */
.etiqueta-negocio { font-size: .66rem; letter-spacing: .03em; font-weight: 700; }
.neg-revisado { background: #198754; color: #fff; }
.neg-general { background: #0d6efd; color: #fff; }
.neg-venta { background: #cfe2ff; color: #084298; border: 1px solid #9ec5fe; }
.neg-sin { background: #f1f2f4; color: #6c757d; border: 1px solid #dee2e6; }