/* assets/css/responsive-overrides.css */
/* ============================================================ 
   UPPM PREMIUM MOBILE-FRIENDLY & RESPONSIVE CSS OVERRIDES
   Isolasi total khusus untuk HP & Tablet (< 991px)
   TIDAK MERUSAK POSISI MENU SIDEBAR & TOMBOL SWEETALERT
   ============================================================ */

/* Hide mobile proposal card container on desktop */
.mobile-proposal-card-container {
    display: none;
}

@media (max-width: 991px) {
    /* 1. Body & Container (Eliminasi Scroll Horizontal Global) */
    body, html {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        max-width: 100% !important;
    }
    
    .app-content {
        padding: 16px 8px calc(88px + env(safe-area-inset-bottom, 0px)) !important; /* Spacing agar konten tidak tertutup bottom-nav */
    }

    /* 2. Glassmorphism Topbar Mobile */
   .topbar {
  background: rgba(255, 255, 255, 0.92); /* naikin opacity solid dikit */
  backdrop-filter: blur(10px);           /* turunin dari 20px ke 10px */
  -webkit-backdrop-filter: blur(10px);
  will-change: backdrop-filter;          /* kasih tau browser siapin layer duluan */
}
    
    .topbar-title {
        font-size: 14px !important;
        font-weight: 700 !important;
    }

    /* 3. Collapse Grid Dasbor Menjadi 1 Kolom Vertikal */
    .main-grid, .grid-3, .grid-4, .grid-2 {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }
    
    /* Sesuaikan tinggi card kaku pada dashboard agar otomatis mengikuti konten */
    .admin-card-row1, .admin-card-row2, .card-row1, .card-row2, .card {
        height: auto !important;
        min-height: unset !important;
    }
    
    .card-body {
        max-height: unset !important;
        overflow-y: visible !important;
    }

    /* 4. Pengaturan Area Kerja & Scrolling Table di HP */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border: 1px solid rgba(226, 232, 240, 0.8) !important;
        border-radius: 12px !important;
        margin-bottom: 16px !important;
    }
    
    /* Beri ruang kolom agar tabel lebar tidak bertumpuk */
    .table-responsive table.datatable, 
    .table-responsive table.table-premium-sla,
    .table-responsive table.table {
        min-width: 980px !important;
    }
    
    /* Tabel detail kecil/profil dalam card tidak perlu dipaksa lebar */
    .card-body table.table-condensed, 
    .card-body table.profile-table,
    table.table-summary {
        min-width: unset !important;
    }

    /* 5. Full-screen drawer sheet untuk SLA Modal di HP */
    .reviewer-sla-modal-overlay {
        padding: 0 !important;
    }
    
    .reviewer-sla-modal-card {
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
    }

    /* 6. Sidebar Kanan Form Proposal */
    .sidebar-right-custom {
        position: static !important;
        margin-top: 24px !important;
    }

    /* 7. Image Auto-Scale */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 768px) {
    /* 8. Touch Targets (Hanya Tombol Class CSS, Tanpa Menimpa Tag button Global) */
    .btn, 
    .btn-kelola, 
    .btn-micro, 
    .btn-check-reviewer, 
    .btn-solid, 
    .bottom-nav-item,
    .btn-action-modal-footer,
    .btn-close-modal-footer {
        min-height: 44px !important; /* Area sentuh ergonomis */
    }
    
    .btn-sm, .btn-micro {
        min-height: 38px !important;
    }
    
    /* Cegah Auto-Zoom Input di iPhone iOS */
    input[type="text"], 
    input[type="email"], 
    input[type="password"], 
    input[type="number"], 
    input[type="tel"], 
    select, 
    textarea {
        min-height: 44px !important;
        font-size: 16px !important; /* Harus minimal 16px agar iOS tidak memaksa zoom-in! */
    }

    /* 9. Penyelarasan Layout Filter di HP */
    .filter-action-wrapper {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 12px !important;
        gap: 12px !important;
    }
    
    .filter-action-wrapper > div {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 12px !important;
    }
    
    .filter-select-group {
        width: 100% !important;
    }
    
    .filter-select-group form, 
    .filter-select-group select {
        width: 100% !important;
    }
    
    .kpi-row, .kpi-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* 10. Table to Card Transformation on Mobile Screens */
    .table-responsive {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow-x: visible !important;
        width: 100% !important;
    }
    
    table.table, 
    table.table-premium-sla,
    table.table-modern,
    table.datatable {
        min-width: unset !important;
        width: 100% !important;
        background: transparent !important;
        border: none !important;
    }
    
    /* Exclude print-layout tables and small summary tables */
    table.header-table,
    table.main-table,
    table.ttd-table,
    table.table-monev,
    table.table-condensed,
    table.profile-table,
    table.table-summary {
        display: table !important;
        width: 100% !important;
    }
    table.header-table thead, table.main-table thead, table.ttd-table thead, table.table-monev thead, table.table-condensed thead, table.profile-table thead, table.table-summary thead {
        display: table-header-group !important;
    }
    table.header-table tbody, table.main-table tbody, table.ttd-table tbody, table.table-monev tbody, table.table-condensed tbody, table.profile-table tbody, table.table-summary tbody {
        display: table-row-group !important;
    }
    table.header-table tr, table.main-table tr, table.ttd-table tr, table.table-monev tr, table.table-condensed tr, table.profile-table tr, table.table-summary tr {
        display: table-row !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
    }
    table.header-table td, table.main-table td, table.ttd-table td, table.table-monev td, table.table-condensed td, table.profile-table td, table.table-summary td,
    table.header-table th, table.main-table th, table.ttd-table th, table.table-monev th, table.table-condensed th, table.profile-table th, table.table-summary th {
        display: table-cell !important;
        text-align: left !important;
        border: 1px solid #cbd5e1 !important;
        padding: 8px !important;
    }
    table.header-table td::before, table.ttd-table td::before, table.table-monev td::before, table.table-condensed td::before, table.profile-table td::before, table.table-summary td::before {
        content: none !important;
    }

    /* Core Transformation Rules for main data tables */
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) thead,
    table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) thead,
    table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) thead {
        display: none !important;
    }
    
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody,
    table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody,
    table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody,
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody tr,
    table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody tr,
    table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody tr {
        display: block !important;
        width: 100% !important;
    }
    
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody tr,
    table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody tr,
    table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody tr {
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 12px !important;
        padding: 14px 16px !important;
        margin-bottom: 14px !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03) !important;
        position: relative !important;
    }
    
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td,
    table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td,
    table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 0 !important;
        border: none !important;
        border-bottom: 1px dashed #e2e8f0 !important;
        width: 100% !important;
        text-align: right !important;
        font-size: 13px !important;
        color: #1e293b !important;
        font-weight: 500 !important;
        background: transparent !important;
    }
    
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td:last-child,
    table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td:last-child,
    table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td:last-child {
        border-bottom: none !important;
    }
    
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td::before,
    table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td::before,
    table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td::before {
        content: attr(data-label) !important;
        font-weight: 700 !important;
        color: #64748b !important;
        text-align: left !important;
        margin-right: 12px !important;
        font-size: 11.5px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    /* Specific overrides for col-no (Hide entirely) with high cascade specificity */
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td.col-no,
    table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td.col-no,
    table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td.col-no,
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td[data-label="No"],
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td[data-label="NO"],
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td[data-label="No."] {
        display: none !important;
    }

    /* Specific overrides for col-info (Format as full-width block and hide label) with high cascade specificity */
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td.col-info,
    table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td.col-info,
    table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td.col-info {
        display: block !important;
        text-align: left !important;
        width: 100% !important;
    }
    table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td.col-info::before,
    table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td.col-info::before,
    table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td.col-info::before {
        display: none !important;
        content: none !important;
    }

    /* Checkbox & action row formatting alignment in mobile card view */
    table.table tbody td input[type="checkbox"] {
        margin: 0 !important;
        transform: scale(1.1);
    }
    
    /* 11. Bottom Nav Styling Refinement for iOS & Android Safe-Area and Clean Look */
    .bottom-nav {
        background: rgba(255, 255, 255, 0.94) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-top: 1px solid #cbd5e1 !important;
        box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08) !important;
        height: 68px !important;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 2px) !important;
    }

    .bottom-nav-item {
        color: #64748b !important;
        font-size: 9px !important;
        padding: 4px 2px !important;
        min-width: 48px !important;
        transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease !important;
    }

    .bottom-nav-item:active,
    .mobile-more-btn:active,
    .mob-btn-detail:active,
    .mob-btn-reviewer:active,
    .list-group-item-action:active,
    .btn:active,
    a.badge:active {
        transform: scale(0.95) !important;
    }

    .bottom-nav-item,
    .mobile-more-btn,
    .mob-btn-detail,
    .mob-btn-reviewer,
    .list-group-item-action,
    .btn,
    a.badge {
        transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, opacity 0.2s ease !important;
    }

    .bottom-nav-item.active {
        color: #2563eb !important;
    }

    .bottom-nav-item.active .nav-icon {
        color: #2563eb !important;
        transform: translateY(-2px) scale(1.08) !important;
    }

    .bottom-nav-item.active::before {
        display: none !important; /* Hide old heavy backdrops */
    }

    /* 12. Step Progress Tracker Bar - Vertical Layout on Mobile */
    .tracker-bar-bg {
        background: #f1f5f9 !important;
        height: auto !important;
        width: 4px !important;
        min-height: 250px !important;
        margin: 20px auto 20px 24px !important;
        border-radius: 4px !important;
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    .tracker-bar-fill {
        width: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    .tracker-node {
        position: relative !important;
        left: 0 !important;
        top: unset !important;
        transform: none !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        text-align: left !important;
        padding-left: 20px !important;
        margin: 16px 0 !important;
    }
    
    .tracker-container .tracker-node[style*="left: 0%"],
    .tracker-container .tracker-node[style*="left: 33.3%"],
    .tracker-container .tracker-node[style*="left: 66.6%"],
    .tracker-container .tracker-node[style*="left: 100%"] {
        left: 0 !important;
        position: relative !important;
        transform: none !important;
    }

    .tracker-circle {
        margin: 0 16px 0 -22px !important;
        z-index: 2 !important;
    }
    
    .tracker-label {
        font-size: 12px !important;
        display: inline !important;
    }
    
    .tracker-status {
        font-size: 11px !important;
        display: inline !important;
        margin-top: 0 !important;
        margin-left: 8px !important;
    }

    /* 13. Bento Card, Layout & Action Stack Overrides */
    .dashboard-wrapper {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    .bento-card, .tracker-container {
        padding: 18px !important;
        border-radius: 16px !important;
    }
    
    .dashboard-wrapper h1, 
    .app-content h1,
    .page-title {
        font-size: 1.6rem !important;
        letter-spacing: -0.5px !important;
    }
    
    /* Make headers stack vertically if they contain buttons */
    .dashboard-wrapper .d-flex.justify-content-between.align-items-center {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }
    
    .dashboard-wrapper .d-flex.justify-content-between.align-items-center > div {
        width: 100% !important;
    }
    
    .dashboard-wrapper .d-flex.justify-content-between.align-items-center .btn-super,
    .dashboard-wrapper .d-flex.justify-content-between.align-items-center a {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    .btn-auth-success, .btn-auth-cyan, .btn-auth-red, .btn-cancel, .btn-super {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* 14. Reset Hardcoded Table Column Widths & Staging on Mobile Card View */
    table.datatable th,
    table.datatable td,
    table.table th,
    table.table td,
    .col-checkbox,
    .col-no,
    .col-info,
    .col-status,
    .col-review,
    .col-actions,
    .col-assign,
    .col-type,
    .col-members,
    .col-journal,
    .col-index,
    .col-dosen {
        width: auto !important;
        min-width: unset !important;
        max-width: unset !important;
        box-sizing: border-box !important;
    }

    table.datatable colgroup,
    table.datatable col,
    table.table colgroup,
    table.table col {
        display: none !important;
    }

    /* 15. DataTables Mobile Controls Alignment Overrides */
    .dataTables_wrapper {
        width: 100% !important;
        overflow-x: visible !important;
    }
    
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        margin: 8px 0 !important;
        width: 100% !important;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 80% !important;
        margin-left: 0 !important;
        display: inline-block !important;
    }

    /* 16. Info Table Metadata Stacking for Mobile viewports (e.g. review.php) */
    table.info-table,
    table.info-table tbody,
    table.info-table tr,
    table.info-table td {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
    }
    
    table.info-table tr {
        margin-bottom: 12px !important;
        border-bottom: 1px dashed #e2e8f0 !important;
        padding-bottom: 8px !important;
    }
    
    table.info-table tr:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    table.info-table td.label-col {
        width: auto !important;
        font-weight: 700 !important;
        color: #64748b !important;
        font-size: 11px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        margin-bottom: 2px !important;
    }
    
    table.info-table td.separator-col {
        display: none !important;
    }
    
    table.info-table td:not(.label-col):not(.separator-col) {
        font-weight: 600 !important;
        color: #0f172a !important;
        font-size: 13px !important;
        padding-left: 0 !important;
    }

    body.dark-mode table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody tr,
    body.dark-mode table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody tr,
    body.dark-mode table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody tr {
        background: var(--bg-card) !important;
        border-color: var(--border-color) !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
    }

    body.dark-mode table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td,
    body.dark-mode table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td,
    body.dark-mode table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td {
        border-bottom-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    body.dark-mode table.table:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td::before,
    body.dark-mode table.table-modern:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td::before,
    body.dark-mode table.datatable:not(.header-table):not(.ttd-table):not(.table-monev):not(.table-condensed):not(.profile-table):not(.table-summary) tbody td::before {
        color: var(--text-secondary) !important;
    }
    
    /* override info-table text (review.php dll) */
    body.dark-mode table.info-table td:not(.label-col):not(.separator-col) {
        color: var(--text-primary) !important;
    }
    body.dark-mode table.info-table td.label-col {
        color: var(--text-secondary) !important;
    }
    body.dark-mode table.info-table tr {
        border-bottom-color: var(--border-color) !important;
    }
    
    /* bottom nav override */
    body.dark-mode .bottom-nav {
        background: rgba(30, 41, 59, 0.96) !important;
        border-top-color: var(--border-color) !important;
    }

    /* Clean, compact styling for Filter & Cetak modal on mobile viewports */
    #proposalFilterModal .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
        display: flex !important;
        align-items: center !important;
        min-height: calc(100% - 20px) !important;
    }
    #proposalFilterModal .modal-content {
        border-radius: 16px !important;
        padding: 4px !important;
    }
    #proposalFilterModal .modal-header {
        padding: 12px 16px 8px !important;
    }
    #proposalFilterModal .modal-header h5 {
        font-size: 15px !important;
    }
    #proposalFilterModal .modal-body {
        padding: 8px 16px !important;
    }
    #proposalFilterModal .modal-body .mb-3 {
        margin-bottom: 8px !important; /* tighter layout */
    }
    #proposalFilterModal .modal-body .form-label {
        font-size: 10.5px !important;
        margin-bottom: 2px !important;
    }
    #proposalFilterModal .modal-body .form-control,
    #proposalFilterModal .modal-body .form-select {
        height: 36px !important;
        padding: 4px 10px !important;
        font-size: 13.5px !important;
    }
    #proposalFilterModal .modal-footer {
        padding: 8px 16px 14px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        align-items: stretch !important;
    }
    #proposalFilterModal .modal-footer .btn,
    #proposalFilterModal .modal-footer .btn-primary,
    #proposalFilterModal .modal-footer a {
        width: 100% !important;
        margin: 0 !important;
        padding: 8px !important;
        font-size: 12.5px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        min-height: 36px !important;
    }

    /* Bulk actions mobile layout optimization */
    .bulk-actions-wrapper {
        flex-wrap: wrap !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .bulk-actions-container {
        width: 100% !important;
        margin-top: 4px !important;
    }
    .bulk-actions-container .btn-group {
        display: flex !important;
        width: 100% !important;
    }
    .bulk-actions-container .btn {
        flex: 1 !important;
        font-size: 11px !important;
        padding: 8px 4px !important;
        white-space: nowrap !important;
    }
}

