/* ==========================================
   TALLER HIKARI - DESIGN SYSTEM & UI STYLE
   Amber/Orange Mechanical & High-Tech Theme
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-color: #020617;
    --primary-color: #0F172A;
    --accent-color: #F59E0B; /* Mechanical Amber */
    --accent-glow: rgba(245, 158, 11, 0.4);
    --secondary-color: #06B6D4; /* Tech Cyan */
    --secondary-glow: rgba(6, 182, 212, 0.3);
    
    --card-bg: rgba(15, 23, 42, 0.6);
    --card-border: rgba(255, 255, 255, 0.06);
    --text-light: #F8FAFC;
    --text-muted: #94A3B8;
    
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-lg: 24px;
    --radius-md: 16px;
    --glass-blur: 16px;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 5% 5%, rgba(245, 158, 11, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 95% 95%, rgba(6, 182, 212, 0.03) 0%, transparent 45%);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #0F172A 0%, #020617 100%);
    border-right: 1px solid rgba(255,255,255,0.03);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 50;
    box-shadow: 10px 0 35px rgba(0,0,0,0.5);
    transition: var(--transition);
}

.sidebar-header {
    padding: 2.2rem 1.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.sidebar-header i {
    font-size: 1.8rem;
    color: var(--accent-color);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.sidebar-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    letter-spacing: 1.5px;
}

.sidebar-header h2 span {
    color: var(--accent-color);
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 0.8rem;
    list-style: none;
    overflow-y: auto;
}

.sidebar-menu li {
    margin-bottom: 0.4rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0.9rem 1.2rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.95rem;
}

.sidebar-menu a:hover, 
.sidebar-menu a.active {
    background: rgba(245, 158, 11, 0.1);
    color: white;
}

.sidebar-menu a i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    transition: var(--transition);
}

.sidebar-menu a.active i {
    color: var(--accent-color);
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.03);
}

.btn-logout {
    width: 100%;
    padding: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.08);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #EF4444;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Main Layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

.top-header {
    height: 70px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: sticky;
    top: 0;
    z-index: 40;
}

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

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
}

.user-role {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-color), #D97706);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #020617;
    font-weight: 800;
    font-size: 1.15rem;
    border: 2px solid rgba(255,255,255,0.2);
}

/* Page Content */
.dashboard-body {
    flex: 1;
    padding: 2.5rem;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

.page-title {
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, #fff 30%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Tab Content Visibility */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

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

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

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.6rem;
    display: flex;
    align-items: center;
    gap: 1.4rem;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    border-color: rgba(245, 158, 11, 0.25);
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4), 0 0 15px rgba(245, 158, 11, 0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-icon.amber { background: rgba(245, 158, 11, 0.12); color: var(--accent-color); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.12); color: var(--secondary-color); }
.stat-icon.green { background: rgba(16, 185, 129, 0.12); color: #10B981; }
.stat-icon.purple { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }

.stat-info {
    flex: 1;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Two Column Layout (Dashboard Widgets) */
.widgets-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .widgets-grid {
        grid-template-columns: 1fr;
    }
}

.panel-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.8rem;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    margin-bottom: 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 0.8rem;
}

.panel-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header h3 i {
    color: var(--accent-color);
}

/* Tables Custom Styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.taller-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.taller-table th {
    padding: 0.85rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.taller-table td {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.taller-table tbody tr {
    transition: var(--transition);
}

.taller-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.pendiente { background: rgba(148, 163, 184, 0.12); color: #94A3B8; border: 1px solid rgba(148, 163, 184, 0.2); }
.badge.progreso { background: rgba(56, 189, 248, 0.12); color: #38BDF8; border: 1px solid rgba(56, 189, 248, 0.2); }
.badge.repuestos { background: rgba(245, 158, 11, 0.12); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge.completado { background: rgba(16, 185, 129, 0.12); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge.entregado { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; border: 1px solid rgba(139, 92, 246, 0.2); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #D97706 100%);
    color: #020617;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: white;
    border: 1px solid rgba(255,255,255,0.08);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
}

.btn-icon-only {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255,255,255,0.05);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon-only:hover {
    background: var(--accent-color);
    color: #020617;
    transform: scale(1.05);
}

.btn-icon-only.red:hover {
    background: #EF4444;
    color: white;
}

/* Forms & Inputs inside Modals */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
}

.form-group-full {
    grid-column: 1 / -1;
}

.taller-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.taller-input, 
.taller-select, 
.taller-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.taller-input:focus, 
.taller-select:focus, 
.taller-textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.taller-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Modales Custom (Glassmorphism Frosted overlay) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 30px rgba(245,158,11,0.05);
    overflow-y: auto;
    padding: 2.2rem;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.modal-close {
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
    border: none;
    transition: var(--transition);
}

