/* Variables de colores Exiauto */
:root {
    --exiauto-red: #E52F1C;
    --exiauto-red-dark: #C12310;
    --exiauto-red-light: #FF4D39;
    --sidebar-bg: #2D2D2D;
    --sidebar-dark: #1F1F1F;
    --main-bg: #F5F5F5;
    --card-bg: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #888888;
    --text-light: #CCCCCC;
    --border-color: #E5E5E5;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page Styles */
.login-body {
    background: linear-gradient(135deg, var(--main-bg) 0%, #EEEEEE 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 450px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 3rem 2rem 1rem;
    background: var(--card-bg);
}

.login-logo {
    height: 80px;
    width: auto;
}

.login-content {
    padding: 0 2rem 3rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--exiauto-red);
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.form-input:focus {
    outline: none;
    border-color: var(--exiauto-red);
    box-shadow: 0 0 0 3px rgba(229, 47, 28, 0.1);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 2;
}

.forgot-password {
    color: var(--text-secondary);
    text-decoration: underline;
    font-size: 0.9rem;
    float: right;
    margin-bottom: 1.5rem;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: var(--exiauto-red);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.login-btn:hover {
    background: var(--exiauto-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.remember-me input[type="checkbox"] {
    margin-right: 0.5rem;
}

.signup-link {
    text-align: center;
    color: var(--text-secondary);
}

.signup-link a {
    color: var(--exiauto-red);
    text-decoration: underline;
}

.login-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Main App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #3A3A3A;
}

.logo-img {
    height: 50px;
    width: auto;
    filter: brightness(0) invert(1);
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 0.2rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

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

.nav-link.active {
    background: var(--exiauto-red);
    color: white;
    border-left-color: var(--exiauto-red-light);
}

.nav-link i {
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.nav-link.disabled {
    color: rgba(204, 204, 204, 0.5);
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.5;
}

.nav-link.disabled:hover {
    background: transparent;
    color: rgba(204, 204, 204, 0.5);
}

.sidebar-footer {
    border-top: 1px solid #3A3A3A;
    padding: 1rem 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
}

.top-header {
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 100;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.page-subtitle {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
}

.search-input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--main-bg);
    width: 300px;
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--exiauto-red);
}

.notifications {
    position: relative;
}

.notifications i {
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--exiauto-red);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-profile-toggle {
    transition: transform 0.3s ease;
}

.user-profile.active .user-profile-toggle {
    transform: rotate(180deg);
}

.user-profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.user-profile-dropdown.show {
    display: block;
}

.dropdown-item-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dropdown-item-profile:hover {
    background: var(--main-bg);
    color: var(--exiauto-red);
}

.dropdown-item-profile i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

.dropdown-item-profile span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Cards */
.metric-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.metric-card.primary {
    background: var(--sidebar-bg);
    color: white;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.metric-change.positive {
    color: #10B981;
}

.metric-change.negative {
    color: var(--exiauto-red);
}

/* Forms */
.form-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.form-row.full {
    grid-template-columns: 1fr;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--exiauto-red);
    box-shadow: 0 0 0 3px rgba(229, 47, 28, 0.1);
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--exiauto-red);
    color: white;
}

.btn-primary:hover {
    background: var(--exiauto-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--sidebar-bg);
    color: white;
}

.btn-secondary:hover {
    background: var(--sidebar-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--exiauto-red);
    color: var(--exiauto-red);
}

.btn-outline:hover {
    background: var(--exiauto-red);
    color: white;
}

/* Tables */
.data-table {
    width: 100%;
    background: var(--card-bg);
    border-radius: 15px;
    overflow: visible;
    box-shadow: var(--shadow);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--main-bg);
    font-weight: 600;
    color: var(--text-primary);
}

.data-table tr:hover {
    background: rgba(229, 47, 28, 0.05);
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-procesado {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.status-por_procesar {
    background: rgba(251, 191, 36, 0.1);
    color: #F59E0B;
}

.status-borrador {
    background: rgba(156, 163, 175, 0.1);
    color: #6B7280;
}

/* Tipo badges */
.tipo-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tipo-vehiculo {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.tipo-latoneria {
    background: rgba(229, 47, 28, 0.1);
    color: var(--exiauto-red);
}

/* Floating button */
.floating-add-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--exiauto-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-hover);
    text-decoration: none;
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-add-btn:hover {
    transform: scale(1.1);
    background: var(--exiauto-red-dark);
}

.floating-add-btn i {
    font-size: 1.5rem;
}

/* Footer */
.footer {
    background: var(--sidebar-bg);
    color: var(--text-light);
    text-align: center;
    padding: 1.5rem;
    margin-left: 250px;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(229, 47, 28, 0.1);
    color: var(--exiauto-red);
    border: 1px solid rgba(229, 47, 28, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    width: 100%;
}

.toast {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
    padding: 16px 20px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.toast-message {
    font-size: 13px;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    transition: width linear;
}

/* Toast Types */
.toast.toast-success {
    border-left-color: #10B981;
}

.toast.toast-success .toast-icon {
    background: #10B981;
}

.toast.toast-success .toast-progress {
    background: #10B981;
}

.toast.toast-error {
    border-left-color: var(--exiauto-red);
}

.toast.toast-error .toast-icon {
    background: var(--exiauto-red);
}

.toast.toast-error .toast-progress {
    background: var(--exiauto-red);
}

.toast.toast-warning {
    border-left-color: #F59E0B;
}

.toast.toast-warning .toast-icon {
    background: #F59E0B;
}

.toast.toast-warning .toast-progress {
    background: #F59E0B;
}

.toast.toast-info {
    border-left-color: #3B82F6;
}

.toast.toast-info .toast-icon {
    background: #3B82F6;
}

.toast.toast-info .toast-progress {
    background: #3B82F6;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .footer {
        margin-left: 200px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-input {
        width: 200px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 100%;
        position: static;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .footer {
        margin-left: 0;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .top-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .search-input {
        width: 100%;
        max-width: 300px;
    }
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* ============================================
   FALLBACK DE ICONOS (Unicode/Emoji)
   Si FontAwesome no carga, muestra símbolos Unicode
   Solo se activa con clase "fa-fallback" en body
   ============================================ */

body.fa-fallback .fas::before,
body.fa-fallback .far::before,
body.fa-fallback .fab::before {
    font-family: Arial, sans-serif !important;
}

/* Dashboard / Resumen */
body.fa-fallback .fa-th-large::before { content: "▦" !important; }

/* Gráficos / Analytics */
body.fa-fallback .fa-chart-bar::before,
body.fa-fallback .fa-chart-line::before { content: "📊" !important; }

/* Descargas */
body.fa-fallback .fa-download::before { content: "⬇" !important; }

/* Añadir / Plus */
body.fa-fallback .fa-plus::before { content: "+" !important; font-weight: bold; font-size: 1.2em; }

/* Usuarios / Clientes */
body.fa-fallback .fa-users::before,
body.fa-fallback .fa-user::before,
body.fa-fallback .fa-user-tie::before { content: "👤" !important; }

/* Recibos / Abonos */
body.fa-fallback .fa-receipt::before,
body.fa-fallback .fa-file-invoice-dollar::before { content: "🧾" !important; }

/* Configuración */
body.fa-fallback .fa-cog::before,
body.fa-fallback .fa-gear::before { content: "⚙" !important; }

/* Ayuda */
body.fa-fallback .fa-question-circle::before { content: "❓" !important; }

/* Contacto / Email */
body.fa-fallback .fa-envelope::before { content: "✉" !important; }

/* Cerrar sesión / Salir */
body.fa-fallback .fa-sign-out-alt::before { content: "🚪" !important; }

/* Búsqueda */
body.fa-fallback .fa-search::before { content: "🔍" !important; }

/* Notificaciones */
body.fa-fallback .fa-bell::before { content: "🔔" !important; }

/* Dropdown / Abajo */
body.fa-fallback .fa-chevron-down::before { content: "▼" !important; font-size: 0.7em; }

/* Check / Correcto */
body.fa-fallback .fa-check::before,
body.fa-fallback .fa-check-circle::before { content: "✓" !important; color: #10B981; }

/* Error / Cerrar */
body.fa-fallback .fa-times::before,
body.fa-fallback .fa-times-circle::before { content: "✗" !important; color: #EF4444; }

/* Información */
body.fa-fallback .fa-info-circle::before { content: "ℹ" !important; color: #3B82F6; }

/* Editar / Lápiz */
body.fa-fallback .fa-edit::before,
body.fa-fallback .fa-pen::before { content: "✎" !important; }

/* Eliminar / Basura */
body.fa-fallback .fa-trash::before { content: "🗑" !important; }

/* PDF */
body.fa-fallback .fa-file-pdf::before { content: "📄" !important; }

/* Excel / Archivo */
body.fa-fallback .fa-file-excel::before { content: "📊" !important; }

/* Tres puntos (menú) */
body.fa-fallback .fa-ellipsis-h::before,
body.fa-fallback .fa-ellipsis-v::before { content: "⋯" !important; font-weight: bold; }

/* Calendario */
body.fa-fallback .fa-calendar::before,
body.fa-fallback .fa-calendar-check::before { content: "📅" !important; }

/* Filtro */
body.fa-fallback .fa-filter::before { content: "⊙" !important; }

/* Dinero / Dólar */
body.fa-fallback .fa-dollar-sign::before,
body.fa-fallback .fa-hand-holding-usd::before { content: "$" !important; font-weight: bold; }

/* Flechas de navegación */
body.fa-fallback .fa-angle-left::before { content: "‹" !important; font-size: 1.5em; }
body.fa-fallback .fa-angle-right::before { content: "›" !important; font-size: 1.5em; }
body.fa-fallback .fa-angle-double-left::before { content: "«" !important; }
body.fa-fallback .fa-angle-double-right::before { content: "»" !important; }

/* Advertencia */
body.fa-fallback .fa-exclamation-triangle::before { content: "⚠" !important; color: #F59E0B; }

/* Edificio / Departamento */
body.fa-fallback .fa-building::before { content: "🏢" !important; }

/* Candado / Seguridad */
body.fa-fallback .fa-lock::before { content: "🔒" !important; }

/* Ojo / Ver */
body.fa-fallback .fa-eye::before { content: "👁" !important; }