/*
 * TMS LPPM EDUARDO V11.8
 * Landscape HP/tablet + cubit dua jari (pinch zoom).
 * Hanya presentasi: tidak mengubah data, jadwal, hak akses, atau proses PHP.
 */

html,
body,
.app-shell,
.main-panel,
.content {
    touch-action: pan-x pan-y pinch-zoom;
}

.table-wrap,
.table-scroll,
.report-table-scroll,
.report-table-wrap,
.document-table-wrap,
.public-token-table,
.instructor-roster-table,
.report-chart,
.report-tabs,
.table-wrap > table,
.table-scroll > table,
.report-table-scroll > table,
.report-table-wrap > table,
.document-table-wrap > table,
.public-token-table > table,
.instructor-roster-table > table {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom !important;
}

/* Tombol tetap cepat disentuh dan tidak menahan gerakan cubit halaman. */
button,
.button,
a,
summary,
input,
select,
textarea {
    touch-action: manipulation;
}

/* Landscape HP dan tablet kecil: maksimalkan bidang kerja tanpa mengecilkan
   teks secara paksa. Tabel yang lebar tetap bisa disapu ke samping. */
@media (orientation: landscape) and (max-width: 1180px) and (max-height: 700px) {
    .app-shell {
        padding-bottom: calc(58px + env(safe-area-inset-bottom)) !important;
    }

    .main-panel {
        width: 100% !important;
        max-width: none !important;
        padding: 8px 10px calc(66px + env(safe-area-inset-bottom)) !important;
    }

    .content {
        width: 100% !important;
        max-width: none !important;
    }

    .topbar {
        gap: 8px !important;
        margin-bottom: 8px !important;
    }

    .panel,
    .notice,
    .form-section {
        padding: 10px !important;
    }

    .table-scroll-controls {
        min-height: 38px !important;
        margin: 6px 0 !important;
        gap: 4px !important;
    }

    .table-scroll-arrow,
    .table-nav-btn {
        min-width: 38px !important;
        min-height: 38px !important;
        padding: 5px 8px !important;
    }

    .table-wrap th,
    .table-wrap td,
    .table-scroll th,
    .table-scroll td,
    .report-table-scroll th,
    .report-table-scroll td {
        padding: 7px 8px !important;
        font-size: .82rem !important;
        line-height: 1.25 !important;
    }

    .bottom-nav {
        min-height: 52px !important;
        padding: 4px max(6px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)) !important;
        gap: 4px !important;
    }

    .bottom-nav > a,
    .bottom-more > summary {
        min-height: 42px !important;
        padding: 5px 7px !important;
        font-size: .78rem !important;
        line-height: 1.1 !important;
    }

    .floating-back-button {
        right: max(8px, env(safe-area-inset-right)) !important;
        bottom: calc(58px + env(safe-area-inset-bottom)) !important;
        min-width: 44px !important;
        min-height: 42px !important;
        padding: 7px 12px !important;
        font-size: .8rem !important;
        opacity: .92;
    }

    .floating-back-button__icon {
        font-size: 16px !important;
    }
}

/* Tablet landscape yang lebih tinggi tetap mendapat ruang aman terhadap
   tombol navigasi bawah, tanpa memaksa layout desktop menjadi layout HP. */
@media (orientation: landscape) and (min-width: 801px) and (max-width: 1366px) {
    .table-wrap,
    .table-scroll,
    .report-table-scroll,
    .report-table-wrap {
        max-width: 100% !important;
        overflow-x: auto !important;
        overscroll-behavior-inline: contain;
    }
}
