/* =========================================================
   TARBIYA MINIMALISM ADMIN - responsive.css
   Breakpoint: Tablet (768-1199), Mobile (<768)
   ========================================================= */

/* ---------- XL ke atas: sidebar penuh (default app.css) ---------- */

@media (max-width: 1199.98px) {
    .tm-content {
        padding: 18px;
    }

    .tm-stat-value {
        font-size: 20px;
    }
}

/* ---------- Tablet: sidebar compact (ikon saja) ---------- */

@media (min-width: 768px) and (max-width: 1199.98px) {
    :root {
        --tm-sidebar-w: 76px;
    }

    .tm-sidebar-brand {
        justify-content: center;
        padding: 0;
    }

    .tm-brand-link {
        justify-content: center;
    }

    .tm-brand-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .tm-nav {
        padding: 12px 8px;
    }

    .tm-nav-section {
        height: 1px;
        padding: 0;
        margin: 12px 6px;
        overflow: hidden;
        text-indent: -999px;
        background: var(--tm-border);
        color: transparent;
    }

    .tm-nav-link {
        position: relative;
        justify-content: center;
        padding: 9px;
        gap: 0;
    }

    .tm-nav-link span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .tm-nav-link i {
        font-size: 19px;
        width: auto;
    }

    .tm-sidebar-footer {
        justify-content: center;
        padding: 10px 8px;
    }

    .tm-user-mini-info {
        display: none;
    }

    .tm-user-mini {
        flex: 0 0 auto;
    }

    .tm-logout-btn {
        display: none;
    }

    .tm-topbar {
        padding: 0 18px;
    }

    .tm-pos {
        grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr);
        gap: 14px;
        padding: 14px;
    }

    .tm-pay-method-inner {
        min-height: 78px;
    }

    .tm-login-brand {
        padding: 36px;
    }
}

/* ---------- Mobile: sidebar menjadi offcanvas ---------- */

@media (max-width: 767.98px) {
    :root {
        --tm-sidebar-w: 0px;
    }

    .tm-main {
        margin-left: 0;
    }

    .tm-sidebar {
        width: min(280px, 84vw);
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: none;
    }

    .tm-sidebar.is-open {
        transform: translateX(0);
        box-shadow: var(--tm-shadow-md);
    }

    .tm-topbar {
        padding: 0 14px;
        gap: 10px;
    }

    .tm-topbar-date,
    .tm-pill {
        display: none;
    }

    .tm-topbar-user .tm-user-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .tm-topbar-user {
        position: relative;
    }

    .tm-content {
        padding: 14px;
    }

    .tm-page-header {
        margin-bottom: 14px;
    }

    .tm-page-header h2 {
        font-size: 18px;
    }

    .tm-page-header-actions {
        width: 100%;
    }

    .tm-page-header-actions .tm-btn {
        flex: 1;
    }

    .tm-stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tm-stat-card {
        padding: 13px;
    }

    .tm-stat-value {
        font-size: 17px;
    }

    .tm-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tm-toolbar {
        padding: 12px 14px;
    }

    .tm-search {
        max-width: none;
        flex-basis: 100%;
    }

    .tm-toolbar .form-select {
        flex: 1;
        min-width: 130px;
    }

    .tm-panel-header {
        padding: 12px 14px;
    }

    .tm-panel-body {
        padding: 14px;
    }

    .tm-table th,
    .tm-table td {
        padding: 10px 14px;
    }

    .tm-tabs {
        padding: 0 12px;
        overflow-x: auto;
    }

    /* POS: layout vertikal sesuai urutan mobile */
    .tm-content-flush {
        height: auto;
        overflow: visible;
    }

    .tm-pos {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding: 12px;
        gap: 12px;
    }

    .tm-pos-input,
    .tm-pos-side {
        overflow: visible;
    }

    .tm-pos-display {
        padding: 16px;
        position: sticky;
        top: calc(var(--tm-topbar-h) + 4px);
        z-index: 5;
    }

    .tm-pos-display-value {
        font-size: 38px;
    }

    .tm-numpad-key {
        min-height: 60px;
        font-size: 21px;
    }

    .tm-numpad-key.is-nominal {
        font-size: 15px;
        min-height: 54px;
    }

    .tm-numpad-grid.tm-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .tm-pay-methods {
        grid-template-columns: repeat(2, 1fr);
    }

    .tm-pay-method-inner {
        min-height: 76px;
        flex-direction: row;
        gap: 8px;
    }

    .tm-pay-method-inner i {
        font-size: 20px;
    }

    .tm-pay-panel {
        padding: 14px;
    }

    .tm-pay-total {
        font-size: 21px;
    }

    .tm-btn-pay {
        min-height: 56px;
        position: sticky;
        bottom: 10px;
    }

    .tm-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tm-product-card {
        min-height: 108px;
        padding: 12px;
    }

    .tm-cart-list {
        max-height: none;
    }

    .tm-chart {
        height: 150px;
        gap: 6px;
    }

    .tm-chart-value {
        display: none;
    }

    /* Login mobile */
    .tm-login {
        grid-template-columns: 1fr;
    }

    .tm-login-brand {
        display: none;
    }

    .tm-login-form-side {
        min-height: 100vh;
        align-items: flex-start;
        padding: 32px 20px;
    }

    .tm-login-mobile-brand {
        display: flex;
    }

    .tm-profile-hero {
        padding: 18px;
        gap: 14px;
    }

    .tm-settings-item {
        flex-wrap: wrap;
    }
}

/* ---------- Mobile kecil ---------- */

@media (max-width: 420px) {
    .tm-stat-grid {
        grid-template-columns: 1fr;
    }

    .tm-product-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tm-pay-methods {
        grid-template-columns: 1fr 1fr;
    }

    .tm-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Tinggi rendah (laptop landscape) ---------- */

@media (max-height: 700px) and (min-width: 768px) {
    .tm-pos-display {
        padding: 14px 18px;
    }

    .tm-pos-display-value {
        font-size: 34px;
    }

    .tm-numpad-key {
        min-height: 48px;
    }
}

/* ---------- Resume Penerimaan POS ---------- */

@media (max-width: 1199.98px) {
    .tm-resume-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .tm-resume-toolbar {
        padding: 12px 14px;
        gap: 12px;
    }

    .tm-range-switch {
        width: 100%;
    }

    .tm-range-btn {
        flex: 1;
    }

    .tm-range-label {
        width: 100%;
    }

    .tm-resume-date {
        width: 100%;
    }

    .tm-resume-date .form-control {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }

    .tm-resume-filters {
        width: 100%;
        margin-left: 0;
    }

    .tm-resume-filters .form-select {
        flex: 1;
        min-width: 130px;
    }

    .tm-method-total strong {
        font-size: 15px;
    }
}

@media (max-width: 420px) {
    .tm-resume-filters .form-select {
        flex-basis: 100%;
    }
}

/* Sembunyikan rincian metode per kasir pada layar yang belum cukup lebar. */
@media (max-width: 1439.98px) {
    .tm-resume-table .tm-col-method {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .tm-table-scroll-hint {
        display: flex;
        align-items: center;
        gap: 2px;
    }

    .tm-resume-table {
        min-width: 0;
    }

    .tm-resume-table .tm-col-trx {
        display: none;
    }

    .tm-resume-table th,
    .tm-resume-table td {
        padding-left: 8px;
        padding-right: 8px;
    }

    .tm-resume-table th:first-child,
    .tm-resume-table td:first-child {
        padding-left: 14px;
    }

    .tm-resume-table th:last-child,
    .tm-resume-table td:last-child {
        padding-right: 14px;
    }
}
