/**
 * Custom CSS Stylesheet
 * Sistem Manajemen Bank Sampah Liliba
 */

/* Global Mobile Responsiveness & Strict Horizontal Overflow Prevention */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Glassmorphism Styles */
.glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(16, 185, 129, 0.08);
}

/* DataTables Styling Overrides for Dark Mode */
.dataTables_wrapper {
    color: #94a3b8 !important;
}

table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 1.5rem 0 !important;
    background: transparent !important;
    border: none !important;
}

table.dataTable thead th {
    background-color: transparent !important;
    border-bottom: 1px solid #1e293b !important;
    color: #64748b !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 12px 16px !important;
}

table.dataTable tbody tr {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(30, 41, 59, 0.4) !important;
}

table.dataTable tbody tr:hover {
    background-color: rgba(30, 41, 59, 0.2) !important;
}

table.dataTable tbody td {
    padding: 14px 16px !important;
    color: #cbd5e1 !important;
}

/* DataTable Search & Entries Controls */
.dataTables_filter input {
    background-color: rgba(2, 6, 23, 0.8) !important;
    border: 1px solid #1e293b !important;
    border-radius: 12px !important;
    color: #f8fafc !important;
    padding: 8px 14px !important;
    font-size: 0.875rem !important;
    outline: none !important;
    transition: border-color 0.2s;
}

.dataTables_filter input:focus {
    border-color: #10b981 !important;
}

.dataTables_length select {
    background-color: rgba(2, 6, 23, 0.8) !important;
    border: 1px solid #1e293b !important;
    border-radius: 10px !important;
    color: #f8fafc !important;
    padding: 6px 28px 6px 12px !important;
    font-size: 0.875rem !important;
    outline: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 8px center !important;
    background-repeat: no-repeat !important;
    background-size: 1.25em auto !important;
}

/* DataTable Pagination buttons */
.dataTables_paginate .paginate_button {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 5px 12px !important;
    margin-left: 4px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    transition: all 0.2s !important;
}

.dataTables_paginate .paginate_button:hover {
    background: #10b981 !important;
    color: #020617 !important;
    border-color: #10b981 !important;
}

.dataTables_paginate .paginate_button.current, 
.dataTables_paginate .paginate_button.current:hover {
    background: #10b981 !important;
    color: #020617 !important;
    border-color: #10b981 !important;
}

.dataTables_paginate .paginate_button.disabled, 
.dataTables_paginate .paginate_button.disabled:hover, 
.dataTables_paginate .paginate_button.disabled:active {
    background: rgba(30, 41, 59, 0.4) !important;
    color: #64748b !important;
    border-color: rgba(30, 41, 59, 0.2) !important;
    cursor: default !important;
}

.dataTables_info {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #64748b !important;
}

