/* POS mainan — tablet & sentuh */
:root {
    --bg: #e8f4fc;
    --panel: #ffffff;
    --accent: #2d9cdb;
    --accent-dark: #2389c4;
    --success: #27ae60;
    --warn: #f39c12;
    --text: #2c3e50;
    --muted: #7f8c8d;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(44, 62, 80, 0.12);
    font-size: clamp(16px, 2.5vw, 22px);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 520px;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.login-title {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    line-height: 1.2;
}

.brand {
    color: var(--accent-dark);
}

.login-sub {
    margin: 0 0 1rem;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 0.6rem;
}

.login-form input[type="text"] {
    width: 100%;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    border: 2px solid #e0e8ef;
    font-size: 1rem;
    outline: none;
}

.login-form input[type="text"]:focus {
    border-color: var(--accent);
}

.form-error {
    background: #fff2f2;
    border: 1px solid #f5c2c2;
    color: #8a1f1f;
    border-radius: 12px;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

.dash {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.9rem;
    display: grid;
    gap: 0.75rem;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.9rem;
    padding-bottom: 1rem;
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    box-sizing: border-box;
}

/* Layout: sidebar kiri (semua halaman) */
body.app-with-sidebar {
    background: #f0f4f8;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 72px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.1rem 0 1rem;
    box-shadow: 2px 0 8px rgba(44, 62, 80, 0.07);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
}

.app-sidebar-logo {
    width: 36px;
    height: 36px;
    background: #d1fae5;
    border-radius: 10px;
    display: grid;
    place-items: center;
    margin-bottom: 1.5rem;
    text-decoration: none;
}

.app-sidebar-logo svg {
    width: 22px;
    height: 22px;
}

.app-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-decoration: none;
    color: #9aa5b1;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.55rem 0.35rem;
    width: 100%;
    border-left: 3px solid transparent;
    transition: color 0.15s, background 0.15s;
}

.app-nav-item svg {
    width: 22px;
    height: 22px;
}

.app-nav-item:hover {
    color: #2d9cdb;
}

.app-nav-item.active {
    color: #2d9cdb;
    border-left-color: #2d9cdb;
    background: #f0f9ff;
}

.app-nav-spacer {
    flex: 1;
}

.app-nav-logout:hover {
    color: #e74c3c;
}

.app-content {
    flex: 1;
    min-width: 0;
    margin-left: 72px;
}

body.app-no-sidebar .app-content {
    margin-left: 0;
}

.page-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.page-main {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid #e6edf3;
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
    z-index: 60;
}

.bn-item {
    text-align: center;
    text-decoration: none;
    padding: 0.65rem 0.25rem;
    border-radius: 12px;
    background: #f1f4f7;
    border: 1px solid #e3ebf2;
    color: #2c3e50;
    font-weight: 900;
    font-size: 0.85rem;
}

.bn-item.active {
    background: #dfe8ef;
    border-color: #cbd8e4;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.75rem;
}

@media (max-width: 520px) {
    .quick-grid {
        grid-template-columns: 1fr;
    }
}

.quick-btn {
    display: block;
    text-decoration: none;
    text-align: center;
    padding: 0.9rem 0.75rem;
    border-radius: 12px;
    background: #fafcfe;
    border: 2px solid #e0e8ef;
    color: var(--text);
    font-weight: 900;
}

.quick-btn:active {
    transform: scale(0.99);
}

.app-kasir {
    padding-bottom: 0;
}

.form-grid {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.75rem;
    min-width: 0;
}

@media (min-width: 820px) {
    .form-grid.cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
    }
}

.field label {
    display: block;
    font-weight: 800;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.field {
    min-width: 0;
}

.field input,
.field select {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 0.8rem;
    border-radius: 12px;
    border: 2px solid #e0e8ef;
    font-size: 1rem;
    outline: none;
    background: #fff;
    box-sizing: border-box;
}

.field input[type="file"] {
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.5rem;
    font-size: 0.9rem;
}

.field input:focus,
.field select:focus {
    border-color: var(--accent);
}

.btn-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}

.btn-small {
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #dce4ea;
    background: #fff;
    font-weight: 900;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
}

