/* Suai Hati Deco — tema sage green & ungu lavender (ikut logo belon & flyer pakej)
 * Asas susun atur sama dengan app Mika's Kitchen / Dusty White. */
:root {
  --brand: #5b3a7e;          /* ungu plum: butang utama */
  --brand-dark: #3d4f37;     /* hijau tua: tajuk */
  --brand-soft: #ece4f6;     /* lavender lembut */
  --gold: #b79ae0;           /* lavender belon */
  --bg: #f3f5ee;
  --card: #fdfefb;
  --line: #dfe6d6;
  --text: #2c3529;
  --muted: #7a8673;
  --ok: #3f7a4a;
  --ok-soft: #e1efe1;
  --warn: #9a6416;
  --warn-soft: #f6ead4;
  --bad: #a83f4a;
  --bad-soft: #f7e1e3;
  --info: #5b3a7e;
  --info-soft: #ece4f6;
  --radius: 18px;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Nunito', system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
h1, h2, h3 { font-family: var(--serif); margin: 0; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  background: var(--brand); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.topbar-logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; padding: 2px; }
.topbar h1 { flex: 1; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-back {
  border: 1.5px solid rgba(255,255,255,.45); background: rgba(255,255,255,.12);
  color: #fff; border-radius: 999px; padding: 7px 16px; font-weight: 700;
}

main { max-width: 680px; margin: 0 auto; padding: 16px; }

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 0;
}
.bottomnav a span { font-size: 20px; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.bottomnav a.active { color: var(--brand); }
.bottomnav a.active span { filter: none; opacity: 1; }
.bottomnav .nav-add span {
  width: 54px; height: 54px; border-radius: 50%; margin-top: -26px;
  background: var(--brand); color: #fff; font-size: 30px; line-height: 54px; text-align: center;
  filter: none; opacity: 1; box-shadow: 0 4px 14px rgba(122,59,34,.35); border: 3px solid var(--bg);
}

/* ---------- Cards & layout ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(90,42,23,.05);
}
.card h2 { font-size: 17px; margin-bottom: 12px; color: var(--brand-dark); }
.card h2 small { font-family: var(--sans); font-weight: 600; color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.hr { border: 0; border-top: 1px dashed var(--line); margin: 12px 0; }

.hello { margin: 4px 2px 16px; }
.hello h2 { font-size: 24px; color: var(--brand-dark); }
.hello p { margin: 4px 0 0; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.stat b { display: block; font-size: 22px; font-family: var(--serif); color: var(--brand-dark); }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat.hl { background: var(--brand); border-color: var(--brand); }
.stat.hl b, .stat.hl span { color: #fff; }

/* ---------- Forms ---------- */
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 5px; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; outline: none; font-size: 16px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 800; font-size: 15.5px;
  background: var(--brand); color: #fff; cursor: pointer; width: 100%;
}
.btn:active { transform: scale(.98); }
.btn.alt { background: var(--brand-soft); color: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); }
.btn.wa { background: #1f9e55; }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; width: auto; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btns.one { grid-template-columns: 1fr; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chip {
  flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 7px 14px; font-weight: 700; font-size: 14px; color: var(--muted);
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.seg { display: flex; background: var(--brand-soft); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 4px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--brand-dark); }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ---------- Order list ---------- */
.olist { display: flex; flex-direction: column; gap: 10px; }
.oitem {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.oitem .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.oitem .no { font-family: var(--serif); font-weight: 700; color: var(--brand-dark); }
.oitem .name { font-weight: 800; }
.oitem .meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.oitem .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.info { background: var(--info-soft); color: var(--info); }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty b { display: block; font-size: 40px; }

/* ---------- Order form items ---------- */
.lines { margin: 0 0 6px; }
.line { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dotted var(--line); align-items: flex-start; }
.line .d { flex: 1; min-width: 0; }
.line .d b { display: block; }
.line .d small { color: var(--muted); display: block; }
.line .p { font-weight: 800; white-space: nowrap; }
.line .x { border: 0; background: var(--bad-soft); color: var(--bad); width: 28px; height: 28px; border-radius: 8px; font-weight: 800; flex: none; }
.qty { display: inline-flex; align-items: center; gap: 0; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 6px; background: #fff; }
.qty button { border: 0; background: var(--brand-soft); width: 32px; height: 30px; font-weight: 800; }
.qty span { min-width: 34px; text-align: center; font-weight: 800; }

.totals .between { padding: 4px 0; }
.totals .grand { font-size: 20px; font-weight: 800; color: var(--brand-dark); border-top: 2px solid var(--line); margin-top: 6px; padding-top: 8px; }
.totals input { width: 110px; padding: 6px 10px; text-align: right; }

/* ---------- Stepper ---------- */
.stepper { display: flex; justify-content: space-between; position: relative; margin: 14px 0 6px; }
.stepper::before { content: ''; position: absolute; left: 12%; right: 12%; top: 18px; height: 3px; background: var(--line); }
.step { position: relative; flex: 1; text-align: center; border: 0; background: transparent; padding: 0; }
.step i {
  display: block; width: 38px; height: 38px; margin: 0 auto 4px; border-radius: 50%;
  background: var(--brand-soft); color: #fff; font-style: normal; font-weight: 800; line-height: 38px;
  border: 3px solid var(--card);
}
.step span { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.step.done i { background: var(--gold); }
.step.cur i { background: var(--brand); }
.step.cur span { color: var(--text); }
.status-line { font-weight: 800; color: var(--info); padding: 0 4px; }

.note {
  background: var(--brand-soft); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; display: flex; gap: 10px;
}

/* ---------- Invoice ---------- */
.inv-wrap { overflow-x: auto; margin: 0 -4px 14px; padding: 4px; }
.invoice {
  background: #fff; color: #3a231b; border-radius: 6px; padding: 26px 22px; max-width: 640px; margin: 0 auto;
  box-shadow: 0 2px 14px rgba(90,42,23,.12); position: relative; overflow: hidden; font-size: 14px;
}
.invoice::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 7px; background: var(--brand); }
.inv-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.inv-head img { width: 76px; height: 76px; }
.inv-head .biz { flex: 1; }
.inv-head .biz b { font-family: var(--serif); font-size: 17px; color: var(--brand-dark); display: block; }
.inv-head .biz small { display: block; color: #8a6a66; font-size: 12px; line-height: 1.4; }
.inv-title { text-align: right; }
.inv-title h3 { font-size: 20px; letter-spacing: 2px; color: var(--brand); }
.inv-title small { display: block; color: #8a6a66; font-size: 12px; }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: #eef2e8; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; }
.inv-meta .lbl { font-size: 10.5px; font-weight: 800; letter-spacing: 1px; color: #a77d84; text-transform: uppercase; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv-table th { text-align: left; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: #a77d84; border-bottom: 2px solid var(--brand); padding: 6px 4px; }
.inv-table td { padding: 8px 4px; border-bottom: 1px solid #f3e1e6; vertical-align: top; }
.inv-table td small { color: #9a7d78; display: block; }
.inv-table .r { text-align: right; white-space: nowrap; }
.inv-sum { margin-left: auto; width: 62%; min-width: 210px; margin-top: 10px; font-size: 13.5px; }
.inv-sum .between { padding: 3px 0; }
.inv-sum .grand { font-weight: 800; font-size: 16px; color: #fff; background: var(--brand); padding: 8px 10px; border-radius: 8px; margin: 6px 0; }
.inv-sum .bal { font-weight: 800; color: var(--bad); }
.inv-pay { display: flex; gap: 14px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed #ecc3cf; font-size: 13px; }
.inv-pay .t { flex: 1; }
.inv-pay b.lbl { display: block; font-size: 10.5px; letter-spacing: 1px; color: #a77d84; text-transform: uppercase; margin-bottom: 4px; }
.inv-pay img { width: 110px; height: 110px; object-fit: contain; border: 1px solid #f3e1e6; border-radius: 8px; }
.inv-foot { text-align: center; color: #9a7d78; font-size: 12px; margin-top: 16px; }
.stamp {
  position: absolute; right: 18px; top: 120px; transform: rotate(-14deg);
  border: 3px solid var(--ok); color: var(--ok); font-weight: 800; letter-spacing: 3px; font-size: 22px;
  padding: 4px 14px; border-radius: 8px; opacity: .75;
}

/* ---------- Products editor ---------- */
.pcat input.cat { font-weight: 800; }
.prow { display: grid; grid-template-columns: 1fr 92px 34px; gap: 8px; margin-bottom: 8px; }
.prow input { padding: 9px 10px; }
.prow .x { border: 0; background: var(--bad-soft); color: var(--bad); border-radius: 10px; font-weight: 800; }

/* ---------- Sheet / toast ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 50; background: rgba(58,35,27,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden] { display: none; }
.sheet .panel {
  background: var(--card); width: 100%; max-width: 680px; border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto;
  animation: up .2s ease-out;
}
.sheet .panel h2 { font-size: 18px; margin-bottom: 12px; color: var(--brand-dark); }
.sheet .opt { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; font-weight: 700; }
.sheet .opt small { display: block; font-weight: 600; color: var(--muted); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Print: invoice only ---------- */
@media print {
  @page { margin: 10mm; }
  body { background: #fff; padding: 0; }
  .topbar, .bottomnav, .no-print, .toast, .sheet { display: none !important; }
  main { padding: 0; max-width: none; }
  .invoice { box-shadow: none; max-width: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- v2 additions ---------- */
.bottomnav a span { filter: none; opacity: 1; display: flex; align-items: center; justify-content: center; height: 26px; }
.bottomnav a.active span { color: var(--brand); }
.bottomnav .nav-add span { display: flex; align-items: center; justify-content: center; height: 54px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin: 2px 0 12px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 700; font-size: 12.5px; text-decoration: underline; padding: 0 4px; }
.link-btn[hidden] { display: none; }
.sheet-x { border: 0; background: var(--brand-soft); color: var(--brand-dark); width: 34px; height: 34px; border-radius: 50%; font-weight: 800; flex: none; }
.sheet .opt.sel { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.btn:disabled { opacity: .5; }
.price-in { width: 92px; padding: 7px 8px; text-align: right; }
.price-in.need { border-color: var(--bad); background: var(--bad-soft); }
.prow { grid-template-columns: 1fr 70px 70px 34px; }
.prow3 { display: grid; grid-template-columns: 1fr 72px 72px 72px; gap: 8px; margin-bottom: 8px; }
.prow3 input { padding: 9px 8px; }
.note.warn { background: var(--warn-soft); color: var(--warn); font-weight: 700; margin-bottom: 14px; }
.f .flabel { display: block; font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.thumb { width: 140px; max-height: 200px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); display: block; margin-bottom: 8px; background: #fff; }
.label-sm small { font-weight: 600; }
label.f > span small { font-weight: 600; }

/* invoice v2 */
.inv-head { margin-bottom: 14px; }
.inv-head .biz small { font-size: 12px; }
.inv-titlebar { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--brand); padding-bottom: 8px; margin-bottom: 14px; }
.inv-titlebar h3 { font-size: 22px; letter-spacing: 3px; color: var(--brand); }
.inv-titlebar div { text-align: right; font-size: 13px; }
.inv-titlebar div b { display: block; font-size: 15px; }
.inv-titlebar div small { color: #8a6a66; }
.inv-sum .req { font-weight: 800; color: var(--warn); background: var(--warn-soft); padding: 6px 10px; border-radius: 8px; margin-top: 4px; }
.inv-terms { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #ecc3cf; font-size: 11.5px; color: #5e4540; line-height: 1.5; }
.inv-terms b.lbl { display: block; font-size: 10.5px; letter-spacing: 1px; color: #a77d84; text-transform: uppercase; margin-bottom: 4px; }
.inv-terms ol { margin: 0; padding-left: 18px; }
.stamp { top: 150px; }

/* small-screen fixes */
.seg button { min-width: 0; }
#zone { display: grid; grid-template-columns: 1fr 1fr; }
.prow { grid-template-columns: minmax(0, 1fr) 64px 64px 32px; }
.prow3 { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(0, 64px)); }
.prow3 b { font-size: 11.5px; line-height: 1.2; }
input, select, textarea { min-width: 0; }
.line > div[style] { flex: none; }
.line input.price-in { width: 84px; padding: 7px 8px; text-align: right; }
@media (max-width: 380px) {
  .row.stack-sm { flex-direction: column; align-items: stretch; gap: 0; }
}
.stat b { font-size: 19px; }


/* full-screen image viewer */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(20,16,8,.92); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; background: #fff; }
.lightbox .sheet-x { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; }

/* sync */
.sync-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #8fd19e; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.sync-dot[hidden] { display: none; }
.sync-dot.busy { background: #f3d27a; }
.sync-dot.err { background: #f08a7e; }
.sync-big { font-family: ui-monospace, Menlo, monospace; font-size: 23px; font-weight: 800; letter-spacing: 2px; text-align: center; background: var(--brand-soft); color: var(--brand-dark); border-radius: 16px; padding: 18px 10px; word-break: break-all; }
.sync-code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; }
.linkcard { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.linkcard b { display: block; color: var(--brand-dark); }
.linkcard small { color: var(--muted); }
.linkcard > span { font-size: 26px; color: var(--muted); }

/* kunci PIN */
.pinlock { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; }
.pin-inner { width: 100%; max-width: 340px; text-align: center; }
.pin-logo { width: 84px; height: 84px; margin-bottom: 8px; }
.pinlock h2 { font-size: 22px; color: var(--brand-dark); }
.pin-sub { color: var(--muted); margin: 4px 0 16px; font-size: 14.5px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; height: 18px; margin-bottom: 6px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand); }
.pin-dots i.on { background: var(--brand); }
.pin-msg { min-height: 20px; color: var(--bad); font-weight: 700; font-size: 14px; margin: 6px 0 10px; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-keys button { height: 62px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); font-size: 24px; font-weight: 700; color: var(--text); }
.pin-keys button:active { background: var(--brand-soft); }
.pin-keys .pin-ok { background: var(--brand); color: #fff; border-color: var(--brand); font-size: 18px; }
.pin-foot { display: flex; justify-content: center; gap: 24px; margin-top: 16px; min-height: 24px; }
.pin-foot .link-btn { font-size: 15px; }
.pinlock.shake .pin-dots { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

/* kalendar */
.cal-head h2 { font-size: 18px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 800; color: var(--muted); padding-bottom: 2px; }
.cal-cell { position: relative; aspect-ratio: 1; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 3px 0 0; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 14px; color: var(--text); min-width: 0; }
.cal-cell.blank { border: 0; background: none; }
.cal-cell span { font-weight: 700; }
.cal-cell b { font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }
.cal-cell.busy { background: #fde8ee; }
.cal-cell.full { background: var(--bad-soft); border-color: #e9b9b2; }
.cal-cell.full b { background: var(--bad); color: #fff; }
.cal-cell.off, .cal-cell.holiday { background: #f1ecec; color: #b0a3a3; }
.cal-cell.holiday::after { content: 'cuti'; font-size: 9px; font-weight: 800; color: var(--bad); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--gold); }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-cell i { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.cal-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line); }
.lg.busy { background: #fde8ee; } .lg.full { background: var(--bad-soft); } .lg.off { background: #f1ecec; } .lg.ev { background: var(--gold); border-radius: 50%; }

/* laporan */
.bar-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 0; font-size: 14px; }
.bar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-t { height: 10px; background: var(--brand-soft); border-radius: 999px; overflow: hidden; }
.bar-t i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar-row b { font-size: 13.5px; white-space: nowrap; }
.rtable { overflow-x: auto; }
.rtable table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rtable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 2px solid var(--brand); padding: 6px 4px; }
.rtable td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.rtable .r { text-align: right; white-space: nowrap; }
.rtable .tot td { font-weight: 800; border-top: 2px solid var(--line); }
.rtable .neg { color: var(--bad); }
.print-only { display: none; }
@media print { .print-only { display: block; } .card { break-inside: avoid; box-shadow: none; } }

.kvs .between { align-items: flex-start; padding: 2px 0; }
.kvs .between > span:last-child { white-space: nowrap; }

/* ---------- senarai pakej ---------- */
.prow2 { display: grid; grid-template-columns: minmax(0, 1fr) 92px 34px; gap: 8px; margin-bottom: 8px; }
.prow2 input { padding: 9px 10px; min-width: 0; }
.prow2 .x { border: 0; background: var(--bad-soft); color: var(--bad); border-radius: 10px; font-weight: 800; }
.hello h2 { font-weight: 600; }
.chips .chip { flex: none; }
[hidden] { display: none !important; }
input[type=time], input[type=date] { width: 100%; }

/* Tarikh & masa di iPhone: Safari bagi lebar sendiri (kotak bertindih) & tunjuk tarikh hari ini bila kosong */
input[type=date], input[type=time] {
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; min-width: 0; max-width: 100%; min-height: 50px;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; outline: none; font-size: 16px; text-align: left; color: var(--text);
}
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
.row > .f, .row > label { flex: 1 1 0; min-width: 0; }
.dt { position: relative; display: block; min-width: 0; }
.dt.dt-none input { color: transparent; }
.dt.dt-none input::-webkit-datetime-edit { color: transparent; }
.dt.dt-none::after { content: attr(data-ph); position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #a3ab9c; pointer-events: none; font-size: 16px; }

/* ================= Tema Suai Hati Deco: sage & lavender ================= */
:root {
  --sage: #7c9369; --sage-2: #6f8760; --sage-3: #5d744f; --sage-soft: #e6ecdf; --sage-mist: #eef2e8;
  --lav: #b79ae0; --lav-2: #cdb8ec; --lav-3: #ece4f6; --plum: #5b3a7e; --plum-2: #4a2d69;
  --ribbon: #3f5a3c; --script: 'Allura', cursive;
}
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(183,154,224,.22), transparent 42%),
    radial-gradient(circle at 110% 30%, rgba(124,147,105,.16), transparent 40%);
  background-attachment: fixed;
}
::selection { background: var(--lav-2); }

/* Bar atas: sage macam logo, tulisan putih */
.topbar {
  background: linear-gradient(135deg, var(--sage-2) 0%, var(--sage-3) 100%);
  color: #fff; box-shadow: 0 4px 18px rgba(61,79,55,.25);
}
.topbar h1 { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: .3px; }
.topbar-logo { width: 42px; height: 42px; padding: 0; background: var(--sage); box-shadow: 0 0 0 2px rgba(255,255,255,.75); }
.btn-back { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.14); }

/* Kad: bucu bulat besar macam widget iPhone */
.card {
  border-radius: 24px; border: 1px solid var(--line); background: var(--card);
  box-shadow: 0 6px 20px rgba(61,79,55,.07); position: relative;
}
.card h2 { color: var(--brand-dark); font-weight: 600; }
.card > h2:first-child, .card > .between:first-child h2 { display: flex; align-items: center; gap: 8px; }
.card > h2:first-child::before {
  content: ''; width: 10px; height: 12px; flex: none;
  background: radial-gradient(circle at 35% 35%, #fff 0 1.5px, transparent 2px), var(--lav);
  border-radius: 50% 50% 46% 46%; box-shadow: 0 6px 0 -4.5px var(--ribbon);
}
.card > h2:first-child small { margin-left: 2px; }

/* Kad sambutan Utama */
.hero {
  position: relative; display: flex; align-items: center; gap: 14px;
  background: linear-gradient(140deg, var(--sage) 0%, var(--sage-3) 100%);
  border-radius: 28px; padding: 16px; margin: 2px 0 12px; color: #fff;
  box-shadow: 0 10px 26px rgba(61,79,55,.28); overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; right: -30px; top: -40px; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.35), rgba(183,154,224,.45) 40%, rgba(183,154,224,0) 70%);
}
.hero::after { content: ''; position: absolute; inset: 7px; border: 1.5px solid rgba(255,255,255,.28); border-radius: 22px; pointer-events: none; }
.hero img { width: 80px; height: 80px; border-radius: 22px; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 6px 14px rgba(0,0,0,.18); position: relative; z-index: 1; }
.hero .t { min-width: 0; position: relative; z-index: 1; }
.hero small { display: block; font-family: var(--script); font-size: 25px; line-height: 1; color: #f1e9fb; }
.hero h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; color: #fff; line-height: 1.25; margin: 2px 0 0; overflow-wrap: anywhere; }
.hero p { margin: 4px 0 0; color: rgba(255,255,255,.88); font-size: 14px; }
.hero p b { color: #fff; }

/* Widget tarikh (ilham dari skrin iPhone client) */
.widgets { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 12px; }
.w-date {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  background: linear-gradient(150deg, #c3a8e8 0%, #a588d4 100%); color: #fff;
  border-radius: 24px; padding: 12px 16px; box-shadow: 0 8px 20px rgba(122,90,170,.28); min-height: 128px; position: relative; overflow: hidden;
}
.w-date::after { content: ''; position: absolute; right: -18px; bottom: -18px; width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,.14); }
.w-date .w-day { font-family: var(--script); font-size: 30px; line-height: 1; }
.w-date b { font-family: var(--sans); font-weight: 800; font-size: 50px; line-height: 1; margin: 2px 0; }
.w-date .w-mon { font-weight: 800; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; opacity: .9; }
.w-side { display: grid; grid-template-rows: 1fr 1fr; gap: 10px; }
.w-mini {
  display: flex; flex-direction: column; justify-content: center; border-radius: 20px; padding: 8px 14px;
  background: var(--sage-soft); border: 1px solid #d3dcc8; color: var(--brand-dark);
}
.w-mini b { font-size: 24px; font-weight: 800; line-height: 1.05; }
.w-mini span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.w-mini.lav { background: var(--lav-3); border-color: #ddd0ef; color: var(--plum); }

/* Statistik */
.stat { border-radius: 20px; border: 1px solid var(--line); background: #fff; box-shadow: 0 4px 12px rgba(61,79,55,.05); position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; right: -16px; top: -16px; width: 50px; height: 50px; border-radius: 50%; background: var(--lav-3); }
.stat b, .stat span { position: relative; }
.stat b { color: var(--brand-dark); font-family: var(--sans); font-weight: 800; }
.stat.hl { background: linear-gradient(135deg, #6a4590, var(--plum-2)); border-color: transparent; box-shadow: 0 8px 18px rgba(91,58,126,.3); }
.stat.hl::before { background: rgba(255,255,255,.12); }
.stat.hl span { color: #e3d6f3; }

/* Butang */
.btn { border-radius: 999px; background: linear-gradient(135deg, #6a4590, var(--plum-2)); box-shadow: 0 6px 14px rgba(91,58,126,.25); letter-spacing: .1px; }
.btn.alt { background: var(--lav-3); color: var(--plum); box-shadow: none; }
.btn.ghost { background: #fff; color: var(--sage-3); box-shadow: none; border: 1.5px solid #d3dcc8; }
.btn.wa { background: linear-gradient(135deg, #25b864, #1a9450); box-shadow: 0 6px 14px rgba(26,148,80,.22); }
.btn.danger { box-shadow: none; }
.chip { border-radius: 999px; background: #fff; border-color: #d3dcc8; color: var(--sage-3); }
.chip.on { background: var(--sage-2); border-color: var(--sage-2); color: #fff; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.seg { background: var(--sage-soft); border-radius: 999px; }
.seg button { border-radius: 999px; color: var(--sage-3); }
.seg button.on { color: var(--plum); box-shadow: 0 2px 8px rgba(61,79,55,.18); }
input:focus, select:focus, textarea:focus { border-color: var(--lav); box-shadow: 0 0 0 3px rgba(183,154,224,.25); }

/* Senarai booking */
.oitem { border-radius: 20px; border: 1px solid var(--line); background: #fff; border-left: 5px solid var(--lav); box-shadow: 0 3px 10px rgba(61,79,55,.04); }
.oitem .no { color: var(--sage-3); font-weight: 600; }
.oitem .top b { color: var(--plum); }
.tag { background: var(--sage-soft); color: var(--sage-3); }
.tag.info { background: var(--lav-3); color: var(--plum); }
.tag.date { background: #f2eefa; color: #6b4f93; }

/* Perlu tindakan */
.act h2 { margin-bottom: 6px; }
.act-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.act-row:last-child { border-bottom: 0; padding-bottom: 0; }
.act-row .tag { flex: none; }
.act-row .d { flex: 1; min-width: 0; }
.act-row .d b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-row .d small { color: var(--muted); }
.act-row > span:last-child { color: var(--lav); font-size: 22px; font-weight: 700; }

/* Butiran booking */
.ono { font-size: 24px; margin: 0; color: var(--plum); }
.tel { color: var(--plum); font-weight: 800; text-decoration: underline; text-decoration-color: var(--lav-2); text-underline-offset: 3px; }
.ev-box { display: grid; gap: 8px; background: var(--sage-mist); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 14.5px; }
.ev-box .lbl { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--sage-3); }
.ev-box b { display: block; }
.ev-box small { color: var(--muted); font-weight: 700; }

/* Pilih pakej */
.sheet { background: rgba(44,53,41,.45); }
.sheet .panel { border-radius: 26px 26px 0 0; }
.sheet .panel h2 { color: var(--brand-dark); font-weight: 600; }
.sheet .opt { border-radius: 16px; }
.sheet .opt small { font-weight: 600; line-height: 1.35; margin-top: 2px; }
.sheet .opt .opt-p { color: var(--plum); font-weight: 800; white-space: nowrap; }
.sheet .opt.sel { border-color: var(--lav); background: var(--lav-3); box-shadow: inset 0 0 0 1px var(--lav); }
.sheet-x { background: var(--sage-soft); color: var(--sage-3); }

/* Editor pakej */
.pvar { padding: 8px 0 10px; border-bottom: 1px dashed var(--line); margin-bottom: 8px; }
.pvar .prow2 { margin-bottom: 6px; }
.pvar input.inc { padding: 8px 10px; font-size: 14px; background: var(--sage-mist); }

/* Status */
.stepper::before { background: var(--line); }
.step i { background: var(--sage-soft); color: var(--sage-3); }
.step.done i { background: var(--sage); color: #fff; } .step.cur i { background: var(--plum); color: #fff; box-shadow: 0 0 0 4px var(--lav-3); }
.status-line { color: var(--plum); }
.note { background: var(--lav-3); }
.totals .grand { color: var(--plum); }
.qty button { background: var(--lav-3); color: var(--plum); }

/* Kosong */
.empty::before { content: '🎈'; display: block; font-size: 36px; margin-bottom: 6px; }

/* Menu bawah */
.bottomnav { background: rgba(253,254,251,.96); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(61,79,55,.08); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.bottomnav a { color: #93a08b; }
.bottomnav a.active span, .bottomnav a.active { color: var(--plum); }
.bottomnav .nav-add span { background: linear-gradient(135deg, #c3a8e8, #9a7bcc); box-shadow: 0 8px 18px rgba(122,90,170,.45); border-color: var(--bg); }

/* Kalendar */
.cal-head h2 { font-family: var(--serif); }
.cal-cell { border-color: var(--line); border-radius: 12px; }
.cal-cell b { background: var(--lav-3); color: var(--plum); }
.cal-cell.busy { background: #f4effb; border-color: #e1d5f1; }
.cal-cell.full { background: var(--bad-soft); border-color: #ebbfc3; }
.cal-cell.off, .cal-cell.holiday { background: #eceee8; color: #a3ab9c; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--sage); }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--plum); }
.lg.busy { background: #f4effb; } .lg.off { background: #eceee8; }

/* Laporan */
.bar-t { background: var(--sage-soft); }
.bar-t i { background: linear-gradient(90deg, var(--sage), var(--lav)); }
.rtable th { border-bottom-color: var(--sage); }

/* Lagi */
.linkcard b { color: var(--brand-dark); }
.linkcard > span { color: var(--lav); }

/* Sync & PIN */
.sync-big { background: var(--lav-3); color: var(--plum); }
.pinlock { background: linear-gradient(170deg, var(--sage) 0%, #a9b99a 30%, var(--bg) 62%); }
.pin-logo { width: 112px; height: 112px; border-radius: 30px; box-shadow: 0 0 0 4px #fff, 0 10px 24px rgba(61,79,55,.3); }
.pinlock h2 { color: var(--brand-dark); }
.pin-dots i { border-color: var(--plum); }
.pin-dots i.on { background: var(--plum); border-color: var(--plum); }
.pin-keys button { border-radius: 999px; background: #fff; border-color: var(--line); }
.pin-keys button:active { background: var(--lav-3); }
.pin-keys .pin-ok { background: linear-gradient(135deg, #6a4590, var(--plum-2)); border-color: transparent; }
.sync-dot { background: #d9f0c8; }

/* ---------- Invois (gambar / PDF) ---------- */
.invoice { color: #2c3529; box-shadow: 0 4px 18px rgba(61,79,55,.14); }
.invoice::before { height: 8px; background: linear-gradient(90deg, var(--sage) 0 70%, var(--lav) 70% 100%); }
.inv-head img { width: 84px; height: 84px; border-radius: 16px; }
.inv-head .biz b { font-family: var(--serif); font-size: 19px; color: var(--brand-dark); font-weight: 600; }
.inv-head .biz small { color: #6c7766; }
.inv-titlebar { border-bottom-color: var(--sage); }
.inv-titlebar h3 { color: var(--plum); font-family: var(--serif); font-weight: 600; letter-spacing: 4px; }
.inv-titlebar div small { color: #6c7766; }
.inv-meta { grid-template-columns: 1fr 1fr; background: var(--sage-mist); border: 1px solid var(--line); }
.inv-meta .full { grid-column: 1 / -1; }
.inv-meta .lbl, .inv-table th, .inv-pay b.lbl, .inv-terms b.lbl { color: var(--sage-3); }
.inv-ev { color: var(--plum); font-weight: 700; }
.inv-table th { border-bottom-color: var(--sage); }
.inv-table td { border-bottom-color: #e7ece1; }
.inv-table td small { color: #77826f; }
.inv-sum .grand { background: linear-gradient(135deg, #6a4590, var(--plum-2)); }
.inv-sum .sec { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--lav-3); color: var(--plum); font-weight: 700; }
.inv-sum .sec small { font-weight: 600; }
.inv-pay, .inv-terms { border-top-color: #d3dcc8; }
.inv-pay img { border-color: var(--line); }
.inv-terms { color: #4c5747; }
.muted-inv { color: #77826f; }
.inv-foot { color: #6c7766; }
.inv-script { display: block; font-family: var(--script); font-size: 30px; color: var(--plum); line-height: 1.1; margin-bottom: 2px; }
.stamp { border-color: var(--ok); color: var(--ok); }
.toast { background: var(--brand-dark); }
h1, h2, h3, .oitem .no, .inv-titlebar, .stat b { font-variant-numeric: lining-nums; }
.inv-sum .sec span { white-space: nowrap; }
.inv-sum .sec span:first-child { white-space: normal; }
.totals #secDep { width: 100%; text-align: left; padding: 10px 14px; }