/* Custom Color Themes (Kombinasi Warna Utama) */
:root, html.theme-emerald {
    --color-primary: #10b981;
    --color-primary-hover: #059669;
    --color-primary-dark: #047857;
    --color-primary-light: rgba(16, 185, 129, 0.15);
    --color-primary-border: rgba(16, 185, 129, 0.25);
    --color-primary-gradient: linear-gradient(135deg, #10b981, #0d9488);
}

html.theme-teal {
    --color-primary: #14b8a6;
    --color-primary-hover: #0d9488;
    --color-primary-dark: #0f766e;
    --color-primary-light: rgba(20, 184, 166, 0.15);
    --color-primary-border: rgba(20, 184, 166, 0.25);
    --color-primary-gradient: linear-gradient(135deg, #14b8a6, #0284c7);
}

html.theme-indigo {
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-dark: #4338ca;
    --color-primary-light: rgba(99, 102, 241, 0.15);
    --color-primary-border: rgba(99, 102, 241, 0.25);
    --color-primary-gradient: linear-gradient(135deg, #6366f1, #3b82f6);
}

html.theme-amber {
    --color-primary: #f59e0b;
    --color-primary-hover: #d97706;
    --color-primary-dark: #b45309;
    --color-primary-light: rgba(245, 158, 11, 0.15);
    --color-primary-border: rgba(245, 158, 11, 0.25);
    --color-primary-gradient: linear-gradient(135deg, #f59e0b, #ea580c);
}

html.theme-rose {
    --color-primary: #f43f5e;
    --color-primary-hover: #e11d48;
    --color-primary-dark: #be123c;
    --color-primary-light: rgba(244, 63, 94, 0.15);
    --color-primary-border: rgba(244, 63, 94, 0.25);
    --color-primary-gradient: linear-gradient(135deg, #f43f5e, #be123c);
}

/* Dynamic Primary Class Overrides */
.text-emerald-400, .text-emerald-500 {
    color: var(--color-primary) !important;
}
.bg-emerald-500, .bg-emerald-600 {
    background-color: var(--color-primary) !important;
}
.hover\:bg-emerald-500:hover, .hover\:bg-emerald-400:hover {
    background-color: var(--color-primary-hover) !important;
}
.border-emerald-500, .border-emerald-500\/20, .border-emerald-500\/30 {
    border-color: var(--color-primary-border) !important;
}
.bg-emerald-500\/10, .bg-emerald-500\/5 {
    background-color: var(--color-primary-light) !important;
}
.bg-gradient-to-r.from-emerald-600,
.bg-gradient-to-r.from-emerald-500,
.bg-gradient-to-tr.from-emerald-500 {
    background-image: var(--color-primary-gradient) !important;
}
.focus\:border-emerald-500:focus {
    border-color: var(--color-primary) !important;
}

/* Print Overrides */
@media print {
    body {
        background-color: white !important;
        color: black !important;
    }
    main {
        animation: none !important;
    }
}

/* Comprehensive Light Mode Contrast & Styling Overrides */
html.light body {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

/* Main Cards, Panels, Sidebars, Topbars in Light Mode */
html.light .bg-slate-900\/60,
html.light .bg-slate-900\/80,
html.light .bg-slate-900,
html.light .bg-slate-950\/80,
html.light .bg-slate-950,
html.light header,
html.light aside {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
}

html.light .command-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02) !important;
}

html.light .text-white {
    color: #0f172a !important;
}
html.light .text-slate-100 {
    color: #1e293b !important;
}
html.light .text-slate-300 {
    color: #334155 !important;
}
html.light .text-slate-400 {
    color: #64748b !important;
}
html.light .text-slate-500 {
    color: #64748b !important;
}

/* Overriding Dark Metallic Gradients on Stat Cards (Status Pembayaran, Keuntungan, Nasabah) */
html.light [class*="from-slate-"],
html.light [class*="to-slate-"],
html.light [class*="to-emerald-950"],
html.light [class*="to-rose-950"],
html.light [class*="to-amber-950"] {
    background-image: none !important;
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.06) !important;
}

/* Primary Action Buttons Keep Vibrant Gradient */
html.light button[type="submit"]:not(.bg-slate-800),
html.light a.bg-gradient-to-r,
html.light button.bg-gradient-to-r {
    background-image: var(--color-primary-gradient) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}
html.light a.bg-gradient-to-r *,
html.light button.bg-gradient-to-r * {
    color: #ffffff !important;
}

/* Inner Item Wrappers (Jadwal Hari Ini, Kalender Gerejawi, Residu Box, Search Inputs) */
html.light .p-3.bg-slate-950\/40,
html.light .p-4.bg-slate-950\/40,
html.light .p-5.bg-slate-950\/40,
html.light .p-3.bg-slate-950\/60,
html.light .p-4.bg-slate-950\/60,
html.light div.bg-slate-950\/40,
html.light div.bg-slate-950\/60,
html.light div.bg-slate-950\/80,
html.light #manual-lookup-section,
html.light #scanner-section {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

/* Specific Soft Mint Background for Nasabah Terdeteksi Card in Light Mode */
html.light #nasabah-info-card {
    background-color: #f0fdf4 !important;
    border-color: var(--color-primary-border) !important;
}

/* Code Pills (Kode TRX, Kode WD, No Rekening) in Table Cells - Soft Accent Tint */
html.light td .bg-slate-950\/60,
html.light td .bg-slate-950\/80,
html.light td .bg-slate-950,
html.light td .bg-slate-850,
html.light td .bg-slate-900,
html.light td .font-mono span,
html.light td span.font-mono,
html.light span.font-mono.bg-slate-950\/80,
html.light span.font-mono.bg-slate-950 {
    background-color: var(--color-primary-light) !important;
    color: var(--color-primary-dark) !important;
    border: 1px solid var(--color-primary-border) !important;
    font-weight: 700 !important;
}

/* Table Summary Footer Rows (Total Penarikan Disetujui, Grand Total) */
html.light tfoot tr,
html.light tr.bg-slate-950\/40,
html.light tr.bg-slate-950\/60,
html.light tfoot tr.bg-slate-950\/40,
html.light tfoot tr.bg-slate-950\/60,
html.light div.bg-slate-800\/50 {
    background-color: #f8fafc !important;
    background-image: none !important;
    color: #0f172a !important;
    border-top: 2px solid #cbd5e1 !important;
}
html.light tfoot td,
html.light tfoot td span {
    color: #0f172a !important;
}

/* Text Contrast Overrides for Light Mode */
html.light .text-white,
html.light .text-slate-100 {
    color: #0f172a !important;
}
html.light .text-slate-200,
html.light .text-slate-300 {
    color: #1e293b !important;
}
html.light .text-slate-400,
html.light .text-slate-350 {
    color: #475569 !important;
}
html.light .text-slate-500,
html.light .text-slate-600 {
    color: #64748b !important;
}

/* Form Inputs in Light Mode */
html.light input:not([type="submit"]):not([type="radio"]):not([type="checkbox"]), 
html.light select, 
html.light textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
html.light input::placeholder,
html.light textarea::placeholder {
    color: #94a3b8 !important;
}

/* Table Header Overrides in Light Mode (No More Dark Grey Slabs!) */
html.light table thead,
html.light table thead tr,
html.light tr.bg-slate-950\/50,
html.light tr.bg-slate-950\/60,
html.light tr.bg-slate-950\/80,
html.light tr.bg-slate-950,
html.light tr.bg-slate-900,
html.light tr.bg-slate-850 {
    background-color: #f8fafc !important;
    background-image: none !important;
    border-bottom: 2px solid #cbd5e1 !important;
}
html.light table thead th {
    color: #475569 !important;
    font-weight: 800 !important;
}
html.light table tbody tr:hover {
    background-color: #f8fafc !important;
}
html.light table tbody td {
    color: #1e293b !important;
}

/* Status Badges in Light Mode Table */
html.light .bg-emerald-500\/10 {
    background-color: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #a7f3d0 !important;
}
html.light .bg-amber-500\/10 {
    background-color: #fffbeb !important;
    color: #b45309 !important;
    border-color: #fde68a !important;
}
html.light .bg-rose-500\/10 {
    background-color: #fff1f2 !important;
    color: #be123c !important;
    border-color: #fecdd3 !important;
}

/* Light Mode Action Buttons & Filter Buttons Fix */
html.light .bg-slate-800,
html.light button.bg-slate-800,
html.light a.bg-slate-800 {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}
html.light .bg-slate-800:hover,
html.light button.bg-slate-800:hover,
html.light a.bg-slate-800:hover,
html.light .hover\:bg-slate-700:hover {
    background-color: var(--color-primary) !important;
    color: #ffffff !important;
    border-color: var(--color-primary) !important;
}
html.light .bg-slate-800:hover i,
html.light button.bg-slate-800:hover i,
html.light a.bg-slate-800:hover i {
    color: #ffffff !important;
}

/* Page Footer Bar in Light Mode */
html.light footer,
html.light div.footer {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #475569 !important;
    border-top: 1px solid #cbd5e1 !important;
}
html.light footer p,
html.light footer span {
    color: #475569 !important;
}

/* Light Mode Modal Backdrop */
html.light .fixed.inset-0.bg-slate-950\/60 {
    background-color: rgba(15, 23, 42, 0.4) !important;
}

/* Light Mode Select2 Dropdown Overrides */
html.light .select2-container--default .select2-selection--single {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}
html.light .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #0f172a !important;
}
html.light .select2-dropdown {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}
html.light .select2-search--dropdown {
    background-color: #f8fafc !important;
}
html.light .select2-search--dropdown .select2-search__field {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html.light .select2-results__option {
    color: #334155 !important;
    border-bottom-color: #f1f5f9 !important;
}
html.light .select2-results__option--highlighted[aria-selected] {
    background-color: var(--color-primary) !important;
    color: #ffffff !important;
}

/* Light Mode ApexCharts Overrides */
html.light .apexcharts-text {
    fill: #475569 !important;
}
html.light .apexcharts-legend-text {
    color: #1e293b !important;
}

/* ==========================================================================
   Jadwal Penjemputan Page Light Mode Overrides
   ========================================================================== */

/* Top Info Box Badges (Jadwal Setor Sampah Terpilah Mandiri) */
html.light div.bg-gradient-to-r.from-emerald-950\/40 {
    background-image: none !important;
    background-color: #f0fdf4 !important;
    border-color: var(--color-primary-border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}
html.light div.bg-gradient-to-r.from-emerald-950\/40 span.rounded-xl {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

/* Weekly Schedule Grid Day Cards */
html.light .grid .bg-gradient-to-br[class*="from-blue-"],
html.light .grid .bg-gradient-to-br[class*="from-purple-"],
html.light .grid .bg-gradient-to-br[class*="from-emerald-"],
html.light .grid .bg-gradient-to-br[class*="from-amber-"],
html.light .grid .bg-gradient-to-br[class*="from-rose-"],
html.light .grid .bg-gradient-to-br[class*="from-cyan-"],
html.light .grid .bg-gradient-to-br[class*="from-orange-"] {
    background-image: none !important;
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
}

/* Day Code Badge (e.g. SE, SE, RA, KA, JU, SA, MI) */
html.light .w-10.h-10.bg-slate-950\/40 {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

/* Schedule Item Cards inside Day Cards (NO MORE GREY SLABS!) */
html.light .bg-slate-950\/30,
html.light div.bg-slate-950\/30 {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
}

html.light div.bg-slate-950\/30 span.text-white,
html.light div.bg-slate-950\/30 h5 {
    color: #0f172a !important;
    font-weight: 800 !important;
}

html.light div.bg-slate-950\/30 span.text-slate-300 {
    color: #1e293b !important;
    font-weight: 700 !important;
}

html.light div.bg-slate-950\/30 span.text-slate-400 {
    color: #475569 !important;
    font-weight: 600 !important;
}

html.light div.bg-slate-950\/30 p.text-slate-500 {
    color: #64748b !important;
}

/* Mobile Responsive & Native APK App Layout Overrides */
@media (max-width: 768px) {
    /* Hide custom scrollbar on mobile to eliminate double scrollbars & touch lag */
    ::-webkit-scrollbar {
        width: 0px !important;
        height: 0px !important;
        display: none !important;
    }
    * {
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    /* Prevent body horizontal wobble on mobile APK view */
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Native APK Sticky Header Height & Padding */
    header {
        height: 3.8rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Floating APK Bottom Nav Bar in Dark & Light Modes */
    nav.md\:hidden {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
    }

    html.light nav.md\:hidden {
        background-color: rgba(255, 255, 255, 0.95) !important;
        border-top-color: #cbd5e1 !important;
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.08) !important;
    }

    /* Active Indicator Pill on Mobile Bottom Dock */
    nav.md\:hidden a.active-mobile-tab {
        color: var(--color-primary) !important;
        font-weight: 800 !important;
    }

    nav.md\:hidden a.active-mobile-tab i {
        color: var(--color-primary) !important;
        transform: translateY(-2px);
        transition: transform 0.2s ease;
    }

    /* Center FAB Scan Button on Mobile APK */
    .mobile-fab-center {
        background-image: var(--color-primary-gradient) !important;
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
    }

    /* Touch Feedback for buttons on mobile APK */
    button, a {
        touch-action: manipulation;
    }
    
    button:active, a:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }

    /* Mobile Page Padding to prevent bottom dock overlap */
    main {
        padding-bottom: 5.5rem !important;
    }

    /* Transform items-table into a card-based layout instead of squished columns */
    #items-table, 
    #items-table thead, 
    #items-table tbody, 
    #items-table tr, 
    #items-table td {
        display: block !important;
        width: 100% !important;
    }
    
    #items-table thead {
        display: none !important;
    }
    
    #items-table tr {
        margin-bottom: 1.25rem;
        padding: 1.25rem;
        background: rgba(15, 23, 42, 0.7);
        border: 1px solid rgba(16, 185, 129, 0.2);
        border-radius: 1.5rem;
        position: relative;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    }
    
    #items-table td {
        padding: 0.6rem 0 !important;
        border: none !important;
        text-align: left !important;
        display: flex;
        flex-direction: column;
    }
    
    /* Display responsive labels using data-label attribute */
    #items-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #94a3b8;
        margin-bottom: 0.35rem;
    }
    
    #items-table td:last-child {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        border-top: 1px solid rgba(148, 163, 184, 0.15) !important;
        margin-top: 0.75rem;
        padding-top: 0.85rem !important;
    }
    
    #items-table td:last-child::before {
        content: "Aksi Hapus Item";
        display: block;
        font-size: 0.75rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #f43f5e;
        margin-right: auto;
    }

    /* Input & Select responsiveness inside items-table */
    #items-table td select, 
    #items-table td input {
        font-size: 0.875rem !important;
        padding: 0.65rem 0.85rem !important;
        border-radius: 0.85rem !important;
    }
    
    /* Responsive general padding and border radius reductions */
    .p-6, .p-8 {
        padding: 1.15rem !important;
    }
    
    .rounded-3xl {
        border-radius: 1.25rem !important;
    }
    
    /* Prevent titles from wrapping awkwardly */
    .text-2xl {
        font-size: 1.35rem !important;
        line-height: 1.85rem !important;
    }
    
    .text-3xl {
        font-size: 1.6rem !important;
        line-height: 2.1rem !important;
    }
}

