/* POS: nyaman di HP seperti aplikasi, tetap rapi di desktop */
.pos { max-width: 720px; margin: 0 auto; padding-bottom: 150px; }
.pos-wide { max-width: 860px; }

.pos-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: #e9ebef; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.pos-tabs a { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px; border-radius: 9px; color: #4b5563; font-weight: 500; text-decoration: none; }
.pos-tabs a.is-active { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

.pos-card { background: #fff; border: 1px solid #e8eaee; border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.pos-label { font-size: .75rem; font-weight: 600; letter-spacing: .02em; color: #6b7280; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }

/* kontrol besar untuk sentuhan; font 16px mencegah zoom otomatis di iOS */
.pos .form-control, .pos .form-select, .pos-sheet .form-control, .pos-sheet .form-select { min-height: 46px; font-size: 16px; border-radius: 10px; }
.pos .btn, .pos-sheet .btn, .pos-bar .btn { min-height: 44px; border-radius: 10px; }
.pos .btn-sm, .pos-sheet .btn-sm { min-height: 34px; }

.pos-row-btn { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: none; border: 0; padding: 0; color: inherit; }
.pos-avatar { width: 40px; height: 40px; border-radius: 12px; background: #fdecec; color: #c1121f; display: grid; place-items: center; flex-shrink: 0; }

.pos-seg { display: flex; gap: 6px; margin-bottom: 10px; }
.pos-seg button { flex: 1; border: 1px solid #dfe2e7; background: #fff; border-radius: 10px; padding: 9px 6px; font-size: .84rem; color: #4b5563; }
.pos-seg button.is-active { background: #111827; border-color: #111827; color: #fff; }

.pos-item-head { display: flex; gap: 10px; align-items: flex-start; }
.pos-item-qty { text-align: right; line-height: 1.1; }
.pos-item-qty strong { font-size: 1.4rem; display: block; }
.pos-money { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed #e5e7eb; margin-top: 10px; padding-top: 10px; }
.pos-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto; margin-top: 8px; }
.pos-chip { border: 1px solid #dfe2e7; border-radius: 999px; padding: 4px 6px 4px 10px; font-size: .75rem; display: inline-flex; align-items: center; gap: 4px; }
.pos-chip button { border: 0; background: none; padding: 0 2px; color: #9ca3af; }

/* bar total menempel di bawah layar */
.pos-bar { position: fixed; left: var(--pos-bar-left, 0px); right: 0; bottom: 0; z-index: 1020; background: #fff; border-top: 1px solid #e8eaee;
    box-shadow: 0 -6px 20px rgba(16, 24, 40, .07); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.pos-bar-in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.pos-bar .total { flex: 1; min-width: 0; }
.pos-bar .total strong { display: block; font-size: 1.25rem; white-space: nowrap; }

/* lembar bawah (bottom sheet); di desktop menjadi dialog di tengah */
.pos-sheet-bg { position: fixed; inset: 0; z-index: 1050; background: rgba(17, 24, 39, .45); display: flex; align-items: flex-end; justify-content: center; }
.pos-sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; animation: pos-up .18s ease-out; }
.pos-sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #f0f1f3; }
.pos-sheet-head h3 { margin: 0; font-size: 1rem; }
.pos-sheet-body { overflow-y: auto; padding: 14px 16px; }
.pos-sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #f0f1f3; display: grid; gap: 8px; }
@keyframes pos-up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 768px) { .pos-sheet-bg { align-items: center; padding: 20px; } .pos-sheet { border-radius: 18px; } }
@media (min-width: 992px) { .sh-app { --pos-bar-left: 260px; } .sh-app.is-collapsed { --pos-bar-left: 76px; } }

.pos-list-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid #f0f1f3; color: inherit; text-decoration: none; }
.pos-list-item:last-child { border-bottom: 0; }
.pos-list-item:active { background: #f8f9fb; }
.pos-kpi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.pos-kpi > :first-child { grid-column: 1 / -1; }
.pos-kpi > :first-child strong { font-size: 1.5rem; }
@media (min-width: 576px) { .pos-kpi { grid-template-columns: 2fr 1fr 1fr; } .pos-kpi > :first-child { grid-column: auto; } }
.pos .min-w-0, .pos-sheet .min-w-0 { min-width: 0; }
.pos-list-item { max-width: 100%; }
.pos-kpi .pos-card { margin: 0; padding: 12px; }
.pos-kpi strong { display: block; font-size: 1.02rem; word-break: break-word; }
.pos-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }

@media print {
    .sh-sidebar, .sh-topbar, .sh-footer, .pos-tabs, .pos-bar, .pos-noprint { display: none !important; }
    .pos { max-width: 80mm; padding: 0; }
    .pos-card { border: 0; border-bottom: 1px dashed #999; border-radius: 0; margin: 0; padding: 8px 0; }
}
/* tab banyak: ikon di atas label pada layar sempit */
@media (max-width: 575px) { .pos-tabs.is-tumpuk a { flex-direction: column; gap: 2px; padding: 8px 4px; font-size: .8rem; } }
/* dashboard canvaser */
.pos-hero { background: linear-gradient(135deg, #111827, #1f2a44); color: #fff; border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.pos-hero-name { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.pos-hero-gudang { display: flex; align-items: center; gap: 6px; font-size: .84rem; opacity: .85; margin-top: 4px; }
.pos-hero-sales { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.pos-hero-sales > div { background: rgba(255, 255, 255, .09); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.pos-hero-sales span, .pos-hero-sales small { display: block; font-size: .74rem; opacity: .75; }
.pos-hero-sales strong { display: block; font-size: 1.05rem; word-break: break-word; }
.pos-menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.pos-menu-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; background: #fff; border: 1px solid #e8eaee; border-radius: 14px; color: #111827; font-size: .8rem; font-weight: 500; text-decoration: none; }
.pos-menu-grid a:active { transform: scale(.97); }
@media (min-width: 576px) { .pos-menu-grid { grid-template-columns: repeat(6, 1fr); } }
