:root {
    --primary: #ed6d25;        /* Naranja corporativo */
    --primary-dark: #d45a1a;   /* Naranja más oscuro */
    --primary-light: #f8a57a;  /* Naranja más claro */
    --secondary: #004c66;      /* Azul corporativo */
    --secondary-dark: #00394d; /* Azul más oscuro */
    --secondary-light: #336b80; /* Azul más claro */
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #95a5a6;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    padding: 10px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.stat-card.proximos-vencer {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffffff);
}
.stat-card.proximos-vencer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}
.stat-card.revision-vencida {
    border-left: 4px solid #dc3545;
    background: linear-gradient(135deg, #f8d7da, #ffffff);
}
.stat-card.revision-vencida:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.total { border-left: 4px solid var(--secondary); }
.stat-card.aprobadas { border-left: 4px solid var(--success); }
.stat-card.rechazadas { border-left: 4px solid var(--warning); }
.stat-card.pendientes { border-left: 4px solid var(--danger); }

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: white;
    padding: 5px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-btn:hover:not(.active) {
    background: rgba(237, 109, 37, 0.1);
    color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box, .filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    flex: 1;
    min-width: 200px;
}

.search-box:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(237, 109, 37, 0.2);
}


.export-btn {
    background-color: #217346;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    margin-right: 10px;
}

.export-btn:hover {
    background-color: #1e663e;
}

.export-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: var(--light);
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    user-select: none;
    position: relative;
}

th:hover {
    background-color: #e9ecef;
}

th i {
    margin-left: 5px;
    opacity: 0.5;
}

tr:hover {
    background-color: #f1f9ff;
}

.patente-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.patente-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
}

.status-aprobado {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-pendiente {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-rechazado {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

.error {
    color: var(--danger);
    text-align: center;
    padding: 20px;
    font-weight: bold;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.summary-header {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.summary-stat {
    text-align: center;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 5px 0;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--gray);
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.footer {
    text-align: center;
    margin-top: 30px;
    color: var(--gray);
    font-size: 0.9rem;
}

/* Estilos para tarjetas clickables */
.summary-card.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.summary-card.clickable:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(237, 109, 37, 0.3);
}

.click-hint {
    margin-top: 10px;
    padding: 6px;
    background: rgba(237, 109, 37, 0.1);
    border-radius: 4px;
    font-size: 0.8em;
    color: var(--primary);
    text-align: center;
    font-style: italic;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    background: var(--primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.close-modal {
    font-size: 2em;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.vehiculo-vencido {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #fff5f5;
    border-left: 4px solid var(--danger);
    border-radius: 5px;
}

.vehiculo-info {
    flex: 1;
}

.vehiculo-patente {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--danger);
}

.vehiculo-details {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.vehiculo-sucursal {
    background: var(--danger);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

/* Agrega esto en tu archivo estilo.css */
.excel-btn {
    background: linear-gradient(135deg, #217346 0%, #1e6e3e 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(33, 115, 70, 0.3);
}

.excel-btn:hover {
    background: linear-gradient(135deg, #1e6e3e 0%, #1a6336 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 115, 70, 0.4);
}

.excel-btn:active {
    transform: translateY(0);
}

/* Agrega esta línea en tu CSS donde defines los colores de las tarjetas */
.stat-card.gps-no-presente { border-left: 4px solid #9b59b6; } /* Color púrpura para GPS */

/* O si prefieres usar tus colores corporativos: */
.stat-card.gps-no-presente { border-left: 4px solid var(--primary-light); }
.stat-card.permisos-vencidos { border-left: 4px solid var(--danger); }

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .controls {
        flex-direction: column;
    }

    .search-box, .filter-select {
        min-width: 100%;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: var(--border-radius);
        padding: 10px;
    }

    td {
        border: none;
        position: relative;
        padding-left: 50%;
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: var(--dark);
    }
}