:root {
  --ink: #607086;
  --heading: #40536b;
  --muted: #8491a4;
  --line: #dce8f2;
  --paper: #ffffff;
  --canvas: #f5faff;
  --navy: #4c9fdd;
  --teal: #4da3e6;
  --teal-dark: #3489cb;
  --teal-soft: #eaf6ff;
  --green: #79b85a;
  --green-dark: #5b963f;
  --green-soft: #edf8e8;
  --gold: #4da3e6;
  --danger: #b42318;
  --shadow: 0 14px 38px rgba(74, 144, 194, .09);
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
strong, h1, h2, h3, h4 { color: var(--heading); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--teal); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h2, h3 { margin-bottom: 7px; }

.login-screen { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 100vh; overflow: hidden auto; padding: 42px 20px; background: #edf7ff; }
.login-visual { position: absolute; z-index: -2; inset: 0; overflow: hidden; background: #dceeff; }
.login-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center center; }
.login-visual-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(225,241,255,.10)); pointer-events: none; }
.login-panel { display: flex; width: min(100%, 440px); min-width: 0; }
.login-content { display: flex; flex: 1; flex-direction: column; justify-content: center; width: 100%; margin: auto; }
.login-logo-wrap { margin-bottom: 30px; text-align: center; }
.login-logo { width: min(100%, 360px); max-height: 150px; height: auto; margin-bottom: 22px; object-fit: contain; }
.login-logo-wrap span { display: block; width: 48px; height: 4px; margin: auto; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--green)); }
.login-heading { margin-bottom: 30px; text-align: center; }
.login-heading h1 { margin-bottom: 11px; color: var(--heading); font-size: 30px; font-weight: 700; line-height: 1.25; }
.login-heading p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.login-card { width: 100%; border: 1px solid rgba(215,233,247,.94); border-radius: 20px; padding: 30px; background: rgba(255,255,255,.91); box-shadow: 0 22px 60px rgba(55,126,183,.18); backdrop-filter: blur(14px); }
.login-card label { color: var(--ink); font-size: 13px; font-weight: 600; }
.input-shell { position: relative; display: block; }
.input-shell > svg { position: absolute; top: 50%; left: 15px; width: 20px; height: 20px; color: #98a2b3; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; transform: translateY(-50%); pointer-events: none; }
.input-shell input { height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 45px; color: var(--heading); background: white; }
.input-shell input:focus { border-color: var(--teal); box-shadow: none; }
.password-shell > button { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 48px; height: 48px; border: 0; color: #98a2b3; background: transparent; }
.password-shell > button:hover { color: #667085; }
.password-shell > button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.remember-login { display: flex; align-items: center; width: fit-content; gap: 9px; margin: -3px 0 20px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 500; }
.remember-login input { width: 17px; height: 17px; margin: 0; padding: 0; accent-color: var(--teal); cursor: pointer; }
.login-submit { height: 48px; color: white; background: linear-gradient(90deg, var(--green), #8bc65f); box-shadow: 0 9px 22px rgba(91,150,63,.24); }
.login-submit:hover:not(:disabled) { background: linear-gradient(90deg, var(--green-dark), var(--green)); box-shadow: 0 11px 24px rgba(91,150,63,.30); transform: translateY(-1px); }
.login-submit svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

label { display: grid; gap: 8px; margin-bottom: 19px; color: var(--ink); font-size: 13px; font-weight: 600; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; outline: none; padding: 12px 14px; color: var(--heading); background: white; transition: border-color .18s, box-shadow .18s; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(77,163,230,.12); }
input[readonly] { cursor: default; color: var(--teal-dark); background: var(--teal-soft); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 43px; border: 0; border-radius: 10px; padding: 10px 17px; font-weight: 600; transition: transform .15s, background .15s, opacity .15s, box-shadow .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.primary { color: white; background: var(--teal); }
.button.primary:hover:not(:disabled) { background: var(--teal-dark); }
.button.accent { color: white; background: var(--green); box-shadow: 0 8px 18px rgba(91,150,63,.20); }
.button.accent:hover:not(:disabled) { background: var(--green-dark); box-shadow: 0 10px 22px rgba(91,150,63,.26); }
.button.secondary { color: var(--teal-dark); border: 1px solid #b9daf1; background: #f7fcff; }
.button.secondary:hover:not(:disabled) { background: var(--teal-soft); }
.button.ghost { color: white; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); }
.button.danger { color: white; background: var(--danger); }
.button.small { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.wide { width: 100%; }
.form-error { min-height: 0; margin: 14px 0 0; color: var(--danger); font-size: 13px; }
.form-error:not(:empty) { border: 1px solid #fecaca; border-radius: 10px; padding: 11px 13px; background: #fef2f2; }

.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 24px 18px; color: white; background: linear-gradient(180deg, #66b6ef 0%, #4da3e6 60%, #4398d7 100%); box-shadow: 9px 0 35px rgba(57,137,196,.12); }
.brand { min-height: 82px; padding: 0 8px 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-logo-wrap { position: relative; display: block; width: 100%; height: 76px; overflow: visible; background: transparent; }
.sidebar-logo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.main-nav { display: grid; gap: 5px; padding-top: 25px; }
.nav-label { padding: 14px 12px 7px; color: rgba(255,255,255,.6); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 10px; padding: 11px 12px; color: rgba(255,255,255,.82); background: transparent; text-align: left; font-weight: 600; }
.nav-button span { display: grid; place-items: center; width: 24px; font-size: 16px; }
.nav-button:hover, .nav-button.active { color: #2f79ad; background: rgba(255,255,255,.92); }
.nav-button.active { box-shadow: 0 8px 20px rgba(43,118,170,.12); }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.24); padding: 18px 8px 2px; }
.sidebar-footer p { margin: 0 0 4px; color: white; font-size: 10px; font-weight: 600; }
.sidebar-footer small { display: block; overflow: hidden; color: rgba(255,255,255,.65); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.user-mini { display: flex; align-items: center; gap: 11px; padding: 18px 4px; }
.user-mini > span { display: grid; place-items: center; width: 36px; height: 36px; color: var(--navy); background: var(--teal); border-radius: 50%; font-weight: 900; }
.user-mini strong, .user-mini small { display: block; max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini small { margin-top: 2px; color: #8da5b4; font-size: 11px; }

.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; gap: 18px; height: 88px; padding: 0 36px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.topbar h2 { margin: 0; color: var(--heading); font-size: 25px; font-weight: 600; }
.topbar .eyebrow { margin-bottom: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-user { display: flex; align-items: center; gap: 10px; border-left: 1px solid var(--line); padding-left: 14px; }
.topbar-user > span:first-child { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--teal), #73bced); font-weight: 700; }
.topbar-user strong, .topbar-user small { display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user strong { color: var(--heading); font-size: 12px; font-weight: 600; }
.topbar-user small { color: var(--muted); font-size: 10px; }
.logout-button { min-height: 38px; padding: 8px 13px; }
.role-chip, .status { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; color: #4f8a37; background: var(--green-soft); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; font-size: 18px; }
#menu-button { display: none; }
.view { padding: 35px 38px 48px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading h3 { margin-bottom: 5px; color: var(--heading); font-size: 25px; font-weight: 600; }
.section-heading p:last-child { margin-bottom: 0; }
.section-heading.compact { align-items: center; margin-bottom: 18px; }
.section-heading.compact h3 { font-size: 21px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--paper); box-shadow: var(--shadow); }

.branding-form { display: grid; gap: 22px; }
.branding-name { max-width: 620px; margin: 0; }
.branding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.branding-asset-card { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 14px; padding: 17px; background: #fbfdff; }
.branding-asset-card > span:first-child { color: var(--heading); font-weight: 600; }
.branding-asset-card small, .branding-actions small { color: var(--muted); font-weight: 400; }
.branding-preview { display: grid; place-items: center; height: 130px; overflow: hidden; border: 1px dashed #bdd6e8; border-radius: 11px; padding: 14px; background: white; }
.branding-preview img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.branding-preview.favicon-preview img { width: 64px; height: 64px; }
.branding-asset-card input[type="file"] { padding: 9px; font-size: 12px; }
.branding-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-top: 20px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 25px; }
.stat-card { position: relative; overflow: hidden; min-height: 142px; }
.stat-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -34px; bottom: -40px; border-radius: 50%; background: rgba(77,163,230,.10); }
.stat-card span { display: block; margin-bottom: 25px; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-card strong { display: block; color: var(--heading); font-size: 29px; font-weight: 600; }
.stat-card small { color: var(--muted); }
.stats-grid .stat-card:first-child { border-top: 3px solid var(--teal); }
.stats-grid .stat-card:nth-child(2) { border-color: #d5e9cb; border-top: 3px solid var(--green); background: linear-gradient(145deg, #ffffff 28%, #f2faee); }
.stats-grid .stat-card:nth-child(2)::after { background: rgba(121,184,90,.14); }
.stats-grid .stat-card:nth-child(2) strong { color: var(--green-dark); }
.stats-grid .stat-card:nth-child(3) { border-top: 3px solid #8bc8ef; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; }
.dashboard-grid > .card:nth-child(2) { border-color: #d5e9cb; background: linear-gradient(145deg, #ffffff, #f1f9ed); }
.dashboard-grid > .card:nth-child(2) .eyebrow { color: var(--green-dark); }
.quick-actions { display: grid; gap: 10px; }
.quick-action { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 11px; padding: 14px; color: var(--ink); background: white; text-align: left; font-weight: 750; }
.quick-action:hover { border-color: var(--teal); }

.toolbar { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; box-shadow: none; }
.toolbar label { margin: 0; }
.grow { flex: 1; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 14px; }
.ticket-card { display: flex; flex-direction: column; min-height: 205px; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: white; }
.ticket-card:hover { border-color: #bfd477; box-shadow: var(--shadow); }
.ticket-code { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.ticket-card h4 { margin: 16px 0 6px; color: var(--heading); font-size: 19px; font-weight: 600; }
.ticket-type { color: var(--muted); font-size: 12px; }
.ticket-price { margin: auto 0 13px; padding-top: 20px; font-size: 18px; font-weight: 900; }
.cart { position: sticky; top: 112px; }
.count-badge { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; color: white; background: var(--green); font-size: 12px; font-weight: 700; }
.cart-items { display: grid; gap: 12px; min-height: 90px; }
.cart-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cart-row strong, .cart-row small { display: block; }
.cart-row small { margin-top: 3px; color: var(--muted); }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-control button { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.cart-total { display: flex; justify-content: space-between; margin: 18px 0; padding-top: 15px; border-top: 1px solid var(--line); font-size: 18px; }
.empty-state { min-height: 220px; place-items: center; padding: 35px; border: 1px dashed #b9c8d2; border-radius: 14px; color: var(--muted); }

.booking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.order-summary { margin: 8px 0 20px; border-radius: 11px; padding: 16px; background: #f5f8fa; }
.order-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.order-line:last-child { border: 0; font-weight: 900; }
.promotion-saving strong { color: var(--green-dark); }
.promotion-summary { display: grid; gap: 8px; margin-top: 12px; border: 1px solid #cfe6c4; border-radius: 11px; padding: 12px; background: #f3faef; }
.promotion-summary > strong { color: var(--green-dark); }
.promotion-summary span { display: flex; justify-content: space-between; gap: 12px; color: var(--text); }
.promotion-summary small { color: var(--muted); }
.wallet-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; border: 1px solid #cfe6c4; border-radius: 11px; padding: 13px; background: #f3faef; }
.wallet-preview > div { min-width: 0; }
.wallet-preview span, .wallet-preview strong { display: block; }
.wallet-preview span { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 600; }
.wallet-preview strong { overflow-wrap: anywhere; color: var(--heading); font-size: 14px; }
.wallet-preview .projected-balance { color: var(--green-dark); }
.wallet-preview.insufficient { border-color: #f3c7c2; background: #fff4f2; }
.wallet-preview.insufficient .projected-balance { color: var(--danger); }
.wallet-preview-message { grid-column: 1 / -1; margin: 0; border-top: 1px solid rgba(121,184,90,.22); padding-top: 9px; color: var(--green-dark); font-size: 11px; }
.wallet-preview.insufficient .wallet-preview-message { border-top-color: #f3c7c2; color: var(--danger); }
.redeem-card { position: sticky; top: 112px; border-color: #cfe6c4; background: linear-gradient(150deg, #ffffff 35%, #f1f9ed); }
.redeem-card .eyebrow { color: var(--green-dark); }
.redeem-card > .muted { line-height: 1.6; }
.redeem-mode-fieldset { margin: 0 0 19px; border: 0; padding: 0; }
.redeem-mode-fieldset legend { margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 600; }
.redeem-mode-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.redeem-mode-toggle label { position: relative; display: block; margin: 0; cursor: pointer; }
.redeem-mode-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.redeem-mode-toggle span { display: block; min-height: 70px; border: 1px solid var(--line); border-radius: 10px; padding: 11px; color: var(--heading); background: white; }
.redeem-mode-toggle small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.35; }
.redeem-mode-toggle input:checked + span { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 2px rgba(121,184,90,.12); }
#redeem-qr-list { min-height: 150px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.55; }
#redeem-qr-hint.invalid { color: var(--danger); }
.redeem-result { margin-top: 18px; }
.ticket-result { margin-top: 10px; border: 1px solid #d4e5a3; border-radius: 10px; padding: 13px; background: #f6f9ea; }
.qr-code { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.booking-history-card { margin-top: 20px; padding: 0; overflow: hidden; }
.booking-history-card > .section-heading { padding: 22px; }
.history-actions { display: flex; align-items: center; gap: 9px; }
.history-actions select { min-width: 155px; }
.booking-history-list { display: grid; gap: 14px; padding: 0 22px 22px; }
.booking-history-item { border: 1px solid var(--line); border-radius: 13px; padding: 18px; background: #fff; }
.booking-history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.booking-history-head h4 { margin: 9px 0 3px; color: var(--heading); font-size: 19px; font-weight: 600; }
.booking-history-head p { margin: 0; color: var(--muted); font-size: 13px; }
.booking-history-total { text-align: right; }
.booking-history-total span, .booking-history-total strong { display: block; }
.booking-history-total span { color: var(--muted); font-size: 11px; }
.booking-history-total strong { margin-top: 5px; font-size: 18px; }
.booking-history-buttons { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.booking-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 17px 0; padding: 13px; border-radius: 10px; background: #f7f9fa; font-size: 12px; }
.booking-meta span, .booking-meta small { display: block; overflow-wrap: anywhere; }
.booking-meta small { margin-bottom: 4px; color: var(--muted); }
.transaction-detail { margin-bottom: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.transaction-detail summary { cursor: pointer; color: var(--teal); font-weight: 800; font-size: 12px; }
.history-detail-body { display: grid; gap: 16px; padding-top: 14px; }
.history-detail-section > strong { display: block; margin-bottom: 6px; }
.issued-ticket { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 9px; border: 1px solid var(--line); border-radius: 9px; padding: 11px; font-size: 12px; }
.issued-ticket code { grid-column: 1 / -1; overflow-wrap: anywhere; color: var(--muted); }
.history-note { margin: 0; border-radius: 8px; padding: 10px; background: #fff8e6; }
.status.outstanding { color: #8a5b0a; background: #fff3d5; }
.status.redeemed { color: #087443; background: #e0f7eb; }

.wallet-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px; }
.balance-card { display: flex; align-items: center; justify-content: space-between; min-height: 108px; border-color: #cfe8f8; padding: 20px 24px; color: var(--ink); background: linear-gradient(115deg, #eff9ff, #ffffff 62%, #f2faee); box-shadow: 0 10px 30px rgba(77,163,230,.08); }
.balance-card span { color: var(--muted); font-size: 12px; font-weight: 500; }
.balance-card strong { display: block; margin-top: 5px; color: var(--teal-dark); font-size: clamp(26px, 3vw, 36px); font-weight: 600; }
.balance-card small { border-radius: 999px; padding: 7px 11px; color: #4f8a37; background: var(--green-soft); font-size: 11px; font-weight: 600; }
.topup-card, #topup-form { border-color: #d5e9cb; background: linear-gradient(145deg, #ffffff 48%, #f3faef); }
.form-stack { display: grid; grid-template-columns: 1fr 1fr 1.15fr auto; align-items: end; gap: 14px; }
.form-stack label { margin: 0; }
.topup-heading { grid-column: 1 / -1; }
.topup-heading h3 { margin-bottom: 5px; color: var(--heading); font-size: 20px; font-weight: 600; }
.topup-heading p:last-child { margin-bottom: 3px; }
.topup-submit { min-width: 155px; margin-bottom: 0; }
#topup-notes { min-height: 44px; height: 44px; resize: vertical; }
.table-card { padding: 0; overflow: hidden; }
.wallet-ledger-card { margin-bottom: 20px; }
.wallet-ledger-filters select { min-width: 145px; }
.table-card .section-heading { padding: 22px 22px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 13px; }
th { color: var(--muted); background: #f8fafb; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
.status.pending { color: #8a5b0a; background: #fff3d5; }
.status.approved { color: #087443; background: #e0f7eb; }
.status.rejected { color: #a2261e; background: #fde9e7; }
.status.user-admin { color: #146c94; background: #e3f3fb; }
.status.user-agent { color: #087443; background: #e0f7eb; }
.status.user-pos { color: #8a5b0a; background: #fff3d5; }
.table-actions { display: flex; gap: 7px; }
.ledger-type { color: var(--heading); font-weight: 600; }
.ledger-reference { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.ledger-amount { font-weight: 700; }
.ledger-amount.credit { color: var(--green-dark); }
.ledger-amount.debit { color: var(--danger); }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding: 14px 18px; color: var(--muted); font-size: 12px; }
.pagination-actions { display: flex; gap: 8px; }
.pagination-controls { display: flex; align-items: center; gap: 12px; }
.pagination-size { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; font-weight: 500; }
.pagination-size select { width: auto; min-width: 72px; padding: 7px 28px 7px 9px; font-size: 12px; }

.ticketing-admin-card { padding: 0; overflow: hidden; }
.ticketing-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); padding: 14px 18px 0; background: linear-gradient(180deg, #f9fcff, #fff); }
.ticketing-tab { flex: 0 0 auto; border: 0; border-bottom: 3px solid transparent; padding: 12px 16px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 600; }
.ticketing-tab:hover { color: var(--teal-dark); }
.ticketing-tab.active { border-bottom-color: var(--green); color: var(--green-dark); }
.ticketing-toolbar { display: flex; align-items: end; gap: 12px; padding: 18px; }
.ticketing-toolbar label { min-width: 240px; margin: 0; }
.ticketing-table-summary { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 13px 18px; color: var(--muted); background: #fbfdff; font-size: 12px; }
.ticketing-table-summary strong { color: var(--green-dark); }
.notice { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; color: var(--muted); background: #fff; font-size: 13px; }
.notice.warning { border-color: #efd38b; color: #715613; background: #fff9e8; }
.checkbox-line { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.checkbox-line input { width: auto; }
.ticketing-ticket-list { max-width: 320px; white-space: normal; line-height: 1.55; }
.ticketing-dialog { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 40px); border: 1px solid var(--line); border-radius: 18px; padding: 0; color: var(--ink); background: white; box-shadow: 0 30px 90px rgba(44, 92, 125, .25); }
.merchant-dialog { width: min(940px, calc(100vw - 32px)); }
.ticketing-dialog::backdrop { background: rgba(37, 62, 80, .48); backdrop-filter: blur(3px); }
.ticketing-dialog form { margin: 0; }
.dialog-heading { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding: 20px 24px; background: rgba(255,255,255,.96); }
.dialog-heading h3 { margin: 0; font-size: 22px; }
.ticketing-form-fields { max-height: calc(100vh - 220px); overflow-y: auto; padding: 24px; }
.ticketing-form-fields select[multiple] { min-height: 150px; }
.nested-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f7fbff; }
.nested-form-grid .ticketing-picker { grid-column: 1 / -1; }
.ticketing-picker { border: 1px solid var(--line); border-radius: 13px; padding: 14px; background: #fbfdff; }
.ticketing-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ticketing-picker-heading label { margin: 0; }
.ticketing-picker-heading strong { color: var(--green-dark); font-size: 12px; }
.ticketing-picker-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 8px; }
.ticketing-picker-toolbar input { min-width: 0; }
.ticketing-picker-selected { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; padding: 10px 0; }
.ticketing-picker-selected span { border-radius: 999px; padding: 5px 9px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 600; }
.ticketing-picker-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 270px; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.ticketing-picker-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; margin: 0; border: 1px solid transparent; border-radius: 9px; padding: 9px 10px; color: var(--ink); background: white; cursor: pointer; font-size: 12px; font-weight: 500; }
.ticketing-picker-option[hidden] { display: none; }
.ticketing-picker-option:hover { border-color: var(--teal); background: #f2fbff; }
.ticketing-picker-option:has(input:checked) { border-color: #8acb65; background: var(--green-soft); }
.ticketing-picker-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.ticketing-picker-option span { overflow: hidden; text-overflow: ellipsis; }
.ticketing-picker-option span strong, .ticketing-picker-option span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticketing-picker-option span small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.ticketing-picker-option code { color: var(--muted); font-size: 10px; }
.ticketing-picker-result-count { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.field-help { color: var(--muted); font-size: 10px; font-weight: 400; }
.dialog-actions { position: sticky; z-index: 2; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding: 16px 24px; background: rgba(255,255,255,.97); }

.audit-toolbar { flex-wrap: wrap; }
.audit-toolbar label { min-width: 145px; }
.audit-toolbar label.grow { min-width: 290px; }
.audit-route { max-width: 360px; white-space: normal; }
.audit-route code, .audit-route small { overflow-wrap: anywhere; white-space: normal; }
.status.audit-action { color: #146c94; background: var(--teal-soft); }
.audit-dialog { width: min(920px, calc(100vw - 32px)); }
.audit-detail-body { display: grid; gap: 18px; max-height: calc(100vh - 150px); overflow-y: auto; padding: 24px; }
.audit-detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.audit-detail-meta div { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fbfdff; }
.audit-detail-meta div.full { grid-column: 1 / -1; }
.audit-detail-meta span, .audit-detail-meta strong { display: block; overflow-wrap: anywhere; }
.audit-detail-meta span { margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.audit-detail-meta strong { color: var(--heading); font-size: 12px; font-weight: 600; }
.audit-detail-section > strong { display: block; margin-bottom: 8px; color: var(--heading); font-size: 12px; }
.audit-detail-section pre { max-height: 280px; overflow: auto; margin: 0; border-radius: 10px; padding: 14px; color: #dbeafa; background: #263747; font: 11px/1.65 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-detail-section p { overflow-wrap: anywhere; margin: 0; font-size: 11px; }

.issued-ticket-dialog { width: min(980px, calc(100vw - 32px)); }
.issued-ticket-toolbar { flex-wrap: wrap; }
.issued-ticket-toolbar label:not(.grow) { min-width: 155px; }
.issued-ticket-detail-body { display: grid; gap: 22px; max-height: calc(100vh - 125px); overflow-y: auto; padding: 24px; }
.issued-ticket-section { min-width: 0; }
.section-heading.compact { margin-bottom: 12px; }
.section-heading.compact h3 { font-size: 17px; }
.issued-ticket-components { display: grid; gap: 9px; }
.issued-ticket-status-actions { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #fbfdff; }
.issued-ticket-status-actions p { margin: 0; }
.issued-ticket-component { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #fbfdff; }
.issued-ticket-component strong, .issued-ticket-component small { display: block; overflow-wrap: anywhere; }
.issued-ticket-component small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.issued-ticket-reschedule-form { display: grid; grid-template-columns: minmax(220px, 1.3fr) minmax(170px, .7fr) minmax(220px, 1fr) auto; align-items: end; gap: 12px; border: 1px solid #cde6bf; border-radius: 14px; padding: 18px; background: var(--green-soft); }
.issued-ticket-reschedule-form h3 { margin: 0 0 4px; font-size: 17px; }
.issued-ticket-reschedule-form p { margin-bottom: 0; }
.issued-ticket-reschedule-form label { margin: 0; }
.issued-ticket-reschedule-form textarea { min-height: 76px; resize: vertical; }
.issued-booking-action-form { display: flex; align-items: end; gap: 12px; }
.issued-booking-action-form label { min-width: 190px; margin: 0; }
.issued-booking-action-form label.grow { flex: 1; }
.issued-booking-action-form textarea { min-height: 76px; resize: vertical; }
.issued-booking-ticket-list { display: grid; gap: 10px; }
.issued-booking-ticket-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.issued-booking-ticket-list-heading .checkbox-line { min-height: 0; margin: 0; }
.issued-booking-ticket-list table { min-width: 700px; }
.selection-column { width: 68px; text-align: center; }
.selection-column input { width: 18px; height: 18px; }
.issued-booking-mid-list { overflow-wrap: anywhere; }

.validation-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 20px; align-items: start; }
.validation-control-card { min-width: 0; }
.validation-mode-fieldset { margin: 0 0 19px; border: 0; padding: 0; }
.validation-mode-fieldset legend { margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 600; }
.validation-mode-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.validation-mode-toggle label { display: block; margin: 0; cursor: pointer; }
.validation-mode-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.validation-mode-toggle span { display: block; min-height: 78px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; color: var(--heading); background: white; }
.validation-mode-toggle span small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.5; }
.validation-mode-toggle input:checked + span { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.validation-mode-toggle label:last-child input:checked + span { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.validation-camera { position: relative; isolation: isolate; display: grid; place-items: center; aspect-ratio: 4 / 3; max-height: 520px; overflow: hidden; border-radius: 15px; color: white; background: #263747; }
.validation-camera video { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.validation-camera.active video { opacity: 1; }
.validation-camera-placeholder { display: grid; gap: 7px; text-align: center; }
.validation-camera-placeholder strong { color: white; font-size: 19px; }
.validation-camera-placeholder span { color: #bfceda; font-size: 12px; }
.validation-camera.active .validation-camera-placeholder { display: none; }
.validation-scan-frame { display: none; width: min(62%, 300px); aspect-ratio: 1; border: 3px solid rgba(255,255,255,.88); border-radius: 18px; box-shadow: 0 0 0 999px rgba(20,35,48,.28); }
.validation-camera.active .validation-scan-frame { display: block; }
.validation-camera-actions { display: flex; gap: 9px; margin-top: 12px; }
.validation-manual-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.validation-manual-form label { margin: 0; }
.validation-camera-note { margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.validation-result-card { position: sticky; top: 112px; min-width: 0; }
.validation-result-empty { display: grid; place-items: center; min-height: 330px; border: 1px dashed var(--line); border-radius: 13px; padding: 28px; text-align: center; }
.validation-result-empty strong { margin-bottom: 7px; }
.validation-result-empty span { color: var(--muted); font-size: 12px; line-height: 1.65; }
.validation-result-state { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fbfdff; }
.validation-result-state.success { border-color: #bcdcad; background: var(--green-soft); }
.validation-result-state.warning { border-color: #f0d39a; background: #fff9eb; }
.validation-result-state.error { border-color: #edc2bd; background: #fff4f2; }
.validation-result-status { display: inline-flex; margin-bottom: 12px; border-radius: 999px; padding: 6px 10px; color: var(--heading); background: white; font-size: 10px; font-weight: 700; }
.validation-result-state h3 { font-size: 19px; line-height: 1.45; }
.validation-result-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.validation-result-meta div { min-width: 0; border-radius: 9px; padding: 10px; background: rgba(255,255,255,.72); }
.validation-result-meta dt { color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.validation-result-meta dd { overflow-wrap: anywhere; margin: 4px 0 0; color: var(--heading); font-size: 11px; font-weight: 600; }
.validation-match-note { margin: 0 0 10px; font-size: 11px; }
.validation-components { display: grid; gap: 7px; }
.validation-component { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; border: 1px solid rgba(190,207,219,.75); border-radius: 10px; padding: 10px; background: white; }
.validation-component.selected { border-color: var(--green); }
.validation-component strong, .validation-component small { display: block; overflow-wrap: anywhere; }
.validation-component strong { font-size: 11px; }
.validation-component small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.validation-component .full { grid-column: 1 / -1; }
.validation-component-status { align-self: start; border-radius: 999px; padding: 4px 7px; color: var(--muted); background: #f0f3f5; font-size: 8px; font-weight: 700; }
.validation-component-status.ready { color: var(--green-dark); background: var(--green-soft); }
.validation-component-status.used, .validation-component-status.expired, .validation-component-status.void, .validation-component-status.refunded { color: var(--danger); background: #fde9e7; }
.validation-history-card { margin-top: 20px; padding: 0; overflow: hidden; }
.validation-history-card > .section-heading { padding: 20px 22px 0; }
.validation-history { display: grid; padding: 0 22px 20px; }
.validation-history-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; border-top: 1px solid var(--line); padding: 12px 0; }
.validation-history-item:first-child { border-top: 0; }
.validation-history-item strong, .validation-history-item small { display: block; }
.validation-history-item small, .validation-history-item time { margin-top: 3px; color: var(--muted); font-size: 10px; }
.validation-history-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.validation-history-dot.success { background: var(--green); }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 420px; border-radius: 11px; padding: 14px 18px; color: white; background: var(--navy); box-shadow: 0 18px 50px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transform: translateY(15px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: -270px; width: 248px; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 15px 0 50px rgba(0,0,0,.18); }
  #menu-button { display: grid; }
  .ticket-layout, .booking-layout, .validation-layout { grid-template-columns: 1fr; }
  .cart, .redeem-card, .validation-result-card { position: static; }
  .form-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topup-heading { grid-column: 1 / -1; }
  .topup-submit { width: 100%; }
  .ticketing-toolbar { align-items: stretch; flex-direction: column; }
  .ticketing-toolbar label { width: 100%; min-width: 0; }
}

@media (max-width: 720px) {
  .history-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .booking-history-head { flex-direction: column; }
  .booking-history-total { text-align: left; }
  .booking-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .login-screen { padding: 30px 18px; }
  .login-visual img { object-position: center bottom; }
  .login-logo { width: min(100%, 300px); max-height: 125px; height: auto; }
  .login-heading h1 { font-size: 27px; }
  .login-card { padding: 22px; }
  .topbar { height: 80px; padding: 0 18px; }
  .topbar h2 { font-size: 22px; }
  .view { padding: 24px 16px 40px; }
  .stats-grid, .dashboard-grid, .wallet-grid, .form-grid, .branding-grid, .nested-form-grid { grid-template-columns: 1fr; }
  .branding-actions { align-items: stretch; flex-direction: column; }
  .branding-actions .button { width: 100%; }
  .form-stack { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .ticketing-form-fields .full { grid-column: auto; }
  .ticketing-picker-toolbar { grid-template-columns: 1fr; }
  .ticketing-picker-options { grid-template-columns: 1fr; }
  .topup-heading { grid-column: auto; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .role-chip { display: none; }
  .topbar-user div { display: none; }
  .logout-button { min-width: 0; padding-inline: 10px; }
  .balance-card { align-items: flex-start; flex-direction: column; gap: 12px; }
  .wallet-preview { grid-template-columns: 1fr; }
  .wallet-preview-message { grid-column: auto; }
  .pagination-bar { align-items: stretch; flex-direction: column; }
  .pagination-controls { align-items: stretch; flex-direction: column; }
  .pagination-actions .button { flex: 1; }
  .validation-mode-toggle, .validation-result-meta, .validation-manual-form { grid-template-columns: 1fr; }
  .audit-detail-meta { grid-template-columns: 1fr; }
  .audit-detail-meta div.full { grid-column: auto; }
  .issued-ticket-component, .issued-ticket-reschedule-form { grid-template-columns: 1fr; }
  .issued-booking-action-form { align-items: stretch; flex-direction: column; }
  .issued-booking-action-form label { width: 100%; min-width: 0; }
  .issued-ticket-component .button, .issued-ticket-reschedule-form .button { width: 100%; }
  .validation-camera-actions .button, .validation-manual-form .button { width: 100%; }
}
