/* Tahap 1 optimasi mobile: ringankan efek visual tanpa mengubah struktur UI desktop. */
@media (max-width: 767.98px) {
    :root {
        --rs-glass-blur: 6px;
        --rs-shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.08);
        --rs-shadow-md: 0 8px 20px rgba(15, 23, 42, 0.10);
    }

    .rs-card,
    .card,
    .rs-page-header,
    .rs-section-card,
    .rs-admin-filter-card,
    .rs-app-topbar,
    .rs-app-sidebar,
    .rs-public-topbar,
    .dropdown-menu,
    .modal-content,
    .offcanvas,
    .rs-pos-cart-panel,
    .rs-pos-detail-modal,
    .rs-auth-card {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        box-shadow: var(--rs-shadow-md) !important;
    }

    .rs-btn,
    .rs-icon-btn,
    .rs-app-icon-btn,
    .rs-app-shell-toggle,
    .rs-theme-toggle {
        box-shadow: none !important;
    }

    .rs-kpi-card,
    .rs-shortcut-card,
    .rs-pos-product,
    .rs-admin-table-card,
    .rs-product-card {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        box-shadow: var(--rs-shadow-sm) !important;
    }

    .modal-backdrop,
    .rs-app-shell__backdrop,
    .rs-pos-cart-backdrop {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    .rs-card::before,
    .rs-card::after,
    .rs-kpi-card::before,
    .rs-kpi-card::after,
    .rs-page-header::before,
    .rs-page-header::after {
        filter: none !important;
    }
}

/* Tahap 4 lanjutan: kurangi transparansi light mode khusus layar kecil agar teks tetap terbaca. */
@media (max-width: 767.98px) {
    html[data-rs-theme="terang"] {
        --rs-panel: rgba(255, 255, 255, .88);
        --rs-panel-soft: rgba(255, 255, 255, .84);
        --rs-panel-strong: rgba(255, 255, 255, .94);
        --rs-border: rgba(226, 232, 240, .82);
        --rs-border-strong: rgba(203, 213, 225, .92);
    }

    html[data-rs-theme="terang"] .rs-app-topbar,
    html[data-rs-theme="terang"] .rs-app-sidebar,
    html[data-rs-theme="terang"] .rs-page-header,
    html[data-rs-theme="terang"] .rs-card,
    html[data-rs-theme="terang"] .card,
    html[data-rs-theme="terang"] .rs-section-card,
    html[data-rs-theme="terang"] .rs-admin-filter-card,
    html[data-rs-theme="terang"] .rs-data-card,
    html[data-rs-theme="terang"] .rs-dashboard-card,
    html[data-rs-theme="terang"] .rs-auth-card,
    html[data-rs-theme="terang"] .modal-content,
    html[data-rs-theme="terang"] .offcanvas,
    html[data-rs-theme="terang"] .dropdown-menu,
    html[data-rs-theme="terang"] .rs-pos-cart-panel,
    html[data-rs-theme="terang"] .rs-pos-detail-modal,
    html[data-rs-theme="terang"] body.rs-public-body .ck2-water-topbar__inner,
    html[data-rs-theme="terang"] body.rs-auth-body .ck2-water-topbar__inner {
        background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(248,250,252,.91)) !important;
        border-color: rgba(226,232,240,.86) !important;
    }

    html[data-rs-theme="terang"] .rs-kpi-card,
    html[data-rs-theme="terang"] .rs-summary-card,
    html[data-rs-theme="terang"] .rs-shortcut-card,
    html[data-rs-theme="terang"] .rs-product-card,
    html[data-rs-theme="terang"] .rs-pos-product,
    html[data-rs-theme="terang"] .rs-admin-table-card,
    html[data-rs-theme="terang"] .table-responsive,
    html[data-rs-theme="terang"] .rs-table-responsive {
        background: rgba(255,255,255,.93) !important;
        border-color: rgba(226,232,240,.82) !important;
    }

    html[data-rs-theme="terang"] .form-control,
    html[data-rs-theme="terang"] .form-select,
    html[data-rs-theme="terang"] .rs-input,
    html[data-rs-theme="terang"] .rs-select,
    html[data-rs-theme="terang"] .rs-textarea,
    html[data-rs-theme="terang"] .modal-content .form-control,
    html[data-rs-theme="terang"] .modal-content .form-select,
    html[data-rs-theme="terang"] .rs-pos-cart-panel .form-control,
    html[data-rs-theme="terang"] .rs-pos-cart-panel .form-select {
        background: rgba(255,255,255,.96) !important;
        border-color: rgba(203,213,225,.86) !important;
    }

    html[data-rs-theme="terang"] .rs-app-footer,
    html[data-rs-theme="terang"] .card-header,
    html[data-rs-theme="terang"] .card-footer,
    html[data-rs-theme="terang"] .modal-header,
    html[data-rs-theme="terang"] .modal-footer,
    html[data-rs-theme="terang"] .rs-pos-cart-panel__header,
    html[data-rs-theme="terang"] .rs-pos-cart-panel__footer {
        background: rgba(255,255,255,.90) !important;
        border-color: rgba(226,232,240,.80) !important;
    }
}
