/* KasirKu — etalase toko di siang hari. Putih bersih, biru cerah, label kuning. */
:root {
  --accent: #0069d9;
  --accent-dark: #0053ad;
  --accent-soft: #e2f0fd;
  --accent-bright: #1e90ff;
  --sunny: #f5b301;
  --sunny-soft: #fff4d6;
  --sunny-dark: #7a5200;
  --bg: #f2f7fc;
  --panel: #ffffff;
  --border: #d9e5f0;
  --text: #14243a;
  --muted: #5b6b7d;
  --danger: #c81e1e;
  --ok: #067647;
  --ok-soft: #e6f4ea;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin: 22px 0 4px; }
h2 { font-size: 18px; font-weight: 700; margin: 20px 0 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price { white-space: nowrap; }

/* header — putih bersih, garis bawah biru cerah */
.topbar { background: #ffffff; color: var(--text); border-bottom: 3px solid var(--accent); }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px;
}
.brand { color: var(--text); font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.brand::before {
  content: ""; display: inline-block; width: 10px; height: 10px;
  background: var(--sunny); border-radius: 3px; margin-right: 8px;
}
.brand:hover { text-decoration: none; }
.topbar nav a { color: #33475e; margin-left: 18px; font-size: 14px; font-weight: 600; }
.topbar nav a:hover { color: var(--accent); text-decoration: none; }

/* panel, tabel, form */
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f2f7fc; }
input, select {
  width: 100%; padding: 10px 12px; margin-top: 4px;
  border: 1px solid var(--border); border-radius: 10px;
  font: inherit; background: #fff;
}
input:focus, select:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.qty { width: 72px; display: inline-block; margin: 0 6px 0 0; }
.inline { display: inline; }
.btn {
  display: inline-block; padding: 10px 16px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-align: center;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: #eef4fa; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: var(--danger); border-color: #f0c4c4; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.full { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.flash { padding: 10px 12px; border-radius: 10px; margin: 14px 0; }
.flash.error { background: #fdeceb; color: var(--danger); border: 1px solid #f5c6c2; }

/* POS */
.pos { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.search input { margin-top: 0; }
.search .btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.search .btn:hover { background: var(--accent-dark); }

/* kartu produk */
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 12px; background: #fff;
  transition: border-color .15s ease;
}
.product-card:hover { border-color: var(--accent); }
.product-name { display: block; font-size: 15px; font-weight: 700; line-height: 1.35; }
.product-sku { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.product-price {
  display: block; font-size: 19px; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 8px;
}
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stock-chip {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: #eef2f6; color: #3f4756; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.stock-chip.low { background: var(--sunny-soft); color: var(--sunny-dark); }
.stock-chip.out { background: #fdeceb; color: var(--danger); }
.add-form { display: flex; gap: 8px; align-items: center; }
.add-form .qty { margin: 0; flex: 0 0 72px; }
.add-form .btn {
  flex: 1; background: var(--accent); border-color: var(--accent); color: #fff;
}
.add-form .btn:hover { background: var(--accent-dark); }

/* keranjang — panel putih terang, garis atas biru cerah */
.cart-panel {
  background: #ffffff; border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  position: sticky; top: 16px;
}
.cart-panel h2 { color: var(--text); margin-top: 0; }
.cart-panel .muted { color: var(--muted); }
.cart-panel table td { border-bottom-color: var(--border); color: var(--text); }
.cart-panel tbody tr:hover { background: #f2f7fc; }
.cart-panel .total {
  font-size: 18px; display: flex; justify-content: space-between; align-items: baseline;
  border-top: 2px dashed var(--border); padding-top: 12px; margin-top: 12px;
}
.cart-panel .total strong { font-size: 28px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.cart-panel label { color: var(--text); }
.cart-panel input, .cart-panel select { background: #fff; }
.btn.pay {
  background: var(--accent); border-color: var(--accent); color: #fff;
  font-size: 17px; font-weight: 800; padding: 13px 16px;
}
.btn.pay:hover { background: var(--accent-dark); }
.btn.ghost-light {
  background: transparent; border-color: var(--border); color: var(--muted);
}
.btn.ghost-light:hover { background: #eef4fa; color: var(--text); }
.cart-panel .btn.danger { background: transparent; border-color: #f0c4c4; color: var(--danger); }
.cart-empty {
  border: 1px dashed #b9c8d8; border-radius: 10px;
  padding: 18px 14px; text-align: center; color: var(--muted); margin: 0;
}
.checkout { margin-top: 12px; }

/* auth — dipusatkan vertikal */
main:has(.auth) { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; justify-content: center; }
.auth { max-width: 405px; width: 100%; margin: 24px auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.auth::before {
  content: ""; display: block; width: 36px; height: 6px;
  background: var(--accent); border-radius: 3px; margin-bottom: 16px;
}
.auth h1 { margin-top: 0; }
.demo-form { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }

/* struk */
.receipt { max-width: 560px; margin: 24px auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.receipt h1 { margin-top: 0; }
.receipt .total { border-top: 2px dashed var(--border); }
.receipt-actions { display: flex; gap: 10px; margin-top: 16px; }
.qris { border: 1px solid #bcd8f5; background: #f2f9ff; border-radius: 12px; padding: 16px; margin-top: 16px; text-align: center; }
.qr { display: inline-block; line-height: 0; border: 8px solid #fff; outline: 1px solid var(--border); }
.qr-row { display: flex; }
.qr-row span { width: 8px; height: 8px; display: block; }
.qr-row span.on { background: var(--accent); }
.qr-row span.off { background: #fff; }
.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.status-pill.ok { background: var(--ok-soft); color: var(--ok); }
.status-pill.wait { background: var(--accent-soft); color: var(--accent-dark); }

/* laporan */
.kpi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kpi-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.kpi-card.highlight { border-left: 4px solid var(--sunny); }
.kpi-label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.kpi-card strong { font-size: 26px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; max-width: 640px; }
.form-grid .btn { grid-column: 1 / -1; }

@media (max-width: 820px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .cart-panel { position: static; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar nav a { margin-left: 10px; }
}
@media (max-width: 480px) {
  th, td { padding: 8px 5px; }
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .auth { margin: 16px auto; padding: 22px; }
  .cart-panel .total strong { font-size: 24px; }
}
@media print {
  .topbar, .receipt-actions { display: none; }
  body { background: #fff; }
  .receipt { border: none; margin: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
