/* =====================================================================
   Cabutan Bertuah — Tema Festive (merah maroon + emas, selaras log masuk)
   ===================================================================== */
:root {
  --primary: #c41e2a;
  --primary-600: #9f1420;
  --primary-700: #8b0f18;
  --primary-soft: #fde8ea;
  --accent: #d97706;
  --accent-soft: #fff8e7;
  --gold: #fcd34d;
  --gold-dark: #d97706;
  --success: #059669;
  --success-soft: #e7f6ef;
  --warning: #b45309;
  --warning-soft: #fdf2e2;
  --danger: #dc2626;
  --danger-soft: #fdecec;

  --bg: #faf8f6;
  --bg-grad-1: #fff5f0;
  --bg-grad-2: #fff8f0;
  --surface: #ffffff;
  --line: #e6e9f0;
  --text: #0f172a;
  --text-soft: #51607a;
  --muted: #8a97ad;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 18px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, .12);
  --sidebar-w: 256px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }

/* ----------------- Layout Auth (login) ----------------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-hero {
  position: relative;
  overflow: hidden;
  background: #4a0810;
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 45%, #c41e2a 0%, #8b0f18 42%, #3d060c 100%),
    radial-gradient(ellipse 50% 40% at 50% 55%, rgba(255, 200, 80, 0.18), transparent 65%);
}
.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent 0, transparent 31px, rgba(255, 215, 0, 0.04) 32px),
    linear-gradient(90deg, transparent 0, transparent 31px, rgba(255, 215, 0, 0.04) 32px);
  background-size: 32px 32px;
  opacity: 0.6;
}
.auth-hero .brand-badge { position: relative; z-index: 1; }
.auth-hero .brand-badge .logo {
  background: #fcd34d;
  color: #5c1a0a;
  border-color: rgba(252, 211, 77, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.auth-hero h1 {
  position: relative;
  z-index: 1;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}
.auth-hero p  {
  position: relative;
  z-index: 1;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
  max-width: 420px;
  line-height: 1.65;
}
.auth-hero .ticket {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.auth-hero .chip {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(252, 211, 77, 0.4);
  backdrop-filter: blur(6px);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.auth-form-side {
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.auth-card .sub { color: var(--text-soft); margin: 6px 0 26px; }

@media (max-width: 920px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* Tema festive — halaman log masuk (selaras landing #utama) */
body.auth-page {
  --auth-red: #8b0f18;
  --auth-red-deep: #4a0810;
  --auth-red-mid: #9f1420;
  --auth-red-bright: #c41e2a;
  --auth-gold: #fcd34d;
  --auth-gold-dark: #d97706;
  --auth-maroon-text: #3d2314;
  background: linear-gradient(165deg, #fffef8 0%, #fff8f0 50%, #ffe9c4 100%);
}
body.auth-page .auth-form-side {
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(255, 215, 0, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(196, 30, 42, 0.06), transparent 50%),
    linear-gradient(180deg, #fffef8 0%, #fffaf5 100%);
}
body.auth-page .auth-card h2 {
  color: var(--auth-red-deep);
}
body.auth-page .auth-card .sub {
  color: #6b4423;
}
body.auth-page .auth-card .brand {
  color: var(--auth-red-deep);
}
body.auth-page .auth-card .brand .logo {
  height: 40px;
  max-width: 130px;
  background: transparent;
  box-shadow: none;
}
body.auth-page .auth-card .brand .logo:not(img) {
  background: linear-gradient(145deg, var(--auth-red-bright), var(--auth-red-deep));
  color: #fff;
  box-shadow: 0 4px 14px rgba(74, 8, 16, 0.3);
}
body.auth-page .auth-card .brand:hover {
  color: var(--auth-red);
}
body.auth-page .field label {
  color: var(--auth-maroon-text);
}
.field-check { margin-bottom: 20px; }
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  user-select: none;
}
.check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--auth-red-bright, #c41e2a);
  cursor: pointer;
}
body.auth-page .check-label {
  color: #6b4423;
}
body.auth-page .auth-wrap .input {
  border-color: rgba(180, 120, 20, 0.25);
  background: #fff;
}
body.auth-page .auth-wrap .input:focus {
  border-color: var(--auth-red-bright);
  box-shadow: 0 0 0 4px rgba(252, 211, 77, 0.35);
}
body.auth-page .auth-wrap .input-icon svg {
  color: rgba(139, 15, 24, 0.45);
}
body.auth-page .auth-wrap .input-icon:focus-within svg {
  color: var(--auth-red-bright);
}
body.auth-page .auth-wrap .btn-primary {
  box-shadow: 0 6px 22px rgba(252, 211, 77, 0.45), 0 2px 8px rgba(74, 8, 16, 0.15);
}
body.auth-page .auth-wrap .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(252, 211, 77, 0.55);
}
body.auth-page .auth-wrap .alert.error {
  background: rgba(196, 30, 42, 0.1);
  color: var(--auth-red-deep);
  border: 1px solid rgba(139, 15, 24, 0.2);
}
body.auth-page a {
  color: var(--auth-red);
}
body.auth-page a:hover {
  color: var(--auth-red-deep);
}