.btn-small.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-small.danger {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

.btn-small.danger:active {
    filter: brightness(0.95);
}

.alert {
    border-radius: 12px;
    padding: 0.6rem 0.75rem;
    margin-top: 0.75rem;
    font-weight: 700;
}

.alert.ok {
    background: #eaf7ef;
    border: 1px solid #bfe7cd;
    color: #1e6d3a;
}

.alert.err {
    background: #fff2f2;
    border: 1px solid #f5c2c2;
    color: #8a1f1f;
}

.tbl td.actions {
    white-space: nowrap;
}

.dash-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.hello {
    font-size: 1.1rem;
}

.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

.link-btn {
    display: inline-block;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    background: #ecf0f1;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

@media (max-width: 720px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.9rem 1rem;
    border: 1px solid #eef3f7;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 900;
}

.stat-label {
    margin-top: 0.1rem;
    color: var(--text);
    font-weight: 700;
}

.stat-note {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.8rem;
}

/* Dashboard */
body.body-dashboard .page {
    max-width: 900px;
}

.dashboard-summary-block {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dash-greeting-date {
    margin: 0 0 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.dash-stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .dash-stat-row {
        grid-template-columns: 1fr;
    }
}

.dash-stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dash-stat-card--wide {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.dash-stat-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.dash-stat-icon-wrap svg {
    width: 20px;
    height: 20px;
}

.dash-stat-icon-wrap.green {
    background: #d1fae5;
    color: #059669;
}

.dash-stat-icon-wrap.blue {
    background: #dbeafe;
    color: #2563eb;
}

.dash-stat-icon-wrap.orange {
    background: #fee2e2;
    color: #dc2626;
}

.dash-stat-val {
    font-size: 1.25rem;
    font-weight: 900;
    color: #2c3e50;
    line-height: 1.15;
    word-break: break-word;
}

.dash-stat-val--sm {
    font-size: 1rem;
}

.dash-stat-lbl {
    font-size: 0.75rem;
    font-weight: 700;
    color: #7f8c8d;
}

.dash-stat-note {
    font-size: 0.7rem;
    color: #aab4bc;
}

.dash-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #9aa5b1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0.25rem 0 0;
}

.dash-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 580px) {
    .dash-menu-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 760px) {
    .dash-menu-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.dash-menu-card {
    background: #fff;
    border-radius: 16px;
    padding: 1rem 0.75rem 0.9rem;
    text-decoration: none;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07);
    border: 1.5px solid rgba(44, 62, 80, 0.06);
    font-weight: 800;
    font-size: 0.8rem;
    transition: transform 0.12s, box-shadow 0.12s;
    touch-action: manipulation;
}

.dash-menu-card:active {
    transform: scale(0.97);
}

.dash-menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.dash-menu-icon svg {
    width: 26px;
    height: 26px;
}

.dash-menu-card--kasir .dash-menu-icon {
    background: #dbeafe;
    color: #2563eb;
}

.dash-menu-card--cek .dash-menu-icon {
    background: #cffafe;
    color: #0891b2;
}

.dash-menu-card--sales .dash-menu-icon {
    background: #fef3c7;
    color: #d97706;
}

.dash-menu-card--goods .dash-menu-icon {
    background: #d1fae5;
    color: #059669;
}

.dash-menu-card--cats .dash-menu-icon {
    background: #ede9fe;
    color: #7c3aed;
}

.dash-menu-card--kasir {
    border-top: 3px solid #2563eb;
}

.dash-menu-card--cek {
    border-top: 3px solid #0891b2;
}

.dash-menu-card--sales {
    border-top: 3px solid #d97706;
}

.dash-menu-card--goods {
    border-top: 3px solid #059669;
}

.dash-menu-card--cats {
    border-top: 3px solid #7c3aed;
}

.dashboard-quick-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0;
}

.dashboard-kasir-btn,
.dashboard-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-decoration: none;
    border-radius: 16px;
    font-weight: 900;
    letter-spacing: 0.06rem;
    color: #1a2b3c;
    border: 3px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08), 0 6px 16px rgba(45, 156, 219, 0.2);
    transition: transform 0.1s, box-shadow 0.1s;
    touch-action: manipulation;
    padding: 0.75rem 0.5rem;
}

.dashboard-kasir-btn:active,
.dashboard-tile:active {
    transform: scale(0.98);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06), 0 3px 8px rgba(0, 0, 0, 0.12);
}

.dashboard-kasir-btn {
    background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 45%, #0ea5e9 100%);
    color: #fff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
    border-color: #0284c7;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
}