/* Select2 Dark Theme Styling for SiLiba */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    background-color: rgba(2, 6, 23, 0.85) !important;
    border: 1px solid #1e293b !important;
    border-radius: 1rem !important;
    height: 48px !important;
    padding: 6px 12px !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.2s ease;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #f8fafc !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    padding-left: 4px !important;
    width: 100% !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
    right: 12px !important;
}

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

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

.select2-dropdown {
    background-color: #0f172a !important;
    border: 1px solid #1e293b !important;
    border-radius: 1rem !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.7) !important;
    overflow: hidden !important;
    z-index: 99999 !important;
}

.select2-search--dropdown {
    padding: 10px !important;
    background-color: #020617 !important;
}

.select2-search--dropdown .select2-search__field {
    background-color: #090d16 !important;
    border: 1px solid #334155 !important;
    border-radius: 0.75rem !important;
    color: #f8fafc !important;
    padding: 10px 14px !important;
    font-size: 0.875rem !important;
    outline: none !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}

.select2-results__option {
    padding: 10px 14px !important;
    font-size: 0.875rem !important;
    color: #cbd5e1 !important;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5) !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: #10b981 !important;
    color: #020617 !important;
    font-weight: 700 !important;
}

.select2-results__option[aria-selected=true] {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
}

/* Custom Micro-animations */
@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.animate-spin-slow {
    animation: spin-slow 12s linear infinite;
}

