/**
 * Custom Styles for Application
 * Mobile-first: defaults target small screens, then enhance via min-width queries
 */

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

/* SVG Global Styles */
svg:not(.gantt) {
    margin-top: -3px;
    /* Keep this !important as it's a critical accessibility override */
    pointer-events: none !important;
}

/* HTML & Body Base Setup */
html,
body {
    height: 100%;
}

body {
    overflow: hidden;
    /* Cross-browser scrollbar hiding */
    -ms-overflow-style: none;
    /* IE/Edge */
    scrollbar-width: none;
    /* Firefox */
}

body::-webkit-scrollbar {
    display: none;
    /* WebKit */
}

.link-text {
    color: var(--bs-secondary-color);
    text-decoration: underline;
}

/* ==========================================================================
   LAYOUT COMPONENTS
   ========================================================================== */

/* Layout Wrapper */
.layout-wrapper {
    min-height: 100vh;
}

/* Page Content Container */
.page-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

/* Ensure footer is reserved inside flex layout and not clipped */
.page-content > .footer {
    flex: 0 0 auto;
    margin-top: 0 !important;
    position: static !important;
}

/* Allow footer to grow if inner content adds padding */
.footer {
    height: auto;
    min-height: 46px;
}

/* Use dynamic viewport where supported to avoid mobile 100vh quirks */
@supports (height: 100dvh) {
    .page-content {
        min-height: 100dvh;
    }
}