/* ----------------- Logo / Brand ----------------- */
.brand {
  display: inline-flex; align-items: center; gap: 11px; font-weight: 800;
  font-size: 18px; letter-spacing: -.02em; color: var(--text);
}
.brand .logo {
  width: auto;
  height: 38px;
  max-width: 120px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}
.brand .logo:not(img) {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: var(--shadow-sm);
}
.brand-badge { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 20px; }
.brand-badge .logo {
  width: auto;
  height: 48px;
  max-width: 180px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  border-radius: 8px;
  background: transparent;
  border: none;
}
.brand-badge .logo:not(img) {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ----------------- App Shell ----------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--line); padding: 22px 16px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 6px 10px 18px; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 16px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px;
  color: var(--text-soft); font-weight: 600; font-size: 14.5px; transition: .15s;
}
.nav-link svg { width: 19px; height: 19px; stroke-width: 2; }
.nav-link:hover { background: var(--primary-soft); color: var(--primary-700); }
.nav-link.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 10px rgba(196, 30, 42, .28);
}
.nav-link.active:hover { color: #fff; }
.sidebar-foot { margin-top: auto; padding: 12px 6px 4px; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ----------------- Topbar ----------------- */
.topbar {
  height: 68px; background: rgba(255,255,255,.75); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.company-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 5px 13px 5px 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-sm); line-height: 1.2;
}
.company-pill .ctx-ic {
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
}
.company-pill .ctx-ic svg { width: 15px; height: 15px; }
.company-pill .ctx-text { display: flex; flex-direction: column; min-width: 0; }
.company-pill .ctx-label { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.company-pill .ctx-val {
  font-size: 13px; font-weight: 700; color: var(--text); max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.company-pill.is-super .ctx-ic { background: var(--accent-soft); color: var(--accent); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(140deg, var(--primary), var(--accent));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.avatar-link { text-decoration: none; transition: opacity .15s, transform .15s; }
.avatar-link:hover { opacity: .9; transform: scale(1.04); }
.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  background: none; border: 1px solid var(--line); cursor: pointer; color: var(--text-soft); transition: .15s;
}
.menu-toggle:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
.menu-toggle svg { width: 20px; height: 20px; }
/* Lipat sidebar pada desktop */
.app.collapsed .sidebar { display: none; }

.content { padding: 28px; flex: 1; }
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 20px;
  align-items: start;
  margin-bottom: 22px;
}
.page-head > div:first-child:not(.page-head-back) { min-width: 0; }
.page-head-back {
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 0;
}
.page-head .btn-back { flex-shrink: 0; }
.page-head h1 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.page-head .lead { color: var(--text-soft); margin-top: 3px; }

/* Bar butang page-head — responsif semua saiz skrin */
.page-head-actions,
.page-head > .flex.gap-2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  width: max-content;
  max-width: min(100%, 760px);
}
.page-head-actions .btn,
.page-head-actions > button,
.page-head > .flex.gap-2 .btn,
.page-head > .flex.gap-2 > button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.page-head > a.btn,
.page-head > .btn {
  max-width: 100%;
}

@media (min-width: 901px) {
  .page-head-actions .btn,
  .page-head-actions > button.btn,
  .page-head > .flex.gap-2 .btn,
  .page-head > .flex.gap-2 > button.btn {
    padding: 9px 14px;
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  .page-head {
    grid-template-columns: 1fr;
  }
  .page-head-actions,
  .page-head > .flex.gap-2 {
    justify-self: stretch;
    width: 100%;
    max-width: none;
    justify-content: stretch;
  }
  .page-head-actions .btn,
  .page-head-actions > button.btn,
  .page-head > .flex.gap-2 .btn,
  .page-head > .flex.gap-2 > button.btn {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    white-space: normal;
    line-height: 1.35;
    text-align: center;
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
  }
  .page-head-actions .badge,
  .page-head > .flex.gap-2 .badge {
    flex: 1 1 100%;
    justify-content: center;
    text-align: center;
  }
  .page-head > a.btn,
  .page-head > .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .page-head-actions .btn,
  .page-head-actions > button.btn,
  .page-head > .flex.gap-2 .btn,
  .page-head > .flex.gap-2 > button.btn {
    flex: 1 1 calc(50% - 4px);
    font-size: 12.5px;
    padding: 9px 10px;
  }
  .page-head-actions .btn svg,
  .page-head > .flex.gap-2 .btn svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 380px) {
  .page-head-actions .btn,
  .page-head-actions > button.btn,
  .page-head > .flex.gap-2 .btn,
  .page-head > .flex.gap-2 > button.btn {
    flex: 1 1 100%;
    width: 100%;
  }
}

/* ----------------- Action dropdown ----------------- */
.action-dropdown { position: relative; }
.action-dropdown-toggle .action-dropdown-chevron {
  width: 16px;
  height: 16px;
  margin-left: 2px;
  transition: transform .15s ease;
}
.action-dropdown.open .action-dropdown-toggle .action-dropdown-chevron {
  transform: rotate(180deg);
}
.action-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 45;
}
.action-dropdown.open .action-dropdown-menu { display: block; }
.action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.action-dropdown-item:hover,
.action-dropdown-item:focus-visible {
  background: var(--primary-soft);
  color: var(--primary-700);
  outline: none;
}
.action-dropdown-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.action-dropdown-item.is-primary {
  color: var(--primary-700);
  font-weight: 700;
}
.action-dropdown-item.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.action-dropdown-item.is-disabled:hover,
.action-dropdown-item.is-disabled:focus-visible {
  background: none;
  color: var(--text);
}
.action-dropdown-item.is-primary.is-disabled {
  color: var(--primary-700);
}
.action-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 6px;
}