.dashboard-btn-icon {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

.dashboard-kasir-btn .dashboard-btn-icon {
    font-size: 2.35rem;
}

.dashboard-btn-text {
    font-size: 0.95rem;
}

.dashboard-tile-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.dashboard-tile {
    padding: 0.65rem 0.35rem;
    font-size: 0.8rem;
}

.dashboard-tile .dashboard-btn-icon {
    font-size: 1.75rem;
}

.dashboard-tile .dashboard-btn-text {
    font-size: 0.72rem;
    letter-spacing: 0.03rem;
    text-align: center;
    line-height: 1.15;
}

.dashboard-tile--sales {
    background: linear-gradient(180deg, #fde68a 0%, #fcd34d 50%, #fbbf24 100%);
    border-color: #d97706;
    color: #78350f;
}

.dashboard-tile--goods {
    background: linear-gradient(180deg, #bbf7d0 0%, #86efac 50%, #4ade80 100%);
    border-color: #16a34a;
    color: #14532d;
}

.dashboard-tile--cats {
    background: linear-gradient(180deg, #e9d5ff 0%, #d8b4fe 50%, #c084fc 100%);
    border-color: #9333ea;
    color: #581c87;
}

.tab-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.tab-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    background: #efefef;
    color: #000;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    padding: 0.85rem 0.5rem;
    font-weight: 900;
}

.tab-btn.active {
    background: #dcdcdc;
}

.tab-panel {
    background: transparent;
}

.panel-card {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.panel-card h2 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
}

.table-wrap {
    overflow: auto;
    border-radius: 12px;
    border: 1px solid #eef3f7;
    margin-top: 0.75rem;
}

.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tbl th,
.tbl td {
    padding: 0.7rem 0.65rem;
    border-bottom: 1px solid #eef3f7;
    text-align: left;
    white-space: nowrap;
}

.tbl th {
    background: #fafcfe;
    font-weight: 900;
}

.right {
    text-align: right !important;
}

.pos-frame {
    width: 100%;
    height: min(78vh, 980px);
    border: 0;
    border-radius: 12px;
    margin-top: 0.75rem;
}

body.pos-embed {
    background: transparent;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem;
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .app {
        grid-template-columns: 1fr 340px;
        align-items: start;
    }
}

header {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

header h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

header .sub {
    color: var(--muted);
    font-size: 0.85rem;
    width: 100%;
}

@media (min-width: 768px) {
    header .sub {
        width: auto;
    }
}

.scanner-hint {
    background: #fff9e6;
    border: 2px dashed var(--warn);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    color: #856404;
}

#scanCapture {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.products {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
}

.products h2 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}

.product-btn {
    border: 2px solid #e0e8ef;
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    background: #fafcfe;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, transform 0.1s;
    touch-action: manipulation;
    min-height: 100px;
}

.product-btn:active {
    transform: scale(0.98);
}

.product-btn:hover,
.product-btn:focus {
    border-color: var(--accent);
    outline: none;
}

.product-btn .emoji {
    font-size: 2rem;
    line-height: 1;
    display: block;
    margin-bottom: 0.25rem;
}

.product-btn .name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
}

.product-btn .price {
    color: var(--accent-dark);
    font-weight: 700;
    margin-top: 0.35rem;
    font-size: 0.9rem;
}

.cart-panel {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    position: sticky;
    top: 0.75rem;
}

.cart-panel h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

#cartLines {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 45vh;
    overflow-y: auto;
}

#cartLines li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #ecf0f1;
    font-size: 0.9rem;
}

#cartLines .qty-wrap {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#cartLines button.mini {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    border: 1px solid #dce4ea;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    touch-action: manipulation;
}

.totals {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid #ecf0f1;
}

.totals .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.totals .grand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--success);
}