/* proposalFilterModal Dark Mode overrides */
body.dark-mode #proposalFilterModal .modal-content {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
body.dark-mode #proposalFilterModal .modal-header h5,
body.dark-mode #proposalFilterModal .modal-header .btn-close {
    color: var(--text-primary) !important;
}
body.dark-mode #proposalFilterModal .modal-body label {
    color: var(--text-secondary) !important;
}
body.dark-mode #proposalFilterModal .modal-body input,
body.dark-mode #proposalFilterModal .modal-body select {
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
    border-color: var(--input-border) !important;
}
body.dark-mode #proposalFilterModal .modal-footer .btn-light {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* ==========================================================================
   Universal Zero-Scroll Table-to-Card Converter Constraints
   Enforces absolute zero horizontal scrolling on all card-converted lists.
   ========================================================================== */
@media (max-width: 768px) {
    /* Force any table with mobile card container to adapt and not scroll */
    .table-responsive:has(.mobile-proposal-card-container) {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        border: none !important;
        background: transparent !important;
    }
    .table-responsive:has(.mobile-proposal-card-container) table {
        min-width: unset !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .table-responsive:has(.mobile-proposal-card-container) colgroup,
    .table-responsive:has(.mobile-proposal-card-container) col {
        display: none !important;
    }
    .table-responsive:has(.mobile-proposal-card-container) thead {
        display: none !important;
    }
    .table-responsive:has(.mobile-proposal-card-container) tbody,
    .table-responsive:has(.mobile-proposal-card-container) tbody tr,
    .table-responsive:has(.mobile-proposal-card-container) tbody td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    /* Hide original row number td.col-no globally if converted cards are present */
    .table-responsive:has(.mobile-proposal-card-container) td.col-no,
    .table-responsive:has(.mobile-proposal-card-container) th.col-no {
        display: none !important;
    }
    
    /* Ensure no DataTable layout container overflows the viewport */
    .dataTables_wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Bento Cards & form spacing on mobile viewports */
    .bento-card {
        padding: 16px !important;
        border-radius: 16px !important;
    }
    .dashboard-wrapper, .container, .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Stack iOS/macOS-style action buttons to prevent overflow */
    .btn-auth-success,
    .btn-auth-cyan,
    .btn-auth-red,
    .btn-super,
    .btn-cancel {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        box-sizing: border-box !important;
        margin: 6px 0 !important;
        padding: 12px 16px !important;
        font-size: 13px !important;
        border-radius: 12px !important;
    }
    .col-lg-5.text-lg-end.d-flex.gap-2 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
    }
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Rubric Evaluation Table-to-Card Stacking (review.php) */
    .table-penilaian,
    .table-penilaian thead,
    .table-penilaian tbody,
    .table-penilaian tbody tr,
    .table-penilaian tbody td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .table-penilaian thead {
        display: none !important;
    }
    .table-penilaian tbody tr {
        background: var(--bg-card, #fff) !important;
        border: 1px solid var(--border-color, #cbd5e1) !important;
        border-radius: 16px !important;
        padding: 16px !important;
        margin-bottom: 12px !important;
    }
    .table-penilaian tbody td {
        border: none !important;
        padding: 6px 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    .table-penilaian tbody tr td:first-child {
        font-size: 14px !important;
        font-weight: 800 !important;
        color: #3b82f6 !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding-bottom: 8px !important;
        margin-bottom: 8px !important;
        display: block !important;
    }
    .table-penilaian tbody tr td:nth-child(2) {
        display: block !important;
        text-align: left !important;
    }
    .table-penilaian tbody tr td:nth-child(3)::before {
        content: "BOBOT: ";
        font-size: 9px;
        font-weight: 800;
        color: var(--text-secondary);
    }
    .table-penilaian tbody tr td:nth-child(4) {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .table-penilaian tbody tr td:nth-child(4)::before {
        content: "SKOR (1-4): ";
        font-size: 9px;
        font-weight: 800;
        color: var(--text-secondary);
        margin-bottom: 4px !important;
        align-self: flex-start !important;
    }
    .table-penilaian tbody tr td:nth-child(5)::before {
        content: "NILAI: ";
        font-size: 9px;
        font-weight: 800;
        color: var(--text-secondary);
    }
    .table-penilaian tfoot,
    .table-penilaian tfoot tr,
    .table-penilaian tfoot td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        text-align: center !important;
        padding: 8px 0 !important;
    }
}

/* ==========================================================================
   BATCH 2 — Finance Filter Overflow, Rubric Score-Select, Tactile Bounce
   Appended: Mobile polish pass — zero desktop impact
   ========================================================================== */

@media (max-width: 768px) {

    /* ── 1. Finance Status Filter Button Row — Prevent overflow on narrow screens
           incentive_finance.php: the twin d-flex.gap-3 columns overflow at ~375px.
           Wrap the outer flex container and reset the inline max-width cap.          ── */

    .col-lg-7 .d-flex.gap-3.justify-content-between.align-items-stretch,
    .col-lg-5 .d-flex.gap-3.justify-content-between.align-items-stretch {
        flex-wrap: wrap !important;
    }

    .col-lg-7 .d-flex.gap-3.justify-content-between.align-items-stretch > .d-flex.gap-3,
    .col-lg-5 .d-flex.gap-3.justify-content-between.align-items-stretch > .d-flex.gap-3 {
        flex: 1 1 100% !important;
        flex-wrap: wrap !important;
    }

    /* Override inline max-width: 190px on each filter button via attribute selector
       to defeat inline style without touching PHP                                    */
    .btn.btn-light.border[style*="max-width: 190px"],
    .btn.btn-light.border[style*="max-width:190px"] {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* ── 2. Evaluation Rubric score-select (review.php) — Full-width on mobile     ── */
    .score-select,
    select.score-select {
        width: 100% !important;
        min-width: unset !important;
        font-size: 16px !important; /* iOS no-zoom: must be >= 16px */
    }

    /* Ensure the rubric td cell containing score-select stretches properly          */
    .table-penilaian tbody tr td:nth-child(4) {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    /* ── 3. Spring Tactile Bounce — Additions for elements not in original list     ── */

    /* Gold update and cyan view action buttons (incentive_finance.php table)        */
    .btn-update-gold:active,
    .btn-view-cyan:active {
        transform: scale(0.92) !important;
        transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    /* Op-pill filter pills (publication.php, incentive_finance.php)                 */
    .op-pill:active {
        transform: scale(0.95) !important;
        transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    /* Animating filter/print button                                                 */
    .btn-filter-animate:active {
        transform: scale(0.97) !important;
        transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    /* Finance table mobile action bar icon buttons                                  */
    .mobile-action-bar .mob-btn-detail:active,
    .mobile-action-bar .mob-btn-reviewer:active {
        transform: scale(0.90) !important;
        transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    /* SweetAlert2 list action items tactile press feel                              */
    .swal2-html-container .list-group-item-action:active {
        transform: scale(0.97) !important;
        transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    /* Status badge pills and anchor badges                                          */
    .badge:active,
    .badge-glow-custom:active {
        transform: scale(0.95) !important;
        transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    /* ── 4. Op-stats-bar wrapping on mobile (incentive_finance.php / publication.php) ── */
    .op-stats-bar {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 12px 14px !important;
    }

    .op-pill {
        font-size: 12px !important;
        padding: 8px 14px !important;
    }

    /* ── 5. Bulk floating bar — readable and self-contained on narrow screens       ── */
    .bulk-floating-bar {
        padding: 12px 14px !important;
        border-radius: 14px !important;
    }

    .bulk-floating-bar > .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    #bulkStatusSelect,
    .bulk-floating-bar select {
        width: 100% !important;
    }

    /* ── 6. result-card padding relief on mobile (review.php evaluation cards)     ── */
    .result-card {
        padding: 1rem !important;
        border-radius: 16px !important;
    }

    /* ── 7. iOS Native / React Native Spring Style Transitions & Animations ── */
    @keyframes iosSlideUp {
        0% {
            opacity: 0;
            transform: translateY(20px) scale(0.98);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    .card, .bento-card, .table-card, .table-container-modern, .ios-header, .verification-card {
        animation: iosSlideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
        will-change: transform, opacity !important;
    }
    
    .table-responsive, .overflow-auto, .overflow-y-auto {
        -webkit-overflow-scrolling: touch !important;
    }
    
    .cmd-item, .btn-action-row, .notif-item, .ios-tab-nav a {
        transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease !important;
    }
    
    .cmd-item:active, .btn-action-row:active, .notif-item:active, .ios-tab-nav a:active {
        transform: scale(0.97) !important;
    }

}