@media (max-width: 900px) {
  .page-head-actions .action-dropdown {
    flex: 1 1 100%;
    width: 100%;
  }
  .page-head-actions .action-dropdown-toggle {
    width: 100%;
    justify-content: center;
  }
  .page-head-actions .action-dropdown-menu {
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .action-dropdown-menu {
    left: 0;
    right: auto;
    min-width: min(230px, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
  }
}

/* ----------------- Cards ----------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { font-size: 16px; font-weight: 700; }

/* Orders list — filter bar */
.orders-list-head {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.orders-list-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.orders-list-head-top h3 { font-size: 16px; font-weight: 700; margin: 0; }
.orders-list-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.orders-list-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.orders-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.orders-status-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.orders-status-tab:hover {
  border-color: #cbd5e1;
  color: var(--text);
}
.orders-status-tab.is-active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.orders-status-tab.is-active.tab-all { background: var(--primary); }
.orders-status-tab.is-active.tab-paid { background: #059669; }
.orders-status-tab.is-active.tab-pending { background: #64748b; }
.orders-status-tab.is-active.tab-failed { background: #dc2626; }
.orders-search {
  position: relative;
  width: 100%;
}
.orders-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.orders-search .input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.orders-search .input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}
.orders-search .input::placeholder { color: #94a3b8; }
@media (min-width: 768px) {
  .orders-list-filters {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .orders-status-tabs { flex: 1; }
  .orders-search { flex: 0 1 320px; min-width: 220px; }
}

/* ----------------- Stat cards ----------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-grid > .stat {
  border: none;
  color: #fff;
  box-shadow: 0 10px 28px rgba(74, 8, 16, 0.14);
}
.stat-grid > .stat::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 80% 70% at 100% 0%, rgba(255, 255, 255, 0.14), transparent 55%);
  pointer-events: none;
}
.stat-grid > .stat:has(.ic-indigo) {
  background: linear-gradient(135deg, #e63946 0%, #c41e2a 42%, #8b0f18 100%);
}
.stat-grid > .stat:has(.ic-green) {
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 38%, #d97706 72%, #9f1420 100%);
  color: #fff8f0;
}
.stat-grid > .stat:has(.ic-pink) {
  background: linear-gradient(135deg, #c41e2a 0%, #9f1420 55%, #4a0810 100%);
}
.stat-grid > .stat:has(.ic-amber) {
  background: linear-gradient(135deg, #fff8dc 0%, #fcd34d 35%, #f59e0b 100%);
  color: #5c1a0a;
  box-shadow: 0 10px 28px rgba(217, 119, 6, 0.2);
}
.stat-grid > .stat .ic {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(4px);
}
.stat-grid > .stat:has(.ic-amber) .ic {
  background: rgba(255, 255, 255, 0.45);
  color: #8b0f18;
  border-color: rgba(255, 255, 255, 0.5);
}
.stat-grid > .stat .val,
.stat-grid > .stat .lbl {
  position: relative;
  z-index: 1;
}
.stat-grid > .stat .lbl {
  color: rgba(255, 255, 255, 0.88);
}
.stat-grid > .stat:has(.ic-amber) .lbl {
  color: rgba(92, 26, 10, 0.72);
}
.stat-action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.stat-action:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.5);
}
.stat-action svg { width: 14px; height: 14px; flex-shrink: 0; }
.stat-grid > .stat:has(.ic-amber) .stat-action {
  background: rgba(255, 255, 255, 0.45);
  color: #5c1a0a;
  border-color: rgba(255, 255, 255, 0.55);
}
.stat-grid > .stat:has(.ic-amber) .stat-action:hover {
  background: rgba(255, 255, 255, 0.62);
}

/* ----------------- Batch switcher (dashboard / batch page) ----------------- */
.batch-switcher { border: 1px solid var(--line); }
.batch-switcher-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.batch-switcher-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
}
.batch-switcher-batch {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}
.batch-switcher-dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.batch-date-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--line);
}
.batch-date-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}
.batch-date-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.batch-switcher-form { margin-top: 4px; }
.batch-switcher-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.batch-switcher-select-wrap { flex: 1; min-width: 200px; }
.batch-switcher-select-wrap label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}
.batch-switcher-select-wrap .select {
  height: 42px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.batch-switcher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  min-height: 42px;
  padding: 0 18px;
  white-space: nowrap;
  flex-shrink: 0;
}
.batch-switcher-foot { padding-top: 4px; }
.batch-switcher-foot a { font-weight: 600; }

.qr-batch-head { align-items: flex-start; }
.qr-batch-head-label {
  margin: 0 0 4px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.qr-batch-head-no {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}
.qr-batch-head-title {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 560px) {
  .batch-switcher-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .batch-switcher-select-wrap { width: 100%; min-width: 0; }
  .batch-switcher-btn { width: 100%; justify-content: center; }
}

.stat .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
}
.stat .ic svg { width: 23px; height: 23px; }
.stat .val { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.stat .lbl { color: var(--text-soft); font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.ic-indigo { background: var(--primary-soft); color: var(--primary); }
.ic-pink   { background: var(--accent-soft); color: var(--accent); }
.ic-green  { background: var(--success-soft); color: var(--success); }
.ic-amber  { background: var(--warning-soft); color: var(--warning); }

/* ----------------- Dashboard chart ----------------- */
.chart-card { margin-bottom: 24px; }
.chart-head { flex-wrap: wrap; gap: 12px; }
.chart-period-btns {
  display: inline-flex;
  align-items: stretch;
  padding: 4px;
  background: linear-gradient(180deg, #f4f6fa 0%, #eef1f6 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}
.chart-period {
  position: relative;
  padding: 9px 18px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .15s ease;
  white-space: nowrap;
  line-height: 1.2;
}
.chart-period:hover:not(:disabled):not(.active) {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.55);
}
.chart-period.active {
  background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
  color: var(--primary-700);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 4px 12px rgba(196, 30, 42, 0.1);
}
.chart-period.active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--primary));
}
.chart-period:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.chart-period:disabled {
  opacity: .55;
  cursor: wait;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}
.chart-legend-item { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.chart-legend .dot-qr { background: rgb(99, 102, 241); }
.chart-legend .dot-reg { background: rgb(34, 197, 94); }
.chart-wrap {
  position: relative;
  height: 320px;
}
@media (max-width: 640px) {
  .chart-wrap { height: 260px; }
  .chart-head { flex-direction: column; align-items: stretch; }
  .chart-period-btns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }
  .chart-period {
    padding: 10px 6px;
    font-size: 11px;
    text-align: center;
  }
  .chart-period.active::after {
    left: 12%;
    right: 12%;
  }
}

/* ----------------- Buttons ----------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #5c1a0a;
  border: 1px solid rgba(255, 215, 0, 0.45);
  box-shadow: 0 4px 16px rgba(252, 211, 77, 0.35), 0 2px 6px rgba(74, 8, 16, 0.1);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #ffe566 0%, #f59e0b 100%);
  color: #5c1a0a;
  filter: brightness(1.03);
}
.btn-light { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-light:hover { background: #f8fafc; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fecaca; color: var(--danger); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 15.5px; }
.btn-whatsapp {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}
.btn-whatsapp:hover {
  background: #1ebe57;
  border-color: #1ebe57;
  color: #fff;
}
.participate-wa-notice {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 0;
}
.participate-wa-cancel {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  padding: 0 0 0 6px;
  text-decoration: underline;
}
.participate-wa-sent-notice {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  color: #065f46;
  font-size: 14px;
  margin: 12px 0 0;
  padding: 10px 14px;
}
.wa-api-section { margin-top: 8px; }
.wa-provider-title { font-size: 14px; margin: 16px 0 10px; }
.wa-template-preview summary { cursor: pointer; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.wa-template-body {
  background: #0f172a;
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  padding: 14px;
  white-space: pre-wrap;
}
.wa-api-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.wa-test-phone-field { flex: 1 1 180px; margin: 0; min-width: 160px; }
.wa-log-list { display: grid; gap: 8px; }
.wa-log-item {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.wa-log-sent { border-left: 3px solid #22c55e; }
.wa-log-failed { border-left: 3px solid #ef4444; }
.wa-log-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.guide-card h2 { font-size: 18px; margin: 0 0 12px; }
.guide-card h3 { font-size: 15px; margin: 18px 0 8px; }
.guide-card ol { margin: 0 0 12px; padding-left: 20px; }
.guide-card ol li { margin-bottom: 6px; }

/* ----------------- Forms ----------------- */
.field { margin-bottom: 16px; }
.fieldset-plain {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--text); }
.input, .select, textarea.input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px;
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--text); transition: .15s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft);
}
.input::placeholder { color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.input-icon .input { padding-left: 42px; }

/* ----------------- Table ----------------- */
.table-wrap { overflow-x: auto; }
.table-wrap.table-framed {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
}
table.table th:last-child { border-right: none; }
table.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #eef2f7;
  vertical-align: middle;
  color: var(--text);
}
table.table td:last-child { border-right: none; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr:hover td { background: #fafbff; }
table.table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.table .col-center { text-align: center; }
table.table .col-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}
.table-wrap.table-responsive-stack { -webkit-overflow-scrolling: touch; }
@media (max-width: 900px) {
  .table-wrap.table-responsive-stack.table-framed { overflow-x: auto; }
  .table-wrap.table-responsive-stack table.table { min-width: 620px; }
}
@media (max-width: 640px) {
  .table-wrap.table-responsive-stack.table-framed {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  .table-wrap.table-responsive-stack table.table {
    min-width: 0;
    width: 100%;
  }
  .table-wrap.table-responsive-stack table.table thead { display: none; }
  .table-wrap.table-responsive-stack table.table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .table-wrap.table-responsive-stack table.table tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: hidden;
  }
  .table-wrap.table-responsive-stack table.table tbody tr:last-child td { border-bottom: none; }
  .table-wrap.table-responsive-stack table.table tbody tr:hover td { background: transparent; }
  .table-wrap.table-responsive-stack table.table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border: none;
    border-bottom: 1px solid #eef2f7;
    text-align: right;
  }
  .table-wrap.table-responsive-stack table.table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 46%;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    line-height: 1.3;
  }
  .table-wrap.table-responsive-stack table.table td.col-primary {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--line);
    text-align: left;
  }
  .table-wrap.table-responsive-stack table.table td.col-primary::before { display: none; }
  .table-wrap.table-responsive-stack table.table td.col-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    background: #fafbff;
  }
  .table-wrap.table-responsive-stack table.table td.col-actions::before {
    width: 100%;
    max-width: none;
    margin-bottom: 2px;
  }
  .table-wrap.table-responsive-stack table.table .sp-table-product {
    width: 100%;
  }
  .table-wrap.table-responsive-stack table.table .sp-table-product span {
    word-break: break-word;
    line-height: 1.35;
  }
}
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; padding: 13px 16px; border-bottom: 1px solid var(--line);
  background: #fbfcfe; white-space: nowrap;
}
table.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: #fafbff; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-weight: 600; letter-spacing: .02em; }