.actions {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.btn {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:active {
    background: var(--accent-dark);
}

.btn-secondary {
    background: #ecf0f1;
    color: var(--text);
}

.toast {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: #2c3e50;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 300;
    opacity: 0;
    transition: transform 0.25s, opacity 0.25s;
    max-width: 90vw;
    text-align: center;
    font-size: 0.95rem;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.card {
    background: #8e44ad;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}

.modal h3 {
    margin: 0 0 0.5rem;
}

.modal p {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.modal .btn {
    margin-top: 0.25rem;
}

.panel-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.panel-card-head h2 {
    margin: 0;
}

body.master-modal-open .app-sidebar {
    display: none;
}

body.master-modal-open .app-content {
    margin-left: 0;
}

.master-form-modal {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    overflow: hidden;
    z-index: 80;
}

.master-form-modal .modal.modal-form-wide {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    border-radius: 0;
    max-height: none;
    flex: 1 0 auto;
    text-align: left;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: none;
    padding: max(1rem, env(safe-area-inset-top, 0px)) max(1.25rem, env(safe-area-inset-right, 0px))
        max(1.25rem, env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left, 0px));
}

.modal-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(44, 62, 80, 0.12);
}

.modal-form-head h3 {
    margin: 0;
    font-size: 1.1rem;
}

.btn-modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    color: var(--muted);
}

.barang-page-compact {
    font-size: 0.8125rem;
}

.barang-page-compact .panel-card-head h2 {
    font-size: 1rem;
}

.barang-page-compact .tbl {
    font-size: inherit;
}

.barang-page-compact .tbl-thumb-img {
    width: 36px;
    height: 36px;
}

.barang-page-compact .btn-small {
    font-size: 0.78rem;
    padding: 0.22rem 0.42rem;
}

.barang-panel-head {
    align-items: flex-end;
}

.barang-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    flex: 1 1 12rem;
    max-width: min(32rem, 100%);
    margin: 0 auto;
}

.barang-filter-kat-label {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}

.barang-filter-select {
    padding: 0.28rem 0.4rem;
    font-size: inherit;
    border: 1px solid rgba(44, 62, 80, 0.2);
    border-radius: 6px;
    background: var(--surface, #fff);
    color: inherit;
    max-width: 11rem;
}

.barang-filter-select:focus {
    outline: 2px solid rgba(52, 152, 219, 0.45);
    outline-offset: 1px;
}

.barang-search-input {
    flex: 1 1 8rem;
    min-width: 0;
    padding: 0.28rem 0.45rem;
    font-size: inherit;
    border: 1px solid rgba(44, 62, 80, 0.2);
    border-radius: 6px;
    background: var(--surface, #fff);
    color: inherit;
}

.barang-search-input:focus {
    outline: 2px solid rgba(52, 152, 219, 0.45);
    outline-offset: 1px;
}

a.tbl-sort {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

a.tbl-sort:hover {
    text-decoration: underline;
    color: var(--accent-dark);
}

.focus-trap-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

/* --- Kasir: scan hidden + CARI + bayar full screen --- */
.scan-capture-hidden {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    z-index: -1;
    border: 0;
    padding: 0;
    margin: 0;
    font-size: 16px;
}

.kasir-panel {
    text-align: center;
}

.kasir-title-block {
    font-weight: 900;
    letter-spacing: 0.2rem;
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.kasir-intro {
    margin: 0 0 0.75rem;
    line-height: 1.35;
}

.kasir-hint {
    margin: 0.6rem 0 0;
    font-size: 0.8rem;
}

.btn-cari {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 0.85rem 1rem;
    font-weight: 900;
    font-size: 1rem;
    border: 2px solid #000;
    background: #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
}

.btn-cari:active {
    background: #d0d0d0;
}

.modal-full {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    overflow: auto;
}

.modal-full.show {
    display: flex;
}

.modal-full-inner {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}

.modal-full-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modal-full-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.btn-modal-close {
    border: 2px solid #000;
    background: #eee;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
}

.cari-results {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cari-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #ccc;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    font: inherit;
    touch-action: manipulation;
}

.cari-row:active {
    background: #eee;
}

.cari-name {
    font-weight: 800;
}

.cari-thumb img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.cari-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.cari-row .cari-name,
.cari-row .cari-meta {
    flex: none;
}

.cari-row .cari-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.modal-pay-full {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 220;
    background: #fff;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: max(0.65rem, env(safe-area-inset-top)) 0.75rem max(0.85rem, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.modal-pay-full.show {
    display: block;
}

body.modal-pay-open {
    overflow: hidden;
}

.modal-pay-inner {
    width: 100%;
    max-width: min(440px, 100%);
    margin: 0 auto;
    padding: 0.15rem 0 1rem;
    text-align: center;
    box-sizing: border-box;
    min-height: min(100%, 100dvh);
}

.pay-label {
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

.pay-label-spaced {
    margin-top: 0.65rem;
}

.pay-big {
    font-size: clamp(1.35rem, 4.5vw, 1.85rem);
    font-weight: 900;
    margin: 0.25rem 0 0.45rem;
    line-height: 1.2;
}

.pay-kembali.pay-kembali-has {
    color: var(--success);
}

.pay-kembali.pay-kembali-zero {
    color: var(--text);
}

.pay-field-label {
    display: block;
    text-align: left;
    font-weight: 700;
    margin-top: 0.5rem;
    margin-bottom: 0.35rem;
}

.pay-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
    box-sizing: border-box;
}

.pay-input-lg {
    font-size: 1.05rem;
}

.pay-input-thick {
    border: 3px solid #000;
    font-weight: 700;
    font-size: clamp(1.25rem, 4vw, 1.65rem);
    text-align: center;
    cursor: default;
    caret-color: transparent;
}

.pay-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-top: 0.45rem;
}

.pay-numpad-key {
    border: 1px solid #c5d0da;
    background: #f4f7fa;
    color: #2c3e50;
    font-weight: 800;
    font-size: 1.1rem;
    min-height: 2.65rem;
    border-radius: 10px;
    cursor: pointer;
    touch-action: manipulation;
    padding: 0.35rem;
}

.pay-numpad-key:active {
    background: #dce8f2;
    transform: scale(0.97);
}

.pay-numpad-fn {
    background: #e8eef3;
}

.pay-numpad-wide {
    font-size: 0.82rem;
    line-height: 1.15;
    padding: 0.35rem 0.25rem;
}

.pay-numpad-key[data-action="pas"] {
    background: #fff;
    border-color: var(--accent);
    color: var(--accent-dark);
}

.btn-pay-simpan {
    display: block;
    width: 100%;
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    font-size: 1.1rem;
    font-weight: 900;
    border: 2px solid #888;
    background: #c8c8c8;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
}

.btn-pay-simpan:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-pay-batal {
    display: block;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.75rem;
    font-weight: 800;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
}

.barang-preview-wrap {
    margin-top: 0.5rem;
}

.barang-preview-img {
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e8ef;
}

.field-inline-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.tbl-thumb {
    width: 52px;
    padding: 0.35rem !important;
}

.tbl-thumb-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e0e8ef;
    vertical-align: middle;
}

.product-img-wrap {
    display: block;
    margin-bottom: 0.25rem;
}

.product-img {
    width: 100%;
    max-height: 72px;
    object-fit: contain;
    border-radius: 8px;
}

/* Master barang — klik baris riwayat stok */
tr.row-barang-histori {
    cursor: pointer;
}

tr.row-barang-histori:hover {
    background: #f0f7fc;
}

.mp-produk-click {
    font-weight: 700;
}

.barang-alur-list {
    max-height: min(70vh, 560px);
    overflow: auto;
}

.mp-alur-table .mp-alur-opening td {
    background: #f4f8fb;
    font-weight: 700;
}

.mp-alur-table .mp-alur-opening .mp-stok-num {
    color: var(--accent-dark);
}

/* Penjualan — klik baris + modal detail */
tr.row-penjualan {
    cursor: pointer;
}

tr.row-penjualan:hover {
    background: #f0f7fc;
}

#modalDetilPenjualan.modal-overlay {
    z-index: 80;
}

.modal.modal-penjualan-detil {
    max-width: min(96vw, 980px);
    width: 100%;
    text-align: left;
    max-height: min(92vh, 900px);
    min-height: min(70vh, 640px);
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.detil-penjualan-table {
    flex: 1 1 auto;
    min-height: 200px;
    max-height: min(55vh, 480px);
    overflow: auto;
}

.modal.modal-penjualan-detil h3 {
    text-align: center;
    margin-top: 0;
}

.detil-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

@media (min-width: 520px) {
    .detil-meta-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.detil-meta-row2 {
    margin-top: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal.modal-penjualan-detil .btn {
    width: 100%;
}

/* --- Kasir POS (layout tablet seperti referensi) --- */
body.body-kasir {
    background: #d5dde6;
}

body.body-kasir .page {
    max-width: none;
    padding: 0.35rem 0.5rem 0.75rem;
}

body.body-kasir .page-top {
    display: none;
}

body.body-kasir .page {
    padding: 0.25rem 0.35rem 0.35rem;
    max-width: none;
}

body.body-kasir .page-main {
    gap: 0;
}

body.body-kasir .toast {
    bottom: calc(1rem + env(safe-area-inset-bottom));
}

.kasir-pos-shell {
    height: calc(100dvh - 0.75rem);
    min-height: 320px;
}

.kasir-pos {
    display: grid;
    grid-template-columns: minmax(280px, 34%) 1fr;
    height: 100%;
    gap: 0;
    background: #c8d2dc;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(44, 62, 80, 0.15);
}

/* HP kecil — keranjang di atas */
@media (max-width: 767px) {
    .kasir-pos-shell {
        height: calc(100dvh - 0.5rem);
    }

    .kasir-pos {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(200px, 40vh) 1fr;
    }
}

/* Tablet 11" (portrait & landscape) */
@media (min-width: 768px) and (max-width: 1366px) {
    body.body-kasir.app-with-sidebar .app-content {
        margin-left: 72px;
    }

    .kasir-pos-shell {
        height: calc(100dvh - 0.5rem);
    }

    .kasir-pos {
        grid-template-columns: minmax(300px, 38%) 1fr;
        grid-template-rows: none;
        border-radius: 8px;
    }

    .kasir-order-title {
        font-size: 1.1rem;
    }

    .kasir-order-sub {
        font-size: 0.82rem;
    }

    .kasir-order-table {
        font-size: 0.88rem;
    }

    .kasir-order-table thead th {
        font-size: 0.78rem;
        padding: 0.5rem 0.35rem;
    }

    .kasir-order-table tbody td {
        padding: 0.5rem 0.35rem;
    }

    .kasir-order-table .cart-item-name {
        max-width: none;
        font-size: 0.9rem;
    }

    .kasir-order-table button.mini {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }

    .kasir-order-table .qty-num {
        font-size: 0.88rem;
        min-width: 1.85rem;
    }

    .kasir-pay-btn {
        font-size: 1.05rem;
        padding: 1rem 0.65rem;
    }

    .kasir-total-amount {
        font-size: 1.2rem;
    }

    .kasir-tab {
        min-height: 3rem;
        font-size: 1rem;
        padding: 0.85rem 0.75rem;
    }

    .kasir-search-input {
        font-size: 0.95rem;
        padding: 0.35rem 0;
    }

    .kasir-kategori-strip .kasir-kat-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        min-height: 2.4rem;
    }

    .kasir-product-grid,
    .kasir-product-scroll .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
        gap: 0.65rem;
    }

    .kasir-product-card {
        min-height: 148px;
        padding: 0.55rem 0.45rem 0.65rem;
    }

    .kasir-product-card .product-img {
        max-height: 88px;
    }

    .kasir-product-card .name {
        font-size: 0.82rem;
    }

    .kasir-product-card .price {
        font-size: 0.88rem;
    }

    .pay-numpad-key {
        min-height: 3.15rem;
        font-size: 1.25rem;
    }

    .pay-numpad-wide {
        font-size: 0.9rem;
    }
}

/* Tablet landscape lebar */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    .kasir-pos {
        grid-template-columns: minmax(340px, 32%) 1fr;
    }

    .kasir-product-grid,
    .kasir-product-scroll .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

.kasir-order {
    display: flex;
    flex-direction: column;
    background: #f4f7fa;
    border-right: 1px solid #b8c5d0;
    min-height: 0;
}

.kasir-order-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem 0.45rem;
    border-bottom: 1px solid #dce4ea;
}

.kasir-order-title-wrap {
    flex: 1;
    min-width: 0;
}

.kasir-order-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.kasir-order-sub {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
}

.kasir-order-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 0.5rem;
    position: relative;
}

.kasir-order-table-wrap.has-items .kasir-cart-empty {
    display: none;
}

.kasir-cart-empty {
    margin: 0.75rem 0.25rem;
    font-size: 0.8rem;
    text-align: center;
}

.kasir-order-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.kasir-order-table thead th {
    position: sticky;
    top: 0;
    background: #f4f7fa;
    z-index: 1;
    text-align: left;
    font-weight: 800;
    padding: 0.45rem 0.25rem;
    border-bottom: 2px solid #dce4ea;
    color: #5a6a78;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kasir-order-table .col-qty {
    width: 5.5rem;
    text-align: center;
}

.kasir-order-table .col-total {
    width: 5.5rem;
}

.kasir-order-table tbody td {
    padding: 0.4rem 0.25rem;
    border-bottom: 1px solid #e8edf2;
    vertical-align: middle;
}

.kasir-order-table .cart-item-name {
    font-weight: 700;
    line-height: 1.25;
    max-width: 9rem;
}

.kasir-order-table .cart-qty .qty-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.kasir-order-table .qty-num {
    min-width: 1.6rem;
    text-align: center;
    font-weight: 800;
    font-size: 0.75rem;
}

.kasir-order-table button.mini {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 6px;
    border: 1px solid #c5d0da;
    background: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.kasir-order-summary {
    padding: 0.45rem 0.75rem;
    border-top: 1px solid #dce4ea;
    font-size: 0.78rem;
}

.kasir-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.kasir-order-head .kasir-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 300;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.kasir-action-icon {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 20%;
    background: #e74c3c;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1rem;
    line-height: 1;
}

.kasir-order-footer {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0;
    margin-top: auto;
}

.kasir-pay-btn {
    border: none;
    background: #3498db;
    color: #fff;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.85rem 0.5rem;
    touch-action: manipulation;
}

.kasir-pay-btn:active {
    background: #2980b9;
}

.kasir-total-bar {
    background: var(--success);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 0.5rem 0.75rem;
    min-height: 100%;
}

.kasir-total-label {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.92;
}

.kasir-total-amount {
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.15;
}

.kasir-catalog {
    display: flex;
    flex-direction: column;
    background: #eef2f6;
    min-height: 0;
    overflow: hidden;
}

.kasir-catalog-head {
    flex: 0 0 auto;
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    background: #eef2f6;
}

.kasir-catalog-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.kasir-catalog--barcode .kasir-head-produk {
    display: none;
}

.kasir-tabs {
    display: flex;
    flex-shrink: 0;
    width: 100%;
    background: #dfe8f0;
    border-bottom: 1px solid #b8c5d0;
}

.kasir-tab {
    flex: 1 1 50%;
    border: none;
    background: transparent;
    padding: 0.75rem 0.65rem;
    min-height: 2.85rem;
    font-weight: 800;
    font-size: 0.95rem;
    color: #5a6a78;
    cursor: pointer;
    touch-action: manipulation;
    border-bottom: 3px solid transparent;
    line-height: 1.2;
}

.kasir-tab.active {
    background: #eef2f6;
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}

.kasir-catalog-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: #fff;
    border-bottom: 1px solid #dce4ea;
    flex-shrink: 0;
}

.kasir-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #f4f7fa;
    border: 1px solid #cfd8e0;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    min-width: 0;
}

