@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --saas-bg: #F7F7F8;
    --saas-surface: #FFFFFF;
    --saas-border: #E4E4E7;
    --saas-border-soft: #F9FAFB;
    --saas-primary: #0838E8;
    --saas-primary-hover: #0830C6;
    --saas-text-main: #131316;
    --saas-text-muted: #696971;
    --saas-text-light: #9D9DA6;
    --saas-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --saas-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --saas-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --saas-radius-md: 6px;
    --saas-radius-lg: 12px;
    --saas-radius-xl: 16px;
    --saas-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   GLOBAL RESET & TYPOGRAPHY
   ========================================================================== */
body {
    font-family: 'Inter', sans-serif !important;
    background-color: var(--saas-bg) !important;
    color: var(--saas-text-main) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
    color: var(--saas-text-main) !important;
    letter-spacing: -0.01em !important;
}

.header h2, .page-title {
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
}

a {
    transition: var(--saas-transition);
}

/* ==========================================================================
   TOP NAVIGATION
   ========================================================================== */
.top-navbar {
    background: var(--saas-surface) !important;
    border-bottom: 1px solid var(--saas-border) !important;
    padding: 0 32px !important;
    display: flex !important;
    align-items: center !important;
    height: 64px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
}

.top-navbar .brand-label {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--saas-text-main) !important;
    margin-right: 48px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.top-nav-links {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.top-nav-links a {
    color: var(--saas-text-muted) !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    padding: 8px 12px !important;
    border-radius: var(--saas-radius-md) !important;
    text-decoration: none !important;
    display: inline-block;
}

.top-nav-links a:hover {
    background-color: var(--saas-bg) !important;
    color: var(--saas-text-main) !important;
}

.top-nav-links a.active {
    color: var(--saas-primary) !important;
    background-color: transparent !important;
    position: relative !important;
}

.top-nav-links > a.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: -16px !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background-color: var(--saas-primary) !important;
    border-radius: 3px 3px 0 0 !important;
}

.notif-btn {
    width: 40px;
    height: 40px;
    border-radius: 50% !important;
    background-color: #ffffff !important;
    border: 1px solid #E4E4E7 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    color: #51515A !important;
    transition: all 0.2s ease;
}
.notif-btn i {
    font-size: 18px !important;
}
.notif-btn:hover {
    background-color: #F2F2F3 !important;
}
.notif-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(8, 56, 232, 0.15) !important;
    border-color: #d4d4d8 !important;
}
.notif-badge {
    top: -2px !important;
    right: -2px !important;
    transform: translate(0, 0) !important;
    background-color: #ef4444 !important;
    border: 2px solid #ffffff !important;
    font-size: 0.65rem !important;
    padding: 0.25em 0.5em !important;
    font-weight: 600 !important;
}