/* ----------------- Badges ----------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-green  { background: var(--success-soft); color: #047857; }
.b-amber  { background: var(--warning-soft); color: #b45309; }
.b-red    { background: var(--danger-soft); color: #b91c1c; }
.b-indigo { background: var(--primary-soft); color: var(--primary-700); }
.b-gray   { background: #f1f5f9; color: #475569; }

/* ----------------- Flash / Alerts ----------------- */
.flash-stack { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.flash {
  display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 12px;
  background: #fff; box-shadow: var(--shadow); border-left: 4px solid var(--primary);
  animation: slideIn .3s ease; font-size: 14px; font-weight: 500;
}
.flash.success { border-color: var(--success); }
.flash.error   { border-color: var(--danger); }
.flash.warning { border-color: var(--warning); }
.alert { padding: 13px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.alert.error   { background: var(--danger-soft); color: #b91c1c; }
.alert.success { background: var(--success-soft); color: #047857; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ----------------- Empty state ----------------- */
.empty { text-align: center; padding: 56px 20px; color: var(--text-soft); }
.empty .ic { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--primary-soft); display: grid; place-items: center; color: var(--primary); }
.empty h4 { font-size: 17px; color: var(--text); margin-bottom: 6px; }

/* ----------------- Modal ----------------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); animation: pop .2s ease; max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.x-close { background: none; border: none; cursor: pointer; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ----------------- Toolbar / filters ----------------- */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar .search,
.toolbar-search {
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.toolbar-search label,
.toolbar-filter-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.toolbar-search .input,
.toolbar-filter-field .select {
  height: 42px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.toolbar-filter {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}
.toolbar-filter-field .select {
  min-width: 220px;
  max-width: 280px;
}
@media (max-width: 860px) {
  .toolbar-search,
  .toolbar .search {
    flex: 1 1 100%;
    max-width: none;
  }
  .toolbar-filter {
    margin-left: 0;
    width: 100%;
  }
  .toolbar-filter-field {
    flex: 1;
    min-width: 0;
  }
  .toolbar-filter-field .select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}
.date-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}
.date-filter-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.date-filter-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.date-filter-field .input {
  min-width: 148px;
  height: 42px;
  padding-top: 8px;
  padding-bottom: 8px;
}
@media (max-width: 860px) {
  .date-filter { margin-left: 0; width: 100%; }
  .date-filter-fields { width: 100%; }
  .date-filter-field { flex: 1; min-width: 130px; }
  .date-filter-field .input { width: 100%; min-width: 0; }
}
.spacer { flex: 1; }

/* ----------------- Pagination ----------------- */
.pager { display: flex; gap: 6px; justify-content: center; padding: 18px; }
.pager a, .pager span {
  min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); font-weight: 700; font-size: 14px; background: #fff; color: var(--text-soft);
}
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .cur { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ----------------- Draw / Winner reveal ----------------- */
.draw-stage {
  text-align: center; padding: 48px 24px; border-radius: 14px;
  background: linear-gradient(135deg, #eff4ff, #eef6f5);
  border: 1px dashed #c2d4f5;
}
.draw-roll {
  font-family: ui-monospace, monospace; font-weight: 800; font-size: 46px; letter-spacing: .06em;
  color: var(--primary); min-height: 60px;
}
.winner-card {
  background: linear-gradient(135deg, var(--primary-700), var(--primary), var(--accent));
  color: #fff; border-radius: 14px; padding: 20px; box-shadow: var(--shadow);
}
.winner-card .pos { font-size: 13px; opacity: .85; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.winner-card .sn  { font-family: ui-monospace, monospace; font-size: 24px; font-weight: 800; margin: 4px 0; }
.winner-card-block + .winner-card-block { margin-top: 0; }
.winner-card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
  margin: 14px 0;
}

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }

/* ----------------- Public participate (festive theme) ----------------- */
.public-bg { min-height: 100vh; background: radial-gradient(circle at 50% 36%, #ef3b2d 0%, #cf1f15 45%, #8f0f0a 100%); background-attachment: fixed; position: relative; overflow-x: hidden; }
.public-bg .public-wrap { position: relative; z-index: 2; }
.public-bg .text-muted { color: rgba(255,255,255,.8) !important; }
.public-bg .text-muted a { color: rgba(255,255,255,.95); text-decoration: underline; text-underline-offset: 2px; }
.public-bg .text-muted a:hover { color: #fff; }

/* Penyertaan berjaya — animasi */
.public-success-wrap {
  animation: success-fade-in 0.5s ease both;
}
.public-success-icon {
  position: relative;
  display: inline-block;
  font-size: 46px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 12px rgba(5, 150, 105, 0.35));
  animation:
    success-pop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    success-bounce 2.2s ease-in-out 0.85s infinite;
}
.public-success-icon::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  animation: success-glow-pulse 2s ease-in-out infinite;
  z-index: -1;
}
.public-success-icon::after {
  content: "✦";
  position: absolute;
  top: -4px;
  right: -8px;
  font-size: 16px;
  color: #fbbf24;
  animation: success-sparkle 1.8s ease-in-out infinite;
}
@keyframes success-pop {
  0% { opacity: 0; transform: scale(0.2) rotate(-25deg); }
  55% { transform: scale(1.2) rotate(10deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes success-bounce {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.1) translateY(-10px); }
}
@keyframes success-glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes success-sparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}
.public-success-title {
  font-size: 22px;
  margin: 8px 0;
  animation: success-title-in 0.6s ease 0.25s both;
}
.public-success-msg {
  max-width: 360px;
  margin: 0 auto 14px;
  line-height: 1.55;
}
.success-participant {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: min(100%, 320px);
  margin: 0 auto 4px;
  color: #0f172a;
}
.success-participant-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 14px;
}
.success-participant-row .lbl {
  font-weight: 700;
  color: #0f172a;
  flex-shrink: 0;
}
.success-participant-row .val {
  font-weight: 700;
  color: #0f172a;
  text-align: right;
  word-break: break-word;
}
.public-success-wrap .winner-card {
  animation: success-card-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.45s both;
}
@keyframes success-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes success-title-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes success-card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Lapisan hiasan animasi */
.festive-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.festive-bg .rays { position: absolute; top: 50%; left: 50%; width: 200vmax; height: 200vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.07) 0deg 7deg, rgba(255,255,255,0) 7deg 14deg); animation: rays-spin 80s linear infinite; }
.festive-bg .glow { position: absolute; inset: 0; background: radial-gradient(60vmax 40vmax at 50% 32%, rgba(255, 210, 120, .35), transparent 60%); animation: glow-pulse 5s ease-in-out infinite; }
@keyframes rays-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes glow-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* Confetti jatuh */
.festive-bg .confetti i { position: absolute; top: -6vh; display: block; opacity: .95; box-shadow: 0 1px 2px rgba(0,0,0,.15); animation-name: conf-fall; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes conf-fall {
    0%   { transform: translateY(-6vh) rotateZ(0deg) rotateX(0deg); opacity: 0; }
    8%   { opacity: 1; }
    100% { transform: translateY(106vh) rotateZ(760deg) rotateX(360deg); opacity: 1; }
}

/* Hadiah / ikon terapung */
.prize-floaters {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.prize-float {
  position: absolute;
  left: var(--pf-left, 10%);
  top: var(--pf-top, 20%);
  font-size: var(--pf-size, 42px);
  line-height: 1;
  opacity: var(--pf-opacity, 0.8);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
  animation:
    prize-float-drift var(--pf-dur, 5s) ease-in-out infinite,
    prize-float-shine 3s ease-in-out infinite;
  animation-delay: var(--pf-delay, 0s), calc(var(--pf-delay, 0s) + 0.4s);
  will-change: transform;
}
.pf-2, .pf-5, .pf-8, .pf-11 { animation-direction: reverse; }
.pf-3, .pf-7, .pf-12 { animation-duration: calc(var(--pf-dur, 5s) * 1.2), 3.5s; }
@keyframes prize-float-drift {
  0%, 100% { transform: translate(0, 0) rotate(-8deg) scale(1); }
  20% { transform: translate(14px, -22px) rotate(6deg) scale(1.06); }
  45% { transform: translate(-10px, -32px) rotate(-5deg) scale(1.1); }
  70% { transform: translate(12px, -14px) rotate(8deg) scale(1.04); }
}
@keyframes prize-float-shine {
  0%, 100% { filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35)) brightness(1); }
  50% { filter: drop-shadow(0 12px 24px rgba(255, 215, 0, 0.45)) brightness(1.2); }
}
.prize-sparkle {
  position: absolute;
  font-size: 18px;
  opacity: 0;
  animation: sparkle-twinkle 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}
@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  45% { opacity: 1; transform: scale(1.2) rotate(20deg); }
  55% { opacity: 0.9; transform: scale(1) rotate(-10deg); }
}
.prize-coin {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8dc, #ffd700 45%, #daa520 100%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 12px rgba(255, 215, 0, 0.4);
  animation: coin-float 4.5s ease-in-out infinite;
}
.prize-coin::after {
  content: "★";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #5c3d0a;
  font-weight: 800;
}
.prize-coin.pc-1 { left: 6%; top: 22%; animation-delay: 0s; width: 22px; height: 22px; }
.prize-coin.pc-2 { right: 8%; top: 18%; animation-delay: -1.2s; width: 32px; height: 32px; }
.prize-coin.pc-3 { left: 4%; top: 48%; animation-delay: -2.4s; }
.prize-coin.pc-4 { right: 5%; top: 42%; animation-delay: -0.8s; width: 24px; height: 24px; }
.prize-coin.pc-5 { left: 10%; top: 68%; animation-delay: -1.8s; width: 20px; height: 20px; }
.prize-coin.pc-6 { right: 12%; top: 62%; animation-delay: -3s; }
@keyframes coin-float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.75; }
  50% { transform: translateY(-20px) rotate(180deg); opacity: 1; }
}

