/* Premium Design Styles - Consolidated */

:root {
    --brand: #344998;
    --brand-hover: #1e2b58;
    /* --bg-light: #f4f6f9; */
    --text-dark: #2c3e50;
    --brand-rgb: 52, 73, 152;
    /* Added for rgba usage */
}

/* Brand Utilities */
.text-brand {
    color: var(--brand) !important;
}

.bg-brand {
    background-color: var(--brand) !important;
    color: white !important;
}

/* Soft brand background (light blue) */
.bg-brand-soft {
    background-color: rgba(52, 73, 152, 0.1) !important;
    color: var(--brand) !important;
}

.bg-brand-ghost {
    background-color: #f8f9fa !important;
}

.brand-rounded {
    border-radius: 16px !important;
}

/* Utility for close buttons on dark types */
.btn-close-white {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    opacity: 0.8;
}

.btn-close-white:hover {
    opacity: 1;
}

/* Global Reset for Page Overflow and Layout */
* {
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
}

html {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Preserve existing margin-top if needed for older layouts */
    margin-top: 0;
}

.main-panel>.content {
    padding: 0;
}

/* Dashboard Hero */
.dashboard-hero {
    background: linear-gradient(135deg, #344998 0%, #1e2b58 100%);
    padding: 30px 30px 25px 30px;
    color: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 30px rgba(52, 73, 152, 0.2);
    position: relative;
    z-index: 20;
    margin-top: 5px;
}

.dashboard-hero h1 {
    font-weight: 800;
    font-size: 32px;
    margin: 0;
    color: white !important;
}

.dashboard-hero p {
    opacity: 0.8;
    font-size: 14px;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Dashboard Card Full */
.dashboard-card-full {
    background: white;
    border-radius: 20px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    padding: 50px;
    /* Match Retefuente formatting */
    margin-top: 20px;
    position: relative;
    z-index: 5;
    overflow: visible !important;
}

/* Table Modern */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background-color: #344998;

    color: #ffffff;
    font-size: 14px;
    /* Increased from 13px */
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 15px 20px;
    border: none;
    /* Ensure no rounded corners on header as requested */
    border-radius: 0;
}

.table-modern tbody tr {
    transition: background-color 0.2s;
}

.table-modern tbody tr:hover {
    background-color: #f8f9fa;
}

.table-modern td {
    padding: 15px 20px;
    border-bottom: 1px solid #f4f6f9;
    font-size: 14px;
    /* Increased from 13px */
    color: #525f7f;
    vertical-align: middle;

}

/* Action Buttons */
.btn-action {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
    padding: 0;
    font-size: 14px;
}

.btn-action.dropdown-toggle::after {
    display: none;
}

.btn-primary,
.badge-primary {
    background: #344998 !important;
    color: white !important;
}

.btn-info {
    background: #17a2b8 !important;
    color: white !important;
}

.btn-success,
.badge-success {
    background: #28a745 !important;
    color: white !important;
}

.btn-warning {
    background: #f29204 !important;
    color: white !important;
}

.btn-secondary {
    background: #6c757d !important;
    color: white !important;
}

.btn-edit {
    background: #ffc107 !important;
    color: #212529 !important;
}

.btn-delete,
.btn-danger {
    background: #dc3545 !important;
    color: white !important;
}

.btn-danger-custom {
    background: #fee2e2;
    color: #dc3545;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

/* Hero Action Button */
.btn-hero-action {
    padding: 10px 25px;
    height: auto;
    width: auto;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    color: white !important;
    white-space: nowrap;
    background-color: var(--brand);
}

.btn-hero-action:hover {
    background-color: var(--brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 73, 152, 0.3);
}

/* Modern Input & Standard Selects */
.modern-input,
select.form-control,
select {
    width: 100%;
    height: 50px !important;
    background-color: white !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    padding: 0 15px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease-in-out;
    display: block;
    line-height: 46px !important;
    color: #444 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23344998' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 15px !important;
}

.modern-input:focus,
select:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(52, 73, 152, 0.1) !important;
    outline: none !important;
}

/* Select2 Premium Override */
.select2-container--default .select2-selection--single {
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    height: 50px !important;
    padding: 10px 15px !important;
    transition: all 0.2s;
    background-color: white !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
    right: 15px !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #888 transparent transparent transparent !important;
    border-style: solid !important;
    border-width: 5px 5px 0 5px !important;
    transition: transform 0.2s ease;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #888 transparent !important;
    border-width: 0 5px 5px 5px !important;
}

.select2-dropdown {
    border: 2px solid #e9ecef !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    z-index: 10002 !important;
    margin-top: -2px !important;
}

.select2-results__option {
    padding: 12px 20px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #2c3e50 !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--brand) !important;
    color: white !important;
}

.select2-search--dropdown {
    padding: 10px 15px !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
}

/* Premium Label - Global */
label:not(.custom-control-label):not(.btn) {
    display: block !important;
    font-weight: 800 !important;
    color: #344998 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 8px !important;
    font-size: 12px !important;
}

/* Premium Label utility */
.premium-label {
    display: block !important;
    font-weight: 800 !important;
    color: #344998 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 8px !important;
    font-size: 14px !important;
}

/* --- GLOBAL INPUT STANDARDIZATION --- */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea {
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    color: #344998 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    height: 50px !important;
    padding: 10px 15px !important;
    transition: all 0.3s ease-in-out;
    box-shadow: none !important;
}

/* Hover State - Blue Outline */
.form-control:hover,
input:hover,
select:hover,
textarea:hover,
.modern-input:hover,
.select2-container--default .select2-selection--single:hover {
    border-color: var(--brand) !important;
}

/* Focus State - Blue Outline, No Glow */
.form-control:focus,
input:focus,
select:focus,
textarea:focus,
.modern-input:focus,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--brand) !important;
    outline: none !important;
    background-color: #fff !important;
    box-shadow: none !important;
}

/* Remove Pink/Red Validation Borders (Bootstrap/Paper Dashboard overrides) */
.form-group.has-danger .form-control,
.input-group.has-danger .form-control,
.form-control.is-invalid,
.was-validated .form-control:invalid {
    border-color: #e9ecef !important;
    /* Reset to default grey or keep blue if preferred, but user asked to remove pink */
}

/* Ensure focus in "danger" state is also blue, not pink */
.form-group.has-danger .form-control:focus,
.input-group.has-danger .form-control:focus,
.form-control.is-invalid:focus,
.was-validated .form-control:invalid:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(52, 73, 152, 0.15) !important;
}

/* Fix for Select2 arrow background match */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
}

/* Modern Pagination */
.modern-pagination {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    /* Spacing between pagination items */
    margin-top: 20px;
    margin-bottom: 20px;
}

.modern-pagination .page-item {
    margin: 0 4px;
    /* Additional spacing between items */
}

.modern-pagination .page-item .page-link {
    border-radius: 10px !important;
    border: 2px solid #e9ecef;
    color: var(--brand);
    font-weight: 700;
    padding: 8px 16px;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.modern-pagination .page-item.active .page-link {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
    color: white !important;
    box-shadow: 0 5px 15px rgba(52, 73, 152, 0.3);
}

/* --- EMPRESA / PRODUCTO DASHBOARD LAYOUT --- */
.enterprise-dashboard {
    background-color: var(--bg-light);
    min-height: calc(100vh - 80px);
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    padding: 0 30px 50px 30px;
    position: relative;
    margin-top: 0;
    padding-top: 0;
}

/* Glassmorphism Stats */
.glass-stat {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.glass-stat:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.15);
}

.glass-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.glass-info h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: white !important;
}

