:root {
  --p: #2563eb;
  --p2: #3b82f6;
  --dark: #111827;
  --side: #172554;
  --side2: #1e3a8a;
  --bg: #eff6ff;
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --border: #e5e7eb;
}
* { box-sizing: border-box; font-family: Inter, 'Segoe UI', system-ui, sans-serif; }
body { margin: 0; background: var(--bg); color: var(--dark); font-size: 14px; }
a { text-decoration: none; color: var(--p); }
.layout { display: flex; min-height: 100vh; }

.sidebar { width: 232px; min-width: 232px; background: linear-gradient(180deg, var(--side), var(--side2)); color: #c7d2fe; padding: 18px 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { padding: 0 18px 16px; color: #fff; font-weight: 800; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.logo .badge { background: var(--ok); color: #fff; font-size: 9px; padding: 3px 6px; border-radius: 6px; }
.grp { font-size: 10px; letter-spacing: .12em; color: #93c5fd; padding: 14px 18px 6px; text-transform: uppercase; }
.mi { padding: 9px 18px; font-size: 13px; color: #c7d2fe; display: flex; gap: 10px; align-items: center; border-left: 3px solid transparent; }
.mi:hover { background: rgba(255,255,255,.07); color: #fff; }
.mi.act { background: rgba(59,130,246,.3); color: #fff; border-left-color: #93c5fd; }
.ver { margin-top: auto; padding: 14px 18px; font-size: 10.5px; color: #64748b; }

.main { flex: 1; min-width: 0; }
.topbar { background: #fff; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 17px; margin: 0; }
.tb-r { font-size: 12px; color: #6b7280; text-align: right; }
.content { padding: 20px 24px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card .lb { font-size: 11.5px; color: #6b7280; }
.card .vl { font-size: 21px; font-weight: 800; margin-top: 4px; }
.card .up { font-size: 11px; color: var(--ok); margin-top: 3px; }
.row2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 18px; }
.panel { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 14px; }
.panel h3 { margin: 0 0 12px; font-size: 14px; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 8px; }
.bar { flex: 1; background: linear-gradient(180deg, var(--p2), var(--p)); border-radius: 6px 6px 3px 3px; position: relative; }
.bar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: #6b7280; }
.chart-wrap { padding-bottom: 20px; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { background: #f9fafb; text-align: left; padding: 9px 10px; color: #4b5563; border-bottom: 2px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
td { padding: 9px 10px; border-bottom: 1px solid #f3f4f6; color: #374151; }
.tnum { text-align: right; font-variant-numeric: tabular-nums; }
.tot-row td { font-weight: 800; background: #f9fafb; }
.tbl-wrap { overflow-x: auto; }

.tag { font-size: 10.5px; padding: 3px 8px; border-radius: 20px; font-weight: 600; }
.t-ok { background: #d1fae5; color: #065f46; }
.t-w { background: #fef3c7; color: #92400e; }
.t-b { background: #dbeafe; color: #1e40af; }
.t-bad { background: #fee2e2; color: #991b1b; }

.btn { display: inline-block; border: 0; border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; background: var(--p); color: #fff; }
.btn:hover { opacity: .9; }
.btn-ok { background: var(--ok); }
.btn-warn { background: var(--warn); }
.btn-bad { background: var(--bad); }
.btn-sm { padding: 5px 10px; font-size: 11.5px; border-radius: 8px; }
.btn-ghost { background: #fff; color: var(--p); border: 1.5px solid var(--p); }

form.inline { display: inline; }
label { font-size: 12px; font-weight: 600; color: #4b5563; display: block; margin-bottom: 4px; }
input, select, textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 13px; background: #fff; color: var(--dark); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--p2); }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.alert { padding: 11px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.alert-ok { background: #d1fae5; color: #065f46; }
.alert-bad { background: #fee2e2; color: #991b1b; }
.toolbar { display: flex; gap: 10px; align-items: end; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar div { min-width: 150px; }
.pagination { font-size: 12px; color: #6b7280; margin-top: 10px; }

.pos { display: flex; gap: 14px; align-items: flex-start; }
.prodwrap { flex: 1; min-width: 0; }
.search { background: #fff; border-radius: 12px; padding: 12px 16px; font-size: 13px; color: #9ca3af; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.search input { border: 0; padding: 0; width: 70%; font-size: 13px; }
.search kbd { float: right; font-size: 10.5px; color: #9ca3af; }
.chips { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip { background: #fff; border: 1px solid var(--border); padding: 6px 14px; border-radius: 20px; font-size: 12px; color: #4b5563; cursor: pointer; }
.chip.on { background: var(--p); border-color: var(--p); color: #fff; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.p { background: #fff; border-radius: 12px; padding: 14px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: .15s; border: 2px solid transparent; }
.p:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37,99,235,.15); border-color: var(--p2); }
.p .ic { font-size: 26px; }
.p .nm { font-size: 12.5px; font-weight: 600; margin-top: 8px; min-height: 32px; }
.p .pr { font-size: 13.5px; font-weight: 800; color: var(--p); margin-top: 4px; }
.p .st { font-size: 10.5px; color: #6b7280; margin-top: 2px; }
.p.out { opacity: .45; pointer-events: none; }

.cart { width: 350px; min-width: 350px; background: #fff; border-radius: 14px; box-shadow: 0 1px 8px rgba(0,0,0,.08); overflow: hidden; position: sticky; top: 80px; }
.cart-h { background: var(--p); color: #fff; padding: 12px 16px; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; }
.citems { max-height: 240px; overflow-y: auto; }
.ci { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid #f3f4f6; font-size: 12.5px; gap: 8px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qbtn { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 700; color: var(--p); }
.csum { padding: 12px 16px; font-size: 12.5px; }
.csum div { display: flex; justify-content: space-between; padding: 3px 0; color: #4b5563; }
.csum .tot { font-size: 19px; font-weight: 800; color: var(--dark); border-top: 2px dashed var(--border); margin-top: 8px; padding-top: 10px; }
.paysel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px; }
.pay { border: 1.5px solid var(--border); border-radius: 10px; padding: 9px; text-align: center; font-size: 12px; cursor: pointer; color: #374151; }
.pay.on { border-color: var(--p); background: #dbeafe; color: var(--p); font-weight: 700; }
.bayar { display: block; margin: 14px 16px 16px; background: var(--ok); color: #fff; border: 0; width: calc(100% - 32px); padding: 13px; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; letter-spacing: .03em; }
.bayar:disabled { opacity: .5; }

.modal-bg { display: none; position: fixed; inset: 0; background: rgba(17,24,39,.55); z-index: 50; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.on { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 22px; }
.modal h3 { margin: 0 0 14px; }

.struk { width: 300px; margin: 0 auto; font-family: 'Courier New', monospace; font-size: 12px; color: #000; }
.struk h2 { text-align: center; font-size: 15px; margin: 4px 0; }
.struk .c { text-align: center; }
.struk hr { border: 0; border-top: 1px dashed #000; }
.struk table { width: 100%; font-size: 11.5px; }
.struk td { padding: 1px 0; border: 0; }
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  body, .layout, .main, .content { background: #fff !important; }
  .content { padding: 0; }
}

@media (max-width: 900px) {
  .pos { flex-direction: column-reverse; }
  .cart { width: 100%; min-width: 0; position: static; }
  .row2 { grid-template-columns: 1fr; }
  .sidebar { width: 64px; min-width: 64px; }
  .sidebar .logo, .sidebar .grp, .sidebar .ver { display: none; }
  .mi { justify-content: center; padding: 11px 6px; font-size: 15px; }
}
