/* POS UMKM - Light/Dark mode switch */
.theme-toggle-btn {
    appearance: none;
    border: 1px solid var(--app-border, #dbe4ef);
    background: var(--app-surface, #ffffff);
    color: var(--app-text, #102033);
    min-height: 38px;
    padding: 7px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--app-shadow-xs, 0 1px 2px rgba(15, 23, 42, .05));
    transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
    white-space: nowrap;
}

.theme-toggle-btn:hover {
    transform: translateY(-1px);
    border-color: var(--app-primary, #2563eb);
    color: var(--app-primary-strong, #1e40af);
}

.theme-toggle-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--app-primary-soft, #e8f0ff);
    color: var(--app-primary-strong, #1e40af);
    font-size: 13px;
}

.theme-toggle-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.theme-toggle-text small {
    color: var(--app-muted, #64748b);
    font-size: 10px;
    font-weight: 800;
}

.login-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(12px);
}

.theme-dark .login-theme-toggle,
.theme-dark .theme-toggle-btn {
    background: rgba(15, 23, 42, .86);
    border-color: rgba(71, 85, 105, .78);
    color: #e2e8f0;
}

.theme-dark .theme-toggle-icon {
    background: rgba(96, 165, 250, .16);
    color: #bfdbfe;
}

.theme-dark .theme-toggle-text small {
    color: #94a3b8;
}

@media (max-width: 760px) {
    .app-nav-right .theme-toggle-btn {
        width: 100%;
        justify-content: center;
    }

    .login-theme-toggle {
        top: 12px;
        right: 12px;
    }

    .theme-toggle-text small {
        display: none;
    }
}


/* Tahap 24B2K.2 - Navbar dipaksa tetap dark professional di semua mode.
   Penyebab bug sebelumnya: sebagian halaman belum memakai class body theme-light,
   jadi selector .theme-light .app-navbar tidak pernah kena. */
.app-navbar {
    --nav-bg: #0f172a;
    --nav-bg-2: #111827;
    --nav-text: #ffffff;
    --nav-muted: #cbd5e1;
    --nav-hover: rgba(255,255,255,.12);
    --nav-active: #2563eb;
    --nav-active-hover: #1d4ed8;
    --nav-border: rgba(255,255,255,.14);
    background: linear-gradient(135deg, var(--nav-bg), var(--nav-bg-2)) !important;
    color: var(--nav-text) !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    box-shadow: 0 10px 28px rgba(2, 6, 23, .22) !important;
}

.app-navbar .app-brand,
.app-navbar .app-brand-text strong,
.app-navbar .app-nav-link,
.app-navbar .app-nav-trigger,
.app-navbar .user-button,
.app-navbar .user-button span:nth-child(2),
.app-navbar .mobile-menu-label {
    color: #ffffff !important;
}

.app-navbar .app-brand-text small,
.app-navbar .app-nav-trigger:after,
.app-navbar .branch-pill,
.app-navbar .branch-pill span {
    color: #cbd5e1 !important;
}

.app-navbar .branch-pill strong {
    color: #ffffff !important;
}

.app-navbar .nav-icon,
.app-navbar .branch-pill,
.app-navbar .user-button,
.app-navbar .mobile-menu-label {
    background: rgba(255,255,255,.10) !important;
    border-color: rgba(255,255,255,.14) !important;
    box-shadow: none !important;
}

.app-navbar .app-nav-link:hover,
.app-navbar .app-nav-trigger:hover,
.app-navbar .app-nav-link.active,
.app-navbar .app-nav-group.active .app-nav-trigger {
    background: rgba(255,255,255,.12) !important;
    color: #ffffff !important;
}

.app-navbar .app-nav-link.primary {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(37,99,235,.30) !important;
}

.app-navbar .app-nav-link.primary:hover {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}

.app-navbar .app-nav-link.primary .nav-icon {
    background: rgba(255,255,255,.18) !important;
}

.app-navbar .app-brand-mark {
    background: linear-gradient(135deg,#2563eb,#06b6d4) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px rgba(37,99,235,.35) !important;
}

.app-navbar .user-avatar {
    background: #ffffff !important;
    color: #0f172a !important;
}

.app-navbar .theme-toggle-btn {
    background: rgba(255,255,255,.10) !important;
    border-color: rgba(255,255,255,.14) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.app-navbar .theme-toggle-btn:hover {
    background: rgba(255,255,255,.16) !important;
    color: #ffffff !important;
}

.app-navbar .theme-toggle-icon {
    background: rgba(255,255,255,.12) !important;
    color: #bfdbfe !important;
}

.app-navbar .theme-toggle-text small {
    color: #cbd5e1 !important;
}


/* Tahap 24B2K3 - Khusus hero dashboard tetap dark juga saat Light Mode.
   User hanya minta section hero ini yang dipertahankan gayanya, jadi override dibuat spesifik. */
.dashboard-page .dashboard-hero-main {
    color: #ffffff !important;
    background:
        radial-gradient(circle at 88% 12%, rgba(59, 130, 246, .55), transparent 32%),
        radial-gradient(circle at 12% 82%, rgba(34, 197, 94, .22), transparent 28%),
        linear-gradient(135deg, #0f172a, #1e293b 58%, #111827) !important;
    border: 1px solid rgba(30, 41, 59, .82) !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .18) !important;
}

.dashboard-page .dashboard-hero-main h1,
.dashboard-page .dashboard-hero-main p strong {
    color: #ffffff !important;
}

.dashboard-page .dashboard-hero-main p {
    color: rgba(255, 255, 255, .76) !important;
}

.dashboard-page .dashboard-hero-main .hero-eyebrow {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 14px !important;
    border-radius: 999px !important;
    background: rgba(37, 99, 235, .18) !important;
    border: 1px solid rgba(96, 165, 250, .26) !important;
    color: #dbeafe !important;
    letter-spacing: .08em !important;
}

.dashboard-page .dashboard-hero-main .btn-glass {
    color: #ffffff !important;
    background: rgba(255, 255, 255, .10) !important;
    border-color: rgba(255, 255, 255, .18) !important;
}

.dashboard-page .dashboard-hero-main .btn-glass:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, .16) !important;
}


/* Tahap 24B2K4 - Light mode kasir readability fix.
   Masalah utama: pos header menjadi putih oleh modern-ui.css,
   tetapi beberapa teks masih memakai warna yang dirancang untuk background gelap. */
.theme-light .pos-header {
    background: rgba(255, 255, 255, .96) !important;
    border-color: rgba(219, 228, 239, .94) !important;
}

.theme-light .pos-header h2 {
    color: #0f172a !important;
}

.theme-light .info-line {
    color: #64748b !important;
}

.theme-light .info-line strong {
    color: #0f172a !important;
}

.theme-light .shortcut-bar .kbd,
.theme-light .kbd {
    background: #f8fafc !important;
    border-color: #dbe3ef !important;
    color: #0f172a !important;
}

.theme-light .shortcut-bar .kbd span,
.theme-light .kbd span {
    color: #475569 !important;
}

.theme-light .inline-item-panel.is-empty,
.theme-light .top-customer-meta,
.theme-light .small-muted,
.theme-light .payment-status-box strong,
.theme-light .submit-helper {
    color: #64748b !important;
}

.theme-light .payment-status-box span,
.theme-light .submit-helper strong,
.theme-light .checkout-section-title,
.theme-light .top-customer-name,
.theme-light .inline-item-name,
.theme-light .cart-product-name,
.theme-light .summary-row strong,
.theme-light .summary-fixed label {
    color: #0f172a !important;
}

.theme-light .empty-cart {
    color: #64748b !important;
}

.theme-light .empty-cart strong {
    color: #334155 !important;
}


/* Tahap 24B2K6/K7 - Finance page header readability.
   Sebelumnya selector terlalu global (.page-header) sehingga halaman non-finance
   seperti customer_groups ikut menjadi putih. Sekarang dibatasi khusus halaman finance. */
body.finance-page .page-header,
body.finance-report-page .page-header,
body.cash-category-page .page-header {
    color: #ffffff !important;
}

body.finance-page .page-header h1,
body.finance-page .page-header h2,
body.finance-page .page-header h3,
body.finance-report-page .page-header h1,
body.finance-report-page .page-header h2,
body.finance-report-page .page-header h3,
body.cash-category-page .page-header h1,
body.cash-category-page .page-header h2,
body.cash-category-page .page-header h3 {
    color: #ffffff !important;
}

body.finance-page .page-header p,
body.finance-page .page-header p strong,
body.finance-page .page-header .muted,
body.finance-report-page .page-header p,
body.finance-report-page .page-header p strong,
body.finance-report-page .page-header .muted,
body.cash-category-page .page-header p,
body.cash-category-page .page-header p strong,
body.cash-category-page .page-header .muted {
    color: rgba(255, 255, 255, .86) !important;
}

body:not(.finance-page):not(.finance-report-page):not(.cash-category-page) .page-header h1,
body:not(.finance-page):not(.finance-report-page):not(.cash-category-page) .page-header h2,
body:not(.finance-page):not(.finance-report-page):not(.cash-category-page) .page-header h3 {
    color: var(--app-heading, #0f172a) !important;
}

body:not(.finance-page):not(.finance-report-page):not(.cash-category-page) .page-header p,
body:not(.finance-page):not(.finance-report-page):not(.cash-category-page) .page-header p strong,
body:not(.finance-page):not(.finance-report-page):not(.cash-category-page) .page-header .muted,
body:not(.finance-page):not(.finance-report-page):not(.cash-category-page) .page-subtitle {
    color: var(--app-muted, #64748b) !important;
}


/* Tahap 24B2K11 - Compact theme toggle button.
   Tombol mode dibuat lebih simple agar tidak makan tempat di navbar. */
.app-navbar .theme-toggle-btn,
.login-theme-toggle.theme-toggle-btn,
.login-theme-toggle {
    min-height: 34px !important;
    padding: 6px 10px !important;
    gap: 6px !important;
    border-radius: 14px !important;
}

.app-navbar .theme-toggle-icon,
.login-theme-toggle .theme-toggle-icon {
    width: 18px !important;
    height: 18px !important;
    font-size: 11px !important;
}

.app-navbar .theme-toggle-text,
.login-theme-toggle .theme-toggle-text {
    gap: 0 !important;
}

.app-navbar .theme-toggle-text strong,
.login-theme-toggle .theme-toggle-text strong {
    font-size: 11px !important;
    line-height: 1.1 !important;
    letter-spacing: 0 !important;
}

.app-navbar .theme-toggle-text small,
.login-theme-toggle .theme-toggle-text small {
    display: none !important;
}


/* Tahap 24B2J19 - POS Kasir compact no-scroll layout.
   Tujuan: area kanan Pembayaran tidak sempit/terlalu tinggi dan halaman kasir lebih muat di layar desktop. */
@media (min-width: 1200px) {
    .pos-page {
        height: calc(100vh - 66px) !important;
        padding: 8px !important;
        gap: 8px !important;
        overflow: hidden !important;
    }

    .pos-header {
        min-height: 58px !important;
        padding: 8px 16px !important;
        border-radius: 18px !important;
    }

    .pos-header h2 {
        font-size: 18px !important;
        margin-bottom: 2px !important;
    }

    .info-line {
        font-size: 11px !important;
    }

    .shortcut-bar {
        gap: 5px !important;
    }

    .shortcut-bar .kbd,
    .kbd {
        padding: 5px 8px !important;
        font-size: 10.5px !important;
        border-radius: 10px !important;
    }

    .pos-form {
        gap: 8px !important;
    }

    .pos-topbar {
        grid-template-columns: minmax(230px, .85fr) minmax(280px, 1fr) minmax(250px, .9fr) 112px 82px 96px 78px !important;
        gap: 8px !important;
        padding: 8px !important;
        border-radius: 18px !important;
    }

    .top-box {
        min-height: 62px !important;
        padding: 8px !important;
        border-radius: 13px !important;
    }

    .scan-box-main label,
    .top-card-title {
        margin-bottom: 4px !important;
        font-size: 11px !important;
    }

    #barcodeInput {
        height: 36px !important;
        min-height: 36px !important;
        font-size: 15px !important;
    }

    .inline-item-panel.is-empty {
        font-size: 12px !important;
        line-height: 1.25 !important;
    }

    .top-customer-name {
        font-size: 13px !important;
    }

    .top-customer-meta {
        font-size: 10.5px !important;
    }

    .customer-top-card .top-customer-actions .btn {
        min-height: 25px !important;
        height: 25px !important;
        font-size: 10.5px !important;
        padding: 4px 6px !important;
    }

    .fast-toggle,
    .top-action-btn {
        min-height: 62px !important;
        padding: 7px 8px !important;
        font-size: 12px !important;
        border-radius: 13px !important;
    }

    .print-toggle span {
        font-size: 11px !important;
    }

    .pos-content {
        grid-template-columns: minmax(0, 1fr) minmax(430px, 470px) !important;
        gap: 8px !important;
        min-height: 0 !important;
    }

    .cart-panel,
    .checkout-panel {
        border-radius: 18px !important;
    }

    .panel-header,
    .checkout-panel .panel-header {
        padding: 9px 13px !important;
    }

    .panel-header h3,
    .cart-panel h3,
    .checkout-panel h3 {
        font-size: 17px !important;
    }

    .small-muted {
        font-size: 11px !important;
        line-height: 1.25 !important;
    }

    .checkout-body {
        padding: 8px !important;
        overflow: auto !important;
    }

    .checkout-section {
        padding: 8px !important;
        margin-bottom: 7px !important;
        border-radius: 13px !important;
    }

    .checkout-section-title {
        margin-bottom: 6px !important;
        font-size: 12px !important;
    }

    .payment-grid {
        gap: 7px !important;
    }

    .payment-grid label,
    .checkout-panel label {
        margin-bottom: 4px !important;
        font-size: 11px !important;
    }

    .payment-grid input,
    .payment-grid select,
    .checkout-panel input,
    .checkout-panel select {
        height: 34px !important;
        min-height: 34px !important;
        padding: 7px 9px !important;
        font-size: 13px !important;
        border-radius: 9px !important;
    }

    #receivableMethodHint,
    #paidAmountHint {
        padding: 6px 8px !important;
        font-size: 10.5px !important;
        line-height: 1.2 !important;
        border-radius: 9px !important;
    }

    .payment-status-box {
        margin-top: 7px !important;
        padding: 7px 9px !important;
        border-radius: 11px !important;
        gap: 2px !important;
        font-size: 11px !important;
    }

    .payment-status-box strong {
        font-size: 10px !important;
    }

    .summary-fixed {
        padding: 8px !important;
    }

    .summary-row {
        margin-bottom: 5px !important;
        font-size: 13px !important;
    }

    .summary-row.total {
        margin: 7px 0 8px !important;
        padding: 10px 12px !important;
        border-radius: 14px !important;
        font-size: 21px !important;
    }

    .summary-fixed label,
    .pos-field-label-tight {
        margin: 7px 0 5px !important;
        font-size: 12px !important;
    }

    .pay-input {
        height: 39px !important;
        min-height: 39px !important;
        font-size: 18px !important;
        border-radius: 12px !important;
    }

    .quick-pay-row {
        gap: 5px !important;
        margin-top: 6px !important;
    }

    .quick-pay-row button {
        padding: 7px 5px !important;
        font-size: 11px !important;
        border-radius: 9px !important;
    }

    .summary-row.change {
        margin-top: 7px !important;
        margin-bottom: 7px !important;
        font-size: 15px !important;
    }

    .submit-helper {
        margin-top: 6px !important;
        padding: 7px 9px !important;
        font-size: 11px !important;
        border-radius: 10px !important;
    }

    .submit-grid {
        margin-top: 7px !important;
    }

    #submitTransactionBtn {
        height: 44px !important;
        min-height: 44px !important;
        font-size: 15px !important;
        border-radius: 13px !important;
    }

    .cart-table td {
        height: 40px !important;
    }

    .cart-table th,
    .cart-table td {
        padding: 7px 9px !important;
    }

    .empty-cart {
        min-height: 260px !important;
        font-size: 14px !important;
    }
}

@media (min-width: 1200px) and (max-height: 820px) {
    .pos-header {
        min-height: 52px !important;
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }

    .pos-topbar {
        padding: 7px !important;
    }

    .top-box,
    .fast-toggle,
    .top-action-btn {
        min-height: 56px !important;
    }

    .checkout-panel .panel-header {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }

    .summary-row.total {
        font-size: 20px !important;
    }

    #submitTransactionBtn {
        height: 42px !important;
        min-height: 42px !important;
    }
}


/* Tahap 24B2J20 - Kasir layout: action buttons pindah ke header, pembayaran naik sejajar topbar.
   Scan/Detail/Pelanggan hanya memakai kolom kiri sampai batas keranjang, sehingga panel pembayaran lebih lega. */
.header-action-toggle,
.header-action-btn {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .08);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.header-action-toggle:hover,
.header-action-btn:hover {
    background: rgba(255, 255, 255, .13);
    color: #ffffff;
    transform: translateY(-1px);
}

.header-action-toggle input {
    width: auto !important;
    min-height: auto !important;
    transform: scale(.95);
    margin: 0;
}

.header-action-toggle small,
.header-action-btn small {
    font-size: 10px;
    opacity: .86;
}

.header-search-btn {
    background: rgba(37, 99, 235, .26);
    border-color: rgba(96, 165, 250, .35);
    color: #dbeafe;
}

.header-history-btn {
    background: rgba(255, 255, 255, .07);
}

@media (min-width: 1200px) {
    .shortcut-bar {
        align-items: center !important;
    }

    .pos-form {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(430px, 470px) !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        gap: 8px !important;
        min-height: 0 !important;
        flex: 1 1 auto !important;
    }

    .pos-topbar {
        grid-column: 1 / 2 !important;
        grid-row: 1 / 2 !important;
        grid-template-columns: minmax(230px, .85fr) minmax(300px, 1fr) minmax(260px, .9fr) !important;
        align-self: start !important;
        width: 100% !important;
    }

    .pos-content {
        display: contents !important;
    }

    .cart-panel {
        grid-column: 1 / 2 !important;
        grid-row: 2 / 3 !important;
        min-height: 0 !important;
    }

    .checkout-panel {
        grid-column: 2 / 3 !important;
        grid-row: 1 / 3 !important;
        min-height: 0 !important;
        height: 100% !important;
    }

    .checkout-body {
        flex: 0 0 auto !important;
        max-height: none !important;
    }

    .summary-fixed {
        margin-top: auto !important;
    }

    .top-box {
        min-height: 62px !important;
    }
}

@media (min-width: 1200px) and (max-height: 820px) {
    .header-action-toggle,
    .header-action-btn {
        min-height: 31px !important;
        padding: 6px 10px !important;
        font-size: 11px !important;
        border-radius: 11px !important;
    }

    .pos-topbar {
        grid-template-columns: minmax(220px, .85fr) minmax(280px, 1fr) minmax(250px, .9fr) !important;
    }
}


/* Tahap 24B2J21 - Kasir checkout compact: pastikan tombol Simpan selalu terlihat di desktop.
   Setelah panel pembayaran dinaikkan, isi kanan masih terlalu tinggi pada layar 768px. */
@media (min-width: 1200px) {
    .checkout-panel {
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .checkout-panel .panel-header {
        padding: 10px 14px !important;
    }

    .checkout-panel .panel-header h3 {
        font-size: 18px !important;
        line-height: 1.1 !important;
    }

    .checkout-panel .panel-header .small-muted {
        font-size: 12px !important;
        line-height: 1.2 !important;
        margin-top: 2px !important;
    }

    .checkout-body {
        flex: 0 0 auto !important;
        padding: 8px 10px 6px !important;
        overflow: visible !important;
    }

    .checkout-section {
        padding: 9px !important;
        margin-bottom: 8px !important;
        border-radius: 13px !important;
    }

    .checkout-section-title {
        margin-bottom: 6px !important;
        font-size: 13px !important;
    }

    .payment-grid {
        gap: 7px !important;
    }

    .payment-grid label,
    .checkout-panel label {
        font-size: 11px !important;
        margin-bottom: 4px !important;
    }

    .payment-grid input,
    .payment-grid select,
    .checkout-panel input,
    .checkout-panel select {
        height: 34px !important;
        min-height: 34px !important;
        padding: 6px 9px !important;
        font-size: 13px !important;
    }

    .payment-status-box {
        margin-top: 7px !important;
        padding: 7px 10px !important;
        gap: 2px !important;
        border-radius: 12px !important;
    }

    .payment-status-box strong {
        font-size: 10px !important;
    }

    .payment-status-box span {
        font-size: 12px !important;
    }

    .summary-fixed {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        margin-top: 0 !important;
        padding: 9px 12px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        gap: 5px !important;
        overflow: visible !important;
    }

    .summary-row {
        margin-bottom: 2px !important;
        font-size: 13px !important;
        line-height: 1.15 !important;
    }

    .summary-row.total {
        margin: 4px 0 5px !important;
        padding: 10px 12px !important;
        min-height: 46px !important;
        font-size: 22px !important;
        border-radius: 13px !important;
    }

    .summary-fixed label,
    .pos-field-label-tight {
        margin: 4px 0 4px !important;
        font-size: 12px !important;
    }

    .pay-input {
        height: 39px !important;
        min-height: 39px !important;
        font-size: 19px !important;
        border-radius: 12px !important;
    }

    .quick-pay-row {
        gap: 5px !important;
        margin-top: 5px !important;
    }

    .quick-pay-row button {
        padding: 7px 5px !important;
        min-height: 32px !important;
        font-size: 11px !important;
        border-radius: 9px !important;
    }

    #paidAmountHint {
        margin-top: 4px !important;
        padding: 6px 8px !important;
        font-size: 10.5px !important;
        line-height: 1.2 !important;
    }

    .summary-row.change {
        margin-top: 4px !important;
        margin-bottom: 4px !important;
        font-size: 14px !important;
    }

    .submit-helper {
        margin-top: 3px !important;
        padding: 7px 9px !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
        border-radius: 10px !important;
    }

    .submit-grid {
        margin-top: 5px !important;
    }

    #submitTransactionBtn {
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 13px !important;
        font-size: 15px !important;
    }
}

@media (min-width: 1200px) and (max-height: 820px) {
    .checkout-panel .panel-header .small-muted,
    .submit-helper {
        display: none !important;
    }

    .checkout-section {
        margin-bottom: 6px !important;
    }

    .summary-fixed {
        gap: 4px !important;
    }

    .summary-row.total {
        min-height: 42px !important;
        font-size: 20px !important;
        padding: 8px 11px !important;
    }

    #submitTransactionBtn {
        height: 44px !important;
        min-height: 44px !important;
    }
}


