:root {
  --bg: #060918;
  --bg-2: #0b1030;
  --panel: rgba(13, 19, 48, 0.66);
  --panel-2: rgba(22, 30, 70, 0.6);
  --line: rgba(140, 170, 255, 0.16);
  --line-2: rgba(140, 170, 255, 0.3);
  --text: #eaf0ff;
  --muted: #9aa6cf;
  --cyan: #38d6ff;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --magenta: #e45cf5;
  --gold: #fbbf24;
  --ok: #34d399;
  --danger: #fb7185;
  --grad: linear-gradient(110deg, var(--cyan), var(--violet) 55%, var(--magenta));
  --radius: 18px;
  --font: "Outfit", "Noto Sans Sinhala", system-ui, sans-serif;
  --font-d: "Orbitron", "Noto Sans Sinhala", "Outfit", sans-serif;
  color-scheme: dark;
}
html[lang="si"] { --font: "Noto Sans Sinhala", "Outfit", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--font); overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { width: 1em; height: 1em; fill: currentColor; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.gold { color: var(--gold); font-family: var(--font-d); letter-spacing: .08em; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-img {
  position: absolute; inset: -20px; background: url(/assets/background.webp) center/cover no-repeat;
  filter: blur(6px) saturate(1.2) brightness(.32);
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(1200px 600px at 15% -10%, rgba(59,130,246,.35), transparent 60%),
              radial-gradient(900px 600px at 100% 20%, rgba(228,92,245,.22), transparent 60%),
              linear-gradient(180deg, rgba(6,9,24,.35), rgba(6,9,24,.92) 70%);
}
.bg-grid {
  position: absolute; inset: 0; z-index: 1; opacity: .35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
.orb { position: absolute; z-index: 1; width: 420px; height: 420px; border-radius: 50%; filter: blur(90px); opacity: .45; animation: drift 18s ease-in-out infinite alternate; }
.orb-a { background: var(--violet); top: 30%; left: -140px; }
.orb-b { background: var(--cyan); bottom: -160px; right: -120px; animation-delay: -9s; opacity: .3; }
@keyframes drift { to { transform: translate(120px, -80px) scale(1.15); } }

.glass {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc((100vw - 1200px) / 2)); background: rgba(6,9,24,.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand img { height: 42px; width: auto; filter: drop-shadow(0 0 12px rgba(139,92,246,.5)); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); padding: 8px 14px; border-radius: 999px; font-weight: 500; transition: .2s; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.lang { display: flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(0,0,0,.25); }
.lang button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); }
.lang button.on { background: var(--grad); color: #fff; box-shadow: 0 0 18px rgba(139,92,246,.6); }
body.admin .nav { visibility: hidden; }

/* ---------- buttons / fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  padding: 11px 22px; border-radius: 12px; font-weight: 600; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s;
  white-space: nowrap; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 30px -8px rgba(139,92,246,.8); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 40px -6px rgba(56,214,255,.75); }
.btn-ghost { background: rgba(255,255,255,.05); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-danger { background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.4); color: var(--danger); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: .85rem; font-weight: 500; color: var(--muted); }
.field input, .field textarea, .field select, .toolbar select, .stepper {
  width: 100%; background: rgba(4,8,26,.6); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus, .field select:focus, .toolbar select:focus, .stepper:focus-within {
  border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,214,255,.18);
}
.field.bad input, .field.bad textarea, .field.bad select { border-color: var(--danger); }
.field select { appearance: auto; cursor: pointer; }
.field select option, .toolbar select option { background: var(--bg-2); color: var(--text); }
.err { color: var(--danger); font-size: .8rem; font-style: normal; min-height: 0; }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.stepper { display: flex; align-items: center; padding: 4px; }
.stepper button { width: 40px; height: 40px; border: 0; border-radius: 9px; background: rgba(255,255,255,.07); font-size: 1.3rem; cursor: pointer; }
.stepper button:hover { background: rgba(139,92,246,.35); }
.stepper input { flex: 1; min-width: 0; border: 0; background: none; text-align: center; font-family: var(--font-d); font-size: 1.15rem; outline: none; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- hero ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 48px 0 56px; }
.hero-logo { width: min(560px, 100%); height: auto; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 0 40px rgba(99,102,241,.55)); }
@keyframes float { 50% { transform: translateY(-10px); } }
.kicker { font-size: clamp(1.1rem, 2.4vw, 1.45rem); font-weight: 600; margin: 8px 0 18px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.date-chips { display: flex; gap: 12px; flex-wrap: wrap; }
.chip { display: inline-flex; flex-direction: column; padding: 10px 18px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.3); }
.chip b { font-family: var(--font-d); font-size: 1.35rem; letter-spacing: .06em; }
.chip small { color: var(--muted); font-size: .8rem; }
.chip-gold { border-color: rgba(251,191,36,.45); background: linear-gradient(135deg, rgba(127,29,29,.55), rgba(69,10,10,.55)); }
.chip-gold b { color: var(--gold); text-shadow: 0 0 18px rgba(251,191,36,.5); }
.venue { display: flex; gap: 8px; align-items: center; color: var(--muted); margin: 18px 0 24px; }
.venue svg { color: var(--magenta); font-size: 1.2rem; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.countdown-card { padding: 28px; position: relative; overflow: hidden; }
.countdown-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7;
}
.cd-head { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .02em; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52,211,153,.7); animation: pulse 1.8s infinite; }
.closed .pulse { background: var(--danger); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0 16px; }
.cd-seg { display: flex; flex-direction: column; align-items: center; padding: 14px 4px 10px; border-radius: 14px; background: rgba(4,8,26,.7); border: 1px solid var(--line); }
.cd-num { font-family: var(--font-d); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #fff, #9cc8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cd-lbl { margin-top: 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
html[lang="si"] .cd-lbl { text-transform: none; letter-spacing: 0; font-size: .8rem; }
.cd-deadline { text-align: center; margin: 0 0 18px; color: var(--muted); }
.cd-deadline b { color: var(--gold); }
.counter-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: rgba(251,191,36,.08); border: 1px dashed rgba(251,191,36,.4); font-size: .92rem; }
.counter-note svg { color: var(--gold); font-size: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.7; margin-top: 1px; }

/* ---------- sections / master-detail ---------- */
.section { padding: 32px 0 48px; }
.section-head { margin-bottom: 22px; }
.section-head h2 { margin: 0 0 6px; font-family: var(--font-d); font-size: clamp(1.35rem, 3vw, 1.9rem); letter-spacing: .02em; }
html[lang="si"] .section-head h2 { font-family: var(--font); font-weight: 800; }
.section-head p { margin: 0; color: var(--muted); max-width: 680px; }

.md { display: grid; grid-template-columns: 360px 1fr; overflow: hidden; min-height: 420px; }
.md-master { padding: 22px; border-right: 1px solid var(--line); background: rgba(4,8,26,.35); }
.md-detail { padding: 26px; min-width: 0; }
.md-label { margin: 0 0 14px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--cyan); }
html[lang="si"] .md-label { text-transform: none; letter-spacing: .02em; font-size: .9rem; }

.day-list { display: flex; flex-direction: column; gap: 10px; }
.day-card {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); transition: .2s;
}
.day-card:hover { border-color: var(--line-2); background: rgba(255,255,255,.06); transform: translateX(3px); }
.day-card[aria-checked="true"] { border-color: transparent; background: linear-gradient(rgba(16,22,58,.95), rgba(16,22,58,.95)) padding-box, var(--grad) border-box; box-shadow: 0 0 28px -6px rgba(139,92,246,.7); }
.day-date { display: grid; place-items: center; min-width: 64px; height: 58px; border-radius: 12px; background: linear-gradient(135deg, #7f1d1d, #3f0a0a); border: 1px solid rgba(251,191,36,.35); line-height: 1; }
.day-date b { font-family: var(--font-d); color: var(--gold); font-size: 1.3rem; }
.day-date b i { font-style: normal; font-family: var(--font); font-weight: 800; font-size: .95rem; color: #fde68a; margin: 0 2px; }
.day-date small { font-size: .65rem; letter-spacing: .2em; color: #fde68a; margin-top: -8px; }
.day-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.day-info small { color: var(--muted); font-size: .8rem; }
.day-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; transition: .2s; }
.day-card[aria-checked="true"] .day-tick { border-color: var(--cyan); background: radial-gradient(var(--cyan) 45%, transparent 50%); box-shadow: 0 0 12px var(--cyan); }

.steps { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps span { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .8rem; font-weight: 700; background: rgba(139,92,246,.2); border: 1px solid rgba(139,92,246,.5); color: #d8c8ff; }
.steps p { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.steps li:last-child p { color: var(--gold); }

.sel-day { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; margin-bottom: 18px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px dashed var(--line-2); color: var(--muted); font-size: .9rem; }
.sel-day.on { border-style: solid; border-color: rgba(56,214,255,.5); color: var(--text); background: rgba(56,214,255,.08); }
.sel-day.on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.sel-day.shake { animation: shake .4s; border-color: var(--danger); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span2 { grid-column: span 2; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.fine { margin: 0; font-size: .82rem; color: var(--muted); max-width: 340px; }
.closed-banner { margin-top: 18px; padding: 14px; border-radius: 12px; background: rgba(251,113,133,.1); border: 1px solid rgba(251,113,133,.4); color: #fecdd3; text-align: center; }
form.is-closed .grid2, form.is-closed .form-foot { opacity: .4; pointer-events: none; }

/* ticket types + total */
.tix { display: flex; flex-direction: column; gap: 8px; }
.tix-label { font-size: .85rem; font-weight: 500; color: var(--muted); }
.tix-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tix-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(4,8,26,.55); border: 1px solid var(--line-2); }
.tix-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, var(--blue), var(--violet)); }
.tix-ico.tix-kid { background: linear-gradient(135deg, var(--magenta), #f59e0b); font-size: 1.15rem; }
.tix-info { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.tix-info small { color: var(--muted); font-size: .8rem; }
.price { color: var(--gold); font-weight: 700; }
.tix-card .stepper { width: 132px; flex: none; padding: 3px; background: rgba(0,0,0,.25); }
.tix-card .stepper button { width: 34px; height: 34px; }
.total { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(127,29,29,.55), rgba(69,10,10,.55)); border: 1px solid rgba(251,191,36,.45); }
.total-lines { font-size: .88rem; color: #fde68a; display: flex; flex-direction: column; gap: 2px; }
.total-lines .dim { color: var(--muted); }
.total-sum { text-align: right; display: flex; flex-direction: column; line-height: 1.15; }
.total-sum b { font-family: var(--font-d); font-size: 1.6rem; color: var(--gold); text-shadow: 0 0 18px rgba(251,191,36,.45); }
.total-sum small { color: var(--muted); font-size: .75rem; }
.price-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.price-chips > span { padding: 6px 14px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--line-2); font-size: .9rem; }
.ticket-amt { font-family: var(--font-d); font-size: 1.3rem; color: #fff; }
.amt { font-family: var(--font-d); color: var(--gold); white-space: nowrap; }

/* stalls */
.stall-list { display: flex; flex-direction: column; gap: 12px; }
.stall-card { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px; border-radius: 16px; cursor: pointer;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); transition: .2s; }
.stall-card:hover { border-color: var(--line-2); background: rgba(255,255,255,.06); transform: translateX(3px); }
.stall-card[aria-pressed="true"] { border-color: transparent; background: linear-gradient(rgba(16,22,58,.95), rgba(16,22,58,.95)) padding-box, var(--grad) border-box; box-shadow: 0 0 28px -6px rgba(139,92,246,.7); }
.stall-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; flex: none; font-size: 1.6rem; color: #fff; background: linear-gradient(135deg, #b45309, #7f1d1d); border: 1px solid rgba(251,191,36,.4); }
.stall-ico-g { background: linear-gradient(135deg, #15803d, #065f46); }
.stall-info { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.stall-info small { color: var(--muted); font-size: .8rem; }
.stall-price { margin-top: 4px; }
.stall-price .price { font-family: var(--font-d); font-size: 1.05rem; }
.stall-count { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-family: var(--font-d); font-size: .9rem;
  border: 2px solid var(--line-2); color: var(--muted); }
.stall-card[aria-pressed="true"] .stall-count { border-color: var(--cyan); color: #fff; background: rgba(56,214,255,.2); box-shadow: 0 0 12px rgba(56,214,255,.5); }
.two-day-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: 12px; font-size: .86rem;
  background: rgba(56,214,255,.07); border: 1px solid rgba(56,214,255,.3); }
.two-day-note svg { color: var(--cyan); font-size: 1.15rem; margin-top: 1px; }
.ticket-stall { background: linear-gradient(120deg, #3b1d06, #1f1147 60%, #0b2a1f); }

/* admin tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; padding: 5px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.tab { border: 0; background: none; padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.tab b { font-family: var(--font-d); font-size: .78rem; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.08); }
.tab.on { background: var(--grad); color: #fff; box-shadow: 0 6px 24px -8px rgba(139,92,246,.8); }
.tab.on b { background: rgba(0,0,0,.25); }
.badge-pending { background: rgba(251,191,36,.12); color: var(--gold); border: 1px solid rgba(251,191,36,.35); }
.badge-confirmed { background: rgba(52,211,153,.12); color: var(--ok); border: 1px solid rgba(52,211,153,.35); }
.badge-stall { background: rgba(245,158,11,.16); color: #fcd34d; border: 1px solid rgba(245,158,11,.45); }
.biz { display: block; font-size: .8rem; color: var(--muted); }

/* success ticket */
.success { animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { opacity: 0; transform: scale(.95); } }
.success h3 { margin: 22px 0 10px; font-size: 1.5rem; }
.ticket { display: grid; grid-template-columns: 1fr auto; border-radius: 16px; overflow: hidden; background: linear-gradient(120deg, #1a1450, #0b1a48 60%, #1d0b44); border: 1px solid var(--line-2); position: relative; }
.ticket::after { content: ""; position: absolute; top: 0; bottom: 0; right: 200px; border-left: 2px dashed rgba(255,255,255,.25); }
.ticket-l { padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.ticket-l img { width: 140px; height: auto; margin-bottom: 8px; }
.ticket-ref { font-family: var(--font-d); font-size: clamp(1.3rem, 4vw, 1.9rem); letter-spacing: .08em; color: #fff; text-shadow: 0 0 16px rgba(56,214,255,.6); }
.ticket-r { width: 200px; padding: 20px; display: flex; flex-direction: column; justify-content: center; gap: 6px; text-align: center; background: rgba(0,0,0,.25); }
.ticket-day { font-family: var(--font-d); color: var(--gold); font-size: 1.05rem; }
html[lang="si"] .ticket-day { font-family: var(--font); font-weight: 700; }
.ticket-qty { font-size: .9rem; color: var(--muted); }
.go-counter { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; background: linear-gradient(135deg, rgba(127,29,29,.6), rgba(69,10,10,.6)); border: 1px solid rgba(251,191,36,.5); }
.go-counter svg { font-size: 2rem; color: var(--gold); }
.go-counter p { margin: 0; font-weight: 600; font-size: 1.05rem; }
.go-pay { display: block; margin-top: 4px; color: var(--gold); font-weight: 600; }

/* my reservations */
.lookup { display: flex; flex-direction: column; gap: 14px; }
.mine-summary { margin-top: 20px; padding: 16px; border-radius: 14px; background: rgba(56,214,255,.06); border: 1px solid rgba(56,214,255,.25); }
.mine-summary b { display: block; font-size: 1.1rem; }
.mine-summary .kv { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); margin-top: 6px; }
.mine-summary .kv span:last-child { color: var(--text); font-family: var(--font-d); }
.mine-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mine-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); animation: pop .35s both; }
.mine-list .ref { font-family: var(--font-d); letter-spacing: .06em; }
.mine-list .meta { color: var(--muted); font-size: .85rem; }
.empty { height: 100%; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); gap: 10px; }
.empty svg { font-size: 3rem; opacity: .35; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge-reserved { background: rgba(251,191,36,.12); color: var(--gold); border: 1px solid rgba(251,191,36,.35); }
.badge-issued { background: rgba(52,211,153,.12); color: var(--ok); border: 1px solid rgba(52,211,153,.35); }
.badge-day { background: rgba(139,92,246,.16); color: #d8c8ff; border: 1px solid rgba(139,92,246,.4); }

/* gallery */
.gallery { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; }
.g-item { padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; background: #000; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.g-item:hover img { transform: scale(1.04); }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(2,4,14,.92); display: grid; place-items: center; padding: 16px; animation: pop .25s; }
.lightbox img { max-height: 92vh; border-radius: 12px; }
.lb-close { position: absolute; top: 12px; right: 16px; border: 0; background: rgba(255,255,255,.1); width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; cursor: pointer; }

/* footer */
.footer { max-width: 1200px; margin: 24px auto 0; padding: 32px 16px 40px; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 24px; border-top: 1px solid var(--line); font-size: .9rem; }
.footer p { margin: 4px 0; }
.footer img { width: 150px; height: auto; margin-bottom: 8px; }
.f-title { font-weight: 700; color: var(--cyan); }
.f-end { text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; gap: 6px; }
body.admin .footer { display: none; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, calc(100% + 40px)); visibility: hidden; z-index: 120; padding: 12px 20px; border-radius: 12px; background: #111842; border: 1px solid var(--line-2); box-shadow: 0 10px 40px rgba(0,0,0,.5); transition: transform .3s; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast.bad { border-color: var(--danger); }

/* ---------- admin ---------- */
.login { max-width: 400px; margin: 64px auto; padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login img { width: 200px; height: auto; }
.login h2 { margin: 0 0 6px; font-family: var(--font-d); font-size: 1.25rem; }
.login form { width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.dash { padding: 24px 0 40px; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--font-d); font-size: 1.7rem; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); }
.stat:nth-child(3) b, .stat:nth-child(4) b { color: var(--gold); }
.stat:nth-child(5) b { color: var(--gold); font-size: 1.35rem; }
.stat:nth-child(6) b { color: var(--ok); }
.stat em { display: block; font-style: normal; font-size: .72rem; color: var(--muted); margin-top: 2px; }
.toolbar { display: flex; gap: 10px; align-items: center; padding: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 260px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding: 10px 12px 10px 36px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(4,8,26,.6); outline: none; }
.search input:focus { border-color: var(--cyan); }
.toolbar select { width: auto; padding: 9px 12px; border-radius: 10px; }
.toolbar select option { background: var(--bg-2); }
.tb-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
#selCount { background: rgba(0,0,0,.3); padding: 0 8px; border-radius: 999px; }

.md-admin { grid-template-columns: 380px 1fr; height: calc(100vh - 280px); min-height: 480px; }
.md-admin .md-master { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.master-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.group-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.group-list li { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: background .15s; }
.group-list li:hover { background: rgba(255,255,255,.04); }
.group-list li.active { background: rgba(139,92,246,.14); border-color: rgba(139,92,246,.45); }
.g-avatar { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; background: var(--grad); color: #fff; font-size: .95rem; }
.g-main { flex: 1; min-width: 0; }
.g-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.g-main small { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.g-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.g-count { font-family: var(--font-d); font-size: .8rem; background: rgba(56,214,255,.14); color: var(--cyan); border-radius: 999px; padding: 1px 9px; }
.g-tix { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.g-tix b { color: var(--gold); font-weight: 600; }
mark { background: rgba(251,191,36,.35); color: inherit; border-radius: 3px; }

.chk { position: relative; display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.chk input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.chk span { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); transition: .15s; display: grid; place-items: center; }
.chk input:checked + span { background: var(--grad); border-color: transparent; }
.chk input:checked + span::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.chk input:indeterminate + span { background: rgba(139,92,246,.5); border-color: transparent; }
.chk input:indeterminate + span::after { content: ""; width: 10px; height: 2px; background: #fff; }
.chk input:focus-visible + span { box-shadow: 0 0 0 3px rgba(56,214,255,.35); }

.md-admin .md-detail { overflow-y: auto; }
.d-back { display: none; margin-bottom: 12px; }
.person { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.person .g-avatar { width: 56px; height: 56px; font-size: 1.3rem; border-radius: 16px; }
.person h3 { margin: 0; font-size: 1.35rem; }
.person .nic { font-family: ui-monospace, Consolas, monospace; color: var(--cyan); }
.p-info { flex: 1; min-width: 200px; }
.p-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 18px 0; }
.p-meta div { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: .92rem; }
.p-meta small { display: block; color: var(--muted); font-size: .75rem; margin-bottom: 2px; }
.p-totals { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.p-totals span { padding: 8px 14px; border-radius: 10px; background: rgba(127,29,29,.4); border: 1px solid rgba(251,191,36,.35); font-size: .88rem; }
.p-totals b { color: var(--gold); font-family: var(--font-d); margin-left: 6px; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.d-actions .chk { margin-right: 4px; }

.inq-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: .92rem; }
.inq-table th { white-space: nowrap; text-align: left; font-size: .75rem; font-weight: 600; color: var(--muted); padding: 4px 10px; text-transform: uppercase; letter-spacing: .08em; }
html[lang="si"] .inq-table th { text-transform: none; letter-spacing: 0; }
.inq-table td { padding: 10px; background: rgba(255,255,255,.035); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; }
.inq-table td:first-child { border-left: 1px solid var(--line); border-radius: 12px 0 0 12px; width: 36px; }
.inq-table td:last-child { border-right: 1px solid var(--line); border-radius: 0 12px 12px 0; text-align: right; white-space: nowrap; }
.inq-table tr.sel td { background: rgba(139,92,246,.12); }
.inq-stall td:nth-child(3) { min-width: 120px; }
.inq-stall td { padding: 10px 8px; }
.md-admin .md-detail { overflow-x: auto; }
.inq-table .ref { font-family: var(--font-d); font-size: .85rem; letter-spacing: .04em; white-space: nowrap; }
.inq-table .lbl { display: none; }
.icon-btn { border: 1px solid var(--line-2); background: rgba(255,255,255,.04); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; display: inline-grid; place-items: center; margin-left: 4px; color: var(--text); }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.icon-btn.ok { color: var(--ok); }
.icon-btn.del:hover { color: var(--danger); border-color: var(--danger); }
.icon-btn svg { font-size: 1rem; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; text-align: center; }
  .hero-logo { margin: 0 auto; }
  .date-chips, .cta-row, .venue, .price-chips { justify-content: center; }
  .md, .md-admin { grid-template-columns: 1fr; height: auto; }
  .md-master { border-right: 0; border-bottom: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .tix-row { grid-template-columns: 1fr; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; }
  .md-admin .md-master { max-height: 60vh; }
  .md-admin.show-detail .md-master { display: none; }
  .md-admin:not(.show-detail) .md-detail { display: none; }
  .d-back { display: inline-flex; }
  .footer { grid-template-columns: 1fr 1fr; }
  .f-end { grid-column: span 2; align-items: flex-start; text-align: left; }
  .tb-actions { margin-left: 0; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
  .brand img { height: 36px; }
  .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .md-master, .md-detail { padding: 18px; }
  .countdown-card { padding: 20px 16px; }
  .countdown { gap: 6px; }
  .form-foot .btn { width: 100%; }
  .ticket { grid-template-columns: 1fr; }
  .ticket::after { display: none; }
  .ticket-r { width: auto; border-top: 2px dashed rgba(255,255,255,.25); }
  .gallery { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .total { flex-direction: column; align-items: stretch; }
  .total-sum { text-align: left; }
  .toolbar select { flex: 1; }
  .inq-table thead { display: none; }
  .inq-table tbody { display: grid; gap: 8px; }
  .inq-table tr { display: grid; grid-template-columns: 36px 1fr 1fr auto; grid-template-areas: "chk ref ref day" "chk ad kd amt" ". st act act";
    align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
  .inq-table tr.sel { background: rgba(139,92,246,.12); }
  .inq-table td { border: 0 !important; border-radius: 0 !important; padding: 0; background: none !important; width: auto !important; }
  .inq-table td:nth-child(1) { grid-area: chk; align-self: start; }
  .inq-table td:nth-child(2) { grid-area: ref; }
  .inq-table td:nth-child(3) { grid-area: day; text-align: right; }
  .inq-table td:nth-child(4) { grid-area: ad; }
  .inq-table td:nth-child(5) { grid-area: kd; }
  .inq-table td:nth-child(6) { grid-area: amt; text-align: right; }
  .inq-table td:nth-child(7) { grid-area: st; }
  .inq-table td:nth-child(8) { grid-area: act; text-align: right; }
  .inq-table .lbl { display: inline; }
  .inq-stall tr { grid-template-areas: "chk ref ref ref" "chk day day day" "chk ad kd amt" ". st act act"; }
  .inq-stall td:nth-child(3) { text-align: left; min-width: 0; }
  .mine-list li { grid-template-columns: 1fr auto; }
  .mine-list li .meta-wrap { grid-column: span 2; order: 3; }
  .footer { grid-template-columns: 1fr; }
  .f-end { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- print ---------- */
#printArea { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff !important; color: #000; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block; }
  .slip {
    border: 2px solid #1e1b4b; border-radius: 10px; padding: 12px 16px; margin-bottom: 8mm; break-inside: avoid; page-break-inside: avoid;
    font-family: "Outfit", "Noto Sans Sinhala", sans-serif; color: #000; position: relative;
  }
  .slip-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #888; padding-bottom: 8px; margin-bottom: 8px; }
  .slip-head img { height: 52px; width: auto; }
  .slip-title { text-align: right; }
  .slip-title b { display: block; font-size: 15px; letter-spacing: .1em; }
  .slip-title .ref { font-family: "Orbitron", monospace; font-size: 20px; font-weight: 700; }
  .slip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; font-size: 13px; }
  .slip-grid .full { grid-column: span 2; }
  .slip-grid small { color: #555; display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
  .slip-day { margin-top: 8px; padding: 8px 12px; border: 2px solid #7f1d1d; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; }
  .slip-lines { margin-top: 6px; display: flex; justify-content: space-between; align-items: flex-end; font-size: 13px; }
  .slip-total { font-size: 17px; font-weight: 800; }
  .slip-note { margin-top: 8px; font-size: 12px; padding: 6px 10px; background: #f3f3f3; border-radius: 6px; }
  .slip-foot { display: flex; justify-content: space-between; margin-top: 18px; font-size: 11px; color: #444; }
  .slip-foot span { border-top: 1px dotted #444; padding-top: 2px; min-width: 150px; text-align: center; }
  .slip .st-issued { position: absolute; top: 112px; right: 28px; transform: rotate(-12deg); border: 2px solid #059669; color: #059669; padding: 2px 10px; font-weight: 800; letter-spacing: .1em; border-radius: 6px; }
}
