:root {
  --bg-page: #fdf6f8;
  --bg-surface: #ffffff;
  --bg-soft: #fff8fa;
  --bg-accent-soft: #f9ecf1;
  --primary: #8e3b5b;
  --primary-dark: #6b2742;
  --accent-gold: #c8963e;
  --text-main: #2d1b24;
  --text-muted: #6c525e;
  --border-soft: #ebd6de;
  --border-strong: #d49bb2;
  --shadow-card: 0 10px 28px rgba(110, 42, 70, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 20px 14px 108px;
  background: linear-gradient(180deg, #fdf3f6 0%, #f8eef2 100%);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* Muka Hadapan / Pelanggan */
.wrap {
  max-width: 1020px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #fff6f9 0%, #f9e8ef 100%);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 22px;
}

.hero-logo-ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--primary), var(--accent-gold));
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(142, 59, 91, 0.16);
}

.hero-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #141414;
  display: block;
}

.hero-copy {
  flex: 1;
  min-width: 220px;
}

.hero-tag {
  display: inline-block;
  background: var(--bg-surface);
  color: var(--primary);
  border: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.hero-copy h1 {
  margin: 0 0 4px;
  font-size: 25px;
  color: var(--primary-dark);
  font-weight: 700;
}

.hero-biz-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 8px;
}

.badge-since {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(107, 39, 66, 0.18);
}

.biz-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--primary-dark);
}

.biz-reg {
  font-weight: 700;
  color: #9e6b18;
  background: #fff9ec;
  border: 1px solid #ebd094;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 12px;
}

.hero-instruction {
  display: block;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.alert-error {
  background: #fff0f2;
  border: 1px solid #e6a8b5;
  color: #9b1c31;
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
}

.kuih-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .kuih-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kuih-card {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.kuih-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 18px rgba(142, 59, 91, 0.08);
}

.kuih-card.aktif {
  border-color: var(--primary);
  background: #fff0f6;
  box-shadow: 0 8px 20px rgba(142, 59, 91, 0.12);
}

.kuih-img {
  width: 100%;
  height: 155px;
  object-fit: cover;
  border-radius: 9px;
  background: #f5e6ec;
  margin-bottom: 10px;
  display: block;
  cursor: zoom-in;
}

.kuih-nama {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.kuih-harga {
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.kuih-catatan {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  min-height: 18px;
}

.kuih-kawalan {
  border-top: 1px dashed var(--border-soft);
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.tick-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-dark);
  cursor: pointer;
}

.tick-label input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--primary);
  cursor: pointer;
}

.balang-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.stepper-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  overflow: hidden;
}

.btn-step {
  width: 30px;
  height: 32px;
  border: none;
  background: var(--bg-accent-soft);
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-step:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-step:active {
  background: var(--primary-dark);
  color: #ffffff;
}

.stepper-group .balang-input,
.balang-input {
  width: 48px;
  height: 32px;
  padding: 4px 4px;
  border: none;
  border-left: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  border-radius: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-surface);
  -moz-appearance: textfield;
}

.balang-input::-webkit-outer-spin-button,
.balang-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.balang-input:focus {
  outline: none;
  background: #fff9fb;
}

.balang-input:disabled {
  background: #f3ecee;
  color: #a6959d;
  border-color: #e3d5da;
}

.subtotal-bar {
  margin-top: 9px;
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
}

.subtotal-bar strong {
  color: var(--primary-dark);
}

.ringkasan {
  background: linear-gradient(135deg, #fdf0f5 0%, #faebf1 100%);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 15px 18px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
}

.ringkasan strong {
  color: var(--primary-dark);
}

/* Floating Ringkasan Tempahan — Sentiasa Nampak di PC & HP */
.floating-ringkasan {
  position: fixed;
  left: 14px;
  right: 72px;
  bottom: 28px;
  max-width: 972px;
  margin: 0 auto;
  padding: 11px 16px;
  background: rgba(255, 244, 248, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(107, 39, 66, 0.24);
  z-index: 990;
}

.borang-pelanggan {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 18px;
}

.borang-pelanggan h2 {
  font-size: 18px;
  margin: 0 0 14px;
  color: var(--primary-dark);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 14px;
  color: var(--text-main);
}

.label-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
}

.label-row label {
  margin-bottom: 0;
}

.label-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input[type="password"],
.password-wrap input[type="text"] {
  width: 100%;
  padding: 10px 44px 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-main);
}

