/* ==========================================================================
   AutoService Pro - Figma-Grade SaaS Design System & UI Theme
   Theme: Ultra Modern Dark Glassmorphism, Slate Surfaces & Neon Accents
   ========================================================================== */

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

:root {
    /* Base Color Tokens */
    --bg-dark: #070A12;
    --bg-surface: #0F172A;
    --bg-card: rgba(15, 23, 42, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.85);

    /* Borders & Glass Effects */
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-primary: rgba(99, 102, 241, 0.3);
    --border-cyan: rgba(6, 182, 212, 0.3);

    /* Vibrant Accents */
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --primary-glow: rgba(99, 102, 241, 0.35);

    --accent-cyan: #06B6D4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.3);

    --accent-amber: #F59E0B;
    --accent-emerald: #10B981;
    --accent-rose: #F43F5E;
    --accent-indigo: #818CF8;

    /* Typography Colors */
    --text-heading: #F8FAFC;
    --text-body: #CBD5E1;
    --text-muted: #64748B;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Shadows & Transitions */
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-body);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar Customization */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ==========================================================================
   1. LOGIN / ONBOARDING SCREEN (Figma Split Screen - 2 Columnas)
   ========================================================================== */
.login-container {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100vw;
    background: var(--bg-dark);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
    overflow-y: auto;
}

.login-container.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Columna Izquierda: Hero Ilustrativo */
.login-left-hero {
    flex: 1.2;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(7, 10, 18, 0.98)),
                url('https://images.unsplash.com/photo-1617814076367-b759c7d7e738?q=80&w=1200&auto=format&fit=crop') center/cover;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    border-right: 1px solid var(--border-glass);
    overflow: hidden;
    min-height: 100vh;
}

.login-left-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.3), transparent 70%);
    pointer-events: none;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.hero-brand-logo {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    box-shadow: var(--shadow-glow);
}

.hero-brand-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
}

.hero-body {
    position: relative;
    z-index: 2;
    max-width: 540px;
}

.hero-body h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    color: white;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
}

.hero-body h1 span {
    background: linear-gradient(135deg, #818CF8, #06B6D4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-body p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-stats-preview {
    display: flex;
    gap: 1.5rem;
}

.hero-stat-mini {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
}

.hero-stat-mini strong {
    font-size: 1.4rem;
    color: white;
    display: block;
}

.hero-stat-mini span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Columna Derecha: Formulario */
.login-right-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg-surface);
    min-height: 100vh;
}

.login-box {
    width: 100%;
    max-width: 440px;
}

.login-header-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    border: 1px solid var(--border-glass);
}

.login-tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.login-tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Adaptación Responsive para pantallas reducidas */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        position: relative;
    }
    .login-left-hero {
        min-height: auto;
        padding: 2.5rem 2rem;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
    }
    .login-right-form {
        min-height: auto;
        padding: 2.5rem 1.5rem;
    }
    .hero-body h1 {
        font-size: 2rem;
    }
}

/* ==========================================================================
   2. MAIN DASHBOARD SHELL
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-dark);
}

.app-container.hidden {
    display: none !important;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.25rem;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2.5rem;
    padding-left: 0.5rem;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    box-shadow: var(--shadow-glow);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
}

.tenant-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-body);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.nav-item button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item button.active {
    background: linear-gradient(135deg, var(--primary), #4F46E5);
    color: white;
    box-shadow: var(--shadow-glow);
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    height: 72px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.multi-tenant-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-body);
}

.tenant-selector select {
    background: var(--bg-dark);
    color: white;
    border: 1px solid var(--border-glass);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent-cyan), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.content-body {
    padding: 2rem;
    flex: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
}

/* UI Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4F46E5);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--accent-indigo);
}
.btn-outline:hover {
    background: rgba(99, 102, 241, 0.1);
    color: white;
}

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

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

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

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-primary);
    box-shadow: var(--shadow-glass);
}

.stat-info h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;

}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.4rem;
    line-height: 1;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.stat-trend.up { color: var(--accent-emerald); }
.stat-trend.neutral { color: var(--accent-cyan); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.stat-icon.blue { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }

/* Tables Design */
.panel-section {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

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

.data-table td {
    padding: 1.1rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-body);
}

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

/* Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: capitalize;
}
.status-recepcionado { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.status-en_reparacion { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }
.status-listo { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-entregado { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); border: 1px solid var(--border-glass); }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(7, 10, 18, 0.85);
    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: all;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    padding: 2.25rem;
    box-shadow: var(--shadow-glow);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-card { transform: translateY(0); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-glass);
}

.modal-header h3 { font-size: 1.3rem; color: white; }

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
}
.close-btn:hover { color: white; }

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-body);
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.1rem;
    background: rgba(7, 10, 18, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* Mobile Simulator */
.mobile-simulator-frame {
    width: 380px;
    height: 740px;
    background: #000;
    border-radius: 44px;
    border: 12px solid #1E293B;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.mobile-simulator-screen {
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    overflow-y: auto;
    padding: 1.5rem;
}

.view-section { display: none; }
.view-section.active {
    display: block;
    animation: fadeIn 0.35s ease;
}

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