:root {
  --pos-primary: #4f46e5;
  --pos-primary-600: #4338ca;
  --pos-primary-50: #eef2ff;
  --pos-bg: #f4f6fb;
  --pos-sidebar: #111827;
  --pos-sidebar-2: #1f2937;
  --pos-text: #0f172a;
  --pos-muted: #64748b;
  --pos-border: #e5e7eb;
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body { background: var(--pos-bg); color: var(--pos-text); font-size: .925rem; }
.btn-primary { --bs-btn-bg: var(--pos-primary); --bs-btn-border-color: var(--pos-primary); --bs-btn-hover-bg: var(--pos-primary-600); --bs-btn-hover-border-color: var(--pos-primary-600); --bs-btn-active-bg: #3730a3; --bs-btn-disabled-bg: #a5b4fc; --bs-btn-disabled-border-color: #a5b4fc; }
.btn-outline-primary { --bs-btn-color: var(--pos-primary); --bs-btn-border-color: var(--pos-primary); --bs-btn-hover-bg: var(--pos-primary); --bs-btn-hover-border-color: var(--pos-primary); --bs-btn-active-bg: var(--pos-primary); }
.text-primary { color: var(--pos-primary) !important; }
.bg-primary { background-color: var(--pos-primary) !important; }
.bg-primary-subtle { background-color: var(--pos-primary-50) !important; }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .2rem rgba(79,70,229,.15); }
.form-check-input:checked { background-color: var(--pos-primary); border-color: var(--pos-primary); }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; background: var(--pos-sidebar); color: #cbd5e1; flex-shrink: 0; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; transition: transform .2s; }
.sidebar .brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.25rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar .brand .logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #6366f1, #06b6d4); display: grid; place-items: center; font-weight: 800; font-size: .95rem; color: #fff; }
.sidebar .brand .nm { font-weight: 700; line-height: 1.1; font-size: .95rem; }
.sidebar .brand small { color: #94a3b8; font-weight: 500; font-size: .72rem; }
.sidebar .grp { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 1rem 1.25rem .35rem; font-weight: 600; }
.sidebar a.nav-i { display: flex; align-items: center; gap: .7rem; padding: .5rem 1.25rem; margin: 1px .6rem; border-radius: 8px; color: #cbd5e1; text-decoration: none; font-weight: 500; }
.sidebar a.nav-i i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.sidebar a.nav-i:hover { background: var(--pos-sidebar-2); color: #fff; }
.sidebar a.nav-i.active { background: var(--pos-primary); color: #fff; }
.sidebar a.nav-i.pos-btn { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; margin: .75rem .9rem .25rem; justify-content: center; padding: .6rem; font-weight: 600; }
.main { flex: 1; margin-left: 248px; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--pos-border); padding: .6rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 1030; }
.topbar .title { font-weight: 700; font-size: 1.1rem; margin: 0; }
.content { padding: 1.5rem; flex: 1; }
.footer { padding: 1rem 1.5rem; color: var(--pos-muted); font-size: .8rem; }
.sb-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: none; }
  .sb-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035; }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
}

/* Cards & tables */
.card { border: 1px solid var(--pos-border); border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--pos-border); font-weight: 600; padding: .85rem 1.1rem; border-radius: 14px 14px 0 0 !important; }
.table { --bs-table-hover-bg: #f8fafc; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .65rem .85rem; vertical-align: middle; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pos-muted); font-weight: 600; background: #f8fafc; border-bottom-width: 1px; white-space: nowrap; }
.stat { padding: 1.1rem 1.2rem; }
.stat .lbl { color: var(--pos-muted); font-size: .8rem; font-weight: 500; }
.stat .val { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin-top: .15rem; }
.stat .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; }
.trend-up { color: #16a34a; } .trend-down { color: #dc2626; }
.badge-soft { padding: .35em .6em; border-radius: 6px; font-weight: 600; font-size: .72rem; }
.bs-ok { background: #dcfce7; color: #166534; } .bs-bad { background: #fee2e2; color: #991b1b; } .bs-warn { background: #fef3c7; color: #92400e; } .bs-info { background: #e0e7ff; color: #3730a3; } .bs-mute { background: #f1f5f9; color: #475569; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .35rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.filters .form-control, .filters .form-select { width: auto; }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.page-head p { margin: 0; color: var(--pos-muted); }
.empty { text-align: center; color: var(--pos-muted); padding: 2.5rem 1rem; }
.empty i { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .5; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
.nav-tabs-lap { gap: .35rem; flex-wrap: nowrap; overflow-x: auto; border: 0; }
.nav-tabs-lap .nav-link { border: 1px solid var(--pos-border); border-radius: 999px; padding: .35rem .9rem; color: #334155; background: #fff; white-space: nowrap; font-weight: 500; }
.nav-tabs-lap .nav-link.active { background: var(--pos-primary); color: #fff; border-color: var(--pos-primary); }
.flash { position: fixed; top: 70px; right: 1rem; z-index: 2000; min-width: 280px; max-width: 420px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(circle at 20% 20%, #6366f1 0, transparent 45%), radial-gradient(circle at 80% 70%, #06b6d4 0, transparent 40%), #0f172a; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.login-art .feat { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .9rem; color: #cbd5e1; }
.login-art .feat i { color: #a5b4fc; font-size: 1.2rem; }
.login-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.login-form .box { width: 100%; max-width: 380px; }
.demo-btn { text-align: left; border: 1px solid var(--pos-border); border-radius: 10px; padding: .55rem .8rem; display: flex; align-items: center; gap: .6rem; background: #fff; width: 100%; text-decoration: none; color: inherit; }
.demo-btn:hover { border-color: var(--pos-primary); background: var(--pos-primary-50); }
.demo-btn .av { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
@media (max-width: 991.98px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

/* Kasir (POS) */
.pos { display: grid; grid-template-columns: 1fr 420px; height: 100vh; overflow: hidden; background: var(--pos-bg); }
.pos-left { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.pos-top { background: #fff; border-bottom: 1px solid var(--pos-border); padding: .6rem 1rem; display: flex; gap: .75rem; align-items: center; }
.pos-search { position: relative; flex: 1; }
.pos-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--pos-muted); }
.pos-search input { padding-left: 2.4rem; height: 44px; border-radius: 10px; font-size: 1rem; }
.cat-bar { display: flex; gap: .4rem; padding: .7rem 1rem; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--pos-border); }
.cat-bar button { border: 1px solid var(--pos-border); background: #fff; border-radius: 999px; padding: .35rem .85rem; white-space: nowrap; font-weight: 500; font-size: .85rem; }
.cat-bar button.active { background: var(--pos-text); color: #fff; border-color: var(--pos-text); }
.grid-prod { flex: 1; overflow-y: auto; padding: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; align-content: start; }
.prod { background: #fff; border: 1px solid var(--pos-border); border-radius: 12px; padding: .7rem; cursor: pointer; text-align: left; transition: .12s; position: relative; display: flex; flex-direction: column; min-height: 128px; }
.prod:hover { border-color: var(--pos-primary); box-shadow: 0 4px 14px rgba(79,70,229,.12); transform: translateY(-1px); }
.prod:active { transform: scale(.98); }
.prod .ini { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .85rem; margin-bottom: .5rem; }
.prod .nm { font-weight: 600; font-size: .85rem; line-height: 1.25; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .pr { font-weight: 700; color: var(--pos-primary); margin-top: .35rem; }
.prod .st { font-size: .72rem; color: var(--pos-muted); }
.prod.habis { opacity: .5; }
.prod.habis::after { content: "Habis"; position: absolute; top: .55rem; right: .55rem; background: #fee2e2; color: #991b1b; font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: 5px; }
.pos-right { background: #fff; border-left: 1px solid var(--pos-border); display: flex; flex-direction: column; overflow: hidden; }
.cart-head { padding: .75rem 1rem; border-bottom: 1px solid var(--pos-border); }
.cart { flex: 1; overflow-y: auto; }
.cart-item { padding: .65rem 1rem; border-bottom: 1px dashed var(--pos-border); }
.cart-item .nm { font-weight: 600; font-size: .88rem; }
.qty-ctl { display: inline-flex; align-items: center; border: 1px solid var(--pos-border); border-radius: 8px; overflow: hidden; }
.qty-ctl button { border: 0; background: #f8fafc; width: 30px; height: 30px; font-size: 1rem; }
.qty-ctl input { width: 46px; border: 0; text-align: center; font-weight: 600; height: 30px; }
.cart-sum { border-top: 1px solid var(--pos-border); padding: .75rem 1rem; background: #fafbff; }
.cart-sum .row-s { display: flex; justify-content: space-between; margin-bottom: .25rem; font-size: .88rem; }
.cart-sum .tot { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.btn-pay { height: 56px; font-size: 1.1rem; font-weight: 700; border-radius: 12px; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.pay-methods button { border: 1.5px solid var(--pos-border); background: #fff; border-radius: 10px; padding: .6rem .3rem; font-weight: 600; font-size: .85rem; }
.pay-methods button.active { border-color: var(--pos-primary); background: var(--pos-primary-50); color: var(--pos-primary); }
.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.quick-cash button { border: 1px solid var(--pos-border); background: #f8fafc; border-radius: 8px; padding: .45rem .2rem; font-weight: 600; font-size: .82rem; }
.pay-big { font-size: 1.6rem; font-weight: 700; text-align: right; height: 56px; }
.kbd { display: inline-block; padding: .05rem .35rem; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 4px; font-size: .7rem; font-family: ui-monospace, monospace; color: #475569; background: #fff; }
@media (max-width: 991.98px) {
  .pos { grid-template-columns: 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .pos-left { height: 60vh; }
  .pos-right { border-left: 0; border-top: 1px solid var(--pos-border); }
  .cart { max-height: none; }
  .grid-prod { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media print {
  .sidebar, .topbar, .no-print, .footer { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; }
}