.glass-info span {
    font-size: 11px;
    opacity: 0.8;
    letter-spacing: 1px;
    color: white !important;
}

/* Dashboard Card (Overlap Style) */
.dashboard-card {
    background: white;
    border-radius: 0 0 20px 20px;
    /* Top corners flat, bottom curved */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    padding: 0;
    margin: 0 0 30px 0;
    overflow: hidden;
    position: relative;
    z-index: 5;
    /* Card BELOW Hero */
}

/* Header with Logo */
.card-header-custom {
    padding: 25px 30px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.company-identity {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #f4f6f9;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: pointer;
}

.logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.logo-wrapper:hover .logo-overlay {
    opacity: 1;
}

.company-text h2 {
    margin: 0;
    color: #344998;
    font-weight: 800;
    font-size: 24px;
}

.company-text p {
    margin: 0;
    color: #8898aa;
    font-size: 14px;
    font-weight: 500;
}

/* Form Section */
.form-section {
    padding: 30px;
}

.section-label {
    font-size: 14px;
    font-weight: 700;
    color: #344998;
    letter-spacing: 1.2px;
    margin-bottom: 20px;
    display: block;
    border-left: 3px solid #344998;
    padding-left: 10px;
}

.modern-group {
    margin-bottom: 20px;
}

.modern-group label {
    font-size: 11px;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

/* Metrics Row */
.metrics-row {
    background: #fcfcfc;
    border-top: 1px solid #f0f0f0;
    padding: 20px;
    display: flex;
    justify-content: space-around;
}

.metric-item {
    text-align: center;
}

.metric-value {
    font-size: 24px;
    font-weight: 800;
    color: #2c3e50;
    display: block;
}

.metric-label {
    font-size: 11px;
    color: #8898aa;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Floating Table */
.floating-table-container {
    margin: 0 0 50px 0;
    /* Full width */
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

/* Badges & Buttons Extras */
.badge-custom {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
}

.badge-success-custom {
    background: rgba(56, 193, 114, 0.1);
    color: #38c172;
}

.badge-danger-custom {
    background: rgba(230, 51, 42, 0.1);
    color: #e6332a;
}

.btn-power {
    background: #6c757d;
    color: white;
}

.btn-power.active {
    background: #28a745;
    color: white;
}

.btn-print-toggle {
    background: #6c757d;
    color: white;
}

.btn-print-toggle.active {
    background: #17a2b8;
    color: white;
}

/* Override Modern Input for Empresa Page Specifics if needed, or rely on global but ensure specificity */
.modern-input:disabled {
    background: #f8f9fa !important;
    border-color: #e9ecef !important;
    color: #344998 !important;
    opacity: 1 !important;
    cursor: default;
}

/* Ensure rotation hover applies if not globally applied */
.btn-action:hover {
    transform: translateY(-2px) rotate(5deg);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

/* Selectpicker / Bootstrap-select Standardized Overrides */
.btn-input-modern,
.bootstrap-select .dropdown-toggle {
    background-color: white !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    height: 50px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #444 !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    /* Counteract default theme button margin */
    box-shadow: none !important;
    transition: all 0.2s !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.bootstrap-select .dropdown-toggle:after {
    display: inline-block !important;
    content: "" !important;
    width: 0 !important;
    height: 0 !important;
    border-top: 5px solid #888 !important;
    border-right: 5px solid transparent !important;
    border-left: 5px solid transparent !important;
    border-bottom: 0 !important;
    margin-left: auto !important;
    transition: transform 0.2s ease;
}

.bootstrap-select.show .dropdown-toggle:after {
    border-top: 0 !important;
    border-bottom: 5px solid #888 !important;
}

.btn-input-modern:focus,
.btn-input-modern:active,
.btn-input-modern:hover,
.bootstrap-select .dropdown-toggle:hover,
.bootstrap-select .dropdown-toggle:focus,
.bootstrap-select .dropdown-toggle:active,
.bootstrap-select .btn:focus,
.bootstrap-select .btn:active,
.bootstrap-select.show>.dropdown-toggle,
.bootstrap-select.show>.btn {
    background-color: #ffffff !important;
    border-color: #344998 !important;
    color: #344998 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-box-shadow: none !important;
}

.bootstrap-select {
    width: 100% !important;
}

.bootstrap-select .dropdown-menu {
    border-radius: 0 0 12px 12px !important;
    border: 2px solid #e9ecef !important;
    /* Softer gray border to match input */
    border-top: none !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    padding: 8px !important;
    margin-top: -1px !important;
    z-index: 1060 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    /* Prevent horizontal scroll on main menu */
}

/* Force inner list to also respect container width */
.bootstrap-select .dropdown-menu.inner,
.bootstrap-select .dropdown-menu.inner.show {
    min-width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 0 !important;
    overflow-x: hidden !important;
    /* Eliminate horizontal scroll */
    border: none !important;
    /* Remove the inner box outline */
    box-shadow: none !important;
}

/* Ensure options wrap if they are too long instead of forcing horizontal scroll */
.bootstrap-select .dropdown-menu li,
.bootstrap-select .dropdown-menu li a {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.bootstrap-select .dropdown-menu li a span.text {
    white-space: normal !important;
    display: inline-block !important;
    width: 100% !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
}

.bootstrap-select .bs-searchbox {
    padding: 10px 15px !important;
    background: #fff !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.bootstrap-select .bs-searchbox input {
    border: 1px solid #ced4da !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-weight: 500 !important;
    color: #444 !important;
    background-color: #fff !important;
}

.bootstrap-select .dropdown-menu li a {
    padding: 12px 20px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #525f7f !important;
    transition: background 0.2s !important;
}

.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li.selected a {
    background-color: var(--brand) !important;
    color: #ffffff !important;
}

.bootstrap-select .dropdown-item.active,
.bootstrap-select .dropdown-item:active {
    background-color: var(--brand) !important;
    color: white !important;
}

.bootstrap-select .bs-searchbox {
    padding: 10px 15px !important;
}

.bootstrap-select .bs-searchbox .form-control {
    border-radius: 8px !important;
    border: 2px solid #e9ecef !important;
    height: 35px !important;
    font-size: 13px !important;
}

/* === CLIENT MODAL SPECIFIC STYLES === */
/* Force all inputs and selects to have the same height and style */
.modal_create_cliente .modern-input,
.modal_edit_cliente .modern-input,
.modal_create_cliente input.form-control,
.modal_edit_cliente input.form-control,
.modal_create_cliente select.form-control,
.modal_edit_cliente select.form-control,
.modal_create_cliente input[type="text"],
.modal_edit_cliente input[type="text"],
.modal_create_cliente input[type="email"],
.modal_edit_cliente input[type="email"] {
    height: 50px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    padding: 0 15px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #344998 !important;
    background-color: white !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.2s ease-in-out !important;
}

/* Force bootstrap-select dropdown toggles to match */
.modal_create_cliente .bootstrap-select .dropdown-toggle,
.modal_edit_cliente .bootstrap-select .dropdown-toggle,
.modal_create_cliente .bootstrap-select>.dropdown-toggle,
.modal_edit_cliente .bootstrap-select>.dropdown-toggle,
.modal_create_cliente .btn-input-modern,
.modal_edit_cliente .btn-input-modern {
    height: 50px !important;
    min-height: 50px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    padding: 0 40px 0 15px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #344998 !important;
    background-color: white !important;
    display: flex !important;
    align-items: center !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.2s ease-in-out !important;
    line-height: 46px !important;
}

/* Remove any conflicting styles */
.modal_create_cliente .bootstrap-select .dropdown-toggle:focus,
.modal_edit_cliente .bootstrap-select .dropdown-toggle:focus,
.modal_create_cliente .bootstrap-select .dropdown-toggle:hover,
.modal_edit_cliente .bootstrap-select .dropdown-toggle:hover {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(52, 73, 152, 0.15) !important;
    outline: none !important;
    background-color: white !important;
}

.modal_create_cliente .premium-label,
.modal_edit_cliente .premium-label {
    display: block !important;
    font-weight: 800 !important;
    color: #344998 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 8px !important;
    font-size: 11px !important;
}

.modal_create_cliente .bootstrap-select,
.modal_edit_cliente .bootstrap-select {
    width: 100% !important;
}

.modal_create_cliente .form-group,
.modal_edit_cliente .form-group {
    margin-bottom: 20px !important;
}

.modal_create_cliente .bootstrap-select .filter-option,
.modal_edit_cliente .bootstrap-select .filter-option {
    color: #344998 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    line-height: 46px !important;
}

.modal_create_cliente .bootstrap-select .filter-option-inner,
.modal_edit_cliente .bootstrap-select .filter-option-inner,
.modal_create_cliente .bootstrap-select .filter-option-inner-inner,
.modal_edit_cliente .bootstrap-select .filter-option-inner-inner {
    color: #344998 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
}

/* Ensure bootstrap-select button has correct width */
.modal_create_cliente .bootstrap-select>.dropdown-toggle,
.modal_edit_cliente .bootstrap-select>.dropdown-toggle {
    width: 100% !important;
}




/* Global Typography Overrides - Prevent forced uppercase */
.btn,
.btn-round,
.navbar .navbar-nav .nav-item .nav-link,
.card-title,
.stats,
.modal-title,
.premium-label,
.section-label,
.bootstrap-select .dropdown-toggle,
.bootstrap-select .dropdown-menu li a {
    text-transform: none !important;
}

.table-modern thead th {
    text-transform: none !important;
}

/* GLOBAL TABLE FONT STANDARDIZATION */
.table thead th,
.table tbody td,
.table th,
.table td {
    font-size: 14px !important;
}

/* GLOBAL BADGE STANDARDIZATION */
.badge {
    font-size: 12px !important;
    /* Increased from default small size */
    padding: 6px 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
}

.table .badge {
    font-size: 12px !important;
    /* Ensure visibility inside tables */
}

/* Specific fix for text columns that might feel small */
.table td span,
.table td small,
.table td strong,
.table td b {
    font-size: inherit;
    /* inherit 14px from td */
}

/* Except badges which we want slightly smaller than text but readable */
.table td .badge {
    font-size: 12px !important;
}

/* Global button spacing adjustment */
.btn.btn-primary.w-100 {
    margin-bottom: 0px !important;
}

/* Autocomplete Styles (Refactored from inline) */
.auto_cl {
    font-weight: bold;
    font-size: 22px;
}

.autocomplete-items {
    border: 1px solid #ddd;
    border-bottom: none;
    border-top: none;
    z-index: 9999;
    /* High z-index to overlay other elements */
    position: absolute;
    background-color: white;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    border-radius: 0 0 8px 8px;
    /* Rounded bottom */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    color: #444;
}


/* ==========================================================================
   SUBGRUPO / CUENTAS CARD STYLES
   ========================================================================== */
.cuentas-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cuenta-card {
    background-color: #fff;
    border-left: 5px solid #D75C9A;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 0 0 0.2rem rgba(189, 52, 127, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s ease all;
    margin-bottom: 12px;
}

.cuenta-card:hover {
    box-shadow: 0 0 0 0.2rem rgba(189, 52, 127, 0.5);
    transform: scale(1.01);
}

.cuenta-text {
    color: #BE347F;
    font-weight: 500;
    font-size: 15px;
}

.btn-eliminar {
    background-color: #BE347F;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    /* Standardized to 8px from mixed 4px/8px */
    padding: 4px 10px;
    box-shadow: 0 0 0 0.1rem rgba(189, 52, 127, 0.3);
    transition: 0.2s;
}

.btn-eliminar:hover {
    background-color: #D75C9A;
    box-shadow: 0 0 0 0.2rem rgba(215, 92, 154, 0.3);
}

#filtro_cuentas_aux {
    border-left: 4px solid #D75C9A !important;
    box-shadow: 0 0 0 0.05rem rgba(189, 52, 127, 0.15) !important;
    border-radius: 8px !important;
}

/* Select2 Override for Subgrupo (hides choices in selection box) */
.select2-selection__choice {
    display: none !important;
}

/* ==========================================================================
   BOOTSTRAP SELECT OVERRIDES (Refactored from remision/index.blade.php)
   ========================================================================== */
.bootstrap-select .btn {
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    background-color: #fff;
    color: #495057;
    height: calc(1.5em + 0.75rem + 2px);
    /* Correct Bootstrap height */
    display: flex;
    /* Flexbox for better text alignment */
    align-items: center;
    /* Vertically center content */
}

.bootstrap-select .btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
    border-color: #80bdff;
}

/* Fix for double border when form-control class is on select */
.bootstrap-select.form-control {
    border: none !important;
    padding: 0 !important;
    height: auto !important;
    background: none !important;
    box-shadow: none !important;
}

.bootstrap-select .filter-option {
    display: flex;
    align-items: center;
}


/* ==========================================================================
   PROVEEDOR & PRODUCTO COMMON STYLES
   ========================================================================== */
.section-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    border-left: 4px solid var(--brand);
    padding-left: 12px;
}

.modern-group {
    margin-bottom: 25px;
}

.modern-group label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: #525f7f;
    margin-bottom: 8px;
}

.btn-volver,
.btn-back {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white !important;
    border-radius: 50px;
    padding: 8px 20px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-volver:hover,
.btn-back:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-3px);
}

.btn-save {
    background: var(--brand);
    color: white !important;
    border: none;
    border-radius: 12px;
    padding: 12px 40px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(52, 73, 152, 0.3);
    transition: all 0.3s;
    cursor: pointer;
}

.btn-save:hover {
    background: var(--brand-hover);
    transform: translateY(-2px);
}

/* Select2 Bootstrap 4 container fix */
.select2-container--bootstrap4 .select2-selection--single {
    height: 50px !important;
    border: 2px solid #e9ecef !important;
    /* using premium border color */
    border-radius: 12px !important;
}

.form-section {
    padding: 30px;
}



/* ==========================================================================
   NAVBAR LOGO
   ========================================================================== */
.navbar-brand {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 800 !important;
    color: white !important;
    font-size: 24px !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    margin-left: 0;
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ==========================================================================
   SIDEBAR & NAVIGATION (Refactored from app.blade.php)
   ========================================================================== */

/* --- MODERN WHITE & BOLD SIDEBAR REDESIGN --- */
.sidebar,
.sidebar[data-color="white"],
.sidebar[data-color="white"]:after,
.sidebar-wrapper {
    background: #ffffff !important;
    /* Pure White */
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.05) !important;
    /* Very soft shadow */
    border-right: 1px solid #f1f5f9 !important;
    width: 280px !important;
    transition: width 0.3s ease !important;
}

/* Sidebar sits below navbar */
.sidebar {
    padding-top: 80px !important;
    z-index: 1029 !important;
}

/* Navbar sits above sidebar */
.premium-navbar {
    z-index: 1040 !important;
}

/* Adjust main panel to accommodate wider sidebar */
.main-panel {
    width: calc(100% - 280px) !important;
    transition: width 0.3s ease !important;
}

/* Clear default borders and overlays */
.sidebar:after {
    content: none !important;
    opacity: 0 !important;
}

/* Sidebar wrapper starts from top (no logo) */
.sidebar .sidebar-wrapper {
    border-right: none !important;
    width: 100% !important;
    margin-top: 0 !important;
    padding-top: 20px !important;
    height: 100%;
    overflow-x: hidden !important;
}

/* --- NAVIGATION ITEMS REDESIGN --- */

/* Base Item Style (Inactive) */
.sidebar .nav li>a {
    background: transparent !important;
    margin: 6px 15px !important;
    border-radius: 12px !important;
    padding: 15px 20px !important;
    /* Larger touch target */
    box-shadow: none !important;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center !important;
    opacity: 1 !important;
}

/* Text - Dark Grey & Larger */
.sidebar .nav p,
.sidebar .caret {
    color: #64748b !important;
    /* Slate 500 */
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    /* Bolder */
    font-size: 16px !important;
    /* Increased from 14px */
    margin: 0 !important;
    letter-spacing: 0.2px !important;
    text-transform: capitalize !important;
}

/* Icons - Brand Blue & Larger */
.sidebar .nav i {
    color: #344998 !important;
    /* Brand Blue */
    font-size: 26px !important;
    /* Increased from 22px */
    margin-right: 20px !important;
    width: 30px !important;
    text-align: center !important;
    vertical-align: middle !important;
    display: inline-block !important;
    transition: all 0.2s ease;
}

/* --- HOVER & ACTIVE STATES --- */

/* Hover State */
.sidebar .nav li:hover>a {
    background: #f8fafc !important;
    /* Slate 50 */
    transform: translateX(3px);
    box-shadow: none !important;
}

.sidebar .nav li:hover i {
    transform: scale(1.1);
}

.sidebar .nav li:hover p {
    color: #334155 !important;
}

/* Darker slate */

/* ACTIVE State */
.sidebar .nav li.active>a {
    background: #eef2ff !important;
    /* Blue 50 */
    box-shadow: none !important;
    opacity: 1 !important;
}

/* Active Text & Icon */
.sidebar .nav li.active p,
.sidebar .nav li.active .caret,
.sidebar .nav li.active i {
    color: #344998 !important;
    /* Brand Blue */
    font-weight: 700 !important;
}


/* --- ACCORDION SUBMENUS --- */

/* Style for the collapsed menu */
.sidebar .nav li .collapse {
    width: 100% !important;
    margin: 5px 0 10px 0 !important;
    background-color: #f8fafc !important;
    /* Very Light Grey for inset */
    border-radius: 12px !important;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.03) !important;
    padding: 5px 0 !important;
}

/* Caret rotation logic */
.sidebar .nav li a[aria-expanded="true"] .caret {
    transform: rotate(180deg);
}

.caret {
    transition: transform 0.3s ease;
    display: inline-block;
    border-top: 4px dashed;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    margin-left: auto;
    /* Push to right */
}

/* Updated selector for items inside collapse */
.sidebar .collapse .nav li>a,
.sidebar .collapse .dropdown-item {
    color: #475569 !important;
    /* Slate 600 */
    padding: 10px 10px 10px 50px !important;
    /* High indentation */
    transition: all 0.2s;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: 'Outfit', sans-serif !important;
    opacity: 1 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.sidebar .dropdown-item {
    color: #475569 !important;
    /* Slate 600 */
    padding: 10px 10px 10px 50px !important;
    /* High indentation to show hierarchy */
    transition: all 0.2s;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: 'Outfit', sans-serif !important;
    opacity: 1 !important;
    background: transparent !important;
}

.sidebar .dropdown-item:hover {
    background: transparent !important;
    /* No background on hover for clean look */
    color: #344998 !important;
    /* Just color change */
    padding-left: 55px !important;
    /* Slight movement */
    font-weight: 700 !important;
}

/* Scrollbar */
.sidebar-wrapper::-webkit-scrollbar {
    width: 5px;
}

.sidebar-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.sidebar-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.nav-item>a:focus {
    outline: none !important;
}

.navbar .dropdown-menu[aria-labelledby="notificacionesDropdown"] .dropdown-item {
    border-radius: 10px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.navbar .dropdown-menu[aria-labelledby="notificacionesDropdown"] .dropdown-item:hover,
.navbar .dropdown-menu[aria-labelledby="notificacionesDropdown"] .dropdown-item:focus {
    background-color: var(--brand) !important;
    color: #ffffff !important;
}

.navbar .dropdown-menu[aria-labelledby="notificacionesDropdown"] .dropdown-item:hover .text-muted,
.navbar .dropdown-menu[aria-labelledby="notificacionesDropdown"] .dropdown-item:focus .text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
}

.navbar .dropdown-menu[aria-labelledby="notificacionesDropdown"] .dropdown-item:hover .font-weight-bold,
.navbar .dropdown-menu[aria-labelledby="notificacionesDropdown"] .dropdown-item:focus .font-weight-bold {
    color: #ffffff !important;
}

/* ==========================================================================
   AJUSTES PAGE OVERRIDES (Refactored from ajustes.blade.php)
   ========================================================================== */
.premium-select2+.select2-container .select2-selection--single {
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    background-color: #fff !important;
    transition: all 0.2s !important;
}

.premium-select2+.select2-container .select2-selection__rendered {
    line-height: normal !important;
    padding-left: 15px !important;
    font-weight: 600 !important;
    color: #344998 !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

.premium-select2+.select2-container .select2-selection__arrow {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-dropdown {
    border: 1px solid #e9ecef !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--brand) !important;
}

.s2-item__code {
    background: #f0f4f8;
    color: #344998;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    margin-right: 8px;
}

.s2-item__name {
    font-weight: 600;
    color: #444;
}

/* Diff colors */
.aj_diff.positive {
    color: #10B981;
}

.aj_diff.negative {
    color: #EF4444;
}


.bootstrap-select.btn-group {
    margin-bottom: 0 !important;
}

/* ==========================================================================
   ENTERPRISE DASHBOARD
   ========================================================================== */
.enterprise-dashboard {
    background-color: var(--bg-light);
    min-height: calc(100vh - 80px);
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    padding-bottom: 50px;
    margin-top: 50px;
    /* Base push */
}

.dashboard-hero {
    background: linear-gradient(135deg, #344998 0%, #1e2b58 100%);
    padding: 50px 30px 40px 30px;
    color: white;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 10px 30px rgba(52, 73, 152, 0.2);
    margin-bottom: 30px;
    position: relative;
    z-index: 20;

    /* Stick to top */
}

.dashboard-hero h1 {
    font-weight: 800;
    font-size: 28px;
    margin: 0;
    color: white !important;
}

.btn-volver {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white !important;
    border-radius: 50px;
    padding: 8px 20px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-volver:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-3px);
}

.dashboard-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
    padding: 35px;

}


.section-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    border-left: 4px solid var(--brand);
    padding-left: 12px;
}

.modern-group {
    margin-bottom: 25px;
}

.modern-group label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: #525f7f;
    margin-bottom: 8px;
}

.modern-input {
    width: 100% !important;
    border: 2px solid #e9ecef !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 8px 15px !important;
    height: 50px !important;
    line-height: 1.5 !important;
    color: #344998 !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02) !important;
}

select.modern-input {
    padding-right: 40px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23344998' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
}

.modern-input:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(52, 73, 152, 0.15) !important;
    outline: none;
}

