/* =========================================
   SISTEMA DE PROGRAMACIÓN DE MIXERS - VITAA
   Diseño profesional y responsive
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f8f9fa;
    color: #212529;
    min-height: 100vh;
}

/* --- Barra superior --- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border-bottom: 3px solid #fbb200;
    flex-wrap: wrap;
    gap: 10px;
}
.top-bar img {
    height: 45px;
}
.top-bar .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}
.top-bar .btn-logout {
    background: #e9ecef;
    color: #212529;
    padding: 10px 18px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.top-bar .btn-logout:hover {
    background: #dc3545;
    color: white;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 25px 20px;
}

/* --- Login --- */
.login-form {
    background: white;
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 420px;
    text-align: center;
}
.login-form h2 {
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #212529;
}
.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    margin: 10px 0;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border 0.2s;
}
.login-form input:focus {
    outline: none;
    border-color: #fbb200;
    box-shadow: 0 0 0 3px rgba(251,178,0,0.2);
}
.login-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #495057;
    margin: 5px 0;
}
.login-form .btn-primario {
    margin-top: 15px;
}

.btn-primario {
    background: #fbb200;
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: inline-block;
    width: 100%;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(251,178,0,0.3);
}
.btn-primario:hover {
    background: #e5a200;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(251,178,0,0.4);
}

.btn-estado {
    color: white;
    border: none;
    padding: 18px 12px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    display: block;
    width: 100%;
    margin: 10px 0;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.btn-estado:active {
    transform: scale(0.97);
}
.btn-estado.operativo { background: #28a745; }
.btn-estado.en_ruta { background: #fd7e14; }
.btn-estado.en_obra { background: #17a2b8; }
.btn-estado.saliendo_obra { background: #6f42c1; }
.btn-estado.en_planta { background: #6c757d; }

.mensaje {
    background: #d4edda;
    color: #155724;
    padding: 12px 18px;
    border-radius: 10px;
    margin: 15px 0;
    font-weight: 500;
}

.operador-panel {
    background: white;
    border-radius: 20px;
    padding: 25px 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    max-width: 500px;
    margin: 0 auto;
}
.estado-badge {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f1f3f5;
    border-radius: 15px;
    color: #212529;
}
.preop-card {
    background: #fff8e1;
    border-left: 5px solid #fbb200;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.preop-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}
.preop-card label {
    display: block;
    margin: 8px 0;
    font-weight: 500;
}

/* ================================
   NUEVO DASHBOARD PROFESIONAL
   ================================ */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.dashboard-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
}
.reloj {
    font-size: 1.5rem;
    font-weight: 600;
    background: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Tarjetas de resumen */
.resumen-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.resumen-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-left: 6px solid;
    transition: transform 0.2s;
}
.resumen-card:hover {
    transform: translateY(-3px);
}
.resumen-card.operativo { border-color: #28a745; }
.resumen-card.en_ruta { border-color: #fd7e14; }
.resumen-card.en_obra { border-color: #17a2b8; }
.resumen-card.en_planta { border-color: #6c757d; }

.resumen-numero {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    color: #212529;
}
.resumen-texto {
    font-size: 0.95rem;
    font-weight: 500;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Semáforo grid */
.semaforo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
.grupo-semaforo {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 8px solid;
}
.grupo-semaforo h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.grupo-semaforo .vehiculos-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.vehiculo-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 280px;
    transition: background 0.2s;
    border: 1px solid #e9ecef;
}
.vehiculo-card:hover {
    background: #f1f3f5;
}
.vehiculo-numero {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fbb200;
    min-width: 60px;
    text-align: center;
}
.vehiculo-info {
    flex: 1;
}
.vehiculo-info strong {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 4px;
}
.vehiculo-info small {
    color: #6c757d;
    font-size: 0.85rem;
}
.vehiculo-hora {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    background: #e9ecef;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Tablas profesionales (admin) */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
.admin-tabs .tab {
    background: #fff;
    border: 2px solid #dee2e6;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    color: #495057;
}
.admin-tabs .tab.active {
    background: #fbb200;
    border-color: #fbb200;
    color: #000;
    box-shadow: 0 4px 10px rgba(251,178,0,0.3);
}
.tab-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
}
table th {
    background: #f8f9fa;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}
table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}
table tbody tr:hover {
    background: #f8f9fa;
}

.form-gestion {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
.form-gestion input,
.form-gestion select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    background: #fff;
}
.form-gestion input:focus,
.form-gestion select:focus {
    border-color: #fbb200;
    outline: none;
    box-shadow: 0 0 0 3px rgba(251,178,0,0.15);
}
.form-gestion button {
    align-self: flex-start;
    padding: 14px 30px;
    background: #212529;
    color: white;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}
.form-gestion button:hover {
    background: #000;
}

canvas {
    max-width: 100%;
    margin-bottom: 20px;
}

/* Botón eliminar */
.btn-eliminar {
    background: #fff;
    color: #dc3545;
    border: 2px solid #dc3545;
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}
.btn-eliminar:hover {
    background: #dc3545;
    color: white;
    box-shadow: 0 4px 10px rgba(220,53,69,0.3);
    transform: translateY(-1px);
}
.btn-eliminar:active {
    transform: scale(0.96);
}

/* Responsive */
@media (max-width: 992px) {
    .resumen-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .top-bar {
        padding: 10px 15px;
    }
    .top-bar img {
        height: 35px;
    }
    .container {
        padding: 15px;
    }
    .btn-estado {
        font-size: 1.1rem;
        padding: 16px;
    }
    .tab-content {
        padding: 20px 15px;
    }
    .admin-tabs .tab {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    .resumen-cards {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .reloj {
        align-self: flex-end;
    }
    .vehiculo-card {
        flex: 1 1 100%;
    }
}