.notif-panel {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
    border-radius: 12px !important;
    border: 1px solid #E4E4E7 !important;
    background: #ffffff !important;
    overflow: hidden;
    padding: 0 !important;
    width: 380px !important;
}
.notif-panel.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.notif-panel-head {
    background: #ffffff;
    border-bottom: 1px solid #E4E4E7;
    padding: 16px 20px !important;
}
.notif-item {
    padding: 16px 20px;
    border-bottom: 1px solid #F2F2F3;
    font-size: 0.9rem;
    transition: background 0.15s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.notif-item:hover {
    background: #F9FAFB;
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notif-icon-blue { background: #eef1fe; color: #3d63f0; }
.notif-icon-green { background: #f0fdf4; color: #22c55e; }
.notif-icon-orange { background: #fff7ed; color: #f97316; }
.notif-icon-purple { background: #faf5ff; color: #a855f7; }

.notif-content-wrapper {
    flex-grow: 1;
    min-width: 0;
}
.notif-item-title {
    font-weight: 600;
    color: #131316;
    margin-bottom: 4px;
    font-size: 0.9rem;
}
.notif-item-detail {
    color: #51515A;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 6px;
}
.notif-item-time {
    color: #9D9DA6;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.notif-item-time::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #3d63f0;
    border-radius: 50%;
}
.notif-panel-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid #E4E4E7;
    background: #F9FAFB;
}
.notif-panel-footer a {
    color: #3d63f0;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}
.notif-panel-footer a:hover {
    text-decoration: underline;
}

@keyframes ringbell {
    0% { transform: rotate(0); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-10deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(5deg); }
    60% { transform: rotate(-5deg); }
    70% { transform: rotate(0); }
    100% { transform: rotate(0); }
}
.notif-btn.ringing i {
    animation: ringbell 1.5s ease-in-out infinite;
    color: #ef4444 !important;
}

.nav-item-dropdown {
    position: relative;
    display: inline-block;
}

.submenu-vehiculos {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    max-height: none !important;
    overflow: visible !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: var(--saas-surface) !important;
    border: 1px solid var(--saas-border) !important;
    border-radius: var(--saas-radius-md) !important;
    box-shadow: var(--saas-shadow-md) !important;
    min-width: 200px !important;
    z-index: 1050 !important;
    padding: 12px 0 8px !important;
    margin-top: 0 !important;
    transform: translateY(-6px) !important;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease !important;
}

/* Pseudo-elemento para tapar el hueco entre el trigger y el submenú */
.nav-item-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
}

.nav-item-dropdown:hover .submenu-vehiculos {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.submenu-vehiculos a {
    display: block !important;
    padding: 8px 16px !important;
    color: var(--saas-text-main) !important;
    font-weight: 400 !important;
    border-radius: 0 !important;
}

.submenu-vehiculos a:hover {
    background-color: var(--saas-bg) !important;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.header, .card-container, .form-section, .table-section, .catalog-section-head {
    background: var(--saas-surface) !important;
    border: 1px solid var(--saas-border) !important;
    border-radius: var(--saas-radius-lg) !important;
    box-shadow: var(--saas-shadow-sm) !important;
    padding: 24px !important;
    margin-bottom: 24px !important;
}

.header h2, .form-section h3, .table-section h3, .card-container h5 {
    margin-bottom: 8px !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

.header p, .catalog-section-subtitle {
    color: var(--saas-text-muted) !important;
    font-size: 0.95rem !important;
}

.main-content {
    margin: 0 auto !important;
    max-width: 1400px !important;
    padding: 32px 40px !important;
}

.header-top {
    display: none !important;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
    border-radius: var(--saas-radius-md) !important;
    padding: 8px 16px !important;
    transition: var(--saas-transition) !important;
    box-shadow: var(--saas-shadow-sm) !important;
    letter-spacing: 0.01em !important;
}

.btn-primary {
    background-color: var(--saas-primary) !important;
    border-color: var(--saas-primary) !important;
    color: white !important;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--saas-primary-hover) !important;
    border-color: var(--saas-primary-hover) !important;
    box-shadow: var(--saas-shadow-md) !important;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--saas-primary) !important;
    border-color: var(--saas-border) !important;
    background-color: white !important;
}

.btn-outline-primary:hover {
    background-color: var(--saas-bg) !important;
    border-color: var(--saas-border) !important;
    color: var(--saas-primary) !important;
}

.btn-secondary {
    background-color: white !important;
    border-color: var(--saas-border) !important;
    color: var(--saas-text-main) !important;
}

.btn-secondary:hover {
    background-color: var(--saas-bg) !important;
    color: var(--saas-text-main) !important;
}

.btn-outline-secondary {
    color: var(--saas-text-muted) !important;
    border-color: var(--saas-border) !important;
    background-color: white !important;
}

.btn-outline-secondary:hover {
    background-color: var(--saas-bg) !important;
    color: var(--saas-text-main) !important;
}

/* Specific for small buttons */
.btn-sm {
    padding: 6px 12px !important;
    font-size: 0.875rem !important;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-control, .form-select {
    border: 1px solid var(--saas-border) !important;
    border-radius: var(--saas-radius-md) !important;
    padding: 10px 14px !important;
    height: 42px !important;
    font-size: 0.95rem !important;
    color: var(--saas-text-main) !important;
    background-color: white !important;
    transition: var(--saas-transition) !important;
    box-shadow: var(--saas-shadow-sm) !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--saas-primary) !important;
    box-shadow: 0 0 0 3px rgba(8, 56, 232, 0.15) !important;
    outline: none !important;
}

.form-label {
    font-weight: 500 !important;
    color: var(--saas-text-main) !important;
    margin-bottom: 6px !important;
    font-size: 0.9rem !important;
}

/* Tom Select Overrides */
.ts-wrapper.single .ts-control {
    border: 1px solid var(--saas-border) !important;
    border-radius: var(--saas-radius-md) !important;
    padding: 10px 14px !important;
    height: 42px !important;
    background-color: white !important;
    box-shadow: var(--saas-shadow-sm) !important;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--saas-primary) !important;
    box-shadow: 0 0 0 3px rgba(8, 56, 232, 0.15) !important;
}

.ts-dropdown {
    border-radius: var(--saas-radius-md) !important;
    border: 1px solid var(--saas-border) !important;
    box-shadow: var(--saas-shadow-lg) !important;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    margin-bottom: 0 !important;
}

.table th {
    background-color: var(--saas-surface) !important;
    color: var(--saas-text-muted) !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--saas-border) !important;
    border-top: none !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.table td {
    padding: 10px 16px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid var(--saas-border-soft) !important;
    border-top: none !important;
    color: var(--saas-text-main) !important;
    font-size: 0.875rem !important;
}

.table tbody tr {
    transition: var(--saas-transition) !important;
}

.table tbody tr:hover {
    background-color: var(--saas-bg) !important;
}

/* Wrap tables in a soft border */
.table-responsive {
    border: 1px solid var(--saas-border) !important;
    border-radius: var(--saas-radius-lg) !important;
    background: var(--saas-surface) !important;
    overflow: auto !important;
}

/* ==========================================================================
   KPIs / STATS
   ========================================================================== */
.kpi-card {
    background: var(--saas-surface) !important;
    border: 1px solid var(--saas-border) !important;
    border-radius: var(--saas-radius-lg) !important;
    box-shadow: none !important;
    padding: 16px 20px !important;
}

.kpi-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--saas-shadow-sm) !important;
}

.kpi-icon {
    background: transparent !important;
    color: var(--saas-primary) !important;
    font-size: 1.5rem !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
    margin-right: 12px !important;
}

.kpi-info h4 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: var(--saas-text-main) !important;
    margin: 0 !important;
}

.kpi-info p {
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    color: var(--saas-text-muted) !important;
    margin: 0 !important;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-content {
    border: none !important;
    border-radius: var(--saas-radius-xl) !important;
    box-shadow: var(--saas-shadow-lg) !important;
    overflow: hidden !important;
}

.modal-header {
    background: white !important;
    border-bottom: 1px solid var(--saas-border) !important;
    padding: 20px 24px !important;
}

.modal-title {
    font-weight: 600 !important;
    color: var(--saas-text-main) !important;
}

.modal-body {
    padding: 24px !important;
}

.modal-footer {
    background: var(--saas-bg) !important;
    border-top: 1px solid var(--saas-border) !important;
    padding: 16px 24px !important;
}

/* Modal backdrops using standard backdrop-filter if present */
.modal-backdrop.show {
    opacity: 1 !important;
    background: rgba(17, 24, 39, 0.4) !important; /* Slightly lighter dim */
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
}

/* Success Overlay Match */
.success-popup-overlay {
    background: rgba(17, 24, 39, 0.4) !important;
}

/* ==========================================================================
   BADGES & STATUS
   ========================================================================== */
.badge {
    padding: 6px 10px !important;
    font-weight: 500 !important;
    border-radius: 9999px !important; /* Pill shape */
    font-size: 0.75rem !important;
}

/* Make badges softer */
.bg-success {
    background-color: #D1FAE5 !important;
    color: #065F46 !important;
}

.bg-danger {
    background-color: #FEE2E2 !important;
    color: #991B1B !important;
}

.bg-warning {
    background-color: #FEF3C7 !important;
    color: #92400E !important;
}

.bg-info {
    background-color: #DCE3FC !important;
    color: #0A2A9E !important;
}

/* ==========================================================================
   LOGIN CARDS / INDEX
   ========================================================================== */
.login-card {
    border: 1px solid var(--saas-border) !important;
    box-shadow: var(--saas-shadow-lg) !important;
    border-radius: var(--saas-radius-xl) !important;
}
/* ==========================================================================
   ADVANCED FILTER COMPONENT
   ========================================================================== */

.advanced-filter-card {
    background: #ffffff;
    border: 1px solid #E4E4E7;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.advanced-filter-header {
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: #ffffff;
    border: none;
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s ease;
}

.advanced-filter-header:hover {
    background-color: #F9FAFB;
}

.advanced-filter-header:not(.collapsed) {
    border-bottom-color: #E4E4E7;
}

.advanced-filter-header .filter-title {
    font-weight: 600;
    color: #131316;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.advanced-filter-header .filter-chevron {
    color: #696971;
    transition: transform 0.3s ease;
    font-size: 0.85rem;
}

.advanced-filter-header:not(.collapsed) .filter-chevron {
    transform: rotate(180deg);
}

.advanced-filter-body {
    padding: 20px;
    background: #ffffff;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

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

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #3f3f46;
    margin: 0;
}

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

.filter-input-group i {
    position: absolute;
    left: 14px;
    color: #9D9DA6;
    font-size: 0.9rem;
    pointer-events: none;
}

.filter-input-group .form-select,
.filter-input-group .form-control {
    height: 44px;
    padding-left: 38px;
    border-radius: 8px;
    border: 1px solid #E4E4E7;
    color: #26262C;
    font-size: 0.9rem;
    background-color: #ffffff;
    box-shadow: none;
    transition: all 0.2s ease;
}

.filter-input-group .form-select:focus,
.filter-input-group .form-control:focus {
    border-color: var(--saas-primary);
    box-shadow: 0 0 0 3px rgba(8, 56, 232, 0.1);
}

.filter-input-group .form-select:hover,
.filter-input-group .form-control:hover {
    border-color: #D1D5DB;
}

/* Date Range specific layout */
.filter-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-date-range .form-control,
.filter-date-range .spa-select {
    height: 48px !important;
    border-radius: 10px !important;
    border: 1px solid #d4d4d8 !important;
    padding: 12px 16px !important;
    font-size: 0.9rem;
    color: #26262C;
    flex: 1;
}

.filter-date-range .form-control:focus,
.filter-date-range .spa-select:focus {
    border-color: #0838e8 !important;
    box-shadow: 0 0 0 3px rgba(8, 56, 232, 0.12) !important;
}

.date-separator {
    color: #9D9DA6;
    font-weight: 500;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #F2F2F3;
}

.filter-actions .btn {
    height: 48px !important;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border-radius: 10px !important;
    padding: 0 24px !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-date-range {
        flex-direction: row;
    }
    
    .filter-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    
    .filter-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   GLOBAL MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 992px) {
    .top-navbar {
        justify-content: space-between;
        height: 64px !important;
        padding: 0 16px !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        background: transparent;
        border: none;
        color: #131316;
        font-size: 1.25rem;
        cursor: pointer;
        padding: 8px;
    }

    .spa-table tbody td {
        padding: 16px;
        vertical-align: middle;
        font-size: 0.85rem;
        color: #51515a;
        border-bottom: 1px solid #f2f2f3;
        white-space: nowrap;
    }

    /* ----------------------------------------------------
       COMPROBANTES LAYOUT (CLIENTE)
    ---------------------------------------------------- */
    .comprobantes-layout {
        display: flex;
        flex-direction: column;
        gap: 24px;
        font-family: 'Inter', sans-serif;
    }

    .comprobantes-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 16px;
    }

    .comprobantes-title-wrap {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .comprobantes-title-text h4 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 700;
        color: #131316;
    }

    .comprobantes-title-text p {
        margin: 0;
        font-size: 0.95rem;
        color: #696971;
    }

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

    .comprobantes-btn-primary {
        background-color: var(--saas-primary);
        color: white;
        border: none;
        border-radius: 8px;
        padding: 10px 20px;
        font-size: 0.9rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.2s;
        box-shadow: 0 4px 6px -1px rgba(8, 56, 232, 0.2);
    }

    .comprobantes-btn-primary:hover {
        background-color: #0830c6;
        transform: translateY(-1px);
    }

    .comprobantes-metrics-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    .comprobantes-metric-card {
        background: white;
        border: 1px solid #E4E4E7;
        border-radius: 12px;
        padding: 20px;
        display: flex;
        align-items: center;
        gap: 16px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    }

    .comprobantes-metric-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .comprobantes-metric-icon i {
        font-size: 1.25rem;
    }

    .comprobantes-metric-icon.total { background: #F2F2F3; color: #51515a; }
    .comprobantes-metric-icon.pendientes { background: #FEF3C7; color: #D97706; }
    .comprobantes-metric-icon.aprobados { background: #DCFCE7; color: #16A34A; }
    .comprobantes-metric-icon.rechazados { background: #FEE2E2; color: #DC2626; }
    .comprobantes-metric-icon.monto { background: #EEF1FE; color: #0838E8; }

    .comprobantes-metric-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .comprobantes-metric-label {
        font-size: 0.8rem;
        color: #696971;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .comprobantes-metric-value {
        font-size: 1.5rem;
        font-weight: 700;
        color: #131316;
        line-height: 1.2;
    }

    .comprobantes-metric-subtext {
        font-size: 0.75rem;
        color: #9D9DA6;
    }

    .comprobantes-filter-bar {
        background: white;
        border: 1px solid #E4E4E7;
        border-radius: 12px;
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .comprobantes-filter-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
    }

    .comprobantes-search {
        position: relative;
        flex-grow: 1;
        max-width: 400px;
    }

    .comprobantes-search i {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: #9D9DA6;
        font-size: 1rem;
    }

    .comprobantes-search input {
        width: 100%;
        padding: 10px 16px 10px 40px;
        border: 1px solid #E4E4E7;
        border-radius: 8px;
        font-size: 0.9rem;
        color: #26262C;
        transition: border-color 0.2s;
    }

    .comprobantes-search input:focus {
        outline: none;
        border-color: var(--saas-primary);
        box-shadow: 0 0 0 3px rgba(8, 56, 232, 0.1);
    }

    .comprobantes-btn-filter {
        background: white;
        border: 1px solid #E4E4E7;
        color: #51515a;
        border-radius: 8px;
        padding: 10px 16px;
        font-size: 0.9rem;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .comprobantes-btn-filter:hover {
        background: #F7F7F8;
        color: #131316;
    }

    .comprobantes-btn-filter.active {
        background: #EEF1FE;
        color: #0838E8;
        border-color: #C4D0FA;
    }

    .comprobantes-advanced-filters {
        display: none;
        border-top: 1px solid #E4E4E7;
        padding-top: 16px;
    }

    .comprobantes-advanced-filters.active {
        display: block;
    }

    .comprobantes-filters-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    .comprobantes-filter-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .comprobantes-filter-group label {
        font-size: 0.8rem;
        font-weight: 500;
        color: #51515a;
    }

    .comprobantes-filter-group select,
    .comprobantes-filter-group input {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #E4E4E7;
        border-radius: 6px;
        font-size: 0.85rem;
        color: #26262C;
    }

    .comprobantes-filter-group select:focus,
    .comprobantes-filter-group input:focus {
        outline: none;
        border-color: var(--saas-primary);
        box-shadow: 0 0 0 2px rgba(8, 56, 232, 0.1);
    }

    .comprobantes-btn-clear {
        background: white;
        border: 1px solid #E4E4E7;
        color: #696971;
        border-radius: 6px;
        padding: 8px 16px;
        font-size: 0.85rem;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .comprobantes-btn-clear:hover {
        background: #F2F2F3;
        color: #131316;
    }

    .comprobantes-table-card {
        background: white;
        border: 1px solid #E4E4E7;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    .comprobantes-table-header {
        padding: 16px 20px;
        border-bottom: 1px solid #E4E4E7;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .comprobantes-table-title {
        font-size: 1rem;
        font-weight: 600;
        color: #131316;
    }

    .comprobantes-table-count {
        font-size: 0.85rem;
        color: #696971;
        background: #F2F2F3;
        padding: 4px 10px;
        border-radius: 20px;
        font-weight: 500;
    }

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

    .comprobantes-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 900px;
    }

    .comprobantes-table th {
        background: #F7F7F8;
        padding: 12px 20px;
        font-size: 0.75rem;
        font-weight: 600;
        color: #51515a;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: left;
        border-bottom: 1px solid #E4E4E7;
    }

    .comprobantes-table td {
        padding: 16px 20px;
        font-size: 0.9rem;
        color: #26262C;
        border-bottom: 1px solid #F2F2F3;
        vertical-align: middle;
    }

    .comprobantes-table tbody tr:hover {
        background-color: #F7F7F8;
    }

    .comprobantes-badge {
        display: inline-flex;
        align-items: center;
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
    }

    .comprobantes-badge.pendiente {
        background: #FEF3C7;
        color: #D97706;
    }

    .comprobantes-badge.aprobado {
        background: #DCFCE7;
        color: #16A34A;
    }

    .comprobantes-badge.rechazado {
        background: #FEE2E2;
        color: #DC2626;
    }

    .comprobantes-action-btn {
        background: transparent;
        border: none;
        color: #696971;
        width: 32px;
        height: 32px;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
    }

    .comprobantes-action-btn:hover {
        background: #F2F2F3;
        color: #131316;
    }

    .comprobantes-action-btn.edit:hover {
        background: #EEF1FE;
        color: #0838E8;
    }

    .comprobantes-action-btn.delete:hover {
        background: #FEE2E2;
        color: #DC2626;
    }

    .comprobantes-action-btn.download:hover {
        background: #DCFCE7;
        color: #16A34A;
    }

    .comprobantes-pagination {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        background: white;
        border-top: 1px solid #E4E4E7;
        flex-wrap: wrap;
        gap: 16px;
    }

    .comprobantes-page-info {
        font-size: 0.85rem;
        color: #696971;
    }

    .comprobantes-page-controls {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .comprobantes-per-page {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.85rem;
        color: #51515a;
    }

    .comprobantes-per-page select {
        padding: 6px 28px 6px 12px;
        border: 1px solid #E4E4E7;
        border-radius: 6px;
        font-size: 0.85rem;
        color: #26262C;
        background-color: white;
        cursor: pointer;
    }

    .comprobantes-page-buttons {
        display: flex;
        gap: 4px;
    }

    .comprobantes-page-btn {
        min-width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #E4E4E7;
        background: white;
        color: #51515a;
        border-radius: 6px;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    .comprobantes-page-btn:hover:not(:disabled) {
        background: #F7F7F8;
        color: #131316;
    }

    .comprobantes-page-btn.active {
        background: var(--saas-primary);
        color: white;
        border-color: var(--saas-primary);
    }

    .comprobantes-page-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    @media (max-width: 768px) {
        .comprobantes-filter-top {
            flex-direction: column;
            align-items: stretch;
        }

        .comprobantes-search {
            max-width: 100%;
        }
        
        .comprobantes-pagination {
            flex-direction: column;
            justify-content: center;
        }

        /* Mobile Cards for Table */
        .comprobantes-table thead {
            display: none;
        }

        .comprobantes-table, 
        .comprobantes-table tbody, 
        .comprobantes-table tr, 
        .comprobantes-table td {
            display: block;
            width: 100%;
        }

        .comprobantes-table tr {
            margin-bottom: 16px;
            border: 1px solid #E4E4E7;
            border-radius: 8px;
            padding: 16px;
            background: white;
        }

        .comprobantes-table td {
            padding: 8px 0;
            border: none;
            display: flex;
            justify-content: space-between;
            align-items: center;
            text-align: right;
        }

        .comprobantes-table td::before {
            content: attr(data-label);
            font-weight: 600;
            font-size: 0.8rem;
            color: #696971;
            text-transform: uppercase;
            text-align: left;
            margin-right: 16px;
        }

        .comprobantes-table td:last-child {
            justify-content: flex-end;
            gap: 8px;
            border-top: 1px solid #F2F2F3;
            margin-top: 8px;
            padding-top: 16px;
        }
        
        .comprobantes-table td:last-child::before {
            display: none;
        }
    }

    .top-nav-links {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        background: #ffffff;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px 20px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 1050;
        overflow-y: auto;
    }

    .top-nav-links.open {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.show {
        display: block;
    }
    
    .top-nav-links .menu-link,
    .top-nav-links .vehiculos-parent {
        width: 100%;
        padding: 12px 16px;
        border-radius: 8px;
        margin-bottom: 4px;
        display: flex;
        justify-content: space-between;
    }

    .top-nav-right {
        margin-left: auto;
    }
    
    .main-content {
        padding: 16px !important;
    }

    .card-container, .form-section, .table-section, .catalog-section-head {
        padding: 16px !important;
    }
    
    /* Ensure tables can scroll horizontally */
    .table-responsive {
        border: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}

@media (max-width: 768px) {
    /* Advanced Filter overrides for mobile */
    .filter-grid {
        grid-template-columns: 1fr !important;
    }
    
    .filter-date-range {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .filter-actions {
        flex-direction: column-reverse !important;
        align-items: stretch !important;
    }
    
    .filter-actions .btn {
        width: 100% !important;
        justify-content: center !important;
    }

}

/* ==========================================================================
   GLOBAL CENTERING & MAX-WIDTH
   ========================================================================== */
.main-content {
    max-width: 1440px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 40px !important;
    padding-right: 40px !important;
}

/* ==========================================================================
   DRAG & DROP FILE UPLOAD COMPONENT
   ========================================================================== */

/* --- Wrapper --- */
.dnd-wrapper {
    margin-top: 6px;
    margin-bottom: 6px;
}

/* --- Dropzone Area --- */
.dnd-dropzone {
    position: relative;
    width: 100%;
    min-height: 120px;
    border: 2px dashed #D4D4D8;
    border-radius: 12px;
    background-color: #F7F7F8;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.dnd-dropzone:hover {
    border-color: #93C5FD;
    background-color: #EEF1FE;
}

.dnd-dropzone.dnd-drag-over {
    border-color: #3D63F0;
    background-color: #DCE3FC;
    box-shadow: 0 0 0 4px rgba(61, 99, 240, 0.12);
}

.dnd-dropzone.dnd-has-files {
    border-style: solid;
    border-color: #A7F3D0;
    background-color: #F0FDF4;
}

/* Hidden native input */
.dnd-dropzone input[type="file"] {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
    margin: 0;
    padding: 0;
}

/* --- Dropzone Inner Content --- */
.dnd-dropzone-content {
    padding: 20px 16px;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.dnd-dropzone-icon {
    font-size: 2rem;
    color: #9D9DA6;
    margin-bottom: 4px;
    transition: color 0.25s ease, transform 0.25s ease;
}

.dnd-dropzone:hover .dnd-dropzone-icon {
    color: #6E8CF4;
    transform: translateY(-2px);
}

.dnd-dropzone.dnd-drag-over .dnd-dropzone-icon {
    color: #3D63F0;
    transform: translateY(-4px);
}

.dnd-dropzone.dnd-has-files .dnd-dropzone-icon {
    color: #34D399;
}

.dnd-dropzone-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3f3f46;
}

.dnd-dropzone.dnd-drag-over .dnd-dropzone-title {
    color: #0830C6;
}

.dnd-dropzone-subtitle {
    font-size: 0.78rem;
    color: #9D9DA6;
    font-weight: 400;
}

/* --- File List --- */
.dnd-file-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
}

.dnd-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #E4E4E7;
    border-radius: 8px;
    background: #FFFFFF;
    margin-bottom: 6px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    animation: dndFileIn 0.25s ease;
}

@keyframes dndFileIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dnd-file-item:hover {
    background: #F7F7F8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.dnd-file-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #FFFFFF;
}

.dnd-file-icon.dnd-icon-pdf  { background: #EF4444; }
.dnd-file-icon.dnd-icon-img  { background: #8B5CF6; }
.dnd-file-icon.dnd-icon-xls  { background: #22C55E; }
.dnd-file-icon.dnd-icon-doc  { background: #3D63F0; }
.dnd-file-icon.dnd-icon-xml  { background: #F59E0B; }
.dnd-file-icon.dnd-icon-default { background: #696971; }

.dnd-file-info {
    flex: 1;
    min-width: 0;
}

.dnd-file-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #26262C;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dnd-file-size {
    font-size: 0.72rem;
    color: #9D9DA6;
    font-weight: 400;
}

.dnd-file-remove {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: none;
    background: transparent;
    color: #9D9DA6;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 0;
}

.dnd-file-remove:hover {
    background: #FEE2E2;
    color: #EF4444;
}

/* --- File Summary --- */
.dnd-file-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 2px 2px;
    font-size: 0.75rem;
}

.dnd-file-count {
    color: #10B981;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dnd-file-count i {
    font-size: 0.7rem;
}

.dnd-file-total-size {
    color: #9D9DA6;
    font-weight: 400;
}

.dnd-file-clear {
    color: #3D63F0;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 0.75rem;
    padding: 0;
    transition: color 0.2s ease;
}

.dnd-file-clear:hover {
    color: #0830C6;
    text-decoration: underline;
}

/* --- Info Banner --- */
.dnd-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: #EEF1FE;
    border: 1px solid #C4D0FA;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #0A2A9E;
    line-height: 1.4;
}

.dnd-info-banner i {
    font-size: 0.85rem;
    margin-top: 1px;
    color: #3D63F0;
    flex-shrink: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .dnd-dropzone {
        min-height: 100px;
    }

    .dnd-dropzone-content {
        padding: 16px 12px;
    }

    .dnd-dropzone-icon {
        font-size: 1.6rem;
    }

    .dnd-dropzone-title {
        font-size: 0.82rem;
    }

    .dnd-dropzone-subtitle {
        font-size: 0.72rem;
    }

    .dnd-file-item {
        padding: 6px 10px;
    }

    .dnd-file-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 0.75rem;
    }

    .dnd-file-name {
        font-size: 0.78rem;
    }
}

/* Legacy override — hide old drag-drop-zone if it ever renders */
.drag-drop-zone { display: none !important; }