.kasir-search-icon {
    font-size: 0.9rem;
    opacity: 0.7;
}

.kasir-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    outline: none;
    padding: 0.15rem 0;
}

.kasir-tab-panel {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.kasir-tab-panel.show {
    display: flex;
}

.kasir-catalog-body > .kasir-tab-panel.show {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.kasir-product-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0.5rem 0.65rem;
}

.kasir-product-grid,
.kasir-product-scroll .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 0.55rem;
}

.kasir-grid-empty {
    text-align: center;
    padding: 1rem 0.5rem;
    font-size: 0.85rem;
}

.kasir-product-card {
    background: #fff;
    border: 1px solid #dce4ea;
    border-radius: 10px;
    padding: 0.45rem 0.4rem 0.55rem;
    min-height: 130px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(44, 62, 80, 0.06);
}

.kasir-product-card.is-popular::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 1.1rem 1.1rem 0;
    border-color: transparent var(--success) transparent transparent;
}

.kasir-product-card .product-img {
    max-height: 72px;
    width: 100%;
    object-fit: contain;
}

.kasir-product-card .name {
    font-size: 0.72rem;
    line-height: 1.2;
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kasir-product-card .price {
    font-size: 0.78rem;
    margin-top: 0.2rem;
}

.kasir-barcode-panel {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.kasir-barcode-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.kasir-barcode-go {
    margin-top: 0.25rem;
}

.kasir-barcode-cari {
    margin-top: 0.15rem;
}

.kasir-kategori-strip {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    background: #fff;
    border-bottom: 1px solid #dce4ea;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    flex-shrink: 0;
}

.kasir-kategori-strip::-webkit-scrollbar {
    height: 4px;
}

.kasir-kategori-strip::-webkit-scrollbar-thumb {
    background: #b8c5d0;
    border-radius: 4px;
}

.kasir-kategori-strip .kasir-kat-btn {
    flex: 0 0 auto;
    border: none;
    background: #e8eef3;
    color: var(--accent-dark);
    font-weight: 800;
    font-size: 0.78rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    touch-action: manipulation;
    text-align: center;
    line-height: 1.2;
    min-height: 2.15rem;
    white-space: nowrap;
    box-shadow: none;
}

.kasir-kategori-strip .kasir-kat-btn:hover {
    background: #d5e3ee;
}

.kasir-kategori-strip .kasir-kat-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.35);
}

