:root {
  --navy: #1e3a5f;
  --navy-dark: #14283f;
  --red: #e94b4b;
  --red-dark: #d33636;
  --bg: #eef1f6;
  --card-bg: #ffffff;
  --border: #e1e6ee;
  --text: #22303f;
  --muted: #8a93a3;
  --pink-bg: #fdeaea;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 40, 63, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding: 14px 14px 90px;
}

/* ---------- Header ---------- */
.topbar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.topbar .who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.who .greet { font-size: 12.5px; color: var(--muted); }
.who .name { font-weight: 700; color: var(--navy-dark); font-size: 15px; }
.btn-logout {
  background: var(--pink-bg); color: var(--red-dark);
  border: none; border-radius: 8px; padding: 8px 14px;
  font-weight: 600; font-size: 13.5px; cursor: pointer;
}

/* ---------- Search ---------- */
.search-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.search-box input {
  border: none; outline: none; flex: 1;
  font-size: 14.5px; background: transparent; color: var(--text);
}

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  background: #f4f5f8;
}
.card .info { padding: 10px 12px 12px; }
.card .pname {
  font-weight: 700; color: var(--navy-dark); font-size: 13.5px;
  margin: 0 0 6px; line-height: 1.3;
}
.card .strike { color: var(--muted); text-decoration: line-through; font-size: 12px; }
.card .price { color: var(--red); font-weight: 800; font-size: 15px; }
.card .stock-empty { color: var(--muted); font-size: 12px; font-style: italic; }

.empty-state {
  text-align: center; padding: 40px 10px; color: var(--muted);
}

/* ---------- Floating cart ---------- */
.fab-cart {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: calc(460px - 28px); max-width: calc(100vw - 28px);
  background: var(--navy); color: #fff;
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 6px 18px rgba(20,40,63,.35);
  cursor: pointer; font-weight: 700;
}
.fab-cart .badge {
  background: var(--red); border-radius: 20px; padding: 2px 9px;
  font-size: 12px; margin-right: 8px;
}

/* ---------- Sheets / modals ---------- */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(20,40,63,.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.sheet {
  background: #fff; width: 100%; max-width: 460px;
  border-radius: 18px 18px 0 0; padding: 20px; max-height: 88vh;
  overflow-y: auto;
}
.sheet h2 { margin: 0 0 14px; font-size: 17px; color: var(--navy-dark); }
.sheet-close {
  float: right; border: none; background: none; font-size: 20px;
  cursor: pointer; color: var(--muted);
}

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 9px; font-size: 14px; font-family: inherit; outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--navy); }

.btn-primary {
  width: 100%; background: var(--navy); color: #fff; border: none;
  border-radius: 9px; padding: 13px; font-weight: 700; font-size: 14.5px;
  cursor: pointer; margin-top: 6px;
}
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary {
  width: 100%; background: #fff; color: var(--navy); border: 1.5px solid var(--navy);
  border-radius: 9px; padding: 12px; font-weight: 700; font-size: 14px; cursor: pointer;
}

.cart-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cart-row img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.cart-row .cname { font-weight: 600; font-size: 13.5px; flex: 1; }
.cart-row .cprice { color: var(--red); font-weight: 700; font-size: 13px; }
.qty-ctrl { display: flex; align-items: center; gap: 8px; }
.qty-ctrl button {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-weight: 700;
}

.summary-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; color: var(--muted); }
.summary-row.total { color: var(--navy-dark); font-weight: 800; font-size: 15.5px; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 6px; }

.qris-box { text-align: center; padding: 10px 0; }
.qris-box canvas, .qris-box img { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: #fff; }
.qris-amount { font-size: 22px; font-weight: 800; color: var(--navy-dark); margin: 10px 0 4px; }
.status-pill {
  display: inline-block; padding: 5px 12px; border-radius: 20px;
  font-size: 12.5px; font-weight: 700; margin-top: 8px;
}
.status-pill.waiting { background: #fff4de; color: #a2650b; }
.status-pill.paid { background: #e4f7ec; color: #1a8a4a; }

.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--navy-dark); color: #fff; padding: 11px 18px;
  border-radius: 9px; font-size: 13.5px; z-index: 100; box-shadow: var(--shadow);
}

.loading { text-align: center; padding: 30px; color: var(--muted); }

/* ---------- Admin ---------- */
.tab-btn {
  border: 1px solid var(--border); background: #fff; color: var(--navy);
  border-radius: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.tab-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.list-item {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; display: flex; gap: 12px; align-items: center;
}
.list-item img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.list-item .li-title { font-weight: 700; font-size: 13.5px; color: var(--navy-dark); }
.list-item .li-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.li-actions { display: flex; gap: 6px; }
.li-actions button {
  border: none; border-radius: 7px; padding: 7px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.li-actions .edit { background: #e7edf7; color: var(--navy); }
.li-actions .delete { background: var(--pink-bg); color: var(--red-dark); }

select.status-select {
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; font-size: 12.5px;
}