.modal-close:hover {
    color: #EF4444;
    transform: scale(1.15);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 1.2rem;
    margin-top: 1.8rem;
}

/* Timeline flow inside active order edit */
.order-timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 2rem 0;
    padding: 0 1rem;
}

.order-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-50%);
    z-index: 1;
}

.timeline-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1E293B;
    border: 2px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
}

.timeline-step::after {
    content: attr(data-label);
    position: absolute;
    top: 36px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: var(--transition);
}

.timeline-step.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #020617;
    box-shadow: 0 0 15px var(--accent-glow);
}

.timeline-step.active::after {
    color: var(--accent-color);
}

.timeline-step.completed {
    background: #10B981;
    border-color: #10B981;
    color: white;
}

.timeline-step.completed::after {
    color: #10B981;
}

/* Spare Parts Assignment Sub-Grid */
.parts-subgrid {
    background: rgba(2, 6, 23, 0.4);
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.2rem;
    margin-top: 1.5rem;
}

.assigned-parts-list {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.assigned-part-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 0.4rem;
    border: 1px solid rgba(255,255,255,0.03);
}

.assigned-part-info h4 {
    font-size: 0.88rem;
    font-weight: 600;
}

.assigned-part-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.assigned-part-price {
    font-weight: bold;
    color: var(--accent-color);
    font-size: 0.9rem;
}

.order-summary-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(245, 158, 11, 0.04);
    border: 1px solid rgba(245,158,11,0.1);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1.5rem;
}

.order-summary-total {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-color);
}

/* Search Dropdown suggestion list */
.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0 0 10px 10px;
    z-index: 200;
    max-height: 150px;
    overflow-y: auto;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    display: none;
}

.suggestion-item {
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:hover {
    background: var(--accent-color);
    color: #020617;
}

.suggestion-item span.stock {
    font-size: 0.75rem;
    opacity: 0.85;
}

/* Critical stock levels labels in Inventory */
.text-danger { color: #EF4444 !important; }
.text-warning { color: #F59E0B !important; }
.text-success { color: #10B981 !important; }

/* PRINT RECEIPT STYLING */
#receiptPrintArea {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    #receiptPrintArea, 
    #receiptPrintArea * {
        visibility: visible;
    }
    
    #receiptPrintArea {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        color: #000000 !important;
        background: #ffffff !important;
        font-family: 'Courier New', Courier, monospace;
        font-size: 12px;
        padding: 15px;
    }
    
    .print-header {
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px dashed #000000;
        padding-bottom: 10px;
    }
    
    .print-header h2 {
        font-size: 18px;
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    .print-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .print-section {
        border: 1px solid #000000;
        padding: 8px;
        border-radius: 4px;
    }
    
    .print-section-title {
        font-weight: bold;
        text-transform: uppercase;
        border-bottom: 1px solid #000000;
        margin-bottom: 6px;
        font-size: 11px;
    }
    
    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 15px;
        margin-bottom: 20px;
    }
    
    .print-table th {
        border-bottom: 2px dashed #000000;
        padding: 6px;
        text-align: left;
        font-weight: bold;
    }
    
    .print-table td {
        padding: 6px;
        border-bottom: 1px dashed #cccccc;
    }
    
    .print-total-box {
        text-align: right;
        margin-top: 15px;
        border-top: 2px dashed #000000;
        padding-top: 10px;
        font-size: 14px;
        font-weight: bold;
    }
    
    .print-signatures {
        display: flex;
        justify-content: space-around;
        margin-top: 60px;
        text-align: center;
    }
    
    .sig-line {
        border-top: 1px solid #000000;
        width: 180px;
        padding-top: 5px;
    }
}

/* =============================================
   MÓDULO: INSPECCIÓN DIGITAL DE INGRESO
   ============================================= */

/* Checklist checkboxes con estilo premium */
.insp-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    user-select: none;
}

.insp-check:hover {
    background: rgba(245,158,11,0.06);
    border-color: rgba(245,158,11,0.2);
    color: white;
}

.insp-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.insp-check:has(input:checked) {
    background: rgba(16,185,129,0.08);
    border-color: rgba(16,185,129,0.3);
    color: #10b981;
}

/* Mapa de daños: botones de zonas del auto */
.danio-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 4px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.danio-btn:hover {
    background: rgba(245,158,11,0.1);
    border-color: rgba(245,158,11,0.3);
    color: var(--accent-color);
}

.danio-btn.danio-activo {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.5);
    color: #ef4444;
    box-shadow: 0 0 10px rgba(239,68,68,0.2);
}

.danio-btn i {
    font-size: 1rem;
}