.kasir-kategori-strip .kasir-kat-btn:active {
    transform: scale(0.98);
}

@media (min-width: 1367px) {
    .kasir-pos-shell {
        height: calc(100dvh - 1rem);
    }

    .kasir-pos {
        grid-template-columns: minmax(320px, 32%) 1fr;
    }
}

/* --- Master Produk --- */
body.body-master-produk .page {
    max-width: none;
}

.mp-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
    padding: 1rem 1.1rem 1.25rem;
}

.mp-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mp-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 900;
}

.mp-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mp-filter-search {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1 1 12rem;
    min-width: 0;
    max-width: 280px;
    border: 1px solid #cfd8e0;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    background: #fff;
}

.mp-search-icon {
    font-size: 0.85rem;
    opacity: 0.65;
}

.mp-filter-search input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    background: transparent;
}

.mp-filter-select {
    padding: 0.4rem 0.55rem;
    border: 1px solid #cfd8e0;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #fff;
    color: var(--text);
}

.mp-filter-clear {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.mp-filter-clear:hover {
    text-decoration: underline;
}

.mp-table-wrap {
    overflow-x: auto;
    border: 1px solid #e6edf3;
    border-radius: 8px;
}

.mp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.mp-table thead th {
    background: #f7fafc;
    text-align: left;
    font-weight: 800;
    padding: 0.65rem 0.75rem;
    border-bottom: 2px solid #e6edf3;
    color: #5a6a78;
    white-space: nowrap;
}

.mp-table tbody tr:nth-child(even) {
    background: #f4f9fd;
}

.mp-table tbody tr:nth-child(odd) {
    background: #fff;
}

.mp-table tbody tr.mp-row-hidden {
    opacity: 0.72;
}

.mp-table tbody td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #eef3f7;
    vertical-align: middle;
}