.btn-save {
    background: var(--brand);
    color: white !important;
    border: none;
    border-radius: 50px;
    padding: 12px 40px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(52, 73, 152, 0.3);
    transition: all 0.3s;
}

.btn-save:hover {
    background: var(--brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(52, 73, 152, 0.4);
}

select.modern-input {
    height: 50px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23344998' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
}

/* ==========================================================================
   BOOTSTRAP SELECT FIXES & COMMON UTILS
   ========================================================================== */
.bootstrap-select.form-control {
    border: none !important;
    padding: 0 !important;
    height: auto !important;
    background: none !important;
    box-shadow: none !important;
}

.bootstrap-select .btn {
    border: 2px solid #e9ecef !important;
    background-color: #fff !important;
}

.form-check-input-lg {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0;
}

/* ==========================================================================
   SUBGRUPO MODAL STYLES
   ========================================================================== */
.titulo-modal {
    font-weight: bold;
    font-size: 20px;
    border-bottom: 3px solid #9A2D68;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.input-busqueda-producto {
    border-left: 5px solid #9A2D68 !important;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 0 0 0.1rem rgba(154, 45, 104, 0.2);
    margin-bottom: 20px;
}

.tabla-productos th {
    background-color: #9A2D68;
    color: white;
    vertical-align: middle;
}

.tabla-productos td,
.tabla-productos th {
    vertical-align: middle;
}

.fila-totales {
    background-color: #f9f1f6;
    font-weight: bold;
    border-top: 3px solid #9A2D68;
}

/* ==========================================================================
   KARDEX STYLES
   ========================================================================== */
.summary-box {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.summary-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.nav-pills .nav-link {
    color: var(--brand);
    font-weight: 700;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin: 0 5px;
    padding: 12px 25px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.nav-pills .nav-link:hover {
    background-color: rgba(52, 73, 152, 0.1);
    color: var(--brand);
    border-color: var(--brand);
}

.nav-pills .nav-link.active {
    background-color: var(--brand) !important;
    color: #fff !important;
    border-color: var(--brand) !important;
    box-shadow: 0 4px 15px rgba(52, 73, 152, 0.3);
}

.nav-pills .nav-link.active i {
    color: #fff !important;
}

.badge-premium {
    padding: 6px 12px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
}

.table-premium {
    width: 100%;
    margin-bottom: 0;
}

.table-premium th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 20px 35px;
    border: none;
}

.table-premium td {
    padding: 20px 35px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
}

/* ==========================================================================
   REMISION STYLES
   ========================================================================== */
.btn-icon-only {
    width: 35px;
    height: 35px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   AUTOCOMPLETE STYLES (Factura Venta)
   ========================================================================== */
.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
    font-size: 14px;
}

.autocomplete-items div:hover {
    background-color: #e9e9e9;
}

/* ==========================================================================
   PRICE MODAL STYLES (Mercado Lista)
   ========================================================================== */
.btn_pre {
    font-size: 35px;
    background: #fff;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    width: 100%;
    padding: 20px 0;
    transition: all 0.2s;
    font-weight: 700;
    color: #344998;
}

.btn_pre:focus,
.btn_pre:focus-visible {
    outline: 0 !important;
    border: 4px solid var(--brand) !important;
    background: #f8f9fa;
}

.btn_pre:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: var(--brand);
}

.cl_prec {
    text-align: center;
    margin-bottom: 20px;
}

.cl_prec h2 {
    font-size: 16px;
    font-weight: 700;
    color: #8898aa;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* ==========================================================================
   CARTERA PAGO STYLES
   ========================================================================== */
.modal .modal-header {
    background: var(--brand) !important;
    background-image: none !important;
    color: #fff !important;
    border-bottom: none !important;
}

.modal .modal-header .modal-title {
    color: #fff !important;
}

.modal .modal-header .close,
.modal .modal-header .btn-close {
    color: #fff !important;
    opacity: 0.8;
    text-shadow: none !important;
}

.modal .modal-header .close:hover,
.modal .modal-header .btn-close:hover {
    opacity: 1;
}

.modal-header-premium {
    background: var(--brand) !important;
    background-image: none !important;
    color: #fff !important;
    border-bottom: none !important;
}

.modal-header-premium .modal-title {
    color: #fff !important;
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Bootstrap Select Overrides in Modals */
.bootstrap-select .dropdown-toggle {
    background-color: #fff !important;
    color: #333 !important;
    border: 1px solid #ced4da !important;
    height: 45px !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
}

.bootstrap-select .dropdown-toggle:focus,
.bootstrap-select .dropdown-toggle:hover,
.bootstrap-select .dropdown-toggle:active,
.bootstrap-select.show>.dropdown-toggle {
    background-color: #fff !important;
    background-image: none !important;
    color: #344998 !important;
    border-color: #344998 !important;
    box-shadow: 0 6px 12px rgba(52, 73, 152, 0.08) !important;
}

/* Z-Index Fixes */
.modal .select2-container {
    z-index: 1055 !important;
}

.modal .select2-container--open {
    z-index: 1056 !important;
}

.modal .bootstrap-select.show,
.modal .bootstrap-select.show .dropdown-menu {
    z-index: 1057 !important;
}

/* Disabled Select */
select:disabled {
    background: #f3f3f3;
    cursor: not-allowed;
}

/* Lista Facturas Cascade */
#lista_facturas_cascade label {
    margin: 0;
}

#lista_facturas_cascade .fact-row:hover {
    background: #fafafa;
}

.fact-mini {
    font-size: 12px;
    line-height: 1.2;
    margin-top: 4px;
}

.fact-mini b {
    font-weight: 700;
}

/* ==========================================================================
   CARGA INVENTARIO PDF STYLES
   ========================================================================== */
.col_cuenta {
    width: 280px !important;
}

.fact_elc {
    width: 280px !important;
}

.subtitle_card {
    margin: 0px;
    text-align: center;
}

/* Panel Styles */
.panel-default {
    padding: 0px;
}

.panel-default>.panel-heading {
    color: #333;
    background-color: #f5f5f5;
    border-color: #ddd;
}

.panel-heading-custom {
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    border: #ddd solid 0.5px;
}

.panel-body-custom {
    padding: 10px 15px;
    border: #ddd solid 0.5px;
}

.block_card_cau {
    padding-right: 31px;
    margin-top: 38px;
}

.text_obs {
    padding-left: 53px;
    font-size: 16px;
}

.main-panel-pdf {
    height: 100vh;
    padding: 30px;
}

.t_h2 {
    margin: 10px 6px 0px;
    float: right;
}

/* Print Styles */
@media print {
    @page {
        margin-bottom: 0;
    }

    .print_block {
        display: none;
    }

    .panel_prit {
        background: #fff;
        height: initial !important;
        padding: initial;
        float: initial;
        width: initial;
    }

    .panel_prit>.content {
        margin-top: 0px !important;
        padding: 0px !important;
    }
}

/* Enterprise Dashboard Specific Overrides */
.enterprise-dashboard .section-label {
    font-size: 15px !important;
    letter-spacing: 1px;
    border-left-width: 4px;
}

/* ==========================================================================
   TABLE WRAPPER FOR RESPONSIVE HORIZONTAL SCROLL
   ========================================================================== */
/* Ensure all table containers support horizontal scroll */
.table-responsive,
.table-container,
.floating-table-container,
.dashboard-card-full,
.card-body {
    position: relative;
}

/* Table wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN - MEDIA QUERIES
   ========================================================================== */

/* Tablet Landscape and Below (992px) */
@media (max-width: 992px) {

    /* Sidebar Adjustments */
    .sidebar,
    .sidebar[data-color="white"],
    .sidebar .sidebar-wrapper,
    .sidebar .logo {
        width: 240px !important;
    }

    .main-panel {
        width: calc(100% - 240px) !important;
    }

    /* Dashboard Hero */
    .dashboard-hero {
        padding: 40px 20px 30px 20px;
    }

    .dashboard-hero h1 {
        font-size: 26px;
    }

    /* Cards */
    .dashboard-card,
    .dashboard-card-full {
        padding: 20px;
    }

    /* Tables - Enable horizontal scroll */
    .table-responsive,
    .table-container,
    .floating-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-modern,
    .table,
    .table-premium {
        min-width: 800px;
        /* Minimum width to trigger scroll on tablets */
        display: table;
        width: 100%;
    }

    .table-modern thead th,
    .table thead th {
        font-size: 13px;
        padding: 12px 16px;
    }

    .table-modern td,
    .table td {
        font-size: 13px;
        padding: 12px 16px;
    }

    /* Glass Stats - Stack on smaller tablets */
    .glass-stat {
        margin-bottom: 15px;
    }

    /* Metrics Row - Wrap items */
    .metrics-row {
        flex-wrap: wrap;
        gap: 15px;
    }

    .metric-item {
        flex: 1 1 calc(50% - 15px);
        min-width: 150px;
    }

    /* Buttons */
    .btn-hero-action {
        width: auto;
        min-width: 150px;
        padding: 0 20px;
    }
}

/* Tablet Portrait and Below (768px) */
/* Tablet Portrait and Below (991px) */
@media (max-width: 991px) {

    /* Container adjustments */
    .wrapper {
        margin-top: 0px !important;
        width: 105% !important;
        margin-left: -2.5% !important;
    }

    body {
        width: 100%;
        overflow-x: hidden;
    }

    /* Navbar logo - smaller on mobile */
    .navbar-brand {
        font-size: 18px !important;
        letter-spacing: 1.5px !important;
        margin-left: 60px !important;
        /* Space for hamburger button */
    }

    /* Navbar z-index fix */
    .navbar {
        z-index: 10001 !important;
    }

    /* Sidebar - Convert to mobile menu (Full Width, Below Navbar) */
    body .sidebar,
    body .sidebar[data-color="white"],
    body .sidebar[data-color="white"]:after {
        width: 100% !important;
        /* Force 100% */
        max-width: none !important;
        /* Remove constraints */
        min-width: 0 !important;
        position: fixed;
        left: -105% !important;
        /* Move fully off-screen */
        right: 0 !important;
        /* Ensure it stretches */
        top: 70px !important;
        /* Start below navbar */
        bottom: 0 !important;
        height: calc(100vh - 70px) !important;
        /* Force exact height */
        min-height: calc(100vh - 70px) !important;
        z-index: 9999;
        transition: left 0.3s ease-in-out;
        overflow-y: auto !important;
        padding-top: 0 !important;
        /* Remove extra space */
        background: #ffffff !important;
        border-right: none !important;
    }

    body .sidebar .sidebar-wrapper {
        width: 100% !important;
        max-width: none !important;
        overflow: visible !important;
        /* Let sidebar handle scroll */
        margin-top: 0 !important;
        padding: 0 0 40px 0 !important;
        min-height: 100% !important;
    }

    body .sidebar.active,
    body .sidebar[data-color="white"].active {
        left: 0 !important;
        visibility: visible !important;
        display: block !important;
        transform: none !important;
    }

    /* Main Panel - Full Width */
    .main-panel {
        width: 100% !important;
        padding: 0;
    }

    /* Dashboard Hero */
    .dashboard-hero {
        padding: 30px 15px 25px 15px;
        border-radius: 0;
        margin-top: 0;
    }

    .dashboard-hero h1 {
        font-size: 22px;
    }

    .dashboard-hero p {
        font-size: 13px;
    }

    /* Centering the main action button on the dashboard for mobile */
    .dashboard-hero .text-right {
        text-align: center !important;
    }

    .header-action-button {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    /* Hero Buttons - Stack vertically */
    .btn-hero-action {
        width: 100%;
        margin-bottom: 10px;
        height: 44px;
    }

    .btn-hero-action+.btn-hero-action {
        margin-left: 0 !important;
    }

    /* Enhanced Search Section Spacing for Mobile */
    .search-section .form-group {
        margin-bottom: 15px !important;
    }

    .search-section .btn-primary {
        margin-top: 10px !important;
    }

    /* Cards */
    .dashboard-card,
    .dashboard-card-full {
        border-radius: 12px;
        padding: 15px;
        margin: 15px 10px;
    }

    .card-header-custom {
        padding: 20px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .company-identity {
        flex-direction: column;
        align-items: center;
        width: 100%;
        text-align: center;
    }

    /* Form Sections */
    .form-section {
        padding: 20px 15px;
    }

    /* Tables - Horizontal Scroll */
    .table-responsive,
    .table-container,
    .floating-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
    }

    .table-modern,
    .table,
    .table-premium {
        min-width: 600px;
        /* Minimum width to trigger horizontal scroll */
        display: table;
        width: 100%;
    }

    .table-modern thead th,
    .table thead th,
    .table-premium th {
        white-space: nowrap;
        /* Prevent header text wrapping */
        font-size: 12px;
        padding: 12px 15px;
    }

    .table-modern td,
    .table td,
    .table-premium td {
        white-space: nowrap;
        font-size: 13px;
        padding: 12px 15px;
    }

    /* Action Buttons in Tables - Keep them compact */
    .table-modern td .btn-action,
    .table td .btn-action {
        margin: 2px;
    }

    /* Glass Stats - Full Width */
    .glass-stat {
        width: 100%;
    }

    /* Metrics Row - Stack Vertically */
    .metrics-row {
        flex-direction: column;
        gap: 15px;
    }

    .metric-item {
        width: 100%;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 15px;
    }

    .metric-item:last-child {
        border-bottom: none;
    }

    /* Inputs and Selects */
    .modern-input,
    select.form-control,
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    textarea {
        font-size: 16px !important;
        /* Prevent zoom on iOS */
    }

    /* Select2 Mobile Adjustments */
    .select2-container--default .select2-selection--single,
    .select2-dropdown {
        font-size: 16px !important;
    }

    /* Bootstrap Select Mobile */
    .bootstrap-select .dropdown-menu {
        max-height: 300px;
        overflow-y: auto;
    }

    /* Sidebar Navigation */
    .sidebar .nav li>a {
        padding: 12px 15px !important;
    }

    .sidebar .nav p {
        font-size: 15px !important;
    }

    .sidebar .nav i {
        font-size: 24px !important;
        margin-right: 15px !important;
    }

    /* Ensure sidebar nav takes full width */
    .sidebar .nav {
        width: 100% !important;
    }

    .sidebar .nav li {
        width: 100% !important;
    }

    .sidebar .nav li>a {
        width: 100% !important;
        white-space: normal !important;
    }

    .sidebar .collapse {
        width: 100% !important;
    }

    /* Modal Adjustments */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-body {
        padding: 15px;
    }

    /* Autocomplete */
    .autocomplete-items {
        max-height: 150px;
    }

    /* Pagination - Prevent overflow with many pages */
    .modern-pagination {
        justify-content: flex-start;
        gap: 6px;
        flex-wrap: nowrap;
        padding: 0 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        /* Hide scrollbar but keep functionality */
        scrollbar-width: thin;
        scrollbar-color: #cbd5e1 transparent;
    }

    .modern-pagination::-webkit-scrollbar {
        height: 4px;
    }

    .modern-pagination::-webkit-scrollbar-track {
        background: transparent;
    }

    .modern-pagination::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    .modern-pagination .page-item {
        margin: 4px 3px;
        flex-shrink: 0;
        /* Prevent items from shrinking */
    }

    .modern-pagination .page-item .page-link {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 36px;
        /* Ensure minimum touch target */
        white-space: nowrap;
    }

    /* Filter Labels and Selects - Better visibility on mobile */
    label,
    .premium-label,
    .modern-group label {
        font-size: 13px !important;
        margin-bottom: 8px !important;
        display: block;
        width: 100%;
    }

    /* Ensure select text is visible and sized appropriately */
    select.form-control,
    .form-control,
    .modern-input,
    .bootstrap-select .dropdown-toggle {
        min-height: 45px !important;
        padding: 10px 40px 10px 15px !important;
        /* Raised text */
        line-height: normal !important;
        font-size: 14px !important;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    /* Select2 mobile fixes */
    .select2-container--default .select2-selection--single {
        min-height: 45px !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 41px !important;
        padding-right: 40px !important;
        font-size: 14px !important;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    /* Bootstrap select text size */
    .bootstrap-select .filter-option-inner-inner {
        font-size: 14px !important;
    }

    /* Floating Table Container */
    .floating-table-container {
        padding: 15px;
        margin: 0 10px 30px 10px;
    }

    /* Logo Wrapper */
    .logo-wrapper {
        width: 60px;
        height: 60px;
    }

    /* Company Text */
    .company-text h2 {
        font-size: 20px;
    }

    .company-text p {
        font-size: 13px;
    }

    /* Section Labels */
    .section-label {
        font-size: 13px !important;
    }

    /* Modern Group Labels */
    .modern-group label {
        font-size: 13px !important;
    }

    /* Buttons */
    .btn-save,
    .btn-volver,
    .btn-back {
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
        justify-content: center;
    }

    /* Badges */
    .badge {
        font-size: 11px !important;
        padding: 5px 8px !important;
    }

    /* Cuenta Card */
    .cuenta-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-eliminar {
        width: 100%;
    }

    /* Enterprise Dashboard */
    .enterprise-dashboard {
        padding-bottom: 30px;
        margin-top: 75px !important;
    }

    /* Panel Padding */
    .panel-body-custom,
    .panel-heading-custom {
        padding: 10px;
    }

    /* Price Modal Buttons */
    .btn_pre {
        font-size: 28px;
        padding: 15px 0;
    }
}

/* Mobile Small (576px and below) */
@media (max-width: 576px) {

    /* Further reduce spacing */
    .dashboard-hero {
        padding: 20px 10px;
    }

    .dashboard-hero h1 {
        font-size: 20px;
    }

    .dashboard-hero p {
        font-size: 12px;
    }

    /* Cards */
    .dashboard-card,
    .dashboard-card-full {
        margin: 10px 5px;
        padding: 12px;
        border-radius: 10px;
    }

    /* Form Sections */
    .form-section {
        padding: 15px 10px;
    }

    /* Tables - Maintain horizontal scroll with smaller text */
    .table-responsive,
    .table-container,
    .floating-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-modern,
    .table,
    .table-premium {
        min-width: 500px;
        /* Minimum width for mobile */
    }

    .table-modern thead th,
    .table thead th,
    .table-premium th {
        font-size: 11px;
        padding: 10px 12px;
    }

    .table-modern td,
    .table td,
    .table-premium td {
        font-size: 12px;
        padding: 10px 12px;
    }

    /* Action Buttons - Smaller */
    .btn-action {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* Glass Icon */
    .glass-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .glass-info h5 {
        font-size: 16px;
    }

    .glass-info span {
        font-size: 10px;
    }

    /* Metric Values */
    .metric-value {
        font-size: 20px;
    }

    .metric-label {
        font-size: 10px;
    }

    /* Inputs - Full Width */
    .modern-input,
    select.form-control,
    .form-control {
        height: 42px !important;
        padding: 10px 12px !important;
    }

    /* Select2 */
    .select2-container--default .select2-selection--single {
        height: 42px !important;
        padding: 6px 12px !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 28px !important;
    }

    /* Bootstrap Select */
    .bootstrap-select .dropdown-toggle {
        height: 42px !important;
    }

    /* Logo */
    .logo-wrapper {
        width: 50px;
        height: 50px;
    }

    /* Company Header */
    .company-text h2 {
        font-size: 18px;
    }

    .company-text p {
        font-size: 12px;
    }

    /* Section Label */
    .section-label {
        font-size: 12px !important;
        padding-left: 8px;
        border-left-width: 3px;
    }

    /* Premium Labels */
    .premium-label {
        font-size: 12px !important;
    }

    /* Modern Group */
    .modern-group {
        margin-bottom: 15px;
    }

    .modern-group label {
        font-size: 12px !important;
        margin-bottom: 6px !important;
    }

    /* Buttons - Adjust padding */
    .btn-save {
        padding: 10px 30px;
        font-size: 13px;
    }

    .btn-hero-action {
        height: 42px;
        font-size: 13px;
        padding: 0 15px;
    }

    /* Floating Container */
    .floating-table-container {
        padding: 12px;
    }

    /* Modal Dialog */
    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }

    /* Modal Header */
    .modal-header-premium .modal-title {
        font-size: 1.1rem;
    }

    /* Autocomplete Items */
    .autocomplete-items div {
        padding: 8px;
        font-size: 13px;
    }

    /* Pagination - Compact with scroll for many pages */
    .modern-pagination {
        gap: 4px;
        margin: 20px 0;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0 5px;
    }

    .modern-pagination .page-item {
        margin: 3px 2px;
        flex-shrink: 0;
    }

    .modern-pagination .page-item .page-link {
        padding: 5px 8px;
        font-size: 12px;
        min-width: 32px;
    }

    /* Summary Box */
    .summary-box {
        padding: 15px;
    }

    /* Table Premium */
    .table-premium th,
    .table-premium td {
        padding: 12px 15px;
        font-size: 13px;
    }

    /* Nav Pills */
    .nav-pills .nav-link {
        padding: 10px 15px;
        font-size: 13px;
        margin: 5px 2px;
    }

    .nav-pills .nav-link.active {
        background-color: var(--brand) !important;
        color: #fff !important;
    }

    /* Badge Premium */
    .badge-premium {
        padding: 4px 10px;
        font-size: 10px;
    }

    /* Price Modal */
    .btn_pre {
        font-size: 24px;
        padding: 12px 0;
    }

    .cl_prec h2 {
        font-size: 14px;
    }

    /* Sidebar Text */
    .sidebar .logo .simple-text {
        font-size: 16px !important;
    }

    .sidebar .nav p {
        font-size: 14px !important;
    }

    .sidebar .nav i {
        font-size: 22px !important;
        margin-right: 12px !important;
    }

    /* Collapse Items */
    .sidebar .dropdown-item,
    .sidebar .collapse .nav li>a {
        padding: 8px 8px 8px 40px !important;
        font-size: 13px !important;
    }

    /* Enterprise Dashboard */
    .enterprise-dashboard .section-label {
        font-size: 13px !important;
    }
}

/* Mobile and Desktop Branding Styles */

/* 1. Global / Desktop Styles (Default) */
.mobile-menu-toggle {
    display: none !important;
    /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 35px;
    height: 35px;
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s ease;
    margin-right: 15px;
    outline: none !important;
}

.brand-with-sidebar {
    margin-left: 55px !important;
    transition: margin-left 0.3s ease;
}

.brand-centered {
    margin-left: 30px !important;
    transition: margin-left 0.3s ease;
}

.navbar-logo {
    height: 50px !important;
    /* Fixed height for desktop */
    width: auto !important;
    transition: all 0.3s ease;
    object-fit: contain;
}

/* 2. Mobile Specific Overrides */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
    }

    .premium-navbar {
        padding-left: 10px !important;
        padding-right: 10px !important;
        height: 70px !important;
    }

    .navbar-logo {
        height: 35px !important;
        /* Smaller on mobile */
        max-width: 150px !important;
    }

    .brand-with-sidebar,
    .brand-centered {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }

    .navbar-wrapper {
        margin-left: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* 3. Hamburger Animation Styles (Mobile only) */
.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Hide existing navbar toggler */
.navbar-toggle {
    display: none !important;
}

/* Landscape Mobile Devices */
@media (max-width: 768px) and (orientation: landscape) {
    .dashboard-hero {
        padding: 20px 15px;
    }

    .dashboard-hero h1 {
        font-size: 20px;
    }

    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Extra Small Devices (320px) */
@media (max-width: 320px) {
    .dashboard-hero h1 {
        font-size: 18px;
    }

    .btn-hero-action {
        font-size: 12px;
        height: 40px;
    }

    .modern-input,
    .form-control {
        height: 40px !important;
        font-size: 14px !important;
    }

    /* Tables - Extra compact for very small screens */
    .table-modern,
    .table,
    .table-premium {
        min-width: 450px;
    }

    .table-modern thead th,
    .table thead th,
    .table-premium th {
        font-size: 10px;
        padding: 8px 10px;
    }

    .table-modern td,
    .table td,
    .table-premium td {
        font-size: 11px;
        padding: 8px 10px;
    }

    .btn-action {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}

/* Custom Scrollbar for Tables */
.table-responsive::-webkit-scrollbar,
.dataTables_scrollBody::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track,
.dataTables_scrollBody::-webkit-scrollbar-track {
    background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb,
.dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    /* Light grey, subtle */
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
    /* Slightly darker on hover */
}

/* --- STANDARD MODAL HEADERS --- */
.modal-header {
    background: #344998 !important;
    /* var(--brand) */
    background-image: none !important;
    background-color: #344998 !important;
    color: white !important;
    border-bottom: none !important;
    border-radius: 12px 12px 0 0 !important;
    /* Ensure rounded top corners */
}

.modal-header .modal-title {
    color: white !important;
    font-weight: 700 !important;
    font-size: 1.2rem !important;
}

.modal-header .close {
    color: white !important;
    text-shadow: none !important;
    opacity: 0.8;
    background: transparent !important;
    border: none !important;
    font-size: 1.5rem !important;
}

.modal-header .close:hover {
    opacity: 1;
    color: white !important;
}

/* Ensure modal content has rounded corners matches header */
.modal-content {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
}

/* --- SWEETALERT FIXES --- */
/* Hide the internal checkbox that clashing styles were un-hiding globally */
.swal2-checkbox,
.swal2-checkbox input[type="checkbox"],
.swal2-checkbox label {
    display: none !important;
}

/* Fix for infinite loader on Factura Venta */
.hidden_loder {
    display: none !important;
}

/* ==========================================================================
   SIDEBAR TOGGLE BUTTON
   ========================================================================== */
.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
}

.sidebar-toggle-btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

body.sidebar-collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

/* Hide sidebar toggle on mobile — the hamburger button handles it */
@media (max-width: 991px) {
    .sidebar-toggle-btn {
        display: none !important;
    }
}

/* ==========================================================================
   COLLAPSED SIDEBAR STATE (Desktop Only)
   ========================================================================== */

/* Sidebar collapse to 80px */
body.sidebar-collapsed .sidebar,
body.sidebar-collapsed .sidebar[data-color="white"],
body.sidebar-collapsed .sidebar[data-color="white"]:after,
body.sidebar-collapsed .sidebar-wrapper {
    width: 80px !important;
}

/* Main panel expands */
body.sidebar-collapsed .main-panel {
    width: calc(100% - 80px) !important;
}

/* Hide ALL text labels (including raw text nodes) */
body.sidebar-collapsed .sidebar .nav p,
body.sidebar-collapsed .sidebar .nav .caret,
body.sidebar-collapsed .sidebar .caret {
    display: none !important;
}

/* Hide text by zeroing font-size on links, restore on icons */
body.sidebar-collapsed .sidebar .nav li>a {
    font-size: 0 !important;
    color: transparent !important;
    justify-content: center !important;
    padding: 15px 10px !important;
    margin: 6px 8px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

/* Center icons and restore their size */
body.sidebar-collapsed .sidebar .nav i {
    margin-right: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
    text-align: center !important;
    font-size: 26px !important;
    color: #344998 !important;
}

/* Hide collapsed submenus */
body.sidebar-collapsed .sidebar .nav li .collapse,
body.sidebar-collapsed .sidebar .nav li .collapsing {
    display: none !important;
}

/* Hide dropdown items */
body.sidebar-collapsed .sidebar .collapse .nav,
body.sidebar-collapsed .sidebar .collapse .dropdown-item {
    display: none !important;
}

/* Sidebar wrapper adjustments */
body.sidebar-collapsed .sidebar .sidebar-wrapper {
    width: 80px !important;
    overflow-x: hidden !important;
}

/* Tooltip-like labels on hover when collapsed (optional enhancement) */
body.sidebar-collapsed .sidebar .nav li>a {
    position: relative;
    overflow: visible !important;
}

body.sidebar-collapsed .sidebar .nav li>a::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: #344998;
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(52, 73, 152, 0.3);
}

body.sidebar-collapsed .sidebar .nav li>a:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Ensure collapsed state doesn't affect mobile */
@media (max-width: 991px) {

    body.sidebar-collapsed .sidebar,
    body.sidebar-collapsed .sidebar[data-color="white"],
    body.sidebar-collapsed .sidebar[data-color="white"]:after,
    body.sidebar-collapsed .sidebar-wrapper {
        width: 100% !important;
    }

    body.sidebar-collapsed .main-panel {
        width: 100% !important;
    }

    body.sidebar-collapsed .sidebar .nav p,
    body.sidebar-collapsed .sidebar .nav .caret,
    body.sidebar-collapsed .sidebar .caret {
        display: inline-block !important;
    }

    body.sidebar-collapsed .sidebar .nav li>a {
        justify-content: flex-start !important;
        padding: 12px 15px !important;
        margin: 6px 15px !important;
    }

    body.sidebar-collapsed .sidebar .nav i {
        margin-right: 15px !important;
        width: auto !important;
        text-align: center !important;
    }

    body.sidebar-collapsed .sidebar .nav li .collapse,
    body.sidebar-collapsed .sidebar .nav li .collapsing {
        display: block !important;
    }

    body.sidebar-collapsed .sidebar .collapse .nav,
    body.sidebar-collapsed .sidebar .collapse .dropdown-item {
        display: block !important;
    }

    body.sidebar-collapsed .sidebar .nav li>a::after {
        display: none !important;
    }
}

/* Premium Search Section - Global Standard */
.search-section-premium {
    background: linear-gradient(135deg, #344998 0%, #1e293b 100%) !important;
    padding: 25px !important;
    border-radius: 15px !important;
    border: none !important;
    box-shadow: 0 10px 25px rgba(52, 73, 152, 0.2) !important;
    margin-bottom: 2rem !important;
}

.search-section-premium .premium-label {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
    display: block;
}

.search-section-premium .modern-input {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    height: 48px !important;
}

.search-section-premium .modern-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.search-section-premium .modern-input:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.search-section-premium .modern-input option {
    color: #333 !important;
    background: white !important;
}

.search-section-premium .btn-primary {
    background: #ffffff !important;
    color: #344998 !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    height: 48px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
}

.search-section-premium .btn-light {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    height: 48px !important;
    width: 48px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 12px !important;
}