/* Tahap 24B2J22 - Kasir layout v2.
   Header kasir + tombol aksi dibatasi sampai kolom keranjang.
   Shortcut F4/F6/F7/F8/F9/Esc dipindah ke bawah keranjang agar panel pembayaran bisa mulai paling atas. */
@media (min-width: 1200px) {
    .pos-page {
        height: calc(100vh - 66px) !important;
        padding: 7px 8px !important;
        gap: 6px !important;
    }

    .pos-form {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(445px, 490px) !important;
        grid-template-rows: auto auto minmax(0, 1fr) auto !important;
        gap: 7px 8px !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }

    .pos-header {
        grid-column: 1 / 2 !important;
        grid-row: 1 / 2 !important;
        min-height: 45px !important;
        padding: 6px 14px !important;
        border-radius: 16px !important;
        display: grid !important;
        grid-template-columns: minmax(260px, 1fr) auto !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .pos-header h2 {
        font-size: 18px !important;
        margin: 0 0 1px !important;
        line-height: 1.12 !important;
    }

    .info-line {
        font-size: 11px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .header-main-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }

    .header-action-toggle,
    .header-action-btn {
        min-height: 30px !important;
        padding: 5px 10px !important;
        font-size: 11px !important;
        border-radius: 10px !important;
        gap: 5px !important;
    }

    .header-action-toggle small,
    .header-action-btn small {
        font-size: 9px !important;
    }

    .header-action-toggle input {
        transform: scale(.88) !important;
    }

    .pos-topbar {
        grid-column: 1 / 2 !important;
        grid-row: 2 / 3 !important;
        grid-template-columns: minmax(230px, .82fr) minmax(285px, 1fr) minmax(255px, .9fr) !important;
        gap: 7px !important;
        padding: 7px !important;
        border-radius: 16px !important;
        width: 100% !important;
    }

    .top-box {
        min-height: 56px !important;
        padding: 7px 8px !important;
        border-radius: 12px !important;
    }

    #barcodeInput {
        height: 34px !important;
        min-height: 34px !important;
        font-size: 15px !important;
    }

    .inline-item-panel.is-empty {
        font-size: 12px !important;
        line-height: 1.2 !important;
    }

    .customer-top-card {
        min-height: 56px !important;
        grid-template-columns: minmax(0, 1fr) 105px !important;
    }

    .customer-top-card .top-customer-actions .btn {
        min-height: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
    }

    .pos-content {
        display: contents !important;
    }

    .cart-panel {
        grid-column: 1 / 2 !important;
        grid-row: 3 / 4 !important;
        min-height: 0 !important;
    }

    .pos-bottom-shortcuts {
        grid-column: 1 / 2 !important;
        grid-row: 4 / 5 !important;
        min-height: 28px !important;
        padding: 4px 8px !important;
        border-radius: 12px !important;
        border: 1px solid rgba(219, 228, 239, .90) !important;
        background: rgba(255, 255, 255, .78) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
        box-shadow: var(--app-shadow-xs, 0 1px 2px rgba(15,23,42,.05)) !important;
    }

    .pos-bottom-shortcuts .kbd {
        min-height: 22px !important;
        padding: 4px 7px !important;
        font-size: 10px !important;
        border-radius: 8px !important;
        background: #f8fafc !important;
        border-color: #dbe3ef !important;
        color: #0f172a !important;
    }

    .pos-bottom-shortcuts .kbd span {
        color: #475569 !important;
    }

    .checkout-panel {
        grid-column: 2 / 3 !important;
        grid-row: 1 / 5 !important;
        min-height: 0 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .checkout-panel .panel-header {
        padding: 9px 14px !important;
    }

    .checkout-panel .panel-header h3 {
        font-size: 18px !important;
    }

    .checkout-body {
        padding: 8px 10px 6px !important;
        overflow: visible !important;
        flex: 0 0 auto !important;
    }

    .summary-fixed {
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }
}

@media (min-width: 1200px) and (max-height: 820px) {
    .pos-header {
        min-height: 42px !important;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    .pos-topbar {
        padding: 6px !important;
    }

    .top-box {
        min-height: 52px !important;
    }

    .pos-bottom-shortcuts {
        min-height: 25px !important;
        padding: 3px 8px !important;
    }

    .pos-bottom-shortcuts .kbd {
        min-height: 20px !important;
        padding: 3px 6px !important;
        font-size: 9.5px !important;
    }
}


/* Tahap 24B2J23 - Shortcut bawah kasir dark mode fix.
   theme-toggle.css dimuat setelah dark-mode.css, jadi perlu override dark di file ini juga. */
body.theme-dark .pos-bottom-shortcuts,
.theme-dark .pos-bottom-shortcuts {
    background: rgba(15, 23, 42, .82) !important;
    border-color: rgba(51, 65, 85, .92) !important;
    box-shadow: 0 8px 18px rgba(2, 6, 23, .18) !important;
}

body.theme-dark .pos-bottom-shortcuts .kbd,
.theme-dark .pos-bottom-shortcuts .kbd {
    background: rgba(30, 41, 59, .96) !important;
    border-color: rgba(71, 85, 105, .88) !important;
    color: #e2e8f0 !important;
    box-shadow: none !important;
}

body.theme-dark .pos-bottom-shortcuts .kbd span,
.theme-dark .pos-bottom-shortcuts .kbd span {
    color: #cbd5e1 !important;
}

.pos-bottom-shortcuts button.kbd {
    font-family: inherit;
    appearance: none;
    cursor: pointer;
}

.pos-bottom-shortcuts button.kbd:hover,
.pos-bottom-shortcuts button.kbd:focus-visible {
    border-color: #60a5fa !important;
    color: #1d4ed8 !important;
    outline: none;
}

body.theme-dark .pos-bottom-shortcuts button.kbd:hover,
body.theme-dark .pos-bottom-shortcuts button.kbd:focus-visible,
.theme-dark .pos-bottom-shortcuts button.kbd:hover,
.theme-dark .pos-bottom-shortcuts button.kbd:focus-visible {
    background: rgba(37, 99, 235, .22) !important;
    color: #ffffff !important;
}


/* Tahap 24B2J24 - Light mode fix untuk tombol aksi atas kasir.
   Tombol Fast Moving / Cari F2 / Print Nota / Riwayat harus kontras dan sejajar. */
body.theme-light .header-main-actions,
.theme-light .header-main-actions {
    align-items: center !important;
    gap: 6px !important;
}

body.theme-light .header-action-toggle,
body.theme-light .header-action-btn,
.theme-light .header-action-toggle,
.theme-light .header-action-btn {
    min-height: 30px !important;
    height: 30px !important;
    padding: 0 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06) !important;
    opacity: 1 !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

body.theme-light .header-action-toggle:hover,
body.theme-light .header-action-btn:hover,
.theme-light .header-action-toggle:hover,
.theme-light .header-action-btn:hover {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
}

body.theme-light .header-action-toggle span,
body.theme-light .header-action-btn,
body.theme-light .header-action-btn small,
.theme-light .header-action-toggle span,
.theme-light .header-action-btn,
.theme-light .header-action-btn small {
    color: inherit !important;
    opacity: 1 !important;
}

body.theme-light .header-action-toggle input,
.theme-light .header-action-toggle input {
    width: 13px !important;
    height: 13px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    opacity: 1 !important;
}

body.theme-light .header-search-btn,
.theme-light .header-search-btn {
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
    color: #1e3a8a !important;
}

body.theme-light .header-print-toggle,
.theme-light .header-print-toggle {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #0f172a !important;
}

body.theme-light .header-history-btn,
.theme-light .header-history-btn {
    background: #ffffff !important;
    border-color: #dbe3ef !important;
    color: #334155 !important;
}

/* Tahap 24B2J25 - Pelanggan pindah ke header kiri, aksi kasir turun ke shortcut bawah. */
@media (min-width: 1200px) {
    .pos-header {
        grid-template-columns: minmax(240px, .9fr) minmax(420px, 1.1fr) !important;
        gap: 8px !important;
        align-items: stretch !important;
    }

    .header-customer-card {
        min-height: 45px !important;
        padding: 6px 8px !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255, 255, 255, .12) !important;
        background: rgba(255, 255, 255, .06) !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 108px !important;
        align-items: center !important;
        gap: 8px !important;
        color: #e2e8f0 !important;
        overflow: hidden !important;
    }

    .header-customer-card .top-card-title {
        margin-bottom: 2px !important;
        font-size: 10.5px !important;
        color: #cbd5e1 !important;
        font-weight: 900 !important;
    }

    .header-customer-card .top-customer-name {
        font-size: 13px !important;
        line-height: 1.1 !important;
        color: #ffffff !important;
        max-width: 100% !important;
    }

    .header-customer-card .top-customer-meta {
        margin-top: 2px !important;
        font-size: 10.5px !important;
        color: #94a3b8 !important;
    }

    .header-customer-card .top-customer-actions {
        gap: 4px !important;
    }

    .header-customer-card .top-customer-actions .btn {
        min-height: 23px !important;
        height: 23px !important;
        padding: 4px 7px !important;
        font-size: 10px !important;
        border-radius: 8px !important;
    }

    .pos-topbar {
        grid-template-columns: minmax(260px, .74fr) minmax(430px, 1.26fr) !important;
    }

    .pos-bottom-shortcuts {
        justify-content: center !important;
        gap: 5px !important;
    }

    .pos-bottom-shortcuts .kbd,
    .pos-bottom-shortcuts .bottom-action-btn,
    .pos-bottom-shortcuts .bottom-action-toggle {
        min-height: 22px !important;
        height: 22px !important;
        padding: 3px 7px !important;
        font-size: 10px !important;
        line-height: 1 !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        white-space: nowrap !important;
        text-decoration: none !important;
        cursor: pointer !important;
        border: 1px solid #dbe3ef !important;
    }

    .pos-bottom-shortcuts .bottom-action-toggle input {
        width: 11px !important;
        height: 11px !important;
        min-height: 11px !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 auto !important;
    }

    .pos-bottom-shortcuts .bottom-action-toggle span,
    .pos-bottom-shortcuts .bottom-action-btn span,
    .pos-bottom-shortcuts .bottom-action-toggle small {
        font-size: 9.5px !important;
        line-height: 1 !important;
        opacity: .95 !important;
    }
}

@media (min-width: 1200px) and (max-height: 820px) {
    .header-customer-card {
        min-height: 40px !important;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    .header-customer-card .top-customer-meta {
        display: none !important;
    }

    .pos-bottom-shortcuts .kbd,
    .pos-bottom-shortcuts .bottom-action-btn,
    .pos-bottom-shortcuts .bottom-action-toggle {
        min-height: 20px !important;
        height: 20px !important;
        padding: 3px 6px !important;
        font-size: 9.5px !important;
    }
}

body.theme-light .header-customer-card,
.theme-light .header-customer-card {
    background: rgba(255, 255, 255, .96) !important;
    border-color: rgba(219, 228, 239, .94) !important;
    color: #0f172a !important;
}

body.theme-light .header-customer-card .top-card-title,
.theme-light .header-customer-card .top-card-title {
    color: #475569 !important;
}

body.theme-light .header-customer-card .top-customer-name,
.theme-light .header-customer-card .top-customer-name {
    color: #0f172a !important;
}

body.theme-light .header-customer-card .top-customer-meta,
.theme-light .header-customer-card .top-customer-meta {
    color: #64748b !important;
}

body.theme-light .pos-bottom-shortcuts .bottom-action-btn,
body.theme-light .pos-bottom-shortcuts .bottom-action-toggle,
.theme-light .pos-bottom-shortcuts .bottom-action-btn,
.theme-light .pos-bottom-shortcuts .bottom-action-toggle {
    background: #f8fafc !important;
    border-color: #dbe3ef !important;
    color: #0f172a !important;
}

body.theme-light .pos-bottom-shortcuts .bottom-action-btn:hover,
body.theme-light .pos-bottom-shortcuts .bottom-action-toggle:hover,
.theme-light .pos-bottom-shortcuts .bottom-action-btn:hover,
.theme-light .pos-bottom-shortcuts .bottom-action-toggle:hover {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
}

body.theme-dark .header-customer-card,
.theme-dark .header-customer-card {
    background: rgba(15, 23, 42, .82) !important;
    border-color: rgba(51, 65, 85, .92) !important;
}

body.theme-dark .header-customer-card .top-card-title,
.theme-dark .header-customer-card .top-card-title {
    color: #cbd5e1 !important;
}

body.theme-dark .header-customer-card .top-customer-name,
.theme-dark .header-customer-card .top-customer-name {
    color: #ffffff !important;
}

body.theme-dark .header-customer-card .top-customer-meta,
.theme-dark .header-customer-card .top-customer-meta {
    color: #94a3b8 !important;
}

body.theme-dark .pos-bottom-shortcuts .bottom-action-btn,
body.theme-dark .pos-bottom-shortcuts .bottom-action-toggle,
.theme-dark .pos-bottom-shortcuts .bottom-action-btn,
.theme-dark .pos-bottom-shortcuts .bottom-action-toggle {
    background: rgba(30, 41, 59, .96) !important;
    border-color: rgba(71, 85, 105, .88) !important;
    color: #e2e8f0 !important;
}

body.theme-dark .pos-bottom-shortcuts .bottom-action-btn:hover,
body.theme-dark .pos-bottom-shortcuts .bottom-action-toggle:hover,
.theme-dark .pos-bottom-shortcuts .bottom-action-btn:hover,
.theme-dark .pos-bottom-shortcuts .bottom-action-toggle:hover {
    background: rgba(37, 99, 235, .22) !important;
    border-color: rgba(96, 165, 250, .35) !important;
    color: #ffffff !important;
}


/* Tahap 24B2J26 - Aksi Fast/Cari/Print/Riwayat pindah ke sebelah Kosongkan. */
@media (min-width: 1200px) {
    .cart-header-row {
        gap: 10px !important;
        align-items: center !important;
    }

    .cart-header-title {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .cart-header-actions {
        flex: 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }

    .cart-action-btn,
    .cart-action-toggle,
    .cart-clear-btn {
        min-height: 28px !important;
        height: 28px !important;
        padding: 5px 9px !important;
        border-radius: 9px !important;
        font-size: 11px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        white-space: nowrap !important;
        text-decoration: none !important;
        cursor: pointer !important;
        border: 1px solid var(--app-border, #dbe3ef) !important;
        box-shadow: none !important;
    }

    .cart-action-toggle input {
        width: 12px !important;
        height: 12px !important;
        min-height: 12px !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 auto !important;
    }

    .cart-action-toggle span,
    .cart-action-btn span,
    .cart-action-toggle small {
        font-size: 10px !important;
        line-height: 1 !important;
    }

    .pos-bottom-shortcuts {
        justify-content: center !important;
    }

    .pos-bottom-shortcuts .bottom-action-btn,
    .pos-bottom-shortcuts .bottom-action-toggle {
        display: none !important;
    }
}

body.theme-light .cart-action-btn,
body.theme-light .cart-action-toggle,
.theme-light .cart-action-btn,
.theme-light .cart-action-toggle {
    background: #f8fafc !important;
    border-color: #dbe3ef !important;
    color: #0f172a !important;
}

body.theme-light .cart-action-btn:hover,
body.theme-light .cart-action-toggle:hover,
.theme-light .cart-action-btn:hover,
.theme-light .cart-action-toggle:hover {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
}

body.theme-light .cart-search-btn,
.theme-light .cart-search-btn {
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
    color: #1e3a8a !important;
}

body.theme-light .cart-print-toggle,
.theme-light .cart-print-toggle {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #0f172a !important;
}

body.theme-dark .cart-action-btn,
body.theme-dark .cart-action-toggle,
.theme-dark .cart-action-btn,
.theme-dark .cart-action-toggle {
    background: rgba(30, 41, 59, .96) !important;
    border-color: rgba(71, 85, 105, .88) !important;
    color: #e2e8f0 !important;
}

body.theme-dark .cart-action-btn:hover,
body.theme-dark .cart-action-toggle:hover,
.theme-dark .cart-action-btn:hover,
.theme-dark .cart-action-toggle:hover {
    background: rgba(37, 99, 235, .22) !important;
    border-color: rgba(96, 165, 250, .35) !important;
    color: #ffffff !important;
}

@media (min-width: 1200px) and (max-height: 820px) {
    .cart-action-btn,
    .cart-action-toggle,
    .cart-clear-btn {
        min-height: 25px !important;
        height: 25px !important;
        padding: 4px 8px !important;
        font-size: 10px !important;
    }

    .cart-action-toggle span,
    .cart-action-btn span,
    .cart-action-toggle small {
        font-size: 9.5px !important;
    }
}

@media (max-width: 1199px) {
    .cart-header-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
}