.mp-col-action {
    width: 11rem;
}

.mp-empty {
    text-align: center;
    color: var(--muted);
    padding: 1.5rem !important;
}

.mp-barcode {
    font-weight: 700;
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
}

.mp-produk {
    font-weight: 600;
}

.mp-harga-old {
    display: block;
    text-decoration: line-through;
    color: var(--muted);
    font-size: 0.78rem;
}

.mp-harga-now {
    display: block;
    font-weight: 800;
    color: var(--accent-dark);
}

.mp-stok .mp-link-add,
.mp-stok .mp-link-edit-stok {
    display: inline-block;
    margin-left: 0.35rem;
    border: none;
    background: none;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.mp-stok .mp-link-add:hover,
.mp-stok .mp-link-edit-stok:hover {
    text-decoration: underline;
}

/* --- Cek Produk --- */
body.body-cek-produk .page {
    max-width: 820px;
}

.cek-produk-panel {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
    padding: 1rem 1.1rem 1.25rem;
}

.cek-produk-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cek-produk-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 900;
}

.cek-produk-sub {
    margin: 0.2rem 0 0;
}

.cek-produk-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cek-produk-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 18rem;
    min-width: 0;
    border: 2px solid #dbe5ee;
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
    background: #fff;
}

.cek-produk-search:focus-within {
    border-color: var(--accent);
}