/* Kotak hadiah terapung */
.festive-bg .gift {
  position: absolute;
  font-size: 56px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.3));
  animation: gift-bob 3.5s ease-in-out infinite;
  z-index: 1;
}
.festive-bg .gift-l { left: 18px; bottom: 16px; animation-delay: 0s; }
.festive-bg .gift-r { right: 18px; bottom: 16px; animation-delay: 0.8s; }
.festive-bg .gift-tl { left: 12%; top: 14%; font-size: 44px; animation-delay: -1.2s; opacity: 0.9; }
@keyframes gift-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

@media (max-width: 540px) {
  .festive-bg .gift { font-size: 40px; }
  .festive-bg .gift-tl { font-size: 32px; opacity: 0.7; }
  .prize-float { font-size: calc(var(--pf-size, 42px) * 0.75) !important; }
  .prize-coin { display: none; }
  .whatsapp-float { right: 14px; bottom: 14px; width: 52px; height: 52px; }
  .whatsapp-float svg { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .festive-bg .rays, .festive-bg .glow, .festive-bg .confetti i, .festive-bg .gift,
  .prize-float, .prize-sparkle, .prize-coin,
  .public-success-icon, .public-success-icon::before, .public-success-icon::after,
  .public-success-title, .public-success-wrap .winner-card { animation: none; }
  .prize-float, .prize-sparkle { opacity: 0.5; }
  .public-success-icon { opacity: 1; transform: none; }
}

/* Floating WhatsApp */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  transition: transform .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.whatsapp-float:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.34);
  color: #fff;
}
.whatsapp-float svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.public-wrap { max-width: 480px; margin: 0 auto; padding: 40px 20px; }
.public-expired-notice {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #92400e;
}
.public-form-disabled .input,
.public-form-disabled .btn {
  opacity: 0.55;
  cursor: not-allowed;
}
.public-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 32px; }