.password-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(142, 59, 91, 0.12);
}

.btn-toggle-pass {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--primary-dark);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-toggle-pass:hover {
  background: var(--bg-accent-soft);
  color: var(--primary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-main);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(142, 59, 91, 0.12);
}

.form-group textarea {
  min-height: 86px;
  resize: vertical;
}

.btn-hantar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border: none;
  padding: 13px 22px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 6px 16px rgba(107, 39, 66, 0.22);
}

.btn-hantar:hover {
  filter: brightness(1.05);
}

/* Lightbox Zoom Gambar Kuih Full Skrin */
.img-lightbox {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(24, 9, 15, 0.88);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  padding: 18px;
}

.img-lightbox.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 96px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.55);
  background: #ffffff;
}

.lightbox-caption {
  color: #ffffff;
  background: rgba(107, 39, 66, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  max-width: 92vw;
}

.lightbox-close {
  position: fixed;
  right: 16px;
  top: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--primary);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2010;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.lightbox-close:hover {
  background: var(--primary-dark);
}

/* Butang Terapung Ke Atas */
.btn-top {
  position: fixed;
  right: 16px;
  bottom: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(107, 39, 66, 0.28);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.btn-top.show {
  display: flex;
}

.btn-top:hover {
  transform: translateY(-3px);
}

/* Resit Individu */
.resit-box {
  max-width: 740px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.resit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border-soft);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.resit-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.resit-logo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
  background: #141414;
}

.resit-brand h1 {
  margin: 0;
  font-size: 21px;
  color: var(--primary-dark);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  font-size: 14px;
}

.meta-box {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  padding: 12px 14px;
  border-radius: 10px;
}

/* Jadual & Komponen Admin */
.admin-wrap {
  max-width: 1280px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  padding: 20px 22px;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 2px solid var(--border-soft);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
  background: #141414;
}

.nav h1 {
  margin: 0;
  font-size: 20px;
  color: var(--primary-dark);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nav-links a.nav-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: var(--bg-accent-soft);
  color: var(--primary-dark);
  border: 1px solid var(--border-strong);
  padding: 7px 13px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-links a.nav-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  text-decoration: none;
}

.nav-links a.nav-btn.aktif {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border-color: var(--primary-dark);
  box-shadow: 0 3px 8px rgba(107, 39, 66, 0.2);
}

.nav-links a.nav-btn-logout {
  background: #fff0f2;
  color: #9b1c31;
  border-color: #e2a8b4;
}

.nav-links a.nav-btn-logout:hover {
  background: #9b1c31;
  color: #ffffff;
  border-color: #9b1c31;
}

/* Panel Kawalan Tapisan & Carian (Kemas & Berhierarki) */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.toolbar-baris-atas {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-baris-bawah {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
}

.filter-label {
  font-weight: 700;
  color: var(--primary-dark);
  margin-right: 2px;
}

.filter-bar a.pill-tempoh {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  text-decoration: none;
  background: var(--bg-surface);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 12.5px;
  border: 1px solid var(--border-strong);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-bar a.pill-tempoh:hover {
  background: var(--bg-accent-soft);
  border-color: var(--primary);
}

.filter-bar a.pill-tempoh.aktif {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border-color: var(--primary-dark);
}

.dropdown-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  padding: 0 10px;
  border-radius: 8px;
}

.filter-select {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  background: var(--bg-surface);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-form input[type="date"] {
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-main);
}

.carian-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.carian-input {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-main);
  background: var(--bg-surface);
  min-width: 225px;
}

.carian-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(142, 59, 91, 0.12);
}