.cek-produk-search input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    background: transparent;
}

.cek-produk-empty {
    border: 1px dashed #cfd8e0;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
    background: #f8fbfd;
}

.cek-produk-result-grid {
    display: grid;
    gap: 0.75rem;
}

.cek-produk-card {
    border: 1px solid #e6edf3;
    border-radius: 14px;
    padding: 0.9rem;
    background: #fbfdff;
}

.cek-produk-card-main {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
}

.cek-produk-img-wrap {
    width: 108px;
    height: 108px;
    border-radius: 14px;
    border: 1px solid #e6edf3;
    background: #fff;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.cek-produk-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cek-produk-img-empty {
    font-size: 2.4rem;
    opacity: 0.55;
}

.cek-produk-info {
    min-width: 0;
}

.cek-produk-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.cek-produk-name {
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.25;
}

.cek-produk-code {
    margin-top: 0.15rem;
    color: var(--muted);
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    font-weight: 700;
}

.cek-produk-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.72rem;
    font-weight: 900;
}

.cek-produk-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.cek-produk-fact {
    border-radius: 12px;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #eef3f7;
}

.cek-produk-fact span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.cek-produk-fact strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.25rem;
    color: var(--accent-dark);
    line-height: 1.15;
}

.cek-produk-fact small {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.cek-produk-meta {
    margin-top: 0.65rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

@media (max-width: 520px) {
    .cek-produk-form {
        align-items: stretch;
    }

    .cek-produk-form .btn-small {
        width: 100%;
    }

    .cek-produk-facts {
        grid-template-columns: 1fr;
    }

    .cek-produk-card-main {
        grid-template-columns: 86px minmax(0, 1fr);
    }

    .cek-produk-img-wrap {
        width: 86px;
        height: 86px;
    }
}

.mp-stok-cell .mp-link-lihat {
    display: inline-block;
    margin-left: 0.35rem;
    border: none;
    background: none;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.mp-stok-cell .mp-link-lihat:hover {
    text-decoration: underline;
}

.kat-barang-list {
    max-height: min(70vh, 520px);
    overflow: auto;
}

.mp-stok-num {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.mp-stok-readonly {
    margin: 0.35rem 0 0;
    font-weight: 800;
    font-size: 0.95rem;
}

.mp-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.mp-toggle-form,
.mp-inline-form {
    display: inline-flex;
    margin: 0;
}

.mp-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.mp-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mp-switch-ui {
    width: 2.25rem;
    height: 1.2rem;
    background: #cbd5e0;
    border-radius: 999px;
    transition: background 0.15s;
    position: relative;
}

.mp-switch-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 0.95rem;
    height: 0.95rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.mp-switch input:checked + .mp-switch-ui {
    background: var(--accent);
}

.mp-switch input:checked + .mp-switch-ui::after {
    transform: translateX(1.05rem);
}

.mp-btn-edit {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    padding: 0.2rem 0.35rem;
}

.mp-btn-edit:hover {
    text-decoration: underline;
}

.mp-btn-del {
    border: none;
    background: none;
    color: #e74c3c;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
}

.mp-btn-del:hover {
    text-decoration: underline;
}

a.mp-sort {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

a.mp-sort:hover {
    color: var(--accent-dark);
}

.mp-link-action {
    border: none;
    background: none;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    font-family: inherit;
    text-decoration: none;
    display: inline;
}

.mp-link-action:hover {
    text-decoration: underline;
}

.mp-status-cell {
    white-space: nowrap;
}

.pj-status--kurang {
    color: #c0392b;
    font-weight: 700;
}

.pj-row-actions {
    white-space: nowrap;
}

.mp-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e6edf3;
}

.mp-pager-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.85rem;
}

.mp-pager-left select {
    padding: 0.3rem 0.4rem;
    border: 1px solid #cfd8e0;
    border-radius: 6px;
}

.mp-pager-info {
    color: var(--muted);
    font-weight: 600;
}

.mp-pager-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.mp-page-btn {
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfd8e0;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-weight: 800;
    font-size: 0.82rem;
    background: #fff;
}

.mp-page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--accent);
    color: var(--accent);
}

.mp-page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.mp-page-btn.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.mp-modal-stok {
    max-width: 400px;
    width: 92vw;
    text-align: left;
}

#modalStok.modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#modalStok .modal {
    margin: 0 auto;
}