/* ----------------- Slideshow banner ----------------- */
.slideshow { position: relative; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: #f1f5f9; }
.slideshow .slides { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.slideshow .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.slideshow .slide.active { opacity: 1; }
.slideshow .dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; }
.slideshow .dot { width: 8px; height: 8px; padding: 0; border: none; border-radius: 999px; background: rgba(255,255,255,.55); cursor: pointer; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.slideshow .dot.active { background: #fff; width: 22px; }
.slideshow .slide-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 40px; height: 40px; border: none; border-radius: 50%; background: rgba(255,255,255,.92); color: #1e293b; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; padding: 0 0 2px; transition: background .15s, transform .15s; }
.slideshow .slide-nav:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.slideshow .slide-prev { left: 10px; }
.slideshow .slide-next { right: 10px; }
.slideshow.is-dragging .slide { transition: none; }
.slideshow .slides { touch-action: pan-y pinch-zoom; cursor: grab; }
.slideshow.is-dragging .slides { cursor: grabbing; }

/* Placeholder bila syarikat belum muat naik imej banner */
.banner-placeholder .slide.ph { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #6a1b0a; opacity: 1; background: linear-gradient(135deg, #ffd84d 0%, #ffb347 50%, #ff8a3d 100%); }
.banner-placeholder .ph-logo { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.banner-placeholder .ph-name { font-size: 20px; font-weight: 800; letter-spacing: .2px; padding: 0 16px; }
.banner-placeholder .ph-sub { font-size: 13px; opacity: .9; margin-top: 2px; }

/* ----------------- Rich-text editor (settings) ----------------- */
.rte { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); background: var(--bg, #f4f6fa); }
.rte-toolbar button { min-width: 34px; height: 32px; padding: 0 8px; border: 1px solid var(--line); background: #fff; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); transition: .15s; }
.rte-toolbar button:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-700); }
.rte-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.rte-editor { min-height: 160px; max-height: 360px; overflow-y: auto; padding: 14px 16px; font-size: 14px; line-height: 1.6; outline: none; color: var(--text); }
.rte-editor-lg { min-height: 220px; max-height: 480px; }
.rte-editor:empty::before { content: attr(data-placeholder); color: var(--text-muted, #94a3b8); }
.rte-editor h3, .rte-content h3 { font-size: 15px; margin: 10px 0 4px; font-weight: 700; }
.rte-editor ul, .rte-editor ol, .rte-content ul, .rte-content ol { padding-left: 22px; margin: 6px 0; }
.rte-editor a, .rte-content a { color: var(--primary); }
.rte-editor img, .rte-content img, .rte-img { max-width: 100%; height: auto; border-radius: 10px; margin: 10px 0; display: block; }
.rte-editor video, .rte-content video, .rte-video {
  background: #0f172a;
  border-radius: 12px;
  display: block;
  margin: 12px 0;
  max-width: 100%;
  width: 100%;
}
.rte-toolbar .rte-btn-video { font-size: 12px; font-weight: 700; min-width: 34px; }
.rte-toolbar button.is-loading { opacity: 0.6; pointer-events: none; }
.rte-toolbar button svg { width: 15px; height: 15px; vertical-align: -2px; }
.rte-toolbar button:has(svg:only-child) { display: inline-grid; place-items: center; padding: 0; min-width: 34px; }
.rte-toolbar button:has(svg:only-child) svg { vertical-align: 0; }
.rte-toolbar .rte-select {
  height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; font-size: 12px; color: var(--text); cursor: pointer;
}
.rte-toolbar .rte-select-font { min-width: 132px; max-width: 180px; }
.rte-toolbar .rte-select-spacing { min-width: 108px; max-width: 140px; }
.rte-toolbar .rte-btn-highlight { background: #fef9c3; font-weight: 800; }
.rte-toolbar .rte-btn-red { color: #dc2626; font-weight: 800; }
.rte-editor span[style*="background-color"],
.rte-content span[style*="background-color"] {
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 1px;
}
.rte-editor [style*="text-align: center"], .rte-content [style*="text-align: center"] { text-align: center; }
.rte-editor [style*="text-align: right"], .rte-content [style*="text-align: right"] { text-align: right; }
.rte-editor [style*="text-align: left"], .rte-content [style*="text-align: left"] { text-align: left; }
.rte-content a { text-decoration: underline; }

/* ----------------- Terms box (public) ----------------- */
.terms-box { padding: 22px 24px; }
.terms-title { font-size: 16px; margin-bottom: 10px; font-weight: 700; }
.rte-content { font-size: 14px; line-height: 1.65; color: var(--text); }
.rte-content p { margin: 0 0 8px; }
.rte-content blockquote { border-left: 3px solid var(--primary); padding-left: 12px; margin: 8px 0; color: var(--text-muted, #64748b); }

/* ----------------- Banner grid (settings) ----------------- */
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.banner-item { position: relative; border-radius: 11px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 9; background: #f1f5f9; }
.banner-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-item .del { position: absolute; top: 6px; right: 6px; padding: 6px; }
.banner-item .del svg { width: 15px; height: 15px; }

/* ----------------- Helpers ----------------- */
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.detail-list { display: flex; flex-direction: column; gap: 10px; }
.detail-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 14px; }
.detail-list dt { color: var(--muted); font-weight: 600; }
.detail-list dd { margin: 0; color: var(--text); }
@media (max-width: 480px) { .detail-list > div { grid-template-columns: 1fr; gap: 2px; } }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.text-soft { color: var(--text-soft); } .text-muted { color: var(--muted); }
.text-sm { font-size: 13px; } .fw-700 { font-weight: 700; }
.text-center { text-align: center; }

/* ----------------- Salespage dashboard ----------------- */
.sp-dash-hero {
  background: linear-gradient(135deg, #1e293b 0%, #334155 45%, #475569 100%);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 22px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.sp-dash-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(251, 191, 36, 0.18) 0%, transparent 45%),
              radial-gradient(circle at 10% 80%, rgba(99, 102, 241, 0.2) 0%, transparent 40%);
  pointer-events: none;
}
.sp-dash-hero-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.sp-dash-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 6px;
}
.sp-dash-hero h1 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.sp-dash-sub {
  margin: 0;
  opacity: 0.88;
  font-size: 14.5px;
  max-width: 520px;
  line-height: 1.55;
}
.sp-dash-url {
  margin-top: 14px;
  max-width: min(100%, 560px);
}
.sp-dash-url-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sp-dash-url-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sp-dash-url-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
  padding: 8px 12px;
  transition: background 0.15s, border-color 0.15s;
}
.sp-dash-url-btn svg {
  height: 15px;
  width: 15px;
  flex-shrink: 0;
}
.sp-dash-url-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
}
.sp-dash-url-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  opacity: 0.72;
  text-transform: uppercase;
}
.sp-dash-url-link {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fde68a;
  display: block;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
  text-decoration: none;
  word-break: break-all;
}
.sp-dash-url-link:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.sp-dash-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.sp-dash-kpi { margin-bottom: 22px; }
.sp-dash-stat .val { font-size: clamp(26px, 4vw, 34px); }
.sp-dash-stat .sp-dash-rm { font-size: clamp(20px, 3vw, 28px); letter-spacing: -0.02em; }
.sp-dash-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;
  line-height: 1.4;
}
.chart-legend .dot-click { background: rgb(99, 102, 241); }
.chart-legend .dot-rev { background: rgb(245, 158, 11); }
.chart-wrap-tall { height: 320px; }
@media (max-width: 640px) {
  .sp-dash-hero { padding: 22px 18px; }
  .chart-wrap-tall { height: 260px; }
}

/* ----------------- Responsive sidebar ----------------- */
@media (max-width: 980px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .content { padding: 18px; }
}
.scrim { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 45; }
.scrim.open { display: block; }
