/* Tampilan Dinamis & Responsif Khusus Ponsel (Mobile-First Polish) */
:root {
    --pos-primary: #0d6efd;
    --pos-surface: #ffffff;
    --pos-bg: #f4f6f9;
}

body {
    background-color: var(--pos-bg);
    -webkit-tap-highlight-color: transparent;
}

.card {
    border: none;
    border-radius: 14px;
}

.card-header {
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
}

/* Navigasi bawah khusus layar ponsel */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: 76px; /* Ruang aman agar tidak tertutup bottom nav */
    }

    /* Sembunyikan navbar atas di ponsel agar lebih ringkas & fokus */
    .top-desktop-nav {
        display: none !important;
    }

    /* Header ringkas khusus ponsel */
    .mobile-top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--pos-primary);
        color: #fff;
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 1020;
        box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--pos-surface);
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
        z-index: 1030;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        justify-content: space-around;
        align-items: center;
    }

    .mobile-bottom-nav a {
        flex: 1;
        text-align: center;
        text-decoration: none;
        color: #64748b;
        font-size: 11px;
        font-weight: 600;
        padding: 4px 2px;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        transition: all 0.15s ease;
    }

    .mobile-bottom-nav a svg {
        width: 20px;
        height: 20px;
    }

    .mobile-bottom-nav a.active {
        color: var(--pos-primary);
        background: rgba(13, 110, 253, 0.08);
    }

    /* Tombol & input nyaman disentuh jari */
    .btn {
        min-height: 42px;
        border-radius: 10px;
    }

    .btn-sm {
        min-height: 36px;
        border-radius: 8px;
    }

    .form-control, .form-select {
        min-height: 44px;
        border-radius: 10px;
        font-size: 15px; /* Mencegah auto-zoom di iOS Safari */
    }

    /* Ubah tabel menjadi kartu dinamis di layar ponsel */
    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards,
    .table-mobile-cards tbody,
    .table-mobile-cards tr,
    .table-mobile-cards td {
        display: block;
        width: 100%;
    }

    .table-mobile-cards tr {
        background: #fff;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 10px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }

    .table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 5px 0 !important;
        border: none !important;
        border-bottom: 1px dashed #f1f5f9 !important;
        text-align: right;
    }

    .table-mobile-cards td:last-child {
        border-bottom: none !important;
        padding-top: 8px !important;
    }

    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #475569;
        font-size: 12px;
        text-align: left;
        flex-shrink: 0;
    }

    .table-mobile-cards td.td-empty {
        display: block;
        text-align: center;
    }

    .table-mobile-cards td.td-empty::before {
        content: none;
    }
}

@media (min-width: 768px) {
    .mobile-top-bar,
    .mobile-bottom-nav {
        display: none !important;
    }
}