@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}
.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

/* ==========================================================================
   Universal Mobile Modal Positioning & Bottom Dock Preservation Overrides
   ========================================================================== */

/* Keep Mobile Bottom Navigation Dock ALWAYS Visible at High Z-Index */
nav.md\:hidden {
    z-index: 99999 !important;
}

/* Universal Modal Overlay Positioning */
div[id*="modal"],
div[id*="Modal"],
div[id$="-modal"],
div[id^="modal"],
.app-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 4.5rem !important; /* Stops above the floating mobile bottom button bar */
    width: 100vw !important;
    height: auto !important;
    max-height: calc(100vh - 4.5rem) !important;
    max-height: calc(100dvh - 4.5rem) !important;
    z-index: 99950 !important; /* Modal overlay sits right below bottom button bar */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important; /* Top aligned - NEVER pushes top header title off-screen */
    padding: 0.5rem 0.75rem !important;
    box-sizing: border-box !important;
    background-color: rgba(2, 6, 23, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
    div[id*="modal"],
    div[id*="Modal"],
    div[id$="-modal"],
    div[id^="modal"],
    .app-modal {
        bottom: 0 !important;
        max-height: 100vh !important;
        padding: 1.5rem !important;
        justify-content: center !important;
    }
}

/* Ensure hidden modals stay strictly hidden */
div[id*="modal"].hidden,
div[id*="Modal"].hidden,
div[id$="-modal"].hidden,
div[id^="modal"].hidden,
.app-modal.hidden {
    display: none !important;
}

