/* Versi B (mudah): warna sama seperti versi A; tulisan minimum 14px, biasa 16px; butang minimum 48px. */
:root {
  --bg: #f4f5fe;
  --ink: #15103d;
  --ink-2: #2a2650;
  --muted: #55526e;
  --purple: #6d46e0;
  --purple-2: #5b34e8;
  --pink: #f0157f;
  --lime: #e2fc7a;
  --green: #1f9d55;
  --orange: #c76a00;
  --shadow: 0 6px 22px rgba(60, 40, 140, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px; line-height: 1.4; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.sidebar { display: none; }
.main { padding-bottom: 110px; }

/* Kepala */
.head {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #2b1878 0%, #35218c 40%, #4b2cb8 100%);
  padding: 14px 18px 86px;
}
.head::before {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  right: -140px; top: -170px;
  background: radial-gradient(circle at 40% 60%, #7b51fb 0%, #6a41ec 45%, rgba(106,65,236,0) 70%);
}
.topbar { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; }
.logo { position: relative; font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.logo span { color: #f83eb8; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn svg { width: 26px; height: 26px; }
.badge { position: absolute; top: 10px; right: 11px; width: 10px; height: 10px; border-radius: 50%; background: #f83eb8; border: 2px solid #fff; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--purple); display: grid; place-items: center; }
.avatar svg { width: 22px; height: 22px; stroke-width: 2.4; }
.hello { position: relative; margin-top: 8px; }
.hello p { font-size: 16px; color: #d9d2ff; }
.hello h1 { font-size: 24px; font-weight: 800; margin-top: 2px; }

.content { position: relative; padding: 0 16px; margin-top: -70px; display: grid; gap: 16px; }
.card { background: #fff; border-radius: 22px; box-shadow: var(--shadow); }

/* 1. Hari ini */
.today { padding: 20px; }
.today .label { font-size: 16px; font-weight: 600; color: var(--muted); }
.today .big { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
.today .count { font-size: 15px; color: var(--muted); margin-top: 2px; }
.today-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pill { border-radius: 16px; padding: 12px 14px; }
.pill b { display: block; font-size: 22px; font-weight: 800; margin-top: 2px; }
.pill span { font-size: 15px; font-weight: 600; }
.pill--green { background: #eafaef; color: #17793a; }
.pill--orange { background: #fff3e2; color: var(--orange); }
.month { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e3def0; font-size: 15px; color: var(--muted); }
.month b { color: var(--ink); }

/* 2. Cakap + butang */
.cakap {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 22px;
  background: linear-gradient(135deg, #8460ff, #5b34e8); color: #fff; box-shadow: 0 10px 26px rgba(91, 52, 232, .32);
}
.cakap .mic { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; background: var(--lime); color: #1c1450; display: grid; place-items: center; }
.cakap .mic svg { width: 32px; height: 32px; stroke-width: 2.4; }
.cakap b { display: block; font-size: 22px; font-weight: 800; }
.cakap small { display: block; font-size: 14px; color: #e9e4ff; margin-top: 4px; line-height: 1.35; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 112px; padding: 14px 6px; background: #fff; border-radius: 20px; box-shadow: var(--shadow);
  font-size: 17px; font-weight: 700; color: var(--ink-2); text-align: center;
}
.action .ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; }
.action .ico svg { width: 28px; height: 28px; }
.ico--pink   { background: linear-gradient(145deg, #ffcbec, #ffa6dc); color: #a3166f; }
.ico--orange { background: linear-gradient(145deg, #ffdca6, #ffc070); color: #7a4100; }
.ico--green  { background: linear-gradient(145deg, #d3f9cd, #a8eea0); color: #17793a; }

/* 3. Perlu perhatian */
.alerts { padding: 18px 16px 10px; }
.alerts h2 { font-size: 20px; font-weight: 800; padding: 0 4px 8px; }
.alert {
  display: flex; align-items: center; gap: 12px; min-height: 64px;
  padding: 10px 8px; border-top: 1px solid #efecf7;
}
.alert .dot { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; }
.dot--stock { background: #fff3e2; }
.dot--debt { background: #fde6f1; }
.alert div { flex: 1; min-width: 0; }
.alert b { display: block; font-size: 16px; font-weight: 700; }
.alert small { display: block; font-size: 15px; color: var(--muted); }
.alert em { font-style: normal; font-size: 16px; font-weight: 800; white-space: nowrap; }
.em--stock { color: var(--orange); }
.em--debt { color: var(--pink); }
.more {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; margin-top: 4px;
  border-top: 1px solid #efecf7; font-size: 16px; font-weight: 700; color: var(--purple);
}
.more svg { width: 20px; height: 20px; stroke-width: 2.6; }

.report-link {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 64px;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow); font-size: 16px; font-weight: 700;
}
.report-link .ico { width: 44px; height: 44px; border-radius: 50%; background: #efeaff; color: var(--purple); display: grid; place-items: center; flex: 0 0 auto; }
.report-link .ico svg { width: 22px; height: 22px; }
.report-link span { flex: 1; }
.report-link small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); }
.report-link > svg { width: 22px; height: 22px; color: var(--muted); }
.sample { text-align: center; font-size: 14px; color: var(--muted); padding: 4px 0 8px; }

/* Navigasi bawah (sama seperti versi A) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: 76px; padding: 0 8px env(safe-area-inset-bottom);
  background: #fff; border-radius: 22px 22px 0 0; box-shadow: 0 -6px 24px rgba(60, 40, 140, .08);
}
.bottom-nav a, .bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 60px; border-radius: 18px; font-size: 14px; font-weight: 600; color: #555270;
}
.bottom-nav svg { width: 26px; height: 26px; }
.bottom-nav a.active { background: #ede6ff; color: var(--purple); font-weight: 800; }
.nav-cakap { color: var(--purple) !important; font-weight: 800 !important; }
.nav-cakap span {
  display: grid; place-items: center; margin-top: -30px; width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(145deg, #8460ff, #5b34e8); color: #fff; border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(91, 52, 232, .35);
}
.nav-cakap svg { width: 28px; height: 28px; stroke-width: 2.2; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(21, 16, 61, .35); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 28px 16px calc(24px + env(safe-area-inset-bottom));
  background: #fff; border-radius: 24px 24px 0 0;
}
.sheet[hidden], .sheet-backdrop[hidden] { display: none; }
.sheet-handle { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: 44px; height: 5px; border-radius: 3px; background: #dcd8ee; }
.sheet a {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0;
  border-radius: 18px; background: #f6f4ff; font-size: 16px; font-weight: 700; color: var(--ink-2);
}
.sheet svg { width: 28px; height: 28px; color: var(--purple); }

/* PC / laptop */
@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
  .sidebar {
    display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh;
    padding: 26px 18px; background: #fff; border-right: 1px solid #ebe8f7;
  }
  .sidebar .logo { color: #2e1a80; font-size: 28px; line-height: 40px; margin-left: 10px; }
  .side-nav { display: flex; flex-direction: column; gap: 6px; }
  .side-nav a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; font-size: 16px; font-weight: 600; color: #555270; }
  .side-nav a:hover { background: #f5f2ff; }
  .side-nav a.active { background: #ede6ff; color: var(--purple); }
  .side-nav svg { width: 22px; height: 22px; }

  /* Atas kotak ungu sama paras dengan butang Home: 26px (padding sidebar) + 40px (logo) + 28px (jarak) */
  .main { padding: 94px 32px 40px; min-width: 0; }
  .head, .content { max-width: 1040px; margin-left: auto; margin-right: auto; }
  .head { border-radius: 26px; padding: 18px 32px 96px; }
  .head .logo { display: none; }
  .hello h1 { font-size: 30px; }
  .content {
    padding: 0 24px;
    grid-template-columns: 1.15fr 1fr; align-items: start;
    grid-template-areas: "today alerts" "cakap alerts" "actions report" "sample sample";
  }
  .today { grid-area: today; }
  .cakap { grid-area: cakap; }
  .actions { grid-area: actions; }
  .alerts { grid-area: alerts; }
  .report-link { grid-area: report; }
  .sample { grid-area: sample; }
  .bottom-nav, .sheet, .sheet-backdrop { display: none !important; }
}

/* ---------- Sesi (P1) ---------- */
/* Semasa sesi disemak: rangka skrin + "Sedang buka…" ganti skrin putih (19 Okt 2026) */
.sesi-tunggu body > * { visibility: hidden; }
.sesi-tunggu body::before {
  content: ""; position: fixed; inset: 0; z-index: 9998;
  background:
    linear-gradient(135deg, #2b1878 0%, #4b2cb8 100%) 0 0 / 100% 150px no-repeat,
    linear-gradient(#fff, #fff) 16px 110px / calc(100% - 32px) 130px no-repeat,
    linear-gradient(#e7e8f8, #e7e8f8) 16px 262px / calc(100% - 32px) 64px no-repeat,
    linear-gradient(#e7e8f8, #e7e8f8) 16px 342px / calc(100% - 32px) 64px no-repeat,
    linear-gradient(#e7e8f8, #e7e8f8) 16px 422px / calc(100% - 32px) 64px no-repeat,
    var(--bg);
  animation: bb-muncul .2s .15s both;
}
.sesi-tunggu body::after {
  content: "Sedang buka…"; position: fixed; left: 50%; top: 520px; z-index: 9999;
  transform: translateX(-50%); padding: 10px 20px; border-radius: 999px;
  background: #fff; color: var(--purple-2); font-size: 16px; font-weight: 800;
  box-shadow: var(--shadow); white-space: nowrap;
  animation: bb-muncul .2s .15s both, bb-denyut 1.2s .35s ease-in-out infinite;
}
@keyframes bb-muncul { from { opacity: 0; } to { opacity: 1; } }
@keyframes bb-denyut { 50% { opacity: .55; } }
@media (max-height: 600px) { .sesi-tunggu body::after { top: auto; bottom: 40px; } }

.profile-menu {
  position: absolute; z-index: 30; min-width: 220px; max-width: calc(100vw - 24px);
  padding: 14px; border-radius: 16px; background: #fff; box-shadow: 0 12px 32px rgba(21, 16, 61, .18);
  display: grid; gap: 4px;
}
.profile-menu[hidden] { display: none; }
.pm-shop { font-size: 16px; font-weight: 800; }
.pm-email { font-size: 14px; color: var(--muted); word-break: break-all; }
.pm-logout {
  margin-top: 8px; min-height: 48px; border-radius: 12px; background: #fde6f1;
  color: #b0105f; font-size: 16px; font-weight: 800;
}

/* ---------- Skrin log masuk & cipta kedai ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-head {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  background: linear-gradient(135deg, #2b1878 0%, #35218c 40%, #4b2cb8 100%);
  padding: 40px 20px 90px;
}
.auth-head::before {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  right: -140px; top: -170px;
  background: radial-gradient(circle at 40% 60%, #7b51fb 0%, #6a41ec 45%, rgba(106,65,236,0) 70%);
}
.auth-head .logo { font-size: 34px; }
.auth-head p { position: relative; margin-top: 6px; font-size: 16px; color: #d9d2ff; }
.auth-card {
  position: relative; width: calc(100% - 32px); max-width: 440px; margin: -60px auto 24px;
  padding: 22px 20px; background: #fff; border-radius: 22px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 22px; font-weight: 800; }
.auth-card .sub { font-size: 15px; color: var(--muted); margin-top: 4px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 14px; background: #f1eefb; margin-bottom: 18px; }
.tabs button { min-height: 44px; border-radius: 10px; font-size: 16px; font-weight: 700; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--purple); box-shadow: 0 2px 8px rgba(60, 40, 140, .12); }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 52px; border-radius: 14px; font-size: 17px; font-weight: 800;
}
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: linear-gradient(135deg, #8460ff, #5b34e8); color: #fff; }
.btn-google { background: #fff; color: var(--ink); border: 2px solid #e3def0; }
.btn-google svg { width: 22px; height: 22px; }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 14px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: #e3def0; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 16px; font-weight: 700; }
.field input {
  min-height: 52px; padding: 0 14px; border-radius: 14px; border: 2px solid #e3def0;
  font: inherit; font-size: 17px; color: var(--ink); background: #fff;
}
.field input:focus { outline: none; border-color: var(--purple); }
.field small { font-size: 14px; color: var(--muted); }
.msg { display: none; margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.msg.err { display: block; background: #fde6f1; color: #b0105f; }
.msg.ok { display: block; background: #eafaef; color: #17793a; }
.text-link { display: block; width: 100%; margin-top: 14px; text-align: center; font-size: 15px; font-weight: 700; color: var(--purple); min-height: 44px; line-height: 44px; }
.fixed-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.fixed-info div { padding: 12px 14px; border-radius: 14px; background: #f6f4ff; }
.fixed-info span { display: block; font-size: 14px; color: var(--muted); }
.fixed-info b { font-size: 16px; }
.legal { margin-top: 16px; text-align: center; font-size: 14px; color: var(--muted); }
.text-link[hidden], .field small[hidden] { display: none; }

/* ---------- Halaman biasa (Produk dll.) ---------- */
.head--page { padding-bottom: 76px; }
.back { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; font-size: 16px; font-weight: 700; color: #fff; }
.back svg { width: 22px; height: 22px; stroke-width: 2.6; }
.page-title { position: relative; font-size: 26px; font-weight: 800; margin-top: 2px; }
.shop-line { position: relative; font-size: 15px; color: #d9d2ff; }
.content.page { display: grid; gap: 16px; }
.box { padding: 18px 18px 16px; }
.box h2 { font-size: 19px; font-weight: 800; }
.hint { font-size: 14px; color: var(--muted); margin-top: 2px; }
.opt { font-size: 14px; font-weight: 500; color: var(--muted); }
.muted { color: var(--muted); font-size: 15px; }

/* Senarai produk */
.toolbar { padding: 14px; display: grid; gap: 12px; }
.search { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border: 2px solid #e3def0; border-radius: 14px; }
.search:focus-within { border-color: var(--purple); }
.search svg { width: 22px; height: 22px; color: var(--muted); flex: 0 0 auto; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 17px; background: none; color: var(--ink); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { min-height: 44px; padding: 0 14px; border-radius: 999px; background: #f1eefb; font-size: 15px; font-weight: 700; color: var(--muted); }
.fchip.on { background: var(--purple); color: #fff; }
.filter-row select { min-height: 44px; padding: 0 12px; border-radius: 999px; border: 2px solid #e3def0; font: inherit; font-size: 15px; font-weight: 600; background: #fff; color: var(--ink-2); }
.filter-row select[hidden] { display: none; }
.plist { display: grid; gap: 10px; }
.pitem { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 16px; }
.pinitial { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #efeaff; color: var(--purple); font-size: 20px; font-weight: 800; }
.pitem div { flex: 1; min-width: 0; }
.pitem b { display: block; font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem small { display: block; font-size: 14px; color: var(--muted); }
.pitem em { font-style: normal; font-size: 16px; font-weight: 800; white-space: nowrap; }
.badge-off { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: #f1eefb; font-size: 13px; font-weight: 700; color: var(--muted); }
.empty { padding: 28px 20px; text-align: center; }
.empty b { font-size: 18px; }
.empty p { margin-top: 6px; color: var(--muted); }
.fab {
  position: fixed; right: 16px; bottom: 92px; z-index: 9;
  display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 22px;
  border-radius: 999px; background: linear-gradient(135deg, #8460ff, #5b34e8); color: #fff;
  font-size: 17px; font-weight: 800; box-shadow: 0 10px 24px rgba(91, 52, 232, .35);
}
.fab[hidden] { display: none; }
.fab svg { width: 22px; height: 22px; stroke-width: 2.6; }

/* Borang produk */
.form .field { margin-top: 12px; margin-bottom: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.i.lock { width: 16px; height: 16px; vertical-align: -2px; color: var(--orange); }
.lock-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #fff3e2; color: var(--orange); font-size: 14px; font-weight: 600; }
.lock-note svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #f6f4ff; cursor: pointer; }
.switch-row[hidden] { display: none; }
.switch-row input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--purple); flex: 0 0 auto; }
.switch-row b { display: block; font-size: 16px; }
.switch-row small { display: block; font-size: 14px; color: var(--muted); }
.add-row { display: flex; gap: 8px; margin-top: 12px; }
.add-row input { flex: 1; min-width: 0; min-height: 52px; padding: 0 14px; border-radius: 14px; border: 2px solid #e3def0; font: inherit; font-size: 17px; }
.add-row input:focus { outline: none; border-color: var(--purple); }
.btn-add { display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 16px; border-radius: 14px; background: #efeaff; color: var(--purple); font-size: 16px; font-weight: 800; }
.btn-add svg { width: 20px; height: 20px; stroke-width: 2.6; }
.chips-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip-item { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 6px 0 14px; border-radius: 999px; background: #efeaff; color: var(--purple); font-size: 16px; font-weight: 700; }
.chip-item button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--purple); }
.chip-item svg { width: 18px; height: 18px; stroke-width: 2.6; }
.size-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.size-btn { min-height: 48px; border-radius: 12px; border: 2px solid #e3def0; background: #fff; font-size: 16px; font-weight: 700; color: var(--ink-2); }
.size-btn.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.small-field input { max-width: 120px; }
.unit-input { display: flex; align-items: center; gap: 10px; }
.unit-input span { font-size: 16px; font-weight: 600; color: var(--muted); }
.vlist { display: grid; gap: 8px; margin-top: 10px; }
.vrow { border: 2px solid #e3def0; border-radius: 14px; padding: 4px 12px; }
.vrow.off { background: #f7f7fa; }
.vrow.off b { color: var(--muted); text-decoration: line-through; }
.vtop { display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; }
.vtop input { width: 24px; height: 24px; accent-color: var(--purple); flex: 0 0 auto; }
.vtop b { flex: 1; font-size: 16px; }
.vtop small { font-size: 14px; font-weight: 700; color: var(--muted); }
.vmore { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 0 12px; }
.vmore[hidden] { display: none; }
.vmore label { display: grid; gap: 4px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.vmore input { min-height: 48px; padding: 0 12px; border-radius: 12px; border: 2px solid #e3def0; font: inherit; font-size: 16px; min-width: 0; }
.btn-save { position: sticky; bottom: 88px; z-index: 5; box-shadow: 0 10px 24px rgba(91, 52, 232, .3); }

@media (min-width: 1024px) {
  .content.page { grid-template-columns: 1fr; grid-template-areas: none; max-width: 820px; }
  .head--page { max-width: 868px; }
  .head--page .logo { display: none; }
  .fab { bottom: 32px; right: 40px; }
  .btn-save { bottom: 24px; }
  .size-grid { grid-template-columns: repeat(8, 1fr); }
  .vmore { grid-template-columns: repeat(4, 1fr); }
}

/* Elak kotak input menolak halaman jadi lebih lebar daripada skrin */
.content.page { grid-template-columns: minmax(0, 1fr); }
.two, .vmore { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.field input, .two input, .vmore input { width: 100%; min-width: 0; }
@media (min-width: 1024px) { .vmore { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Penerangan di atas borang */
.explain { background: linear-gradient(180deg, #fbfaff, #f3efff); border: 2px solid #e3dbff; }
.explain p { margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.explain .ex { padding: 10px 12px; border-radius: 12px; background: #fff; }
.explain .warn-line { padding: 10px 12px; border-radius: 12px; background: #fff3e2; color: var(--orange); font-weight: 600; }
.explain .warn-line b { color: var(--orange); }
.pm-role { font-size: 14px; color: var(--muted); }
.badge-cost { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: #fff3e2; font-size: 13px; font-weight: 700; color: var(--orange); }
.lock-note[hidden], .field[hidden] { display: none; }

/* Tetapan: pilihan cara kira untung */
.method { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 14px; border: 2px solid #e3def0; border-radius: 16px; cursor: pointer; }
.method input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--purple); flex: 0 0 auto; }
.method:has(input:checked) { border-color: var(--purple); background: #f6f3ff; }
.method b { display: block; font-size: 17px; }
.method p { margin-top: 4px; font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.method .rumus { display: inline-block; margin-top: 8px; padding: 6px 10px; border-radius: 10px; background: #fff; font-size: 15px; font-weight: 700; color: var(--purple); }
.method small { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.btn[hidden] { display: none; }

/* ---------- Stok ---------- */
.inline-link { color: var(--purple); font-weight: 700; text-decoration: underline; }
.pick-list { display: grid; gap: 8px; margin-top: 12px; }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 10px 14px; border: 2px solid #e3def0; border-radius: 14px; text-align: left; background: #fff; }
.pick b { flex: 1; font-size: 17px; }
.pick small { font-size: 14px; color: var(--muted); white-space: nowrap; }
.pick svg { width: 20px; height: 20px; color: var(--muted); }
.picked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #f6f4ff; }
.picked div { flex: 1; min-width: 0; }
.picked small { display: block; font-size: 14px; color: var(--muted); }
.picked b { display: block; font-size: 18px; }
.color-block { margin-top: 14px; }
.color-name { display: block; font-size: 17px; margin-bottom: 8px; }
.qty-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qty-cell { display: grid; gap: 4px; padding: 10px; border: 2px solid #e3def0; border-radius: 14px; text-align: center; }
.qty-cell:focus-within { border-color: var(--purple); background: #faf8ff; }
.qty-size { font-size: 16px; font-weight: 800; }
.qty-cell input { width: 100%; min-width: 0; min-height: 52px; border: 2px solid #e3def0; border-radius: 12px; text-align: center; font: inherit; font-size: 22px; font-weight: 800; color: var(--ink); }
.qty-cell input:focus { outline: none; border-color: var(--purple); }
.qty-cell small { font-size: 14px; color: var(--muted); }
.total-line { margin: 14px 0; padding: 12px 14px; border-radius: 14px; background: #eafaef; color: #17793a; font-size: 18px; font-weight: 800; text-align: center; }
.done { text-align: center; }
.done[hidden] { display: none; }
.done-icon { font-size: 44px; }
.done-actions { display: grid; gap: 10px; margin-top: 16px; }
.stock-card2 { padding: 14px 16px; }
.sc-head { display: flex; align-items: center; gap: 12px; }
.sc-head div { flex: 1; min-width: 0; }
.sc-head b { display: block; font-size: 17px; }
.sc-head small { display: block; font-size: 14px; color: var(--muted); }
.sc-rows { margin-top: 10px; display: grid; gap: 6px; }
.sc-row { display: grid; grid-template-columns: 1fr auto 92px; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 12px; background: #f6f4ff; font-size: 16px; }
.sc-row b { font-size: 18px; font-weight: 800; text-align: right; }
.sc-row em { font-style: normal; font-size: 14px; font-weight: 700; text-align: right; }
.sc-row.low { background: #fff3e2; }
.sc-row.low em, .sc-row.low b { color: var(--orange); }
.sc-row.zero { background: #fde6f1; }
.sc-row.zero em, .sc-row.zero b { color: #b0105f; }
form.card[hidden], section.card[hidden] { display: none; }
@media (min-width: 1024px) { .qty-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Bahagian 5 borang produk: jual + bilangan helai */
.vtop { justify-content: space-between; }
.vjual { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 52px; cursor: pointer; }
.vjual span { min-width: 0; }
.vjual b { display: block; font-size: 16px; }
.vjual small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.vqty { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.vqty[hidden] { display: none; }
.vqty span { font-size: 14px; font-weight: 700; color: var(--purple); white-space: nowrap; }
.vtop .vqty input { width: 84px; height: 48px; padding: 0 8px; border: 2px solid #e3def0; border-radius: 12px; text-align: center; font: inherit; font-size: 20px; font-weight: 800; color: var(--ink); accent-color: auto; }
.vtop .vqty input:focus { outline: none; border-color: var(--purple); }
.notice-ok { display: block; }
.msg[hidden] { display: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.tag.low { background: #fff3e2; color: var(--orange); }
.tag.zero { background: #fde6f1; color: #b0105f; }
.pitem .chev { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }

/* ---------- Borang Produk: variasi ---------- */
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.yn { min-height: 56px; border-radius: 14px; border: 2px solid #e3def0; background: #fff; font-size: 18px; font-weight: 800; color: var(--ink-2); }
.yn.on { background: var(--purple); border-color: var(--purple); color: #fff; }
#kotakVariasi[hidden], .var-card[hidden], #kotakHarga[hidden], .apply-all[hidden], .btn-var2[hidden], .total-line[hidden], .hint[hidden] { display: none; }
.var-card { margin-top: 14px; padding: 14px; border: 2px solid #e3def0; border-radius: 16px; background: #fbfaff; }
.var-head { display: flex; align-items: center; justify-content: space-between; }
.var-head b { font-size: 17px; color: var(--purple); }
.link-x { min-height: 40px; padding: 0 12px; border-radius: 10px; color: #b0105f; font-size: 15px; font-weight: 700; }
.var-card .field { margin-top: 10px; }
.btn-var2 { width: 100%; justify-content: center; margin-top: 12px; }
.apply-all { margin-top: 12px; padding: 14px; border-radius: 16px; background: #f1eefb; display: grid; gap: 10px; }
.apply-all b { font-size: 16px; }
.apply-all .btn-add { justify-content: center; background: var(--purple); color: #fff; }
.vfields { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.vfields label { display: grid; gap: 4px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.vfields input { width: 100%; min-width: 0; min-height: 50px; padding: 0 10px; border: 2px solid #e3def0; border-radius: 12px; font: inherit; font-size: 18px; font-weight: 700; color: var(--ink); background: #fff; }
.vfields input:focus { outline: none; border-color: var(--purple); }
.vrow { padding: 10px 12px 12px; }
.vname { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.vname b { font-size: 17px; }
.vname small { font-size: 14px; font-weight: 700; color: var(--muted); }
.vname .off-tag { color: #b0105f; }
.vrow.off .vname b { text-decoration: line-through; color: var(--muted); }
.vmore { margin-top: 8px; }
.stop-row { display: flex !important; align-items: center; gap: 8px; grid-column: 1 / -1; font-size: 15px; }
.stop-row input { width: 22px; height: 22px; min-height: 0; accent-color: #b0105f; }

/* ---------- Gambar produk ---------- */
.photo-box { display: flex; gap: 12px; align-items: center; }
.photo-preview { flex: 0 0 auto; width: 104px; height: 104px; border-radius: 16px; border: 2px dashed #d6cff0; background: #faf8ff; display: grid; place-items: center; overflow: hidden; text-align: center; }
.photo-preview span { font-size: 30px; line-height: 1; }
.photo-preview small { display: block; font-size: 12px; color: var(--muted); padding: 0 6px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: grid; gap: 8px; flex: 1; min-width: 0; }
.photo-actions .btn-add { justify-content: center; }
.link-x[hidden] { display: none; }
.chip-item .chip-cam { width: 36px; height: 36px; margin-left: -8px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 17px; overflow: hidden; }
.chip-item .chip-cam img { width: 100%; height: 100%; object-fit: cover; }
.chip-item { padding-left: 12px; }
.pthumb { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; object-fit: cover; background: #efeaff; }
.photo-full { padding: 0; overflow: hidden; }
.photo-full[hidden] { display: none; }
.photo-full img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #f6f4ff; }
.sc-row.with-thumb { grid-template-columns: 40px 1fr auto 92px; }
.row-thumb img { display: block; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
/* Kotak yang salah: merah + nota di bawah */
.input-salah { border-color: #e0245e !important; background: #fff5f8 !important; }
.btn-add.input-salah { outline: 3px solid #e0245e; }
.salah-nota { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #fde6f1; color: #b0105f; font-size: 15px; font-weight: 700; }

/* Semasa menaip di telefon: sorok menu bawah & butang terapung (tidak naik bersama papan kekunci) */
@media (max-width: 1023px) {
  html.sedang-menaip .bottom-nav,
  html.sedang-menaip .fab { display: none !important; }
  html.sedang-menaip .btn-save { position: static; box-shadow: none; }
  html.sedang-menaip .main { padding-bottom: 24px; }
}

/* ---------- Jualan ---------- */
.sub-label { margin-top: 14px; margin-bottom: 8px; font-size: 16px; font-weight: 700; }
.choice-row { margin-top: 10px; }
.choice-row .fchip { min-height: 48px; padding: 0 18px; font-size: 16px; }
.pick.on { border-color: var(--purple); background: #f6f3ff; }
.pick .pthumb, .pick .pinitial { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.vbtn { display: grid; gap: 2px; min-height: 60px; padding: 8px 10px; border: 2px solid #e3def0; border-radius: 14px; background: #fff; text-align: center; }
.vbtn b { font-size: 16px; }
.vbtn small { font-size: 14px; font-weight: 600; color: var(--green); }
.vbtn:disabled { opacity: .45; cursor: not-allowed; }
.vbtn:disabled small { color: #b0105f; }
.vbtn:not(:disabled):active { background: #efeaff; border-color: var(--purple); }
.cart { display: grid; gap: 10px; margin-top: 10px; }
.cart-row { position: relative; display: grid; gap: 8px; padding: 12px; border: 2px solid #e3def0; border-radius: 16px; }
.cart-name { padding-right: 40px; }
.cart-name b { display: block; font-size: 17px; }
.cart-name small { display: block; font-size: 14px; color: var(--muted); }
.cart-x { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #b0105f; }
.cart-x svg { width: 20px; height: 20px; stroke-width: 2.6; }
.cart-fields { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: end; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button { width: 48px; height: 48px; border-radius: 12px; background: #efeaff; color: var(--purple); font-size: 24px; font-weight: 800; }
.stepper button:disabled { opacity: .4; }
.stepper input, .stepper output { width: 56px; height: 48px; border: 2px solid #e3def0; border-radius: 12px; text-align: center; font: inherit; font-size: 20px; font-weight: 800; color: var(--ink); display: grid; place-items: center; }
.cart-price { display: grid; gap: 4px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.cart-price input { width: 100%; min-width: 0; min-height: 48px; padding: 0 12px; border: 2px solid #e3def0; border-radius: 12px; font: inherit; font-size: 18px; font-weight: 700; color: var(--ink); }
.cart-price input:focus, .stepper input:focus { outline: none; border-color: var(--purple); }
.cart-line { font-size: 15px; color: var(--ink-2); }
.cart-row .stepper { justify-self: end; }
.cart-row:has(> .stepper) { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.cart-row:has(> .stepper) .cart-name { padding-right: 0; }
.summary { display: grid; gap: 4px; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; font-size: 16px; border-bottom: 1px dashed #ece8f6; }
.sum-row:last-child { border-bottom: 0; }
.sum-row span { min-width: 0; }
.sum-row b { white-space: nowrap; font-weight: 800; }
.sum-row.big { font-size: 20px; }
.sum-row.big b { font-size: 24px; }
.sum-row.debt, .sum-row.debt b { color: #b0105f; }
.review-items { margin-top: 10px; }
#semakIsi .msg { margin-top: 10px; }
.opt.wajib { color: #b0105f; font-weight: 700; }
.tag.ok { background: #eafaef; color: #17793a; }
.tag.off { background: #f1eefb; color: var(--muted); }
.big-tag { display: inline-block; margin-bottom: 8px; padding: 6px 14px; font-size: 16px; }
.struck { text-decoration: line-through; color: var(--muted) !important; }
.sale-item b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ch-list { display: grid; gap: 8px; margin: 12px 0 4px; }
.ch-row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; border-radius: 14px; background: #f6f4ff; }
.ch-row div { flex: 1; min-width: 0; }
.ch-row b { display: block; font-size: 16px; }
.ch-row small { display: block; font-size: 14px; color: var(--muted); }
.ch-row.off b { color: var(--muted); text-decoration: line-through; }
.channels-wrap { margin-top: 16px; }
#tambahSaluran[hidden], #kotakTroli[hidden], #pilihJenis[hidden], #kotakSaluran[hidden], #kotakPlatform[hidden], #kotakBayar[hidden], #kotakCara[hidden], #kotakCaraPulang[hidden], .field.small-field[hidden], #semak[hidden], #selesai[hidden], form[hidden] { display: none; }
#pilihJenis { margin-top: 12px; }
@media (min-width: 1024px) { .channels-wrap { margin-top: 16px; } }
.cart-qty { display: grid; gap: 4px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.btn-add[hidden], #notaOnline[hidden], .back[hidden] { display: none; }
#semak { margin-top: 16px; }

/* ---------- Belanja ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.cat-btn { min-height: 56px; padding: 8px 10px; border-radius: 14px; border: 2px solid #e3def0; background: #fff; font-size: 15px; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.25; }
.cat-btn.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn-danger { background: #fde6f1; color: #b0105f; margin-top: 4px; }
#kotakKategori { margin-top: 16px; }
#kotakKategori[hidden], #kadBulan[hidden], #notaCaraB[hidden], #notaStaf[hidden], #penerangan[hidden] { display: none; }
#kadBulan h2 { margin-bottom: 4px; }
input[type=date] { font: inherit; }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
#tarikh { max-width: 200px; }
/* Home data sebenar */
#hariPil[hidden], #btnSemua[hidden] { display: none; }
#btnSemua { width: 100%; }
a.alert { color: inherit; }
.month small { display: block; margin-top: 4px; font-size: 14px; color: var(--orange); font-weight: 600; }

/* ---------- Staf ---------- */
#kotakStaf { margin-top: 16px; }
#kotakStaf[hidden], #kadJemput[hidden], #kadStaf[hidden], #kadPautan[hidden], #kadKeluar[hidden], #kotakPautan[hidden], .pm-shops[hidden], #btnKongsi[hidden], #btnTerima[hidden], #btnKeluar[hidden] { display: none; }
.staf-row { flex-wrap: wrap; }
.staf-row > div { flex: 1 1 60%; }
.staf-row .switch-row { flex: 1 1 100%; margin-top: 4px; background: #fff; }
.link-x.biasa { color: var(--purple); }
.link-box { width: 100%; min-height: 48px; padding: 0 12px; border: 2px solid #e3def0; border-radius: 12px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; }
#kadJemput .btn { margin-top: 12px; }
.pm-shops { display: grid; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #efecf7; }
.pm-shops small { font-size: 13px; color: var(--muted); }
.pm-switch { min-height: 44px; padding: 0 12px; border-radius: 12px; background: #f6f4ff; color: var(--purple); font-size: 15px; font-weight: 700; text-align: left; }

/* ---------- Tolak stok & sejarah ---------- */
#btnTolak[hidden], #kadSejarah[hidden], #ringkas[hidden] { display: none; }
#btnTolak { margin-top: -4px; }
.hist { display: grid; margin-top: 8px; }
.hist-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 2px; border-top: 1px solid #efecf7; }
.hist-row:first-child { border-top: 0; }
.hist-row div { flex: 1; min-width: 0; }
.hist-row b { display: block; font-size: 16px; }
.hist-row small { display: block; font-size: 14px; color: var(--muted); }
.hist-row em { font-style: normal; font-size: 18px; font-weight: 800; white-space: nowrap; }
.hist-row em.naik { color: var(--green); }
.hist-row em.turun { color: #b0105f; }

/* ---------- Pelanggan ---------- */
.cust-item { gap: 8px; padding-right: 10px; }
.cust-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; min-height: 60px; color: inherit; }
.cust-link div { flex: 1; min-width: 0; }
.btn-chat { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #f6f4ff; font-size: 26px; line-height: 1; }
.btn-chat img { width: 32px; height: 32px; }
.btn-chat[hidden], #kadRingkas[hidden], #kadJualan[hidden], #btnUbah[hidden], #notaPelanggan[hidden] { display: none; }
.cust-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
#notaPelanggan { color: var(--purple); font-weight: 600; }

/* Skrin senarai (Jualan, Belanja): .sample BUKAN dalam grid Home — tanpa ini PC jadi 3 lajur (dibaiki 12 Okt 2026) */
.content.page .sample { grid-area: auto; }
