/* CRCRT v8.2 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Roboto, Arial, sans-serif; background: #f2f2f2; color: #222; min-height: 100vh; display: flex; flex-direction: column; }
.shell { max-width: 1280px; margin: 0 auto; width: 100%; }
.banner { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%); color: #fff; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.banner-titulo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.app-nombre { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.app-nombre .rc { color: #ffd700; }
.app-autor { font-size: 16px; color: #ffd700; }
.icono-sr { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: #d90429; color: #fff; font-weight: 800; font-size: 16px; text-decoration: none; border: 2px solid #ffd700; transition: all .2s; }
.icono-sr:hover { background: #ffd700; color: #1a1a2e; }
.banner-version { font-size: 12px; color: #9aa7c0; }
.franja-bandera { height: 10px; background-image: linear-gradient(45deg,#111 25%,transparent 25%,transparent 75%,#111 75%),linear-gradient(45deg,#111 25%,#fff 25%,#fff 75%,#111 75%); background-size: 12px 12px; background-position: 0 0, 6px 6px; }
.nav-principal { position: sticky; top: 0; z-index: 1000; background: #d90429; box-shadow: 0 3px 10px rgba(0,0,0,.28); display: flex; gap: 4px; padding: 8px 16px; overflow-x: auto; }
.nav-principal a { color: #fff; text-decoration: none; padding: 8px 18px; border-radius: 6px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav-principal a:hover { background: rgba(255,255,255,.22); }
.nav-principal a.activo { background: #1a1a2e; }
.cuerpo { flex: 1; width: 100%; padding: 20px 16px; }
.pie { background: #1a1a2e; color: #9aa7c0; text-align: center; padding: 14px; font-size: 13px; }
.pie a { color: #ffd700; }
.tarjeta { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.08); margin-bottom: 18px; }
.tarjeta h2 { color: #1a1a2e; margin-bottom: 8px; font-size: 20px; }
.tarjeta h3 { color: #1a1a2e; margin: 16px 0 10px; font-size: 16px; }
.subtitulo { color: #666; font-size: 13px; margin-bottom: 12px; }
.nota { font-size: 12px; color: #888; margin-top: 6px; }
.gris { color: #999; }
.derecha { text-align: right; white-space: nowrap; }
.centro { text-align: center; }
.bold { font-weight: 700; }
.cabecera-fila { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.btn { display: inline-block; background: #d90429; color: #fff; border: none; padding: 10px 18px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 14px; text-decoration: none; }
.btn:hover { background: #a1021f; }
.btn-verde { background: #2e9e44; } .btn-verde:hover { background: #237d35; }
.btn-sec { background: #1a1a2e; } .btn-sec:hover { background: #0f0f22; }
.btn-grande { width: 100%; padding: 14px; font-size: 16px; margin-top: 16px; }
.btn-mini { display: inline-block; background: #1a1a2e; color: #fff; border: none; border-radius: 5px; padding: 5px 10px; font-size: 12px; text-decoration: none; cursor: pointer; margin-right: 4px; }
.btn-peligro { background: #c0392b; } .btn-peligro:hover { background: #922b21; }
.btn-agregar { background: #2e9e44; white-space: nowrap; } .btn-agregar:hover { background: #237d35; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { background: #1a1a2e; color: #fff; padding: 10px; font-size: 13px; text-align: left; }
.tabla td { padding: 8px 10px; border-bottom: 1px solid #eee; font-size: 14px; }
.tabla tr:hover td { background: #faf7f7; }
.tabla th.derecha, .tabla td.derecha { text-align: right; }
label { display: block; font-size: 13px; font-weight: 600; color: #444; margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=time], input[type=number], input[type=date], select, .buscador input, .buscador select { padding: 9px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; width: 100%; }
.buscador { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin: 14px 0; }
.buscador input, .buscador select { flex: 1; min-width: 110px; width: auto; }
.grupito { display: inline-flex; gap: 6px; align-items: center; }
.grupito select { flex: 1; min-width: 90px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 14px; }
.campo select, .campo input { width: 100%; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.check-inline input { width: auto; }
.barra-acciones { display: flex; gap: 10px; margin-top: 16px; }
.inline-form { display: inline; }
.fecha-nac { display: flex; gap: 6px; }
.fecha-nac select { flex: 1; }
.fila-venta { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.fila-superior { align-items: flex-end; }
.campo-piloto { flex: 1 1 420px; min-width: 260px; }
.campo-agregar { display: flex; flex-direction: column; justify-content: flex-end; flex: 0 0 auto; }
.campo-agregar-label { display: block; height: 0; line-height: 0; font-size: 0; }
.campo-pago { flex: 0 0 150px; }
.campo-carro { flex: 0 0 180px; }
.alerta { padding: 12px 16px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.alerta.ok { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.alerta.error { background: #fdecea; color: #b71c1c; border: 1px solid #ef9a9a; }
.estadisticas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { text-align: center; padding: 24px; }
.stat-num { font-size: 26px; font-weight: 800; color: #d90429; }
.stat-txt { font-size: 13px; color: #666; margin-top: 4px; }
.accesos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.acceso { display: block; text-align: center; font-weight: 700; font-size: 15px; color: #1a1a2e; text-decoration: none; padding: 26px 14px; border: 2px solid #eee; border-radius: 10px; transition: all .2s; }
.acceso:hover { border-color: #d90429; background: #fff5f5; }
.lista-pilotos { border: 1px solid #ddd; border-radius: 6px; margin-top: 6px; max-height: 200px; overflow: auto; display: none; }
.lista-pilotos:not(:empty) { display: block; }
.lp-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #eee; font-size: 13px; }
.lp-item:hover { background: #d90429; color: #fff; }
.lp-code { color: #888; }
.lp-vacio { padding: 10px; font-size: 13px; color: #888; }
.info-piloto { margin-top: 8px; padding: 10px; background: #eef4fb; border-radius: 8px; font-size: 14px; }
.info-piloto:empty { display: none; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 12px; font-weight: 800; font-size: 12px; color: #fff; }
.cat-a { background: #2e9e44; } .cat-b { background: #f39c12; } .cat-c { background: #d90429; } .cat-pro { background: #1a1a2e; }
.login-box { max-width: 420px; margin: 40px auto; }
.login-box form { display: flex; flex-direction: column; gap: 10px; }

/* Zona de venta */
.zona-venta { display: grid; grid-template-columns: 35% 20% 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.zona-venta h3 { margin-top: 0; }
.col-pistas { padding-right: 4px; }
.col-periodos { overflow-y: auto; }
.col-factura { position: sticky; top: 70px; }
.pistas-vertical { display: flex; flex-direction: column; gap: 6px; }
.fila-pista { border: 1px solid #e0e0e0; border-radius: 8px; padding: 6px 10px; background: #fafafa; transition: border-color .15s; }
.fila-pista.activa { border-color: #d90429; background: #fff1f1; }
.pista-linea-titulo { display: flex; align-items: baseline; gap: 8px; }
.pista-info .pista-codigo { font-size: 15px; font-weight: 800; color: #1a1a2e; }
.pista-info .pista-cat { font-size: 11px; color: #d90429; font-weight: 700; }
.pista-precios { margin-top: 2px; font-size: 12px; line-height: 1.35; }
.precio-propio { color: #2e9e44; font-weight: 700; }
.precio-alquila { color: #d90429; font-weight: 700; }
.periodos-vertical { display: flex; flex-direction: column; gap: 8px; }
.fila-periodo { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.fp-codigo { font-weight: 800; color: #1a1a2e; min-width: 30px; }
.periodo-pista { width: 70px; padding: 6px; text-align: center; font-weight: 700; }
.fp-lbl { font-size: 12px; color: #666; }
.replica-factura { background: #1a1a2e; color: #fff; border-radius: 10px; padding: 16px; font-family: 'Courier New', monospace; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.rf-encabezado { text-align: center; font-weight: 800; font-size: 14px; border-bottom: 1px dashed #666; padding-bottom: 8px; margin-bottom: 8px; line-height: 1.2; }
.rf-encabezado span { display: block; font-size: 16px; letter-spacing: 2px; margin-top: 2px; }
.rf-linea { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dotted #444; font-size: 13px; gap: 8px; }
.rf-linea span:first-child { color: #9aa7c0; white-space: nowrap; }
.rf-linea span:last-child { text-align: right; font-weight: 700; }
.rf-linea.rf-total span:last-child, .rf-linea.rf-cobrar span:last-child { color: #ffd700; font-size: 15px; }
.rf-linea.rf-desc span:last-child, .rf-linea.rf-devolucion span:last-child { color: #7ee08a; }
.rf-recibido input { width: 100%; text-align: right; padding: 6px; font-size: 14px; font-family: 'Courier New', monospace; font-weight: 700; border: 1px solid #555; border-radius: 4px; background: #fff; color: #000; }
.rf-total-periodos { display: flex; justify-content: space-between; padding-top: 8px; font-size: 12px; color: #9aa7c0; }

/* Contabilidad */
.cont-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.resumen-venta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; background: #f7f7fa; border-radius: 10px; padding: 16px; margin-top: 14px; }
.rv-item strong { font-size: 18px; color: #d90429; }
.e_periodos, .e_precios { width: 100%; max-width: 160px; }
#tablaAsiento .sel-cuenta { min-width: 260px; }
#tablaAsiento .inp-debito, #tablaAsiento .inp-credito { max-width: 160px; text-align: right; }

@media (max-width: 900px) {
    .zona-venta { grid-template-columns: 1fr; }
    .col-factura { position: static; }
}
@media (max-width: 640px) {
    .app-nombre { font-size: 19px; }
    .app-autor { font-size: 14px; }
    .nav-principal a { padding: 8px 12px; font-size: 13px; }
    .campo-pago, .campo-carro { flex: 1 1 120px; }
}