/* Account for iOS safe area */
@supports (padding: env(safe-area-inset-bottom)) {
    .page-content > .view-scrollbar,
    .page-content > .px-3.view-scrollbar {
        padding-bottom: calc(56px + env(safe-area-inset-bottom));
    }
    .page-content > .footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Mobile: footer participates in layout; reserve space via padding */
@media (max-width: 768px) {
    .page-content > .footer {
        position: static !important;
        bottom: auto;
        left: auto;
        right: auto;
        z-index: 1030;
    }
    .page-content > .view-scrollbar,
    .page-content > .px-3.view-scrollbar {
        padding-bottom: 56px; /* reserve space for footer */
    }
}

/* App Menu Padding */
.simplebar-content .app-menu {
    padding-bottom: 3rem;
}

/* ==========================================================================
   CUSTOM SCROLLBAR SYSTEM
   ========================================================================== */

/* Mobile-first defaults for scrollbars */
.view-scrollbar {
    /* CSS Custom Properties for theming */
    --scrollbar-thumb: var(--bs-secondary, #6c757d);
    --scrollbar-thumb-hover: rgba(var(--bs-secondary-rgb, 108, 117, 125), 0.85);
    --scrollbar-track: rgba(var(--bs-secondary-rgb, 108, 117, 125), 0.18);

    /* Layout Properties */
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;

    /* Firefox Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Page Content Scrollbar Variants */
.page-content>.view-scrollbar,
.page-content>.px-3.view-scrollbar {
    flex: 1 1 auto;
    min-height: 0;
    /* Keep page-level scroll vertical-only; horizontal overflow is clipped */
    overflow-x: hidden;

    /* Provide breathing room so content isn't flush to the bottom */
    padding-bottom: 56px; /* reserve space for footer */
}

/* Dark Theme Scrollbar Adjustments */
html[data-bs-theme="dark"] .view-scrollbar {
    --scrollbar-thumb-hover: rgba(var(--bs-secondary-rgb, 173, 181, 189), 0.78);
    --scrollbar-track: rgba(var(--bs-secondary-rgb, 173, 181, 189), 0.22);
}

/* WebKit Scrollbar Styling (native only) */
.view-scrollbar:not([data-simplebar])::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.view-scrollbar:not([data-simplebar])::-webkit-scrollbar-track {
    background-color: var(--scrollbar-track);
}

.view-scrollbar:not([data-simplebar])::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid var(--scrollbar-track);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.view-scrollbar:not([data-simplebar])::-webkit-scrollbar-thumb:hover,
.view-scrollbar:not([data-simplebar])::-webkit-scrollbar-thumb:active {
    background-color: var(--scrollbar-thumb-hover);
    border-color: rgba(0, 0, 0, 0.05);
}

.view-scrollbar::-webkit-scrollbar-corner {
    background-color: transparent;
}

/* SimpleBar Integration: overlay (absolute) scrollbars that do not consume content width */
.view-scrollbar[data-simplebar] {
    /* Hide native scrollbars and anchor overlay tracks */
    overflow: hidden;
    position: relative;
    scrollbar-width: none; /* Firefox: hide native */
}

/* Hide native WebKit scrollbars when SimpleBar is active */
.view-scrollbar[data-simplebar]::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}

/* Absolute overlay tracks */
.view-scrollbar[data-simplebar] .simplebar-track.simplebar-vertical {
    position: absolute;
    right: 2px;
    top: 2px;
    bottom: 2px;
    width: 10px;
    background-color: var(--scrollbar-track);
    border-radius: 999px;
}

.view-scrollbar[data-simplebar] .simplebar-track.simplebar-horizontal {
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 2px;
    height: 10px;
    background-color: var(--scrollbar-track);
    border-radius: 999px;
}

/* Thumb visuals */
.view-scrollbar[data-simplebar] .simplebar-scrollbar::before {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
    opacity: 0.5;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.view-scrollbar[data-simplebar] .simplebar-scrollbar:hover::before,
.view-scrollbar[data-simplebar] .simplebar-scrollbar.simplebar-visible::before {
    background: var(--scrollbar-thumb-hover);
    opacity: 0.85;
}

/* Prevent SimpleBar from shifting content with padding */
.view-scrollbar[data-simplebar] .simplebar-content-wrapper {
    padding-right: 0 !important;
    padding-bottom: 0 !important;
}

/* Optional: keep content tight to overlay tracks */
.view-scrollbar[data-simplebar] .simplebar-content {
    margin-right: 0 !important;
    margin-bottom: 0 !important;
}

/* ==========================================================================
   BUTTON COMPONENTS
   ========================================================================== */

/* Action bar mobile defaults */
.action-bar>* {
    min-width: 0;
}

/* Modal Icon */
.icon-mdl {
    display: block;
    width: var(--icon-size, 1.25em);
    height: var(--icon-size, 1.25em);
    flex: 0 0 auto;
    fill: currentColor;
    transform: translate(var(--icon-nudge-x, 0.4px), var(--icon-nudge-y, 1.9px));
    font-size: var(--icon-size, 2em);
}

/* Modal Footer - mobile-first: stack buttons */
.modal-footer {
    display: flex;
    gap: 0.2rem;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    padding: 0.7rem 1.25rem;
}

/* Modal buttons - mobile: full width and compact */
.btn-mdl-center {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    line-height: 1;
    font-size: 14px;
    padding: .4rem .6rem;
}

.btn-mdl-center .icon-mdl-btn {
    display: block;
    width: var(--icon-size, 1.25em);
    height: var(--icon-size, 1.25em);
    flex: 0 0 auto;
    fill: currentColor;
    transform: translateY(1.48px);
}

.btn-mdl-center .label-mdl-btn {
    transform: translateY(0.4px);
    line-height: .5;
}

/* Global button icon styling - mobile defaults smaller */
.btn-center {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    line-height: 1;
    font-size: var(--btn-font, 13px);
    --py: .3rem;
    --px: .3rem;
    --icon-size: 1.25rem;
}

.btn-center .icon-btn {
    display: block;
    width: var(--icon-size, 1.25em);
    height: var(--icon-size, 1.25em);
    flex: 0 0 auto;
    fill: currentColor;
    transform: translateY(1px);
    margin-top: -1.9px;
    margin-bottom: 0px;
}

.btn-center .label-btn {
    line-height: 1;
    transform: translateY(0px);
}

.icon-btn.drop-icon-btn {
    transform: translateY(0px);
}

/* DataTables button - mobile baseline */
.btn-dt-center {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: var(--btn-size, 32px);
    height: var(--btn-size, 32px);
    padding: var(--py, 0.95rem) var(--px, 1rem);
    font-size: var(--btn-font, 15px);
    cursor: pointer;
}

.btn-dt-center .icon-dt-btn {
    display: block;
    width: var(--icon-size, 1.25em);
    height: var(--icon-size, 1.25em);
    flex: 0 0 auto;
    fill: currentColor;
    transform: translateY(1.3px) translateX(0px);
}

.btn-dt-center.btn-sm {
    --btn-font: 15px;
    --btn-size: 1.25em;
    --icon-size: 1.35em;
}

/* ==========================================================================
   DATATABLE TOOLBAR COMPONENTS (Mobile-first)
   ========================================================================== */

/* Enhanced Mobile baseline: grid layout (not stacked) with accessibility and transitions */
.dt-toolbar {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto;
    gap: 0.75rem;
    text-align: left;
    margin-bottom: 0.1rem;
    padding: 0.3rem 0;
    position: relative;
    z-index: 10;
    background: transparent;
    border-radius: 0.375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    
    /* Accessibility enhancements */
    outline: none;
    
    /* Minimum spacing constraints */
    min-height: 3rem;
    
    /* Prevent overlapping with other elements */
    isolation: isolate;
}


/* Enhanced responsive behavior with smooth transitions */
.dt-toolbar.inline-mode {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.dt-toolbar-left {
    display: flex;
    align-items: center;
    justify-self: start;
    gap: 0.5rem;
    min-width: 0; /* Prevent flex item overflow */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Accessibility */
    outline: none;
    
    /* Mobile optimization */
    flex-shrink: 0;
}


/* Responsive behavior for left toolbar section */
.dt-toolbar-left.compact-mode {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dt-length {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Minimum spacing constraints */
    min-width: fit-content;
    
    /* Visual feedback */
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
}

.dt-length-select {
    min-width: 4rem;
    justify-self: stretch;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Enhanced accessibility */
    outline: none;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background-color: var(--bs-body-bg, #fff);
    
    /* High contrast support */
    @media (prefers-contrast: high) {
        border-width: 2px;
        border-color: var(--bs-dark, #212529);
    }
}

.dt-length-label {
    font-size: 0.75rem;
    color: var(--bs-secondary, #6c757d);
    font-weight: 500;
    user-select: none;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Accessibility enhancements */
    cursor: default;
    
    /* High contrast support */
    @media (prefers-contrast: high) {
        color: var(--bs-dark, #212529);
        font-weight: 600;
    }
    
    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {
        transition: none;
    }
}

/* Enhanced right section with responsive behavior */
.dt-toolbar-right {
    display: flex;
    justify-self: end;
    align-items: center;
    min-width: 120px;
    max-width: 100%;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Prevent overflow */
    overflow: hidden;
    
    /* Accessibility */
    outline: none;
    
    /* Mobile optimization */
    flex-shrink: 1;
}

/* Responsive behavior for right toolbar section */
.dt-toolbar-right.compact-mode {
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 100%;
}

.dt-search-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 180px; /* Reduced for mobile grid */
    min-width: 120px; /* Ensure minimum usable width */
    position: relative;
}

.dt-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.dt-search {
    width: 100%;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-image: none;
    padding-right: 2.5rem;
}

/* Placeholder and WebKit input resets */
.dt-search::placeholder {
    color: var(--bs-secondary, #6c757d);
    opacity: 0.8;
    font-style: normal;
}

.dt-search::-webkit-search-cancel-button {
    display: none;
}

.dt-search::-webkit-search-decoration {
    display: none;
}

/* Integrated clear button - mobile compact */
.dt-search-clear {
    position: absolute;
    right: 0.25rem;
    top: .884rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--bs-secondary, #6c757d);
    border-radius: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    opacity: 0;
    visibility: hidden;
    z-index: 10;
}

.dt-search-clear .dt-clear-icon {
    width: 0.75rem;
    height: 0.75rem;
    stroke-width: 2;
    transition: inherit;
}

/* Visible when input has content */
.dt-search-clear:not([style*="display: none"]) {
    opacity: 1;
    visibility: visible;
}

.dt-row {
    padding-bottom: 0.75rem;
}

/* ==========================================================================
   ENHANCED TABLE LAYOUT & SCROLLING STYLES
   ========================================================================== */

/* Enhanced wrapper for better table layout */
.dt-enhanced-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--bs-border-radius);
    /* box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); */
}

/* Scroll container enhancements */
.dt-scroll-container {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    border-radius: var(--bs-border-radius);
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--bs-secondary) transparent;
}

.dt-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.dt-scroll-container::-webkit-scrollbar-track {
    background: rgba(var(--bs-secondary-rgb), 0.1);
    border-radius: 4px;
}

.dt-scroll-container::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 4px;
    opacity: 0.7;
}

.dt-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary);
    opacity: 1;
}

/* Universal: make header/body tables share width when scrollX clones the thead */
table.dataTable,
.dataTables_wrapper .dataTables_scrollHead table,
.dataTables_wrapper .dataTables_scrollBody table {
    width: 100% !important;
    margin: 0 !important;
}

/* Desktop/tablet default: fixed layout + nowrap (compact, stable widths) */
table.dataTable.dt-fixed { table-layout: fixed; }
table.dataTable.dt-fixed th,
table.dataTable.dt-fixed td {
    box-sizing: border-box;
    /*white-space: nowrap;*/       /* keep rows single-line on larger screens */
    /* overflow: hidden; */
    padding: .5rem .75rem;     /* ensure identical padding for th/td */
    border-width: 0;
}

/* Mobile: let content breathe — wrap text and relax the layout */
@media (max-width: 968px) {
    table.dataTable.dt-fixed { table-layout: auto; }   /* allows natural column sizing */
    table.dataTable.dt-fixed th,
    table.dataTable.dt-fixed td {
        white-space: normal;                             /* wrap long text */
        word-break: break-word;                          /* prevent overflow on long tokens */
    }

    /* Smooth horizontal panning if the table still needs it */
    .dataTables_wrapper .dataTables_scrollBody {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Optional: nicer child-row presentation for hidden columns on phones */
table.dataTable tr.child td { padding: .5rem .75rem; }

/* Width consistency for tables */
/* .dt-width-consistent {
    table-layout: fixed;
    width: 100%;
} */

/* .dt-width-consistent th,
.dt-width-consistent td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
} */



/* Responsive table enhancements */
/* .dt-responsive-enhanced {
    position: relative;
}

.dt-responsive-enhanced .dataTables_scrollHead {
    overflow: hidden;
}

.dt-responsive-enhanced .dataTables_scrollBody {
    border-top: 1px solid var(--bs-border-color);
} */

/* Header alignment fixes */
.dt-responsive-enhanced .dataTables_scrollHead table {
    margin-bottom: 0;
}

.dt-responsive-enhanced .dataTables_scrollBody table {
    margin-top: 0;
}

/* Ensure proper column alignment */
.dt-responsive-enhanced .dataTables_scrollHead th,
.dt-responsive-enhanced .dataTables_scrollBody td {
    box-sizing: border-box;
}

/* Mobile-specific table enhancements */
@media (max-width: 767.98px) {
    .dt-enhanced-wrapper {
        margin: 0 -0.75rem;
        border-radius: 0;
    }
    
    .dt-scroll-container {
        border-radius: 0;
    }
    
    .dt-width-consistent th,
    .dt-width-consistent td {
        min-width: 120px;
        white-space: normal;
        word-wrap: break-word;
    }
}

/* Accessibility helper (unchanged) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 992px) {
    .dt-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
}



/* ==========================================================================
   PROFILE (Mobile-first defaults)
   ========================================================================== */

.photo-edit-container {
    position: relative;
}

.photo-edit-container .hover-edit-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    padding: .5rem;
    opacity: 0;
    transition: opacity .2s ease-in-out;
}

.btn-edt-photo {
    padding: .3rem .4rem;
    font-size: .8125rem;
    border-radius: 1rem;
}

.btn-edt-banner {
    padding: .3rem .4rem;
    font-size: .8125rem;
    border-radius: 1rem;
}

.btn-edt-photo .icon-btn-edt {
    --icon-size: 1.25rem;
    transform: translateY(1px) translateX(1px);
}

.btn-edt-banner .icon-btn-edt {
    --icon-size: 1.25rem;
    transform: translateY(1px) translateX(1px);
}

.photo-edit-container:hover .hover-edit-overlay,
.photo-edit-container:focus-within .hover-edit-overlay {
    opacity: 1;
}

.photo-edit-container .overlay-bg {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, .35);
    border-radius: inherit;
    opacity: 0;
    transition: opacity .2s ease-in-out;
}

.photo-edit-container:hover .overlay-bg,
.photo-edit-container:focus-within .overlay-bg {
    opacity: 1;
}

/* ==========================================================================
   MODAL (Mobile-first)
   ========================================================================== */

/* .modal:nth-of-type(even) {
    z-index: 1052 ;
}
.modal-backdrop.show:nth-of-type(even){
    z-index: 1053;
} */

.modal-dialog {
    display: flex;
    align-items: center;
    min-height: 90vh;
}

/* Modal Seamless Scrollbar Solution */
.modal-body {
    /* Prevent content width changes when scrollbar appears */
    scrollbar-gutter: stable;
    
    /* Use overlay scrollbar where supported */
    overflow: overlay;
    
    /* Fallback for browsers that don't support overlay */
    overflow-y: auto;
    
    /* Ensure consistent width calculation */
    box-sizing: border-box;
    
    /* Custom scrollbar styling for seamless appearance */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

/* WebKit browsers - overlay scrollbar styling */
.modal-body::-webkit-scrollbar {
    width: 8px;
    /* Use overlay positioning to prevent layout shifts */
    position: absolute;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
    /* Ensure track doesn't affect content width */
    width: 0;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    /* Overlay positioning */
    position: absolute;
    right: 0;
    
    /* Smooth transitions */
    transition: background-color 0.2s ease, opacity 0.2s ease;
    
    /* Initially semi-transparent */
    opacity: 0.6;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
}

.modal-body::-webkit-scrollbar-thumb:active {
    background: rgba(0, 0, 0, 0.7);
    opacity: 1;
}

/* Hide scrollbar corner to maintain clean appearance */
.modal-body::-webkit-scrollbar-corner {
    background: transparent;
}

/* Enhanced modal body for content with fixed width containers */
.modal-body-seamless {
    /* Stable scrollbar gutter prevents layout shifts */
    scrollbar-gutter: stable both-edges;
    
    /* Overlay scrollbar for seamless appearance */
    overflow: overlay;
    overflow-y: auto;
    
    /* Maintain consistent padding regardless of scrollbar */
    padding-right: calc(var(--bs-modal-padding, 1rem) + env(scrollbar-width, 0px));
    
    /* Smooth scrolling behavior */
    scroll-behavior: smooth;
    
    /* Optimize for touch scrolling on mobile */
    -webkit-overflow-scrolling: touch;
}

/* Firefox-specific enhancements */
@-moz-document url-prefix() {
    .modal-body,
    .modal-body-seamless {
        /* Firefox overlay scrollbar */
        overflow: -moz-scrollbars-none;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
    }
}

/* Dark theme modal scrollbar adjustments */
html[data-bs-theme="dark"] .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
}

html[data-bs-theme="dark"] .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

html[data-bs-theme="dark"] .modal-body::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.7);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modal-body::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    html[data-bs-theme="dark"] .modal-body::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(0, 0, 0, 0.2);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .modal-body,
    .modal-body-seamless {
        scroll-behavior: auto;
    }
    
    .modal-body::-webkit-scrollbar-thumb {
        transition: none;
    }
}

/* ==========================================================================
   MODAL SCROLLBAR ENHANCEMENTS
   ========================================================================== */

/* Base modal scrollbar styling */
.modal-body,
.modal-body-seamless {
    /* Custom scrollbar properties */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* WebKit scrollbar styling for modals */
.modal-body::-webkit-scrollbar,
.modal-body-seamless::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track,
.modal-body-seamless::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb,
.modal-body-seamless::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.6;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.modal-body-seamless::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
}

/* Dark theme modal scrollbar adjustments */
html[data-bs-theme="dark"] .modal-body,
html[data-bs-theme="dark"] .modal-body-seamless {
    scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

html[data-bs-theme="dark"] .modal-body::-webkit-scrollbar-thumb,
html[data-bs-theme="dark"] .modal-body-seamless::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
}

html[data-bs-theme="dark"] .modal-body::-webkit-scrollbar-thumb:hover,
html[data-bs-theme="dark"] .modal-body-seamless::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Responsive modal scrollbar adjustments */
@media (max-width: 576px) {
    .modal-body,
    .modal-body-seamless {
        /* Larger scrollbar for better touch interaction on mobile */
        scrollbar-width: auto;
    }
    
    .modal-body::-webkit-scrollbar,
    .modal-body-seamless::-webkit-scrollbar {
        width: 12px;
    }
    
    .modal-body::-webkit-scrollbar-thumb,
    .modal-body-seamless::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.4);
        border-radius: 6px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .modal-body,
    .modal-body-seamless {
        /* Medium scrollbar for tablet devices */
        scrollbar-width: thin;
    }
    
    .modal-body::-webkit-scrollbar,
    .modal-body-seamless::-webkit-scrollbar {
        width: 10px;
    }
}

