:root {
    --color-fondo: #f4f7fa;
    --color-principal: #ffffff;
    --color-menu: #1e293b;
    --color-texto-menu: #cbd5e1;
    --color-borde: #e2e8f0;
    --color-verde: #28a745;
    --color-rojo: #dc3545;
    --color-azul: #0d6efd;
    --color-texto-principal: #334155;
    --color-naranja: #ff8c00;
    --color-purpura: #6f42c1;
    --color-cyan: #17a2b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-fondo);
    color: var(--color-texto-principal);
    min-height: 100vh;
}

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

/* --- Menú Lateral (Responsivo) --- */
.menu-lateral {
    background: linear-gradient(135deg, var(--color-menu) 0%, #0f172a 100%);
    color: var(--color-texto-menu);
    padding: 1rem;
    width: 100%;
    order: 2;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.menu-lateral h2 {
    text-align: center;
    color: var(--color-principal);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.menu-lateral ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.menu-lateral li {
    flex: 1 1 auto;
    min-width: 120px;
    position: relative;
}

.menu-lateral li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-texto-menu);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    border: 2px solid transparent;
}

.menu-lateral li.activo a {
    background: linear-gradient(135deg, var(--color-azul) 0%, #0d4fd8 100%);
    color: var(--color-principal);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
    border-color: rgba(255,255,255,0.2);
}

.menu-lateral li a:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

/* Submenu para reportes */
.menu-reportes {
    position: relative;
}

.submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: var(--color-menu);
    min-width: 200px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.1);
}

.menu-reportes:hover .submenu {
    display: block;
}

.submenu li {
    min-width: 100%;
}

.submenu a {
    justify-content: flex-start !important;
    padding: 0.7rem 1rem !important;
    border-radius: 8px !important;
    margin: 0.2rem;
    font-size: 0.85rem;
}

/* --- Contenido Principal --- */
.contenido-principal {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    order: 1;
    background: var(--color-fondo);
}

/* Secciones */
.seccion-oculta {
    display: none;
}