.carian-reset {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #9b1c31;
  background: #fff0f2;
  border: 1px solid #e2a8b4;
  text-decoration: none;
}

.carian-reset:hover {
  background: #9b1c31;
  color: #ffffff;
}

/* Pautan Pantas Status (Kemas & Selari) */
.quick-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.quick-status-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.quick-status-link:hover {
  background: var(--bg-accent-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.quick-status-link.aktif {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.quick-status-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(142, 59, 91, 0.12);
  color: var(--primary-dark);
}

.quick-status-link.aktif .quick-status-cnt {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.btn,
.btn-print {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0 14px;
  height: 34px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 12.5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover,
.btn-print:hover {
  background: var(--primary-dark);
}

.btn-sm {
  height: 34px;
  padding: 0 13px;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-sm:hover {
  background: var(--primary-dark);
}

.btn-delete {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #e09aa8;
  border-radius: 6px;
  background: #fff0f2;
  color: #9b1c31;
  cursor: pointer;
}

.btn-delete:hover {
  background: #9b1c31;
  color: #ffffff;
}

.btn-batal {
  background: var(--bg-accent-soft);
  color: var(--primary-dark);
  border: 1px solid var(--border-soft);
  margin-left: 8px;
}

.btn-back {
  background: var(--bg-accent-soft);
  color: var(--primary-dark);
  border: 1px solid var(--border-soft);
}

/* Kad Ringkasan Admin (Lebih Compact & Seimbang) */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card .lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.card .val {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-top: 2px;
  line-height: 1.25;
}

.ok-bar {
  background: #edf9f1;
  border: 1px solid #9fd8b4;
  color: #166534;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.err-bar {
  background: #fff0f2;
  border: 1px solid #e6a8b5;
  color: #9b1c31;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.form-box {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 22px;
  width: 100%;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

@media (max-width: 720px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

h2 {
  font-size: 17px;
  margin: 22px 0 10px;
  color: var(--primary-dark);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}

th,
td {
  border: 1px solid var(--border-soft);
  padding: 9px 10px;
  vertical-align: top;
}

th {
  background: var(--bg-accent-soft);
  text-align: left;
  color: var(--primary-dark);
}

.num {
  text-align: right;
}

.ctr {
  text-align: center;
}

.total-row td {
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--primary-dark);
}

.sub-list {
  margin: 0;
  padding-left: 16px;
}

/* Gaya Korporat Jadual Tempahan */
.tbl-tempahan-korporat thead th {
  background: linear-gradient(180deg, #f8e6ee 0%, #f1d4e0 100%);
  color: var(--primary-dark);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--border-strong);
}

.tbl-tempahan-korporat tbody tr:nth-child(even) {
  background: #fffbfd;
}

.tbl-tempahan-korporat tbody tr:hover {
  background: #fff2f7;
}

.tbl-tempahan-korporat tbody tr.row-sedang-edit {
  background: #fff3d6;
  outline: 2px solid var(--accent-gold);
}

.ts-sub {
  display: inline-block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.pelanggan-nama {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-main);
}

.pelanggan-hp {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 2px;
}

.pelanggan-alamat {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed var(--border-soft);
}

.col-kuih-besar {
  min-width: 240px;
}

.sub-list-besar {
  margin: 0;
  padding-left: 18px;
}

.sub-list-besar li {
  margin-bottom: 5px;
  font-size: 13.5px;
  line-height: 1.45;
}

.sub-list-besar li:last-child {
  margin-bottom: 0;
}

.kuih-item-nama {
  font-weight: 600;
  color: var(--text-main);
}

.kuih-item-qty {
  color: var(--primary-dark);
}

.kuih-item-sub {
  color: var(--text-muted);
  font-size: 12.5px;
}

.status-gabung-blok {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.status-baris {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.status-baris-pemisah {
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.tindakan-korporat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
}

.tbl-tempahan-korporat td a.btn-lihat-korporat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  padding: 7px 12px;
  margin-bottom: 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  background: linear-gradient(180deg, #8e3b5b 0%, #6b2742 100%);
  color: #ffffff;
  border: 1px solid #6b2742;
  box-shadow: 0 3px 8px rgba(107, 39, 66, 0.2);
  cursor: pointer;
}

.tbl-tempahan-korporat td a.btn-lihat-korporat:hover {
  background: linear-gradient(180deg, #6b2742 0%, #521b31 100%);
  color: #ffffff;
  text-decoration: none;
}

.tbl-tempahan-korporat td a.btn-edit-korporat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  padding: 7px 12px;
  margin-bottom: 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  background: #fff9ec;
  color: #7a4b00;
  border: 1px solid #d9a441;
  box-shadow: 0 2px 5px rgba(158, 107, 24, 0.12);
  cursor: pointer;
}

.tbl-tempahan-korporat td a.btn-edit-korporat:hover {
  background: #b87b14;
  border-color: #9e670d;
  color: #ffffff;
  text-decoration: none;
}

.form-padam-jarak {
  width: 112px;
  margin: 0;
}

.tbl-tempahan-korporat td button.btn-padam-korporat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  border-radius: 7px;
  border: 1px solid #c94a63;
  background: #fff0f3;
  color: #9b1c31;
  box-shadow: 0 2px 5px rgba(155, 28, 49, 0.1);
  cursor: pointer;
}

.tbl-tempahan-korporat td button.btn-padam-korporat:hover {
  background: #9b1c31;
  border-color: #9b1c31;
  color: #ffffff;
}

/* Panel Edit Tempahan Admin - Susunan Kemas & Kontras Jelas */
.edit-order-box {
  background: #ffffff;
  border: 2px solid var(--border-strong);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(142, 59, 91, 0.08);
}

.edit-order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}

.edit-order-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--primary-dark);
}

.edit-section-wrap {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
}

.edit-section-aktif {
  background: #fff7fa;
  border: 1.5px solid #dfa8bc;
}

.edit-section-pilihan {
  background: #f3f7fc;
  border: 1.5px dashed #b3c5dc;
}

.edit-items-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #3b232d;
  margin-bottom: 12px;
}

.tag-section {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.tag-aktif {
  background: #6b243e;
  color: #ffffff;
}

.tag-pilihan {
  background: #2f5b88;
  color: #ffffff;
}

.edit-kuih-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.edit-kuih-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5cbd4;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.edit-kuih-tambah {
  background: #ffffff;
  border: 1px solid #c9d7e8;
}

.edit-kuih-card.ada-kuantiti {
  border-color: #6b243e;
  box-shadow: 0 2px 8px rgba(107, 36, 62, 0.1);
}

.edit-kuih-tambah.ada-kuantiti {
  border-color: #2f5b88;
  background: #f9fcff;
  box-shadow: 0 2px 8px rgba(47, 91, 136, 0.12);
}

.edit-kuih-info {
  min-width: 0;
}

.edit-kuih-info .kuih-nama {
  font-weight: 700;
  font-size: 14px;
  color: #2b1820;
  line-height: 1.3;
  margin-bottom: 3px;
}

.edit-kuih-info .ts-sub {
  display: block;
  font-size: 12px;
  color: #6e5862;
  white-space: normal;
}

.edit-kuih-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f2e8ec;
}

.edit-qty-input {
  width: 44px;
  height: 30px;
  padding: 4px;
  border: none;
  border-left: 1px solid #e5d2d9;
  border-right: 1px solid #e5d2d9;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #2b1820;
  background: #ffffff;
  -moz-appearance: textfield;
}

.edit-qty-input::-webkit-outer-spin-button,
.edit-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.edit-qty-input:focus {
  outline: none;
  background: #fff9fb;
}

.edit-kuih-sub {
  font-size: 13px;
  font-weight: 700;
  color: #6b243e;
  white-space: nowrap;
  text-align: right;
}

.edit-kuih-tambah .edit-kuih-sub {
  color: #2f5b88;
}

.edit-summary-bar {
  margin-top: 16px;
  padding: 12px 14px;
  background: #fdf6f8;
  border: 1px solid #e8ced8;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14.5px;
}

.edit-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Laporan Matriks Bilangan Kuih & Kiraan Biji */
.matriks-scroll {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.tbl-matriks-kuih {
  margin-bottom: 0;
  border-collapse: collapse;
  min-width: 860px;
}

.tbl-matriks-kuih th,
.tbl-matriks-kuih td {
  border: 1px solid var(--border-strong);
  vertical-align: middle;
}

.col-nama-hp {
  min-width: 155px;
  background: var(--bg-soft);
}

.col-kuih-head {
  min-width: 96px;
  padding: 6px 5px;
  background: linear-gradient(180deg, #fff8fb 0%, #f6e3ec 100%);
}

.matriks-head-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.matriks-img {
  width: 58px;
  height: 44px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border-soft);
  background: #f5e6ec;
  display: block;
}

.matriks-img-empty {
  width: 58px;
  height: 44px;
  border-radius: 5px;
  border: 1px dashed var(--border-strong);
  background: #fff;
  color: var(--text-muted);
  font-size: 9.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
}

.matriks-nama {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.25;
  word-break: break-word;
}

.matriks-harga {
  font-size: 11px;
  color: var(--text-main);
  line-height: 1.25;
}

.matriks-biji-tag {
  display: inline-block;
  background: #fff3d6;
  color: #7a4b00;
  border: 1px solid #e7c67b;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 2px;
}

.matriks-sel {
  font-size: 13px;
  padding: 7px 6px;
}

.matriks-sel.ada-balang {
  background: #fff5f9;
  color: var(--primary-dark);
}

.sel-kosong {
  color: #c7b2bb;
  font-size: 12px;
}

.baris-jumlah-balang td {
  background: #fdf0f5;
  color: var(--primary-dark);
  font-size: 13px;
}

.baris-jumlah-biji td {
  background: #fff9eb;
  color: #5c3800;
  font-size: 13px;
}

.rumus-kecil {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.baris-jumlah-semua-biji td {
  background: linear-gradient(135deg, #6b2742 0%, #8e3b5b 100%);
  color: #ffffff;
  padding: 12px 14px;
  font-size: 14px;
}

.grand-biji-label {
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-right: 10px;
}

.grand-biji-nilai {
  font-size: 18px;
  font-weight: 800;
  color: #ffe396;
}

.grand-biji-balang {
  font-size: 12.5px;
  opacity: 0.92;
  margin-left: 6px;
}

.thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f5e6ec;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.st-Baru {
  background: #fff2cc;
  color: #7a5200;
}

.st-Disahkan {
  background: #fce4ee;
  color: #8e3b5b;
}

.st-Siap {
  background: #e3f2fd;
  color: #0d47a1;
}

.st-Selesai {
  background: #dcfce7;
  color: #166534;
}

.byr-belum {
  background: #fee2e2;
  color: #991b1b;
}

.byr-separa {
  background: #fef3c7;
  color: #92400e;
}

.byr-lunas {
  background: #dcfce7;
  color: #166534;
}

.st-form select {
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
}

.st-form button {
  padding: 4px 8px;
  font-size: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
}

.save-indicator {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}

.save-indicator.saving {
  color: #8a5a00;
}

.save-indicator.saved {
  color: #1f7a3e;
}

.save-indicator.error {
  color: #9b1c31;
}

button:disabled,
input[type="submit"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.login-box {
  max-width: 390px;
  margin: 24px auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  padding: 24px;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.print-page-break {
  display: none;
}

/* Responsif Telefon Pintar */
@media (max-width: 640px) {
  body {
    padding: 10px 8px 116px;
  }

  .wrap,
  .resit-box,
  .admin-wrap {
    padding: 14px;
    border-radius: 12px;
  }

  .cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .carian-input {
    min-width: 0;
    flex: 1 1 170px;
  }

  .hero-brand {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 14px;
  }

  .hero-logo-ring {
    width: 90px;
    height: 90px;
    margin: 0 auto;
  }

  .hero-copy {
    min-width: 0;
    width: 100%;
  }

  .hero-copy h1 {
    font-size: 21px;
  }

  .hero-biz-line {
    justify-content: center;
  }

  .hero-instruction {
    font-size: 13px;
  }

  .kuih-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .kuih-card {
    padding: 14px;
    border-radius: 12px;
  }

  .kuih-img {
    height: 175px;
  }

  .kuih-nama {
    font-size: 16px;
  }

  .kuih-harga {
    font-size: 15px;
  }

  .kuih-kawalan {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .stepper-group .balang-input,
  .balang-input {
    width: 48px;
    font-size: 15px;
  }

  .edit-qty-input {
    width: 44px;
    font-size: 15px;
  }

  .subtotal-bar {
    text-align: right;
    font-size: 13px;
  }

  .ringkasan {
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    padding: 12px 14px;
  }

  .floating-ringkasan {
    left: 8px;
    right: 68px;
    bottom: 44px;
    padding: 9px 12px;
    gap: 2px;
    font-size: 13px;
    border-radius: 10px;
  }

  .img-lightbox {
    padding: 12px;
  }

  .lightbox-img {
    max-height: calc(100vh - 110px);
    border-radius: 10px;
  }

  .lightbox-caption {
    font-size: 13px;
    padding: 6px 14px;
  }

  .lightbox-close {
    right: 12px;
    top: 12px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .borang-pelanggan {
    padding: 14px;
  }

  .form-group input[type="text"],
  .form-group input[type="password"],
  .form-group input[type="number"],
  .form-group input[type="file"],
  .form-group textarea,
  .password-wrap input[type="password"],
  .password-wrap input[type="text"],
  .st-form select,
  .filter-select,
  .edit-qty-input {
    font-size: 16px;
  }

  .edit-kuih-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-wrap {
    overflow-x: auto;
  }

  .actions .btn,
  .actions .btn-print,
  .toolbar .btn-print {
    width: 100%;
    text-align: center;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 14mm 10mm 10mm 10mm;

    @top-right {
      content: "Muka Surat " counter(page) " / " counter(pages);
      font-family: "Segoe UI", Arial, Helvetica, sans-serif;
      font-size: 9.5pt;
      font-weight: 700;
      color: #6b2742;
      vertical-align: bottom;
      padding-bottom: 4mm;
    }
  }

  body {
    background: #ffffff;
    padding: 0;
    font-size: 11px;
  }

  body.print-landscape {
    font-size: 10.5px;
  }

  body.print-landscape .admin-wrap {
    max-width: 100%;
    width: 100%;
    padding: 0;
  }

  .wrap,
  .resit-box,
  .admin-wrap {
    box-shadow: none;
    border: none;
    max-width: 100%;
    padding: 0;
    border-radius: 0;
  }

  .no-print,
  .print-hide-cards,
  .btn-top,
  .img-lightbox,
  .edit-order-box {
    display: none !important;
  }

  .print-page-break {
    display: block;
    page-break-before: always;
    break-before: page;
    page-break-after: avoid;
    break-after: avoid;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .nav {
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  h2,
  h2.matriks-heading {
    margin: 4px 0 8px;
    page-break-after: avoid;
    break-after: avoid;
  }

  thead {
    display: table-header-group;
  }

  tfoot {
    display: table-footer-group;
  }

  .floating-ringkasan {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    max-width: none;
    margin-bottom: 24px;
    padding: 15px 18px;
    box-shadow: none;
    background: #fdf0f5;
  }

  .matriks-scroll {
    overflow: visible;
    border: none;
  }

  .tbl-matriks-kuih {
    min-width: 0;
    width: 100%;
    font-size: 10px;
  }

  .matriks-img {
    width: 44px;
    height: 34px;
  }

  .baris-jumlah-semua-biji td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  th,
  td {
    padding: 6px 7px;
  }

  tr {
    page-break-inside: avoid;
  }
}