@media (min-width: 769px) {
    .modal-body,
    .modal-body-seamless {
        /* Thin scrollbar for desktop - most seamless appearance */
        scrollbar-width: thin;
    }
    
    .modal-body::-webkit-scrollbar,
    .modal-body-seamless::-webkit-scrollbar {
        width: 8px;
    }
    
    /* Enhanced overlay effect on desktop */
    .modal-body::-webkit-scrollbar-thumb,
    .modal-body-seamless::-webkit-scrollbar-thumb {
        opacity: 0.4;
    }
    
    .modal-body:hover::-webkit-scrollbar-thumb,
    .modal-body-seamless:hover::-webkit-scrollbar-thumb {
        opacity: 0.8;
    }
}

/* Safari-specific enhancements */
@supports (-webkit-appearance: none) {
    .modal-body,
    .modal-body-seamless {
        /* Safari overlay scrollbar optimization */
        overflow: overlay;
        -webkit-overflow-scrolling: touch;
    }
}

/* Edge/Chromium-specific optimizations */
@supports (scrollbar-gutter: stable) {
    .modal-body,
    .modal-body-seamless {
        /* Use stable scrollbar gutter where supported */
        scrollbar-gutter: stable;
    }
}

/* Fallback for older browsers */
@supports not (scrollbar-gutter: stable) {
    .modal-body,
    .modal-body-seamless {
        /* Fallback: add right padding to compensate for scrollbar */
        padding-right: calc(var(--bs-modal-padding, 1rem) + 8px);
    }
    
    .modal-body:not(:hover),
    .modal-body-seamless:not(:hover) {
        /* Hide scrollbar when not hovering on older browsers */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .modal-body:not(:hover)::-webkit-scrollbar,
    .modal-body-seamless:not(:hover)::-webkit-scrollbar {
        display: none;
    }
}

/* Reduced motion preferences for modal scrollbars */
@media (prefers-reduced-motion: reduce) {
    .modal-body,
    .modal-body-seamless {
        scroll-behavior: auto;
    }
    
    .modal-body::-webkit-scrollbar-thumb,
    .modal-body-seamless::-webkit-scrollbar-thumb {
        transition: none;
    }
}


/* ==========================================================================
   RESPONSIVE ENHANCEMENTS (min-width)
   ========================================================================== */

/* ≥360px: slightly larger controls */
@media (min-width: 360px) {
    .dt-length-select {
        min-width: 4.5rem;
        font-size: 0.875rem;
    }

    .dt-length-label {
        font-size: 0.875rem;
    }

    .dt-search {
        font-size: 0.875rem;
    }

    .dt-search-clear {
        right: 0.375rem;
        width: 1.375rem;
        height: 1.375rem;
    }

    .dt-search-clear .dt-clear-icon {
        width: 0.8125rem;
        height: 0.8125rem;
    }
}

/* ≥421px: modal footer returns to row layout */
@media (min-width: 421px) {
    .modal-footer {
        flex-direction: row;
        gap: 0.3rem;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
    }

    .btn-mdl-center {
        font-size: var(--btn-font, 14px);
        padding: var(--py, 0.5rem) var(--px, 1rem);
        width: auto;
    }
}

/* ≥521px: global buttons scale up */
@media (min-width: 521px) {
    .btn-center {
        font-size: var(--btn-font, 15px);
        white-space: nowrap;
        --py: .5rem;
        --px: .9rem;
        --icon-size: 1.35rem;
    }

    .btn-center .label-btn {
        line-height: 1;
        transform: translateY(1px);
    }

    .modal-footer {
        justify-content: center;
        align-items: stretch;
    }

    .modal-footer .btn-mdl-center {
        flex: end;
    }
}

/* ≥576px: side-by-side toolbar with enhanced responsive behavior */
@media (min-width: 576px) {
    .dt-toolbar {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.75rem 0;
        grid-template-columns: none;
        grid-template-rows: none;
        
        /* Enhanced spacing constraints */
        min-height: 3.5rem;
    }
    
    /* Automatic inline mode activation */
    .dt-toolbar.inline-mode {
        gap: 1.5rem;
    }

    .dt-toolbar-left {
        justify-self: start;
        flex-shrink: 0;
    }

    .dt-toolbar-right {
        justify-self: end;
        min-width: 150px;
        max-width: 100%;
        flex-shrink: 1;
    }

    .dt-search-wrapper {
        max-width: 200px;
        min-width: 120px;
    }

    .dt-length-label {
        font-size: 0.8125rem;
    }
  
}

/* ≥768px: enhanced spacing and dynamic element rearrangement */
@media (min-width: 768px) {
    .dt-toolbar {
        gap: 1.25rem;
        padding: 0.75rem 0;
        min-height: .4rem;
        
        /* Enhanced z-index management */
        z-index: 15;
    }
    
    /* Dynamic element rearrangement based on available space */
    .dt-toolbar.space-constrained {
        gap: 0.75rem;
    }
    
    .dt-toolbar.space-abundant {
        gap: 2rem;
    }

    .dt-toolbar-right {
        min-width: 180px;
        max-width: 300px;
    }

    .dt-search-wrapper {
        max-width: 250px;
        min-width: 150px;
        
        /* Enhanced transitions */
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .dt-search-clear {
        right: 0.375rem;
        width: 1.375rem;
        height: 1.375rem;
        
        /* Enhanced interaction feedback */
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* .dt-search-clear:hover {
        background: rgba(var(--bs-danger-rgb, 220, 53, 69), 0.1);
        color: var(--bs-danger, #dc3545);
        transform: translateY(-50%) scale(1.1);
    } */

    .dt-search-clear .dt-clear-icon {
        width: 0.8125rem;
        height: 0.8125rem;
    }

    .modal-footer {
        width: 100%;
        justify-content: center;
    }

    .modal-dialog {
        align-items: flex-start;
        padding: 0;
        min-height: auto;
    }
    
}

/* ≥992px: desktop enhancements with full functionality */
@media (min-width: 992px) {
    .dt-toolbar {
        gap: 1.5rem;
        padding: .5rem 0;
        min-height: .5rem;
        
        /* Maximum z-index for desktop */
        z-index: 20;
    }
    
    /* Full inline mode with optimal spacing */
    .dt-toolbar.inline-mode {
        gap: 2.5rem;
    }
    
    .dt-toolbar-right {
        min-width: 220px;
        max-width: 400px;
    }
    
    .dt-search-wrapper {
        max-width: 300px;
        min-width: 180px;
    }
    
    
    
    .dt-search:focus {
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb, 13, 110, 253), 0.15);
    }
    

    .modal-dialog {
        align-items: flex-start;
        padding-top: 2rem;
        min-height: auto;
        max-height: 90vh;
    }

    .modal-footer {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }
}

/* ≥1200px: large desktop optimizations with maximum functionality */
@media (min-width: 1200px) {
    .dt-toolbar {
        gap: 2rem;
        padding: .3rem 0;
        min-height: .5rem;
        
        /* Premium desktop experience */
        z-index: 25;
    }
    
    .dt-toolbar.inline-mode {
        gap: 3rem;
    }
    
    .dt-toolbar-right {
        min-width: 250px;
        max-width: 500px;
    }
    
    .dt-search-wrapper {
        max-width: 350px;
        min-width: 200px;
    }
    
}

/* ≥1400px: extra large desktop with maximum spacing */
@media (min-width: 1400px) {
    .dt-toolbar {
        gap: 2.5rem;
        padding: .3rem 0;
        min-height: .5rem;
    }
    
    .dt-toolbar.inline-mode {
        gap: 4rem;
    }
    
    .dt-search-wrapper {
        max-width: 400px;
        min-width: 220px;
    }
}

/* ==========================================================================
    CUSTOMER SPECIFIC STYLES
   ========================================================================== */
    .customer-summary__name {
        font-size: 1.625rem;
        font-weight: 600;
    }

    .customer-summary__meta {
        line-height: 1.4;
    }

    .customer-summary__meta-label {
        font-weight: 600;
        color: var(--bs-secondary-color, #6c757d);
    }

    .customer-summary .btn-link {
        color: var(--bs-primary);
    }

    .customer-summary .btn-link:focus,
    .customer-summary .btn-link:hover {
        text-decoration: underline;
    }

    .customer-summary__badge {
        display: inline-flex;
        align-items: center;
    }

    .customer-summary__badge > .badge {
        margin: 0;
    }

    .customer-sidebar .nav-link {
        /* border-radius: 0.75rem; */
        padding: 0.75rem 1rem;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .customer-sidebar .nav-link.active {
        background-color: var(--bs-primary-bg-subtle, rgba(58, 115, 248, 0.12));
        color: var(--bs-primary, #3a73f8);
    }

    .customer-sidebar .nav-link small {
        font-size: 0.75rem;
    }

    .preview-definition {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 0.75rem 1.5rem;
        margin-bottom: 0;
    }

    .preview-definition__item {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    .preview-definition dt {
        font-size: 0.75rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--bs-secondary-color, #6c757d);
        margin-bottom: 0;
    }

    .preview-definition dd {
        margin-bottom: 0;
        font-weight: 500;
        color: var(--bs-body-color, #212529);
    }

    .copy-field.btn-link {
        font-size: 0.75rem;
    }

    .copy-field.btn-outline-secondary {
        font-size: 0.75rem;
        line-height: 1.5;
    }

    /* Dynamic Address Tabs Styling */
    .address-tab-wrapper {
        position: relative;
        display: inline-block;
        margin-bottom: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .address-tab-wrapper .nav-link {
        border-radius: 0.375rem;
        margin-right: 0;
        padding-right: 2.5rem; /* Add space for the X button */
        display: block;
    }
    
    .address-tab-wrapper .remove-address-btn {
        position: absolute;
        top: 0.46rem;
        right: 0.5rem;
        border-radius: 50%;
        padding: 0.25rem;
        font-size: 0.7rem;
        line-height: 1;
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }
    
    .address-tab-wrapper .remove-address-btn:hover {
        background-color: #dc3545;
        border-color: #dc3545;
        color: white;
    }
    
    /* Edit Modal Address Tabs Styling */
    .address-tab-wrapper-edit {
        position: relative;
        display: inline-block;
        margin-bottom: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .address-tab-wrapper-edit .nav-link {
        border-radius: 0.375rem;
        margin-right: 0;
        padding-right: 2.5rem; /* Add space for the X button */
        padding-top: 0.5rem;
        display: block;
    }
    
    .address-tab-wrapper-edit .remove-address-btn-edit {
        position: absolute;
        top: 0.46rem;
        right: 0.5rem;
        border-radius: 50%;
        padding: 0.25rem;
        font-size: 0.7rem;
        line-height: 1;
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }
    
    .address-tab-wrapper-edit .remove-address-btn-edit:hover {
        background-color: #dc3545;
        border-color: #dc3545;
        color: white;
    }

    #add-address-btn, #add-address-btn-edit {
        border-radius: 0.375rem;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    #add-address-btn:hover, #add-address-btn-edit:hover {
        background-color: var(--bs-primary);
        border-color: var(--bs-primary);
        color: white;
    }

    @media (min-width: 992px) {
        .customer-sidebar {
            position: sticky;
            top: 1rem;
        }
    }



/* ==========================================================================
   ACCESSIBILITY AND MOTION PREFERENCES
   ========================================================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dt-toolbar {
        border: 2px solid var(--bs-dark, #212529);
        background: var(--bs-light, #f8f9fa);
    }
    
    .dt-toolbar:focus-within,
    .dt-toolbar-left:focus-within,
    .dt-toolbar-right:focus-within {
        outline-width: 3px;
        outline-color: var(--bs-dark, #212529);
    }
    
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .dt-toolbar,
    .dt-toolbar-left,
    .dt-toolbar-right,
    .dt-length,
    .dt-length-select,
    .dt-length-label,
    .dt-search-wrapper,
    .dt-search-clear {
        transition: none;
        transform: none;
    }
    
}

/* ==========================================================================
   RESPONSIVE UTILITY CLASSES FOR DYNAMIC BEHAVIOR
   ========================================================================== */

/* Space management utility classes */
.dt-toolbar.space-constrained {
    gap: 0.5rem !important;
}

.dt-toolbar.space-abundant {
    gap: 2rem !important;
}

.dt-toolbar.compact-mode .dt-toolbar-left,
.dt-toolbar.compact-mode .dt-toolbar-right {
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Interactive state classes */
.dt-toolbar.interactive-enhanced:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Keyboard navigation enhancement */
.dt-toolbar.keyboard-focused {
    outline: 3px solid var(--bs-primary, #0d6efd);
    outline-offset: 3px;
}

/* ==========================================================================
   ENHANCED DATATABLE TOOLBAR COMPONENTS (Mobile-first)
   ========================================================================== */

/* Modal-specific table header styling to prevent squishing */
/* .modal .table thead th {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 100px;
    vertical-align: middle; */
    /* border-bottom: 2px solid var(--bs-border-color); */
/* } */

/* Specific styling for tables inside modal bodies */
/* .modal-body .table thead th {
    padding: 0.875rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: center; */
    /* background-color: var(--bs-light); */
    /* border-bottom: 2px solid var(--bs-primary); */
/* } */

/* Enhanced spacing for modal tables */
/* .modal .table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.modal .table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--bs-border-color-translucent);
} */


/* Responsive adjustments for modal tables */
@media (max-width: 767.98px) {
    .modal .table thead th {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .modal .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }

}

/* Ensure modal tables don't interfere with external DataTables */
.modal .table:not(.dataTable) thead th {
    position: relative;
    background-clip: padding-box;
}

/* Prevent modal table styles from affecting external DataTables */
/* .dataTables_wrapper:not(.modal .dataTables_wrapper) .table thead th { */
    /* Reset any modal-specific styles for external tables */
    /* padding: 0.75rem;
    font-size: inherit;
    min-width: auto; */
    /* background-color: transparent; */
/* } */

/* Modal card body adjustments for better table display */
.modal .card-body {
    padding: 1.25rem;
    overflow-x: auto;
}

/* .modal .card-body .table-responsive {
    border-radius: var(--bs-border-radius);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
} */

/* THEME, PRINT, ACCESSIBILITY */

/* Dark theme support */
html[data-bs-theme="dark"] .dt-length-label {
    color: var(--bs-secondary, #adb5bd);
}

html[data-bs-theme="dark"] .dt-search::placeholder {
    color: var(--bs-secondary, #adb5bd);
}

/* Print styles - hide toolbar when printing */
@media print {
    .dt-toolbar {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dt-toolbar {
        border-bottom-width: 2px;
    }

    .dt-length-select:focus,
    .dt-search:focus {
        outline: 2px solid;
        outline-offset: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .dt-length-select,
    .dt-search {
        transition: none;
    }
}



/* ==========================================================================
   FLATPICKR
   ========================================================================== */

.flatpickr-calendar .flatpickr-months{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  width: 100%;
  overflow: visible !important;                      /* fix: avoid clipping the center controls */
}

/* Stop absolute positioning so flex can allocate space */
.flatpickr-calendar .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-next-month{
  position: static !important;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  transform: none !important;
  border-radius: 6px;
  color: #4b5563;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.flatpickr-calendar .flatpickr-prev-month:hover,
.flatpickr-calendar .flatpickr-next-month:hover{
  background-color: rgba(99, 102, 241, 0.08);
  color: #4338ca;
}

/* Center group holds Month select + Year pill */
.flatpickr-calendar .flatpickr-months .flatpickr-month{
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;                                       /* prevents overflow squeeze */
  height: auto;
  position: relative;
  overflow: visible;
}

.flatpickr-calendar .flatpickr-current-month{
  position: static;
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
  font-size: 14px !important;
  font-weight: 600;
  color: inherit;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
}

/* Month label fallback when dropdown is not available */
.flatpickr-calendar .flatpickr-current-month .cur-month{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 32px;
  line-height: 32px;
  padding: 0 16px;
  border: 1px solid #d5daeb;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  flex: 0 0 auto;
  white-space: nowrap;
}

.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months ~ .cur-month{
  display: none;
}

/* Month dropdown chip */
.flatpickr-calendar .flatpickr-monthDropdown-months{
  box-sizing: border-box;
  display: inline-block;
  min-width: 120px;                                   /* readable month width */
  height: 32px;
  line-height: 15px;
  padding: 8px 42px 8px 12px !important;
  border: 1px solid #d5daeb !important;
  border-radius: 6px !important;
  background-color: #fff !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'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 4px center !important;
  background-size: 20px 20px !important;
  color: #1f2937 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  flex: 0 1 auto;
  flex-shrink: 0;
  font-weight: 500 !important;
  cursor: pointer;
}

.flatpickr-calendar .flatpickr-monthDropdown-months::-ms-expand{
  display: none;
}

/* Year spinner toggle */
.flatpickr-calendar .flatpickr-current-month .numInputWrapper{
  position: relative;
  height: 32px;
  width: 71px;
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #d5daeb;
  border-radius: 6px;
  background: #fff;
  flex: 0 0 auto;
  padding-right: 0;
  overflow: hidden;
}

.flatpickr-calendar .flatpickr-current-month .numInputWrapper input.cur-year{
  flex: 1 1 auto;
  min-width: 10px;
  padding: 5px 10px !important;
  height: 100%;
  border: 0;
  background: transparent;
  font-weight: 500 !important;
  line-height: 32px;
  color: inherit;
  text-align: start;
}

.flatpickr-calendar .flatpickr-current-month .numInputWrapper span{
  position: absolute;
  right: 0;
  width: 21px;
  height: 50%;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.9;
  pointer-events: auto;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  border-left: 1px solid #d5daeb;
  background-color: inherit;
}

/* Year spinner icons */
.flatpickr-calendar .flatpickr-current-month .numInputWrapper .arrowUp,
.flatpickr-calendar .flatpickr-current-month .numInputWrapper .arrowDown{
  position: absolute;
}

.flatpickr-calendar .flatpickr-current-month .numInputWrapper .arrowUp{
  top: 0;
  border-bottom: 1px solid #d5daeb;
}

.flatpickr-calendar .flatpickr-current-month .numInputWrapper .arrowDown{
  bottom: 0;
}

.flatpickr-calendar .flatpickr-current-month .numInputWrapper:hover .arrowUp,
.flatpickr-calendar .flatpickr-current-month .numInputWrapper:hover .arrowDown,
.flatpickr-calendar .flatpickr-current-month .numInputWrapper:focus-within .arrowUp,
.flatpickr-calendar .flatpickr-current-month .numInputWrapper:focus-within .arrowDown{
  opacity: 1;
  pointer-events: auto;
}

.flatpickr-calendar .flatpickr-current-month .numInputWrapper .arrowUp:hover,
.flatpickr-calendar .flatpickr-current-month .numInputWrapper .arrowDown:hover{
  opacity: 1;
  background-color: rgba(99, 102, 241, 0.08);
}

.flatpickr-prev-month:hover, .flatpickr-next-month:hover{ background: #d1d5da !important;}
html[data-bs-theme="dark"] .flatpickr-prev-month:hover{ background: #6e6e6e !important;}
html[data-bs-theme="dark"] .flatpickr-next-month:hover{background: #6e6e6e !important;}

.flatpickr-prev-month svg { fill: #3b3b3b !important;} 
.flatpickr-next-month svg{ fill: #3b3b3b !important;}
.flatpickr-prev-month:hover svg{ fill: #5a5a5a !important; }
.flatpickr-next-month:hover svg{ fill: #5a5a5a !important; }

html[data-bs-theme="dark"] .flatpickr-prev-month svg{ fill: #bebebe !important;}
html[data-bs-theme="dark"] .flatpickr-next-month svg{ fill: #bebebe !important;}
html[data-bs-theme="dark"] .flatpickr-prev-month:hover svg{ fill: #bebebe !important; }
html[data-bs-theme="dark"] .flatpickr-next-month:hover svg{ fill: #bebebe !important; }


/* Represent arrow chevrons with subtle caret */
/* Update borders below to change spinner chevron appearance */
.flatpickr-calendar .flatpickr-current-month .numInputWrapper .arrowUp:after,
.flatpickr-calendar .flatpickr-current-month .numInputWrapper .arrowDown:after{
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  margin: 0;
}

.flatpickr-calendar .flatpickr-current-month .numInputWrapper .arrowUp:after{
  border-bottom: 6px solid #4b5563;
}

.flatpickr-calendar .flatpickr-current-month .numInputWrapper .arrowDown:after{
  border-top: 6px solid #4b5563;
}

/* kill native number spinners (Chrome/Edge/Firefox) so flatpickr arrows handle the control */
.flatpickr-calendar .flatpickr-current-month input.cur-year::-webkit-outer-spin-button,
.flatpickr-calendar .flatpickr-current-month input.cur-year::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }
.flatpickr-calendar .flatpickr-current-month input.cur-year{ -moz-appearance: textfield; }

.flatpickr-day.prevMonthDay:hover, .flatpickr-day.nextMonthDay:hover{
    background: transparent !important;
}

.flatpickr-weekdays{
  background:#e6e6e6 !important;
}

html[data-bs-theme="dark"] .flatpickr-weekdays{
  background:#5f5f5f !important;
}

/* Dark mode mirrors */
html[data-bs-theme="dark"] .flatpickr-current-month .cur-month,
html[data-bs-theme="dark"] .flatpickr-monthDropdown-months{
  background:#1f2937 !important;
  border-color:#4b5563 !important;
  color:#dbdcdd !important;
}

html[data-bs-theme="dark"] .flatpickr-monthDropdown-months{
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 4px center !important;
    background-size: 20px 20px !important;
}

html[data-bs-theme="dark"] .flatpickr-current-month .numInputWrapper{
    background:#1f2937;
    border-color:#4b5563;
    color:#dbdcdd !important;
}

html[data-bs-theme="dark"] .flatpickr-current-month .numInputWrapper span{
  border-color:#4b5563;
}

html[data-bs-theme="dark"] .flatpickr-current-month .numInputWrapper .arrowUp{
  border-bottom-color:#4b5563;
}

html[data-bs-theme="dark"] .flatpickr-weekday{
  color:#dbdcdd !important;
}
html[data-bs-theme="dark"] .flatpickr-day{
  color:#dbdcdd !important;
}
html[data-bs-theme="dark"] .flatpickr-day:hover{
  color:#5a5a5a !important;
}

html[data-bs-theme="dark"] .flatpickr-day.prevMonthDay{
    color:#6d727a !important;
}
html[data-bs-theme="dark"] .flatpickr-day.prevMonthDay:hover,
html[data-bs-theme="dark"] .flatpickr-day.nextMonthDay:hover{
    background: transparent !important;  
}

html[data-bs-theme="dark"] .flatpickr-day.nextMonthDay{
    color:#6d727a !important;
}


html[data-bs-theme="dark"] .flatpickr-calendar{
  background:#272c31;
  /* border: 1px solid #e4e7f2;  */
}

/* Small screens keep proportions */
@media (max-width:640px){
  .flatpickr-calendar .flatpickr-months{ gap: 6px; padding: 8px; }
  .flatpickr-calendar .flatpickr-prev-month,
  .flatpickr-calendar .flatpickr-next-month{ width:28px; height:28px; flex:0 0 28px; }
  .flatpickr-calendar .flatpickr-monthDropdown-months,
  .flatpickr-calendar .flatpickr-current-month .cur-month,
  .flatpickr-calendar .flatpickr-current-month .numInputWrapper{ height:28px; line-height:28px; }
  .flatpickr-calendar .flatpickr-current-month .cur-month{ min-width: 104px; padding: 0 14px; }
  .flatpickr-calendar .flatpickr-monthDropdown-months{ 
    min-width: 104px; 
    padding: 0 32px 0 10px !important; background-position: right 10px center !important; background-size: 16px 16px !important; }
  .flatpickr-calendar .flatpickr-current-month .numInputWrapper input.cur-year{ min-width: 52px; line-height: 28px; }
  .flatpickr-calendar .flatpickr-current-month .numInputWrapper{ padding-right: 0; }
  .flatpickr-calendar .flatpickr-current-month .numInputWrapper span{ width: 24px; }
}




/* ==========================================================================
   Order Preview Modal
   ========================================================================== */
.order-preview {
    font-size: 0.95rem;
}

.order-preview__hero {
    position: relative;
}

.order-preview__hero-bg {
    position: absolute;
    inset: 0;
    /* background: linear-gradient(135deg, rgba(var(--bs-primary-rgb, 13, 110, 253), 0.12), rgba(var(--bs-info-rgb, 13, 202, 240), 0.12)); */
}

.order-preview__hero .card-body {
    position: relative;
    z-index: 1;
}

.order-preview__title {
    font-weight: 600;
}

.order-preview__avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    /* background: linear-gradient(135deg, var(--bs-primary, #0d6efd), var(--bs-info, #0dcaf0)); */
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.5rem;
    /* box-shadow: 0 0.6rem 1.5rem rgba(13, 110, 253, 0.22); */
}

.order-preview__meta-item span {
    font-weight: 500;
}

.progress-thin {
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
}

.progress-thin .progress-bar {
    border-radius: 999px;
}

.order-preview__progress small {
    letter-spacing: 0.04em;
}

.order-preview__method {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.order-preview__stat .card-body {
    padding: .1rem 1.25rem;
}

.order-preview__stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* box-shadow: inset 0 0 0 1px rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.65); */
}

.order-preview__stat-icon .stat-icon{
    transform: translateY(1.5px);
}

.order-preview__stat-label {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.order-preview__stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.order-preview__panel .card-body {
    padding: 1rem 1.5rem;
}

.order-preview__detail {
    padding: 0.85rem 0;
    border-bottom: 1px dashed rgba(var(--bs-border-color-rgb, 222, 226, 230), 0.6);
}

.order-preview__detail:first-child {
    padding-top: 0;
}

.order-preview__detail:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.order-preview__detail-info {
    flex: 1 1 auto;
}

.order-preview__detail-value {
    font-weight: 600;
    color: var(--bs-body-color);
    word-break: break-word;
}

.order-preview__detail-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); */
}

.order-preview__detail-icon svg{
    transform: translateY(1.5px);
}

.order-preview__stat-row .card {
    border: 1px solid rgba(var(--bs-border-color-rgb, 222, 226, 230), 0.6);
}

.order-preview__panel {
    border: 1px solid rgba(var(--bs-border-color-rgb, 222, 226, 230), 0.6);
}

.order-preview .btn-outline-secondary {
    border-radius: 999px;
    padding-inline: 0.75rem;
}

.order-preview .btn-outline-secondary svg {
    pointer-events: none;
}

.order-preview__detail a.order-preview__detail-value {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.order-preview__detail a.order-preview__detail-value:hover {
    color: var(--bs-primary);
}



@media (max-width: 575.98px) {
    .order-preview__avatar {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .order-preview__panel .card-body {
        padding: 1.25rem;
    }
}

/* html[data-bs-theme="dark"] .order-preview__hero-bg {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb, 120, 80, 255), 0.32), rgba(var(--bs-info-rgb, 13, 202, 240), 0.22));
} */

html[data-bs-theme="dark"] .order-preview__stat-row .card,
html[data-bs-theme="dark"] .order-preview__panel {
    border-color: rgba(148, 163, 184, 0.35);
}

html[data-bs-theme="dark"] .order-preview__detail {
    border-color: rgba(148, 163, 184, 0.35);
}

html[data-bs-theme="dark"] .order-preview__detail-icon {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.6);
}

/* ==========================================================================
   PROGRESS LOADER
   ========================================================================== */

.loader-block {
    display: none;
    text-align: center;
    /* padding: 1.5rem 1rem; */
    opacity: 0;
}

.loader-block.is-visible {
    display: block;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.loader-block.is-visible.is-fading {
    opacity: 0;
}

.loader-progress {
    max-width: 320px;
    margin: 0;
}

.loader-progress__track {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.12);
    overflow: hidden;
}

.loader-progress__fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--bs-primary, #0d6efd), var(--bs-info, #0dcaf0));
    transition: width 0.4s ease;
}


html[data-bs-theme="dark"] .loader-progress__track {
    background: rgba(var(--bs-primary-rgb, 120, 80, 255), 0.25);
}

/* ====== LOADER FOR MODAL */

.loader-modal-block {
    display: none;
    text-align: center;
    /* padding: 1.5rem 1rem; */
    opacity: 0;
}

.loader-modal-block.is-visible {
    display: block;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.loader-modal-block.is-visible.is-fading {
    opacity: 0;
}

.loader-modal-progress {
    max-width: 320px;
    margin: 0;
}

html[data-bs-theme="dark"] .loader-progress__track {
    background: rgba(var(--bs-primary-rgb, 120, 80, 255), 0.25);
}

/* ====== Horizontal Scrollable Nav Tabs Styling ====== */
.nav-tabs-scroll-container {
    position: relative;
    margin-bottom: 1rem;
}

.nav-tabs-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.nav-tabs-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.nav-tabs-scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.nav-tabs-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Ensure nav items don't shrink and maintain proper spacing */
.nav-tabs-scroll-container .nav-tabs {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0;
}

.nav-tabs-scroll-container .nav-item {
    margin-bottom: -1px;
}

.nav-tabs-scroll-container .nav-link {
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
    border: 1px solid transparent;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

/* Responsive adjustments */
/* Keep horizontal scroll gestures within the tab scroller on mobile/tablet */
@media (max-width: 991.98px) {
    .nav-tabs-scroll-container {
        max-width: 100%;
        overscroll-behavior-x: contain;
    }
}
@media (max-width: 768px) {
    .nav-tabs-scroll-container .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* For preview modal card - 3 col */
.col3-definition {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 0.8rem;
    margin-bottom: 0;
}

.col3-definition__item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.col3-definition dt {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: 0;
}

.col3-definition dd {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--bs-body-color, #212529);
}

/* For preview modal card - 2 col */
.col2-definition {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem 0.8rem;
    margin-bottom: 0;
}

.col2-definition__item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.col2-definition dt {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: 0;
}

.col2-definition dd {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--bs-body-color, #212529);
}

/* ==========================================================================
   OVERRIDES: Page Content & Footer Flow
   ========================================================================== */

/* Ensure the page area uses dynamic viewport height for mobile */
.page-content {
    min-height: 100dvh;
}

/* Make the inner scroll area a flex column so footer can sit at bottom */
.page-content > .view-scrollbar,
.page-content > .px-3.view-scrollbar {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0;
}

/* Let the main content take available space above the footer */
.page-content > .view-scrollbar > .container-fluid {
    flex: 1 0 auto;
}

/* Footer inside content: non-fixed, non-shrinking, minimum height */
.page-content > .view-scrollbar > .footer {
    position: static !important;
    flex: 0 0 auto;
    flex-shrink: 0;
    margin-top: 0 !important;
    height: auto;
    min-height: 46px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--bs-body-bg, #fff);
}

/* If you previously added a mobile fixed footer, neutralize it here */
@media (max-width: 768px) {
    .page-content > .footer,
    .page-content > .view-scrollbar > .footer {
        position: static !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
    }
    /* Also remove extra padding reserved for fixed footer */
    .page-content > .view-scrollbar,
    .page-content > .px-3.view-scrollbar {
        padding-bottom: 0 !important;
    }
}

/* ==========================================================================
   OVERRIDES: Quill
   ========================================================================== */

/* Quill resizable wrapper + handle */
.quill-wrapper {
    position: relative;
    border: 1px solid var(--bs-border-color);
    /* border-radius: .5rem; */
    background: var(--bs-body-bg);
    padding-bottom: 14px;
}
/* Quill adds its own border; hide it so wrapper controls the outline */
.quill-wrapper .ql-container.ql-snow {
    border: none;
    border-radius: .5rem .5rem 0 0;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    position: relative;
    min-height: 120px;
}
.quill-wrapper .ql-editor {
    color: var(--bs-body-color);
}
.quill-wrapper .ql-toolbar.ql-snow {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}
.quill-resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 14px;
    cursor: ns-resize;
    background: var(--bs-secondary-bg);
    border-top: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
    z-index: 10;
}
.quill-wrapper.dragging .quill-resize-handle {
    background: var(--bs-tertiary-bg);
}
/* Center "grip" */
.quill-resize-handle::before {
    content: '';
    width: 24px;
    height: 6px;
    border-radius: 3px;
    background:
        linear-gradient(var(--bs-border-color),var(--bs-border-color)) center 0/100% 2px no-repeat,
        linear-gradient(var(--bs-border-color),var(--bs-border-color)) center 2px/100% 2px no-repeat,
        linear-gradient(var(--bs-border-color),var(--bs-border-color)) center 4px/100% 2px no-repeat;
}
.ql-snow .ql-stroke {
    stroke: var(--bs-body-color);
}
.ql-snow .ql-fill {
    fill: var(--bs-body-color);
}
.ql-snow .ql-picker-options {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

/* Quill size picker: show pixel values instead of labels like "Normal" */
.ql-snow .ql-picker.ql-size .ql-picker-label::before { content: '16px'; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="12px"]::before { content: '12px'; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14px"]::before { content: '14px'; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="16px"]::before { content: '16px'; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="18px"]::before { content: '18px'; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="24px"]::before { content: '24px'; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="32px"]::before { content: '32px'; }
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12px"]::before { content: '12px'; }
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before { content: '14px'; }
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16px"]::before { content: '16px'; }
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18px"]::before { content: '18px'; }
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24px"]::before { content: '24px'; }
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="32px"]::before { content: '32px'; }



/* ==========================================================================
   RESERVED FOR SETTINGS PAGE | WILL BE USED FOR SECONDARY SIDEBAR IF NECESSARY
   ========================================================================== */

.app-menu-second{
    list-style:none;
    margin:0;
    padding:0;
    width:100%;
}
.app-menu-second .menu-item-second{
    position:relative;
    list-style:none;
}
.app-menu-second .menu-link-second{
    display:flex;
    align-items:center;
    gap:.5rem;
    padding:.5rem .75rem;
    text-decoration:none;
    color:var(--bs-body-color,#212529);
}
.app-menu-second .menu-link-second.active{
    color:var(--bs-primary,#3a73f8);
    font-weight:600;
}
.app-menu-second .menu-icon-second{
    text-align:center;
    width:1.75rem;
    flex:0 0 1.75rem;
}
.app-menu-second .menu-text-second{
    flex:1 1 auto;
    font-size: .875rem;
}
.app-menu-second .menu-arrow-second{
    margin-left:auto;
    display:inline-block;
    transition:transform .2s;
}
.app-menu-second .menu-arrow-second::before{
    content: "\f0142";
    font-family: "Material Design Icons";
}
.app-menu-second .menu-link-second[aria-expanded='true'] .menu-arrow-second{
    transform:rotate(90deg);
}
.app-menu-second .sub-menu-second{
    padding-left:1rem;
    margin:0;
    list-style:none;
}