.seccion-activa {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.header h1 {
    font-size: 1.8rem;
    text-align: center;
    color: var(--color-menu);
    font-weight: 700;
}
.area-estacionamiento  {
     margin-bottom: 20px;
}



.acciones-rapidas {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 10px;
    margin-bottom: 10px;
}

.acciones-reporte {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.acciones-rapidas .btn,
.acciones-reporte .btn {
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1 1 auto;
    min-width: 160px;
    text-align: center;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
}

.acciones-rapidas .btn::before,
.acciones-reporte .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.acciones-rapidas .btn:hover::before,
.acciones-reporte .btn:hover::before {
    left: 100%;
}

.acciones-rapidas .btn:hover,
.acciones-reporte .btn:hover {
    transform: translateY(-3px);
    
}

.acciones-reporte .btn {
    flex: 0 1 auto;
    min-width: auto;
}

/* Botones específicos */
.abrircaja {
    background: linear-gradient(135deg, var(--color-verde) 0%, #1e7e34 100%);
}

.cerrarcaja {
    background: linear-gradient(135deg, var(--color-rojo) 0%, #c82333 100%);
}

.cierre-definitivo {
    background: linear-gradient(135deg, var(--color-purpura) 0%, #5a2d9a 100%);
}

.btn-moto {
    background: linear-gradient(135deg, var(--color-naranja) 0%, #e67e22 100%);
}

.btn-salida-motos {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.btn-actualizar {
    background: linear-gradient(135deg, var(--color-cyan) 0%, #138496 100%);
}

.btn-exportar {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

/* --- Panel de Estadísticas --- */
.panel-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    margin-top:  1rem;
}
.panel-stats2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
   
    margin-bottom: 5px;
    padding: 4px;
   
}

.stat-card {
    background: linear-gradient(135deg, #FFC107 0%, #ffb300 100%);
    padding: 0.1rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 5px 10px rgba(255, 193, 7, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    height: 80px;
    
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(255, 193, 7, 0.5);
}

.stat-card h3 {
    margin: 0 0 0.8rem 0;
    font-size: 25px;
    color: #333;
    font-weight: 600;
    padding: 1px;
}

.stat-card p {
    margin: 0;
    font-size: 35px;
    font-weight: 700;
    color: #000;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2px;
}

.card2 {
    background: linear-gradient(135deg, #1eb0b0 0%, #1a9c9c 100%);
    box-shadow: 0 2px 10px rgba(30, 176, 176, 0.5);
}

.card2:hover {
    box-shadow: 0 12px 30px rgba(30, 176, 176, 0.4);
}

.card3 {
    background: linear-gradient(135deg, #54bb40 0%, #4aa836 100%);
    box-shadow: 0 5px 10px rgba(84, 187, 64, 0.3);
}

.card3:hover {
    box-shadow: 0 12px 30px rgba(84, 187, 64, 0.4);
}

/* --- Área de Estacionamiento --- */
.grid-vehiculos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    
    background: rgba(245, 249, 249, 0.8);
    border-radius: 16px;
    box-shadow: 0 8px 5px rgba(0, 0, 0, 0.8);
    margin-bottom: 1px;
    margin-top: 1px;
    padding: 5px;
}

.espacio {
    height: 180px;  /* AUMENTADO de 130px a 180px */
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
}

.espacio.libre {
    background: linear-gradient(135deg, var(--color-azul) 0%, #0d4fd8 100%);
}

.espacio.ocupado {
    background: linear-gradient(135deg, var(--color-rojo) 0%, #c82333 100%);
}

.espacio:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255,255,255,0.3);
}

.espacio-accion {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    margin: 0.2rem 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    width: 85%;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.espacio-accion:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.espacio-numero {
    margin: 0.3rem 0;
    font-size: 1.6rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Montos totales */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 2px;
    margin-bottom: 15px;
    flex-wrap: wrap;
   
}

.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    min-width: 250px;
    text-align: center;
    box-shadow: 0 5px 5px rgba(102, 126, 234, 0.6);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-box:hover {
    transform: translateY(-3px);
}

.stat-box span:first-child {
    display: block;
    font-weight: 600;
    margin-bottom: 0.1rem;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
}

#stat-total-vehiculos, 
#stat-total-motos,
#stat-total-total {
    font-size: 1.4rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Estilos para el contador de tiempo */
.tiempo-transcurrido {
    font-size: 0.7rem;
    margin-top: 0.3rem;
    color: white;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    text-align: center;
    width: 85%;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.ticket-info {
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    margin-top: 0.3rem;
    text-align: center;
    width: 85%;
    backdrop-filter: blur(10px);
}

/* --- MODALES --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-contenido {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    animation: modalAppear 0.4s ease-out;
}

@keyframes modalAppear {
    from { 
        opacity: 0; 
        transform: scale(0.8) translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

.modal-contenido h3 {
    margin-bottom: 1.5rem;
    color: var(--color-menu);
    font-size: 1.4rem;
    text-align: center;
    font-weight: 700;
}

.modal-caja {
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-texto-principal);
}

.input-monto {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--color-borde);
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.input-monto:focus {
    outline: none;
    border-color: var(--color-azul);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.info-caja {
    background: rgba(13, 110, 253, 0.1);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--color-azul);
}

.resumen-cierre,
.resumen-final {
    background: rgba(108, 117, 125, 0.1);
    padding: 1.2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.1);
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.resumen-item:last-child {
    border-bottom: none;
}

.resumen-item.total {
    font-weight: 700;
    color: var(--color-verde);
    font-size: 1.1rem;
}

.resumen-item.diferencia {
    font-weight: 700;
    color: var(--color-rojo);
    font-size: 1.1rem;
}

.alerta-importante {
    background: rgba(220, 53, 69, 0.1);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--color-rojo);
    text-align: center;
}

.alerta-importante p {
    margin: 0;
    color: var(--color-rojo);
    font-weight: 600;
}

.modal-botones {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-botones button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
}

.modal-botones button:first-child {
    background: #6c757d;
    color: white;
}

.modal-botones button:first-child:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-confirmar {
    background: linear-gradient(135deg, var(--color-verde) 0%, #1e7e34 100%);
    color: white;
}

.btn-confirmar:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-2px);
}

/* --- REPORTES --- */
.contenedor-reportes {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

.tabla-reporte {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tabla-reporte th {
    background: linear-gradient(135deg, var(--color-menu) 0%, #0f172a 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.tabla-reporte td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--color-borde);
    font-size: 0.9rem;
}

.tabla-reporte tr:hover {
    background: rgba(13, 110, 253, 0.05);
}

.tabla-reporte tr:last-child td {
    border-bottom: none;
}

/* Botones deshabilitados */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.btn:disabled::before {
    display: none;
}

.espacio-accion:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1) !important;
}

.espacio-accion:disabled:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: none !important;
}

/* --- MEDIA QUERIES --- */
@media (min-width: 1300px) {
    .app-container {
        flex-direction: row;
    }
    
    .menu-lateral {
        width: 280px;
        order: 0;
        padding: 2rem 1.5rem;
    }
    
    .menu-lateral ul {
        display: block;
    }
    
    .menu-lateral li {
        min-width: auto;
    }
    
    .menu-lateral li a {
        justify-content: flex-start;
        padding: 0.9rem 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .header h1 {
        text-align: left;
        font-size: 2.2rem;
    }
    
    .stat-card h3 {
        margin: 0px;
        font-size: 20px;
    }
    .acciones-rapidas .btn {
        flex: 0 1 auto;
        min-width: auto;
    }
    
    .grid-vehiculos {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .panel-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .submenu {
        left: 0;
        top: 100%;
        margin-top: 0.5rem;
    }
    
    .espacio-numero {
        margin: 0px 0; /* ← MODIFICA EL MARGIN (arriba/abajo) */
        padding: 0px 0; /* ← AÑADE PADDING si quieres */
        font-size: 1.5rem;
    }

    .espacio-accion {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
        margin: 1px;
    }

    .espacio {
    height: 140px;  /* ← AQUÍ MODIFICA EL ALTO */
    }
}

@media (max-width: 1250px) {
    .contenido-principal {
        padding: 2.5rem;
    }
    
    .stat-card {
        height: 110px;
        padding: 0.9rem;
    }
    
    .panel-stats {
       
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stat-card h3 {
        margin: 0px;
        font-size: 14px;
    }
    
    .stat-card p {
        font-size: 1.6rem;
    }
    
    
    .espacio-numero {
        margin: 0px 0; /* ← MODIFICA EL MARGIN (arriba/abajo) */
        padding: 0px 0; /* ← AÑADE PADDING si quieres */
        font-size: 1.5rem;
    }

    .espacio-accion {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
        margin: 1px;
    }

    .espacio {
    height: 140px;  /* ← AQUÍ MODIFICA EL ALTO */
    }
}

@media (max-width: 850px) {
    .panel-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat-card  {
       height: 80px;
    } 
    .stat-card h3 {
        margin: 0px;
        font-size: 14px;
    }
    .stat-box {
       
        min-width: 180px;
    }
    
    .acciones-rapidas .btn {
        width: 100%;
        max-width: 200px;
    }
    .espacio-numero {
    margin: 0px 0; /* ← MODIFICA EL MARGIN (arriba/abajo) */
    padding: 0px 0; /* ← AÑADE PADDING si quieres */
    font-size: 1.5rem;
    }

    .espacio-accion {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    margin: 1px;;
    }

    .espacio {
    height: 140px;  /* ← AQUÍ MODIFICA EL ALTO */
    }

}

@media (max-width: 480px) {
    .espacio-numero {
    margin: 0px 0; /* ← MODIFICA EL MARGIN (arriba/abajo) */
    padding: 0px 0; /* ← AÑADE PADDING si quieres */
    font-size: 1.5rem;
    }

    .espacio-accion {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    margin: 1px;;
    }

    .espacio {
    height: 140px;  /* ← AQUÍ MODIFICA EL ALTO */
    }
    .panel-stats {
        grid-template-columns: 1fr;
    }
    
    .grid-vehiculos {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 1px;
        margin-bottom: 2px;
        padding: 1px;
    }
    
    .modal-contenido {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-botones {
        flex-direction: column;
    }
    .stat-card  {
        height: 70px;
        padding: 1px;
        margin-bottom: 1px;
    }

    .stat-card h3 {
        font-size: 20px;
        padding: 1px;
        margin: 1px;
    }
    .stat-card p {
        padding: 1px;
        margin: 1px;
    }
     .stats-container {
        flex-direction: row;
        align-items: center;
    }
    .acciones-rapidas .btn{
        flex-direction: row;
       
        align-items: center; 
        margin: 1px;
        padding: 10px;
    }
    .panel-stats2 {
        grid-template-columns: repeat(1, 1fr);
        gap: 5px;
    }

    .stat-box {
        min-width: 250px;
        margin-bottom: 1px;
    }
    .stat-box span {
        padding: 2px;
        margin: 1px;
    }
   
   

}