/* ============================================
   TALLER PRO - CSS PERSONALIZADO
   ============================================ */

:root {
    --primary-color: #003d82;
    --primary-dark: #002855;
    --secondary-color: #0066cc;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-color: #dee2e6;
    --sidebar-width: 250px;
    --navbar-height: 60px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: var(--dark-color);
}

/* ============================================
   LAYOUT GENERAL
   ============================================ */

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

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 28px;
    color: #ffc107;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-subtext {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.2;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #ffc107;
    color: white;
}

.menu-item i {
    font-size: 18px;
    width: 24px;
    display: flex;
    justify-content: center;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.user-details {
    font-size: 12px;
    line-height: 1.3;
}

.user-name {
    font-weight: 600;
}

.user-email {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
}

.logout-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}

.logout-btn:hover {
    color: white;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ============================================
   TOP NAVBAR
   ============================================ */

.top-navbar {
    height: var(--navbar-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--dark-color);
    cursor: pointer;
    display: none;
    padding: 8px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--light-color);
    padding: 8px 15px;
    border-radius: 25px;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    color: #999;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    width: 100%;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--dark-color);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    position: relative;
    transition: var(--transition);
    text-decoration: none;
}

.nav-btn:hover {
    color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* ============================================
   PAGE CONTENT
   ============================================ */

.page-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* ============================================
   FICHA DEL VEHÍCULO
   ============================================ */

.ficha-vehiculo {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Header de Ficha */
.ficha-header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ficha-foto {
    width: 220px;
    height: 220px;
    background: var(--light-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ficha-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-placeholder {
    font-size: 80px;
    color: #ddd;
}

.ficha-datos-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    flex: 1;
}

.ficha-patente {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.patente-plate {
    background: white;
    border: 3px solid var(--dark-color);
    padding: 8px 16px;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
    font-family: 'Arial', sans-serif;
    width: 140px;
}

.patente-pais {
    font-size: 12px;
    font-weight: bold;
    color: var(--dark-color);
}

.ficha-datos-principales {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modelo-titulo h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.modelo-specs {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.ficha-grid-datos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dato-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dato-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.dato-valor {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-color);
}

.btn-editar {
    align-self: flex-start;
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-editar:hover {
    background: var(--primary-color);
    color: white;
}

/* Tarjetas de Estado */
.tarjetas-estado {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.tarjeta-estado {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.tarjeta-estado:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tarjeta-icono {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.tarjeta-icono.check {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.tarjeta-icono.warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.tarjeta-icono.danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.tarjeta-icono.info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

.tarjeta-contenido h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0 0 8px 0;
}

.tarjeta-estado-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.tarjeta-fecha {
    font-size: 12px;
    color: #666;
    margin: 4px 0 8px 0;
}

.tarjeta-link {
    font-size: 12px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.tarjeta-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Main Content Area */
.ficha-main {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.ficha-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Tabs */
.ficha-tabs {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-color);
}

.tab-item {
    flex: 1;
}

.tab-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab-item a:hover {
    color: var(--primary-color);
}

.tab-item.active a {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

.tab-content {
    padding: 20px;
    min-height: 400px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Timeline */
.historial-timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    background: var(--secondary-color);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--secondary-color);
    margin-top: 6px;
}

.timeline-item:not(:last-child) .timeline-marker::after {
    content: '';
    position: absolute;
    width: 2px;
    height: calc(100% + 30px);
    background: var(--border-color);
    top: 30px;
    left: 7px;
}

.timeline-content {
    padding: 15px;
    background: var(--light-color);
    border-radius: 8px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 10px;
}

.fecha {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.km {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.timeline-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0 0 6px 0;
}

.timeline-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px 0;
}

.timeline-mecanico {
    font-size: 12px;
    color: #888;
    margin: 0 0 6px 0;
}

.timeline-monto {
    font-size: 15px;
    font-weight: 700;
    color: var(--success-color);
    margin: 8px 0;
}

.timeline-link {
    display: inline-block;
    font-size: 12px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.timeline-link:hover {
    text-decoration: underline;
}

/* Sidebar derecho */
.ficha-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alertas-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.alerta-item {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
}

.alerta-item.critico {
    background: rgba(220, 53, 69, 0.1);
    border-left: 3px solid var(--danger-color);
}

.alerta-item.medio {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid var(--warning-color);
}

.alerta-item.bajo {
    background: rgba(23, 162, 184, 0.1);
    border-left: 3px solid var(--info-color);
}

.alerta-badge {
    font-size: 16px;
    display: flex;
    align-items: flex-start;
    margin-top: 2px;
}

.alerta-desc {
    font-weight: 500;
    color: var(--dark-color);
    margin: 0 0 4px 0;
}

.alerta-prioridad {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #666;
}

.mantenciones-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.mantencion-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--light-color);
    border-radius: 8px;
}

.mantencion-item i {
    font-size: 18px;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.mantencion-item p {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 4px 0;
}

.acciones-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accion-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--light-color);
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--dark-color);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.accion-btn:hover {
    background: var(--primary-color);
    color: white;
}

.accion-btn i {
    font-size: 16px;
}

.panel-link {
    font-size: 12px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: var(--transition);
}

.panel-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Footer Cards */
.ficha-footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.footer-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.card-icon {
    font-size: 32px;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.footer-card h5 {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-content {
    margin-bottom: 12px;
    text-align: left;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0 0 6px 0;
}

.card-text {
    font-size: 12px;
    color: #666;
    margin: 0 0 4px 0;
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span {
    color: #666;
}

.stat-row strong {
    color: var(--dark-color);
    font-weight: 700;
}

.card-link {
    font-size: 11px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: var(--transition);
}

.card-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1366px) {
    .tarjetas-estado {
        grid-template-columns: repeat(2, 1fr);
    }

    .ficha-header {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ficha-foto {
        width: 100%;
        height: 300px;
    }

    .ficha-grid-datos {
        grid-template-columns: repeat(2, 1fr);
    }

    .ficha-footer {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 100%;
        max-width: 280px;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .top-navbar {
        padding: 0 15px;
    }

    .search-box {
        max-width: 200px;
        font-size: 12px;
    }

    .navbar-right {
        gap: 8px;
    }

    .nav-btn {
        font-size: 16px;
    }

    .ficha-header {
        padding: 15px;
        gap: 15px;
    }

    .ficha-foto {
        width: 100%;
        height: 220px;
    }

    .modelo-titulo h2 {
        font-size: 20px;
    }

    .ficha-grid-datos {
        grid-template-columns: 1fr;
    }

    .tarjetas-estado {
        grid-template-columns: 1fr;
    }

    .ficha-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ficha-tabs {
        flex-wrap: wrap;
    }

    .tab-item a {
        padding: 12px 10px;
        font-size: 12px;
        gap: 4px;
    }

    .tab-item a i {
        font-size: 14px;
    }

    .tab-content {
        padding: 15px;
        min-height: 300px;
    }

    .ficha-footer {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .page-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .ficha-header {
        padding: 10px;
    }

    .modelo-titulo h2 {
        font-size: 18px;
    }

    .ficha-grid-datos {
        grid-template-columns: 1fr;
    }

    .tarjetas-estado {
        gap: 10px;
    }

    .tarjeta-estado {
        flex-direction: column;
        text-align: center;
    }

    .tarjeta-icono {
        align-self: center;
    }

    .tab-item a i {
        display: none;
    }

    .ficha-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-item {
        flex-shrink: 0;
        min-width: 100px;
    }
}