/* Inner Modal Card Container */
div[id*="modal"] > div,
div[id*="Modal"] > div,
div[id$="-modal"] > div,
div[id^="modal"] > div,
.app-modal > div {
    max-height: calc(100dvh - 5.5rem) !important;
    max-height: calc(100vh - 5.5rem) !important;
    overflow-y: auto !important;
    margin-top: 0.25rem !important;
    margin-bottom: auto !important;
    width: 100% !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.95) !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@media (max-width: 639px) {
    div[id*="modal"] > div,
    div[id*="Modal"] > div,
    div[id$="-modal"] > div,
    div[id^="modal"] > div,
    .app-modal > div {
        padding: 1.15rem !important;
    }
}

@media (min-width: 768px) {
    div[id*="modal"] > div,
    div[id*="Modal"] > div,
    div[id$="-modal"] > div,
    div[id^="modal"] > div,
    .app-modal > div {
        max-height: 85vh !important;
        margin-top: auto !important;
    }
}

/* Stacking Context Fix for main element */
body.overflow-hidden main,
body.modal-open main {
    transform: none !important;
    animation: none !important;
    perspective: none !important;
    filter: none !important;
    will-change: auto !important;
}

body.modal-open,
body.overflow-hidden {
    overflow: hidden !important;
    touch-action: none;
}




