:root {
  --red: #E63946;
  --red-d: #C62835;
  --yellow: #FFC53D;
  --blue: #2D7FF9;
  --navy: #1B2A4A;
  --cream: #FFF6E5;
  --mint: #2EC4B6;
  --green: #22B573;
  --orange: #FF8A3D;
  --pink: #FF5C8A;
  --grey: #8A94A6;
  --ink: #1B2A4A;
  --muted: #5B6478;
  --line: #1B2A4A;
  --card: #FFFFFF;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--navy);
  --shadow-sm: 3px 3px 0 var(--navy);
  --font-h: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  background-image: radial-gradient(rgba(27, 42, 74, .07) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}
main { flex: 1; }
h1, h2, h3, h4 { font-family: var(--font-h); line-height: 1.15; margin: 0 0 .5em; letter-spacing: .2px; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
a { color: var(--blue); font-weight: 700; }
img { max-width: 100%; }
code { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 1px 6px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.warn { color: var(--red-d); font-weight: 700; }
.red-text { color: var(--red); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- butang ---------- */
.btn {
  --bg: #fff; --fg: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1rem/1 var(--font-h);
  padding: 12px 20px; border-radius: 999px;
  border: 2.5px solid var(--navy); background: var(--bg); color: var(--fg);
  box-shadow: var(--shadow-sm); cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--navy); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn.primary { --bg: var(--red); --fg: #fff; }
.btn.primary:hover { --bg: var(--red-d); }
.btn.ghost { --bg: #fff; }
.btn.danger { --bg: var(--red); --fg: #fff; }
.btn.danger-ghost { --bg: #fff; --fg: var(--red-d); }
.btn.big { padding: 16px 28px; font-size: 1.15rem; }
.btn.small { padding: 8px 14px; font-size: .9rem; }
.btn.tiny { padding: 5px 10px; font-size: .78rem; box-shadow: 2px 2px 0 var(--navy); border-width: 2px; }
.btn.block { width: 100%; margin-top: 10px; }
.linkish { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }

.spin { width: 16px; height: 16px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; }
.spin.big { width: 40px; height: 40px; border-width: 5px; color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { display: grid; place-items: center; gap: 10px; padding: 80px 0; text-align: center; }

/* ---------- navigasi ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc((100vw - 1180px) / 2 + 16px));
  background: #fff; border-bottom: 3px solid var(--navy);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-family: var(--font-h); font-size: 1.1rem; }
.brand img { width: 46px; height: 46px; }
.brand b { color: var(--red); }
.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links > a { text-decoration: none; color: var(--navy); padding: 8px 12px; border-radius: 999px; font-family: var(--font-h); font-weight: 600; }
.nav-links > a:hover { background: var(--cream); }
.nav-links > a.on { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--navy); }
.nav-user { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.chip { background: var(--cream); border: 2px solid var(--navy); border-radius: 999px; padding: 4px 12px; font-weight: 800; white-space: nowrap; }
.chip small { color: var(--red); font-weight: 800; margin-left: 4px; }
.burger { display: none; margin-left: auto; background: var(--yellow); border: 2.5px solid var(--navy); border-radius: 12px; width: 46px; height: 42px; padding: 8px; cursor: pointer; box-shadow: var(--shadow-sm); }
.burger span { display: block; height: 3px; background: var(--navy); border-radius: 3px; margin: 4px 0; }
@media (max-width: 900px) {
  .burger { display: block; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 3px solid var(--navy); padding: 12px 16px 16px; }
  .nav.open .nav-links { display: flex; }
  .nav-user { margin: 8px 0 0; flex-wrap: wrap; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 3px solid var(--navy); background: var(--navy); }
.hero-strip { position: absolute; inset: 0; }
/* banner.jpg = 3720x560, dipaparkan pada tinggi 480px -> lebar 3189px setiap ulangan */
.hero-strip div {
  position: absolute; inset: 0;
  background: url('/assets/banner.jpg') repeat 0 center / 3189px 480px;
  animation: pan 90s linear infinite;
}
.hero-strip::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(27, 42, 74, .92) 0%, rgba(27, 42, 74, .72) 45%, rgba(230, 57, 70, .3) 100%); }
@keyframes pan { to { background-position-x: -3189px; } }
@media (prefers-reduced-motion: reduce) { .hero-strip div { animation: none; } }
.hero-inner { position: relative; display: flex; align-items: center; gap: 36px; padding-top: 48px; padding-bottom: 56px; color: #fff; }
.hero-logo { width: clamp(150px, 24vw, 280px); flex-shrink: 0; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-1.5deg); } }
.kicker { font-family: var(--font-h); text-transform: uppercase; letter-spacing: 1.5px; font-size: .85rem; color: var(--red); font-weight: 700; margin: 0 0 6px; }
.hero .kicker { color: var(--yellow); }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); text-shadow: 3px 3px 0 rgba(0, 0, 0, .3); }
.hl-y { color: var(--yellow); } .hl-b { color: #7CC4FF; } .hl-r { color: #FF7A85; }
.lead { font-size: 1.15rem; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.hero .btn.ghost { --bg: var(--yellow); }
@media (max-width: 720px) {
  .hero-inner { flex-direction: column; text-align: center; padding-top: 28px; gap: 12px; }
  .hero-cta { justify-content: center; }
}

/* ---------- seksyen & kad ---------- */
.section-head { text-align: center; margin: 48px 0 22px; }
.section-head.left { text-align: left; margin-top: 32px; }
.section-head p { color: var(--muted); margin: 0; }
.card { background: var(--card); border: 3px solid var(--navy); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.sunny { background: #FFF1C9; }
.card.minty { background: #D7F5F1; }
.card.pinky { background: #FFE0E6; }
.card.empty { text-align: center; padding: 36px 20px; }
.error-card { max-width: 520px; margin: 60px auto; text-align: center; }

.session-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.session-card { position: relative; border: 3px solid var(--navy); border-radius: 22px; box-shadow: var(--shadow); padding: 22px; background: #fff; overflow: hidden; }
.session-card::before { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; opacity: .9; }
.session-card.fri::before { background: #CFE2FF; }
.session-card.sun::before { background: #FFE7A3; }
.session-card > * { position: relative; }
.sc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.sc-day { font-family: var(--font-h); font-weight: 700; }
.session-card h3 { font-size: 1.6rem; }
.count-box { background: var(--cream); border: 2.5px dashed var(--navy); border-radius: 14px; padding: 12px; text-align: center; display: grid; margin: 12px 0; }
.count-box b { font-family: var(--font-h); font-size: 2rem; color: var(--navy); }
.count-box b span { font-size: 1rem; color: var(--muted); }
.count-box.go { background: #DFF7EA; }
.count-box.go b { color: var(--green); }
.count-box.bad { background: #FFE0E6; }

.badge { display: inline-block; font: 700 .78rem/1 var(--font-h); padding: 6px 10px; border-radius: 999px; border: 2px solid var(--navy); background: #eee; white-space: nowrap; }
.badge.green { background: #BDF0D4; } .badge.blue { background: #CFE2FF; } .badge.amber { background: #FFE7A3; }
.badge.red { background: #FFC9D0; } .badge.grey { background: #E7E9EE; color: #4b5467; } .badge.navy { background: var(--navy); color: #fff; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.step { border: 3px solid var(--navy); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); background: #fff; }
.step b { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--navy); font: 700 1.3rem var(--font-h); margin-bottom: 8px; }
.step.c1 b { background: var(--red); color: #fff; } .step.c2 b { background: var(--yellow); }
.step.c3 b { background: var(--blue); color: #fff; } .step.c4 b { background: var(--mint); color: #fff; }
.step p { margin: 0; color: var(--muted); }
.info-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 40px auto 56px; }
.big-num { font: 700 2.4rem/1 var(--font-h); color: var(--red); margin: 6px 0 10px; }
.big-num small { font-size: 1rem; color: var(--muted); }

/* ---------- borang ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 340px); gap: 24px; justify-content: center; align-items: start; padding-top: 36px; padding-bottom: 56px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: minmax(0, 1fr); } }
.auth-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.auth-head img { width: 72px; }
.auth-head h1 { margin: 0; font-size: 1.8rem; }
.auth-head p { margin: 0; color: var(--muted); }
.steps-mini { padding-left: 20px; margin: 0 0 10px; }
.steps-mini li { margin-bottom: 8px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 800; font-size: .9rem; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); width: 100%;
  border: 2.5px solid var(--navy); border-radius: 12px; padding: 11px 13px; background: #fff;
}
.field textarea { resize: vertical; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 112px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: .8rem; font-weight: 800; color: var(--navy);
  background: #fff; border: 2px solid var(--navy); border-radius: 999px; padding: 5px 10px; cursor: pointer;
}
.pw-toggle:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(45, 127, 249, .3); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: 0 0 0 4px rgba(45, 127, 249, .3); }
.field.inline { min-width: 160px; }
.field.grow { flex: 1; min-width: 200px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--red); flex-shrink: 0; }
.radio-list { display: grid; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.settings-form { display: grid; gap: 16px; }
.settings-form > .btn { justify-self: start; }

/* ---------- peta & tempahan ---------- */
.book-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 28px 0 18px; }
.book-head h1 { margin-bottom: 6px; }
.phase-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs a { text-decoration: none; color: var(--navy); background: #fff; border: 2.5px solid var(--navy); border-radius: 999px; padding: 9px 16px; font-family: var(--font-h); font-weight: 600; box-shadow: var(--shadow-sm); }
.tabs a.on { background: var(--yellow); }
.tabs.pills { margin: 0; }
.book-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; margin-bottom: 56px; }
@media (max-width: 980px) { .book-grid { grid-template-columns: minmax(0, 1fr); } .book-panel { order: -1; } }
.book-panel { position: sticky; top: 90px; }
@media (max-width: 980px) { .book-panel { position: static; } }
.map-card { padding: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; font-weight: 700; margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lot-dot { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--navy); display: inline-block; }

.map-scroll { overflow-x: auto; border-radius: 12px; border: 2.5px solid var(--navy); -webkit-overflow-scrolling: touch; }
.map-viewport { position: relative; aspect-ratio: 1330 / 1100; overflow: hidden; min-width: 680px; container-type: inline-size; }
.map-inner { position: absolute; aspect-ratio: 1; }
.map-inner img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.lot {
  position: absolute; display: grid; place-items: center; padding: 0;
  font: 700 1.55cqw/1 var(--font-h); color: var(--navy);
  border: .25cqw solid var(--navy); border-radius: .5cqw; cursor: pointer;
  transition: transform .12s, background .15s;
}
.lot.v { writing-mode: horizontal-tb; }
.lot.free, .lot-dot.free { background: #9BE7B0; }
.lot.free:hover { background: var(--yellow); transform: scale(1.15); z-index: 2; }
.lot.held, .lot-dot.held { background: repeating-linear-gradient(45deg, #FFB547 0 5px, #FFD38A 5px 10px); cursor: not-allowed; }
.lot.confirmed, .lot-dot.confirmed { background: var(--red); color: #fff; cursor: not-allowed; }
.lot.mine, .lot-dot.mine { background: var(--blue); color: #fff; }
.lot.sel, .lot-dot.sel { background: var(--yellow); }
.lot.sel { transform: scale(1.25); z-index: 3; box-shadow: 0 0 0 .5cqw #fff, 0 0 0 .9cqw var(--navy); animation: pulse 1.1s ease-in-out infinite; }
.lot[aria-disabled='true'] { cursor: default; }
.lot.free[aria-disabled='true']:hover { transform: none; background: #9BE7B0; }
.lot:focus-visible { outline: .4cqw solid var(--blue); outline-offset: .2cqw; z-index: 4; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.price-tag { display: flex; justify-content: space-between; align-items: center; background: var(--cream); border: 2.5px dashed var(--navy); border-radius: 12px; padding: 10px 14px; margin-top: 12px; }
.price-tag b { font: 700 1.5rem var(--font-h); color: var(--red); }

.big-q { font-size: 1.15rem; }
.terms-doc { max-height: 46vh; overflow: auto; border: 2.5px solid var(--navy); border-radius: 14px; padding: 4px 18px 14px; background: #FFFDF8; font-size: .93rem; }
.terms-doc h4 { font-size: 1rem; margin: 16px 0 6px; color: var(--red-d); }
.terms-doc p { margin: 6px 0; }
.terms-doc .clause { display: grid; grid-template-columns: 2.6em 1fr; gap: 4px; }
.terms-doc .clause b { color: var(--navy); }
.terms-doc .cont { padding-left: 2.85em; }
.terms-doc ul { margin: 4px 0 8px 2.85em; padding-left: 18px; }
.terms-doc li { margin-bottom: 2px; }
.terms-hint { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.goods-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; margin: 14px 0; }
@media (max-width: 600px) { .goods-fields { grid-template-columns: minmax(0, 1fr); } }
.pay-box { background: #FFF1C9; border: 2.5px solid var(--navy); border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
.pay-box h4 { margin: 0 0 6px; }
.pay-box p { margin: 6px 0; }
.pay-box dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0; }
.pay-box dt { color: var(--muted); font-weight: 700; }
.pay-box dd { margin: 0; font-weight: 800; }
.pay-box.compact { padding: 10px 14px; margin: 10px 0; }
.pay-qr { display: grid; justify-items: center; gap: 6px; text-align: center; margin: 10px 0 4px; }
.pay-qr img, .qr-now img { width: min(260px, 100%); height: auto; background: #fff; border: 2.5px solid var(--navy); border-radius: 12px; padding: 8px; }
.pay-qr p { margin: 0; }
.qr-card { margin-top: 18px; }
.qr-card h3 { margin: 0; }
.acc { font-family: ui-monospace, Consolas, monospace; font-size: 1.05em; letter-spacing: .5px; }

/* ---------- tempahan saya ---------- */
.booking-list { display: grid; gap: 18px; margin-bottom: 56px; }
.booking-card { display: flex; gap: 18px; align-items: flex-start; }
.booking-card.flash { animation: flash 1.6s ease 2; }
@keyframes flash { 50% { box-shadow: 0 0 0 6px var(--yellow), var(--shadow); } }
.bc-lot { flex-shrink: 0; width: 84px; text-align: center; background: var(--yellow); border: 3px solid var(--navy); border-radius: 16px; padding: 8px 4px; display: grid; }
.bc-lot small { font: 700 .75rem var(--font-h); letter-spacing: 2px; }
.bc-lot b { font: 700 2.1rem/1 var(--font-h); }
.st-DISAHKAN .bc-lot { background: #BDF0D4; }
.st-MENUNGGU_PENGESAHAN .bc-lot { background: #CFE2FF; }
.st-DITOLAK .bc-lot, .st-SESI_DIBATALKAN .bc-lot { background: #FFC9D0; }
.st-DIBATALKAN .bc-lot, .st-TAMAT_TEMPOH .bc-lot { background: #E7E9EE; }
.bc-main { flex: 1; min-width: 0; }
.bc-main h3 { margin: 6px 0; }
.bc-main p { margin: 6px 0; }
.bc-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.bc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.upload-btn.loading { pointer-events: none; opacity: .7; }
.hold-timer { display: inline-block; background: var(--red); color: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 700; margin: 6px 0; }
.proof-view { max-height: 70vh; overflow: auto; text-align: center; background: #f4f4f4; border-radius: 12px; }
.proof-view img { max-width: 100%; }
@media (max-width: 560px) { .booking-card { flex-direction: column; } .bc-lot { width: 100%; grid-auto-flow: column; justify-content: center; align-items: baseline; gap: 10px; } }

/* ---------- pentadbir ---------- */
.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { border: 3px solid var(--navy); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow-sm); display: grid; }
.stat small { font-weight: 800; }
.stat b { font: 700 1.7rem var(--font-h); }
.stat.green { background: #BDF0D4; } .stat.blue { background: #CFE2FF; } .stat.amber { background: #FFE7A3; } .stat.navy { background: var(--navy); color: #fff; }
.admin-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-bottom: 56px; align-items: start; }
@media (max-width: 1080px) { .admin-split { grid-template-columns: minmax(0, 1fr); } }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-family: var(--font-h); font-weight: 600; background: var(--cream); padding: 10px; border-bottom: 2.5px solid var(--navy); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid #E3E6EC; vertical-align: top; }
.tbl tr:hover td { background: #FFFBF1; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lot-pill { display: inline-grid; place-items: center; min-width: 38px; height: 30px; border-radius: 8px; background: var(--yellow); border: 2px solid var(--navy); font-family: var(--font-h); }
.audit .detail { max-width: 460px; word-break: break-word; }
.act { font-weight: 800; }
.act-payment { color: var(--green); } .act-login { color: var(--blue); } .act-session { color: var(--red); } .act-user { color: var(--orange); }
.queue { display: grid; gap: 14px; margin-bottom: 56px; }
.queue-card { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.q-main { flex: 1; min-width: 220px; }
.q-main h3 { margin: 0 0 4px; }
.q-main p { margin: 2px 0; }
.q-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.detail-grid > div { display: grid; gap: 2px; background: var(--cream); border-radius: 10px; padding: 8px 12px; }
.detail-grid small { color: var(--muted); font-weight: 700; }
.timeline { list-style: none; padding: 0 0 0 18px; border-left: 3px solid var(--yellow); margin: 0; }
.timeline li { position: relative; padding: 0 0 12px 10px; }
.timeline li::before { content: ''; position: absolute; left: -27px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 2px solid var(--navy); }
.report-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 56px; }
.report-picker .card { display: grid; gap: 10px; align-content: start; }
.report-picker h3, .report-picker p { margin: 0; }

.mode-card { margin-bottom: 16px; }
.mode-card p { margin: 8px 0 0; }
.mode-card.test { background: #FFF1C9; }
.mode-card.live { background: #DFF7EA; }
.manual-form { margin-bottom: 16px; }
.manual-form h3 { margin: 0; }
.manual-form > .btn { justify-self: start; }
.danger-zone { margin: 18px 0 56px; background: #FFE0E6; }
.danger-zone h3 { margin-top: 0; }

/* ---------- modal & toast ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(27, 42, 74, .55); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal-wrap.out { opacity: 0; transition: opacity .18s; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: min(100%, 520px); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border: 3px solid var(--navy); border-radius: 22px; box-shadow: 6px 6px 0 var(--navy); padding: 24px; animation: pop .2s; }
.modal.wide { width: min(100%, 760px); }
@keyframes pop { from { transform: scale(.92); } }
.modal h3 { font-size: 1.4rem; padding-right: 30px; }
.modal-x { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 1.8rem; cursor: pointer; color: var(--navy); line-height: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
#toasts { position: fixed; z-index: 200; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 440px); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 14px; border: 2.5px solid var(--navy); box-shadow: var(--shadow-sm); font-weight: 700; animation: pop .2s; transition: opacity .4s, transform .4s; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ---------- footer ---------- */
.site-foot { background: var(--navy); color: #fff; border-top: 3px solid var(--navy); padding: 22px 0; }
.site-foot .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-foot p { margin: 0; }
.site-foot a { color: var(--yellow); }
.site-foot .small { margin-left: auto; }

/* ---------- laporan ---------- */
body.bare { background: #E9ECF1; }
body.bare .nav, body.bare .site-foot { display: none; }
.rpt-toolbar { max-width: 210mm; margin: 18px auto 12px; padding: 0 12px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.report { max-width: 210mm; min-height: 270mm; margin: 0 auto 40px; background: #fff; padding: 16mm 14mm; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); font-size: 10.5pt; color: #111827; font-family: var(--font); }
.rpt-head { display: flex; align-items: center; gap: 14px; border-bottom: 3px solid var(--navy); padding-bottom: 12px; }
.rpt-head img { width: 68px; }
.rpt-org { display: grid; flex: 1; }
.rpt-org b { font-family: var(--font-h); font-size: 14pt; color: var(--navy); }
.rpt-org span { color: #4B5563; }
.rpt-meta { display: grid; grid-template-columns: auto auto; gap: 0 10px; font-size: 8.5pt; text-align: right; }
.rpt-meta span { color: #6B7280; }
.rpt-title { margin: 16px 0 12px; }
.rpt-title h1 { font-size: 16pt; margin: 0 0 2px; color: var(--navy); }
.rpt-title p { margin: 0; color: #374151; font-size: 11pt; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.kpi { border: 1.5px solid #D1D5DB; border-radius: 8px; padding: 8px 10px; display: grid; }
.kpi span { font-size: 8pt; text-transform: uppercase; letter-spacing: .5px; color: #6B7280; font-weight: 700; }
.kpi b { font-family: var(--font-h); font-size: 14pt; color: var(--navy); }
.kpi small { font-size: 8pt; color: #6B7280; }
.kpi.hero { background: var(--navy); border-color: var(--navy); }
.kpi.hero span, .kpi.hero small { color: #CBD5E1; }
.kpi.hero b { color: var(--yellow); font-size: 16pt; }
.occ-bar { position: relative; height: 18px; background: #F3F4F6; border-radius: 9px; overflow: hidden; margin-bottom: 12px; }
.occ-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--mint), var(--green)); }
.occ-bar span { position: relative; font-size: 8pt; font-weight: 800; padding-left: 8px; line-height: 18px; }
.rpt-h2 { font-size: 11.5pt; color: var(--navy); margin: 16px 0 6px; border-left: 4px solid var(--red); padding-left: 8px; }
.rpt-tbl { width: 100%; border-collapse: collapse; font-size: 9pt; }
.rpt-tbl th { background: #F3F4F6; text-align: left; padding: 6px; border-bottom: 1.5px solid #9CA3AF; font-weight: 800; }
.rpt-tbl td { padding: 5px 6px; border-bottom: 1px solid #E5E7EB; }
.rpt-tbl tbody tr:nth-child(even) td { background: #FAFAFB; }
.rpt-tbl tfoot td { font-weight: 800; border-top: 2px solid var(--navy); border-bottom: 3px double var(--navy); padding: 7px 6px; background: #FFF7E0; }
.rpt-tbl .num, .rpt-tbl .nowrap { text-align: right; white-space: nowrap; }
.rpt-tbl .nowrap { text-align: left; font-size: 8.5pt; }
.kpi.split b { font-size: 11pt; }
.rpt-tbl.compact td { padding: 3px 6px; }
.rpt-tbl tr.cancelled td { color: #9CA3AF; }
.bar-cell { width: 22%; }
.bar-cell i { display: block; height: 10px; border-radius: 5px; background: var(--blue); min-width: 2px; }
.rpt-note { background: #FEF3C7; border: 1px solid #F59E0B; border-radius: 6px; padding: 8px 10px; font-size: 9pt; }
.rpt-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.rpt-sign div { display: grid; gap: 2px; font-size: 9pt; }
.rpt-sign span { color: #6B7280; }
.rpt-sign i { display: block; height: 38px; border-bottom: 1.5px solid #374151; }
.rpt-sign b { height: 38px; display: flex; align-items: flex-end; border-bottom: 1.5px solid #374151; }
.rpt-foot { margin-top: 22px; font-size: 7.5pt; color: #6B7280; border-top: 1px solid #E5E7EB; padding-top: 8px; }
@media (max-width: 700px) { .report { padding: 16px; } .kpis { grid-template-columns: repeat(2, 1fr); } .rpt-sign { grid-template-columns: 1fr; } }

@media print {
  @page { size: A4; margin: 12mm; }
  body, body.bare { background: #fff; display: block; }
  .no-print, .nav, .site-foot, #toasts { display: none !important; }
  .report { box-shadow: none; margin: 0; padding: 0; max-width: none; min-height: 0; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .rpt-sign { grid-template-columns: repeat(3, 1fr); }
  .kpi.hero, .rpt-tbl th, .rpt-tbl tfoot td, .occ-bar i, .bar-cell i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rpt-tbl tr { break-inside: avoid; }
}

html[data-env='local'] body::after {
  content: 'EMULATOR'; position: fixed; left: 10px; bottom: 10px; z-index: 300;
  background: var(--orange); color: #fff; font: 700 .7rem var(--font-h); padding: 4px 8px; border-radius: 6px; border: 2px solid var(--navy);
}
