/* ================================================================
   TikTok AWARDS "The Ones Who Spark It"  |  Theme: black #050608 + teal #6CC7D1 / #1DB4B0
   ================================================================ */
/* ---------- Fonts (ไฟล์ในโฟลเดอร์ /fonts) ----------
   "TTA Sans" = Noto Sans (อังกฤษ) + Noto Sans Thai (ไทย) แยกตาม unicode-range */
@font-face { font-family: 'TTA Sans'; src: url('../fonts/NotoSans-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-0E00, U+0E80-FFFF; }
@font-face { font-family: 'TTA Sans'; src: url('../fonts/NotoSans-Bold.woff2') format('woff2'); font-weight: 600 900; font-style: normal; font-display: swap; unicode-range: U+0000-0E00, U+0E80-FFFF; }
@font-face { font-family: 'TTA Sans'; src: url('../fonts/NotoSansThai-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0E01-0E7F, U+200C-200D, U+25CC; }
@font-face { font-family: 'TTA Sans'; src: url('../fonts/NotoSansThai-Bold.woff2') format('woff2'); font-weight: 600 900; font-style: normal; font-display: swap; unicode-range: U+0E01-0E7F, U+200C-200D, U+25CC; }
@font-face { font-family: 'TTA Mono'; src: url('../fonts/Mono-Bold.woff2') format('woff2'); font-weight: 400 900; font-style: normal; font-display: swap; }

:root {
  --tt-black: #000000;
  --tt-bg: #050608;
  --tt-surface: #0f0f12;
  --tt-surface-2: #17171b;
  --tt-line: #26262d;
  /* Theme: TikTok AWARDS "The Ones Who Spark It" — ดำ + เขียวฟ้า (ตาม Packaging design)
     --tt-red = สีหลัก (AWARDS teal), --tt-cyan = สีรอง (frame teal) — ชื่อตัวแปรเดิมคงไว้ */
  --tt-red: #6CC7D1;
  --tt-red-deep: #0D2326;
  --tt-cyan: #1DB4B0;
  --tt-green-deep: #0A1C1E;
  --tt-lilac: #A8E6EC;
  --tt-on-accent: #031012;
  --tt-danger: #FF4D6A;
  --tt-text: #ffffff;
  --tt-text-2: #c9c9d1;
  --tt-muted: #8b8b95;
  --tt-success: #2fe08a;
  --tt-warn: #ffb547;
  --radius: 18px;
  --shadow-red: 0 0 0 1px rgba(108,199,209,.35), 0 10px 40px -10px rgba(108,199,209,.45);
  --font: 'TTA Sans', 'Noto Sans Thai', 'Noto Sans', 'Segoe UI', Tahoma, sans-serif;
  --font-mono: 'TTA Mono', 'DejaVu Sans Mono', Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 700px at 100% 0%, rgba(29,180,176,.10) 0%, rgba(0,0,0,0) 60%), radial-gradient(1100px 700px at 0% 100%, rgba(108,199,209,.07) 0%, rgba(0,0,0,0) 60%), #050608;
  background-attachment: fixed;
  color: var(--tt-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--tt-cyan); }
img { max-width: 100%; }

/* ---------- Background decor (frame motif) ---------- */
.tt-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.tt-decor::before, .tt-decor::after {
  content: ""; position: absolute; width: 620px; height: 600px;
  background: url('../images/frame.png') no-repeat center / contain;
  opacity: .22; filter: saturate(1.2);
}
.tt-decor::before { left: -260px; top: -120px; }
.tt-decor::after  { right: -280px; bottom: -160px; transform: scaleX(-1) rotate(180deg); }
.tt-glow { position: fixed; width: 520px; height: 520px; border-radius: 50%; filter: blur(120px); opacity: .22; pointer-events: none; z-index: 0; }
.tt-glow.red  { background: #0f5f5d;  top: -200px; right: -120px; opacity: .35; }
.tt-glow.cyan { background: #0b4a52; bottom: -260px; left: -180px; opacity: .35; }

.tt-wrap { position: relative; z-index: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
.tt-wrap.wide { max-width: 1240px; }

/* ---------- Brand ---------- */
.tt-brand { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 0 18px; }
.tt-logo { display: block; height: 96px; width: auto; margin: 0 auto; }
.ad-top .tt-logo { height: 48px; margin: 0; }
.tt-wordmark { font-weight: 800; letter-spacing: .5px; font-size: 20px; line-height: 1; text-align: center; }
.tt-wordmark .a { display: block; font-size: 13px; letter-spacing: 6px; color: var(--tt-red); margin-top: 4px; }
.tt-logo-img { height: 34px; width: auto; }

/* ---------- Hero ---------- */
.tt-hero { position: relative; border-radius: var(--radius); overflow: hidden; background: #050608; box-shadow: var(--shadow-red); text-align: center; }
.tt-hero img.stage { display: block; width: auto; max-width: 100%; height: auto; max-height: 280px; margin: 0 auto; }
.tt-hero .cap { position: relative; z-index: 2; padding: 14px 20px 16px; text-align: left; background: linear-gradient(180deg, #050506, #0b0b0d); border-top: 1px solid rgba(108,199,209,.35); }
.tt-eyebrow { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--tt-lilac); font-weight: 600; }
.tt-hero h1 { margin: 2px 0 0; font-size: 26px; line-height: 1.25; }

/* ---------- Card ---------- */
.tt-card {
  position: relative; background: linear-gradient(180deg, var(--tt-surface) 0%, #0b0b0d 100%);
  border: 1px solid var(--tt-line); border-radius: var(--radius); padding: 22px 20px; margin-top: 16px;
}
.tt-card.accent { border-color: rgba(108,199,209,.45); box-shadow: var(--shadow-red);
  background: linear-gradient(180deg, #07090b 0%, #0a1416 50%, #0d2326 100%); }
/* การ์ดโทนเขียว (แบบโปสเตอร์ Private Event) */
.tt-card.teal { border-color: rgba(29,180,176,.45); box-shadow: 0 0 0 1px rgba(29,180,176,.25), 0 10px 40px -10px rgba(29,180,176,.4);
  background: linear-gradient(180deg, #050608 0%, #081517 45%, #0d2a2d 100%); }
.tt-card.teal .badge-ic { background: rgba(29,180,176,.12); border-color: var(--tt-cyan); color: var(--tt-cyan); }
.tt-card h2 { font-weight: 800; letter-spacing: .2px; }
.tt-headline { font-weight: 800; text-transform: uppercase; line-height: 1.05; letter-spacing: .5px; }
.tt-card h2 { margin: 0 0 6px; font-size: 20px; }
.tt-card p { color: var(--tt-text-2); margin: 0 0 10px; }
.tt-muted { color: var(--tt-muted); font-size: 13px; }

/* Guest profile */
.tt-profile { display: flex; gap: 14px; align-items: center; }
.tt-avatar {
  flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 22px; color: #fff;
  background: #000; box-shadow: -3px -2px 0 var(--tt-cyan), 3px 2px 0 var(--tt-red);
}
.tt-profile .nm { font-size: 19px; font-weight: 700; line-height: 1.3; word-break: break-word; }
.tt-profile .hd { color: var(--tt-cyan); font-size: 14px; text-decoration: none; word-break: break-all; }
.tt-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.tt-info .it { background: var(--tt-surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.tt-info .it.full { grid-column: 1 / -1; }
.tt-info .lb { font-size: 11px; letter-spacing: .3px; color: var(--tt-muted); text-transform: uppercase; }
.tt-info .vl { font-size: 14px; font-weight: 600; word-break: break-word; }
.tt-info .vl a { text-decoration: none; }

/* Event info rows */
.tt-event { list-style: none; padding: 0; margin: 12px 0 0; }
.tt-event li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--tt-line); font-size: 14px; }
.tt-event li:last-child { border-bottom: 0; }
.tt-event .k { flex: 0 0 82px; color: var(--tt-muted); }

/* ---------- Choice buttons ---------- */
.tt-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.tt-choice {
  appearance: none; cursor: pointer; border-radius: 16px; padding: 20px 12px; text-align: center;
  font-family: inherit; color: #fff; border: 1px solid var(--tt-line); background: var(--tt-surface-2);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tt-choice:hover { transform: translateY(-2px); }
.tt-choice .ic { font-size: 28px; line-height: 1; display: block; margin-bottom: 8px; }
.tt-choice .t1 { font-size: 17px; font-weight: 700; display: block; }
.tt-choice .t2 { font-size: 12px; color: var(--tt-muted); display: block; }
.tt-choice.yes { border-color: rgba(108,199,209,.6); background: linear-gradient(160deg, rgba(108,199,209,.22), rgba(108,199,209,.05)); }
.tt-choice.yes:hover { box-shadow: var(--shadow-red); }
.tt-choice.no:hover { border-color: var(--tt-cyan); }

/* ---------- Forms ---------- */
.tt-field { margin-top: 14px; }
.tt-field label.lb { display: block; font-size: 14px; color: var(--tt-text-2); margin-bottom: 6px; }
.tt-input, .tt-textarea, .tt-select {
  width: 100%; font-family: inherit; font-size: 16px; color: #fff; background: #0a0a0c;
  border: 1px solid var(--tt-line); border-radius: 12px; padding: 12px 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.tt-textarea { min-height: 110px; resize: vertical; }
.tt-input:focus, .tt-textarea:focus, .tt-select:focus { border-color: var(--tt-cyan); box-shadow: 0 0 0 3px rgba(29,180,176,.15); }
.tt-input.err { border-color: var(--tt-danger); box-shadow: 0 0 0 3px rgba(255,77,106,.2); }
.req { color: var(--tt-danger); }
.tt-check.err { border-color: var(--tt-danger); }
.tt-select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b8b95 50%), linear-gradient(135deg, #8b8b95 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
.tt-select option { background: #0f0f12; color: #fff; }
.tt-select.err { border-color: var(--tt-danger); box-shadow: 0 0 0 3px rgba(255,77,106,.2); }
.tt-err { color: var(--tt-danger); font-size: 13px; margin-top: 6px; display: none; }
.tt-err.show { display: block; }

.tt-check {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px;
  background: var(--tt-surface-2); border: 1px solid var(--tt-line); cursor: pointer; user-select: none;
}
.tt-check input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--tt-red); flex: 0 0 22px; margin: 0; }
.tt-check label { cursor: pointer; font-size: 15px; }
.tt-check.on { border-color: rgba(108,199,209,.6); }
.tt-collapse { display: none; }
.tt-collapse.open { display: block; animation: ttFade .2s ease; }

/* ---------- Buttons ---------- */
.tt-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 16px; font-weight: 700; padding: 14px 22px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: filter .15s, transform .1s, opacity .15s;
  color: #fff; background: var(--tt-surface-2);
}
.tt-btn:active { transform: scale(.98); }
.tt-btn[disabled], .tt-btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.tt-btn.primary { background: var(--tt-red); color: var(--tt-on-accent); box-shadow: 0 8px 24px -8px rgba(108,199,209,.8); }
.tt-btn.primary:hover { filter: brightness(1.08); }
.tt-btn.cyan { background: var(--tt-cyan); color: #00140e; }
.tt-btn.ghost { background: transparent; border-color: var(--tt-line); color: var(--tt-text-2); }
.tt-btn.ghost:hover { border-color: var(--tt-cyan); color: #fff; }
.tt-btn.block { width: 100%; }
.tt-btn.sm { font-size: 13px; padding: 8px 14px; }
.tt-btn.xs { font-size: 12px; padding: 5px 10px; font-weight: 600; }
.tt-actions { display: flex; gap: 10px; margin-top: 20px; }
.tt-actions .tt-btn { flex: 1; }

/* ---------- Summary ---------- */
.tt-done { text-align: center; }
.tt-done .badge-ic, .ci-result .badge-ic {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 14px;
  font-size: 34px; background: rgba(108,199,209,.15); border: 2px solid var(--tt-red); color: var(--tt-red);
}
.tt-done .badge-ic.cyan, .ci-result .badge-ic.cyan { background: rgba(29,180,176,.1); border-color: var(--tt-cyan); color: var(--tt-cyan); }
.tt-qr {
  display: inline-block; background: #fff; padding: 12px; border-radius: 18px; margin: 14px auto 6px;
  box-shadow: -6px -4px 0 var(--tt-cyan), 6px 4px 0 var(--tt-red);
}
.tt-qr img { display: block; width: 240px; height: 240px; }
.tt-code { font-family: var(--font-mono); font-size: 24px; font-weight: 800; letter-spacing: 4px; margin-top: 10px; }
.tt-note { font-size: 13px; color: var(--tt-text-2); background: var(--tt-surface-2); padding: 12px 14px; border-radius: 12px; margin-top: 14px; text-align: left; }
.tt-note.warn { border-left: 3px solid var(--tt-warn); }
.tt-note.ok { border-left: 3px solid var(--tt-cyan); }

/* ---------- Modal ---------- */
.tt-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.tt-modal.open { display: flex; }
.tt-modal .bd { position: absolute; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.tt-modal .dlg {
  position: relative; width: 100%; max-width: 420px; background: var(--tt-surface); border: 1px solid rgba(108,199,209,.45);
  border-radius: 20px; padding: 24px 20px; box-shadow: var(--shadow-red); animation: ttPop .2s ease;
}
.tt-modal h3 { margin: 0 0 10px; font-size: 19px; }
.tt-modal .rv { background: var(--tt-surface-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.tt-modal .rv div { display: flex; gap: 10px; padding: 4px 0; }
.tt-modal .rv .k { flex: 0 0 90px; color: var(--tt-muted); }
.tt-modal .rv .v { word-break: break-word; }
.tt-loading { text-align: center; }
.tt-loading p { color: var(--tt-text-2); margin: 14px 0 0; font-size: 14px; }

/* Loading: โลโก้ TikTok (images/tiktok-note.png) + เงาแดง/เขียวฟ้า เต้นเป็นจังหวะ */
.tt-spinner { width: 64px; height: 64px; margin: 6px auto 0; position: relative; }
.tt-spinner::before {
  content: ""; position: absolute; inset: 0;
  background: url('../images/tiktok-note.png') no-repeat center / contain;
  animation: ttBeat 1.1s ease-in-out infinite;
}
@keyframes ttBeat {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 6px rgba(108,199,209,.6)); }
  50%      { transform: scale(1.12); filter: drop-shadow(0 0 16px rgba(108,199,209,.9)); }
}
.tt-progress { height: 10px; border-radius: 99px; background: var(--tt-surface-2); overflow: hidden; margin-top: 16px; }
.tt-progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--tt-cyan), var(--tt-red)); transition: width .3s; }

@keyframes ttSpin { to { transform: rotate(360deg); } }
@keyframes ttPop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ttFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.tt-footer { text-align: center; color: var(--tt-muted); font-size: 12px; margin-top: 28px; }
.hidden { display: none !important; }

/* ================================================================
   Admin
   ================================================================ */
.ad-top {
  position: sticky; top: 0; z-index: 20; background: rgba(5,5,6,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--tt-line);
}
.ad-top .in { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ad-top .tt-wordmark { font-size: 16px; text-align: left; }
.ad-top .tt-wordmark .a { font-size: 10px; letter-spacing: 4px; }
.ad-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.ad-nav a { color: var(--tt-text-2); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.ad-nav a:hover { background: var(--tt-surface-2); color: #fff; }
.ad-nav a.on { background: var(--tt-red); color: var(--tt-on-accent); }

.ad-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 4px; }
.ad-title h1 { margin: 0; font-size: 24px; }

.ad-stats { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.ad-stat {
  display: block; text-decoration: none; color: #fff; background: var(--tt-surface); border: 1px solid var(--tt-line);
  border-radius: 16px; padding: 16px; position: relative; overflow: hidden; transition: transform .15s, border-color .15s;
}
.ad-stat:hover { transform: translateY(-2px); border-color: #3a3a44; }
.ad-stat.on { border-color: var(--tt-red); box-shadow: var(--shadow-red); }
.ad-stat .lb { font-size: 13px; color: var(--tt-text-2); }
.ad-stat .num { font-size: 34px; font-weight: 800; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ad-stat .sub { font-size: 12px; color: var(--tt-muted); margin-top: 2px; }
.ad-stat .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.ad-stat.c-all .bar { background: #fff; }
.ad-stat.c-resp .bar { background: var(--tt-lilac); }
.ad-stat.c-yes .bar { background: var(--tt-cyan); }
.ad-stat.c-yes .num { color: var(--tt-cyan); }
.ad-stat.c-no .bar { background: var(--tt-muted); }
.ad-stat.c-pend .bar { background: var(--tt-warn); }
.ad-stat.c-in .bar { background: var(--tt-lilac); }
.ad-stat.c-in .num { color: var(--tt-lilac); }
.ad-stat.c-walk .bar { background: var(--tt-red); }
.ad-stat.c-walk .num { color: var(--tt-red); }

.ad-split { height: 12px; border-radius: 99px; overflow: hidden; display: flex; background: var(--tt-surface-2); margin-top: 16px; }
.ad-split span { display: block; height: 100%; }
.ad-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--tt-text-2); margin-top: 8px; }
.ad-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.ad-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.ad-panel { background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: 16px; padding: 18px; margin-top: 16px; }
.ad-panel h2 { margin: 0 0 4px; font-size: 17px; }
.ad-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.ad-toolbar .tt-input, .ad-toolbar .tt-select { width: auto; flex: 1 1 200px; font-size: 14px; padding: 10px 12px; }
.ad-toolbar .tt-select { padding-right: 34px; }

.ad-tablewrap { overflow-x: auto; margin-top: 14px; border-radius: 12px; border: 1px solid var(--tt-line); }
table.ad-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 980px; }
.ad-table th { text-align: left; background: var(--tt-surface-2); color: var(--tt-text-2); font-weight: 600; padding: 10px 12px; white-space: nowrap; position: sticky; top: 0; }
.ad-table td { padding: 10px 12px; border-top: 1px solid var(--tt-line); vertical-align: top; }
.ad-table tr:hover td { background: rgba(255,255,255,.02); }
.ad-table .nm { font-weight: 600; color: #fff; }
.ad-table .sm { color: var(--tt-muted); font-size: 12px; }
.ad-table a { text-decoration: none; }
.ad-table .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-empty { text-align: center; color: var(--tt-muted); padding: 40px 10px; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.pill.yes  { background: rgba(29,180,176,.16); color: var(--tt-cyan); }
.pill.no   { background: rgba(139,139,149,.18); color: #b7b7c0; }
.pill.pend { background: rgba(255,181,71,.14); color: var(--tt-warn); }
.pill.in   { background: rgba(168,230,236,.14); color: var(--tt-lilac); }
.pill.err  { background: rgba(255,77,106,.25); color: #fff; }
.pill.cat  { background: #fff; color: #000; font-size: 13px; padding: 4px 14px; }
.pill.walk { background: rgba(168,230,236,.18); color: var(--tt-lilac); }
.pill.ok   { background: rgba(47,224,138,.14); color: var(--tt-success); }

table.ad-mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.ad-mini th, .ad-mini td { padding: 8px 6px; border-bottom: 1px solid var(--tt-line); text-align: right; }
.ad-mini th:first-child, .ad-mini td:first-child { text-align: left; }
.ad-mini th { color: var(--tt-muted); font-weight: 500; }

.ad-msg { padding: 12px 14px; border-radius: 12px; margin-top: 14px; font-size: 14px; }
.ad-msg.ok { background: rgba(29,180,176,.08); border: 1px solid rgba(29,180,176,.35); }
.ad-msg.err { background: rgba(255,77,106,.1); border: 1px solid rgba(255,77,106,.45); }
.ad-msg.warn { background: rgba(255,181,71,.08); border: 1px solid rgba(255,181,71,.4); }

.ad-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 200;
  background: #fff; color: #000; padding: 10px 18px; border-radius: 99px; font-size: 14px; font-weight: 600; transition: all .2s;
}
.ad-toast.show { opacity: 1; transform: translateX(-50%); }

.ad-stats.five { grid-template-columns: repeat(5, minmax(0,1fr)); }
.ad-bulk {
  display: none; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: 12px;
  background: rgba(108,199,209,.08); border: 1px solid rgba(108,199,209,.4); font-size: 14px;
}
.ad-bulk.show { display: flex; }
.ad-bulk span { margin-right: auto; }
.row-cat { font-size: 12px !important; padding: 6px 28px 6px 8px !important; border-radius: 8px !important; width: 170px !important; background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50% !important; background-size: 5px 5px !important; }
.ad-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--tt-red); }
.ad-table tr:has(.rowchk:checked) td { background: rgba(108,199,209,.06); }
.ci-num { display: flex; align-items: center; gap: 10px; }
.ci-num .tt-input { width: 90px; text-align: center; font-size: 22px; font-weight: 700; padding: 8px; }
.ci-num .tt-btn { width: 48px; height: 48px; padding: 0; font-size: 24px; }

/* Check-in */
.ci-result { text-align: center; }
.ci-result .big { font-size: 26px; font-weight: 800; margin: 6px 0; }


/* ================= Clear data ================= */
.cd-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cd-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--tt-surface-2); border: 1px solid var(--tt-line); cursor: pointer; }
.cd-opt input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--tt-red); flex: 0 0 20px; }
.cd-opt .d { display: block; font-size: 13px; color: var(--tt-muted); margin-top: 4px; }
.cd-opt:has(input:checked) { border-color: var(--tt-cyan); }
.cd-opt.danger:has(input:checked) { border-color: var(--tt-danger); background: rgba(255,77,106,.08); }

/* ================= Counter (Check-in / Walk-in) ================= */
.ct-nav a { font-size: 16px; padding: 10px 20px; }
.ct-staff { appearance: none; font-family: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start;
  background: var(--tt-surface-2); border: 1px solid var(--tt-line); border-radius: 12px; padding: 6px 14px; color: #fff; line-height: 1.2; }
.ct-staff .lb { font-size: 11px; color: var(--tt-muted); }
.ct-staff .nm { font-size: 14px; font-weight: 700; color: var(--tt-cyan); }
.ct-staff:hover { border-color: var(--tt-cyan); }

/* ================= iPad Check-in ================= */
.ci-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 16px 0 4px; }
.ci-top h1 { margin: 0; font-size: 26px; }
.ci-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.ci-kpi { background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: 14px; padding: 8px 16px; min-width: 96px; text-align: center; }
.ci-kpi .n { display: block; font-size: 26px; font-weight: 800; color: var(--tt-red); line-height: 1.2; font-variant-numeric: tabular-nums; }
.ci-kpi .n.sm { font-size: 15px; color: #fff; padding: 6px 0; }
.ci-kpi .l { font-size: 12px; color: var(--tt-muted); }
.ci-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; align-items: start; }
.ci-left .ad-panel:first-child, .ci-right .tt-card { margin-top: 16px; }

.ci-cam { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--tt-line); }
.ci-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ci-cam.mirror video { transform: scaleX(-1); }
.ci-reticle { position: absolute; inset: 18% 24%; pointer-events: none; }
.ci-reticle i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--tt-red); }
.ci-reticle i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.ci-reticle i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.ci-reticle i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.ci-reticle i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }
.ci-flash { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .25s; }
.ci-flash.show { opacity: .45; }
.ci-flash.ok { background: var(--tt-cyan); }
.ci-flash.warn { background: var(--tt-warn); }
.ci-flash.bad { background: var(--tt-danger); }
.ci-camoff { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 20px; background: radial-gradient(circle at 50% 40%, #0d1f20, #000); }
.ci-camoff .ic { font-size: 54px; color: var(--tt-red); line-height: 1; }
.ci-camctl { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.ci-camctl .tt-btn { flex: 1; min-height: 52px; }
.ci-sound { display: flex; align-items: center; gap: 6px; color: var(--tt-text-2); font-size: 14px; }
.ci-sound input { width: 20px; height: 20px; accent-color: var(--tt-red); }

.ci-search { display: flex; gap: 10px; }
.ci-search .tt-input { font-size: 18px; padding: 14px 16px; }
.ci-search .tt-btn { min-width: 110px; }
.ci-list, .ci-recent { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 420px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ci-item {
  appearance: none; text-align: left; font-family: inherit; color: #fff; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  background: var(--tt-surface-2); border: 1px solid var(--tt-line); border-radius: 12px; padding: 12px 14px; min-height: 56px;
}
.ci-item:active { border-color: var(--tt-red); }
.ci-item .nm { font-weight: 600; font-size: 15px; }
.ci-item .sub { grid-column: 1; font-size: 12px; color: var(--tt-muted); }
.ci-item .pill, .ci-item .tm { grid-column: 2; grid-row: 1 / span 2; }
.ci-item .tm { color: var(--tt-cyan); font-weight: 700; font-variant-numeric: tabular-nums; }
.ci-walkin { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--tt-muted); font-size: 14px; }

.ci-result-card { min-height: 300px; transition: border-color .2s, box-shadow .2s; }
.ci-result-card.st-ok { background: linear-gradient(180deg, #050608 0%, #081517 55%, #0d2a2d 100%); border-color: var(--tt-cyan); box-shadow: 0 0 0 1px rgba(29,180,176,.35), 0 10px 40px -10px rgba(29,180,176,.45); }
.ci-result-card.st-done { border-color: var(--tt-lilac); }
.ci-result-card.st-warn { border-color: var(--tt-warn); }
.ci-result-card.st-bad { border-color: var(--tt-danger); background: linear-gradient(180deg, #0a0102 0%, #1d0304 55%, #3d0507 100%); }
.ci-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 260px; text-align: center; color: var(--tt-text-2); }
.ci-empty .ic { font-size: 44px; opacity: .6; }
.ci-banner { margin: -22px -20px 16px; padding: 12px 20px; font-weight: 700; font-size: 15px; border-radius: var(--radius) var(--radius) 0 0; background: var(--tt-surface-2); }
.st-ok .ci-banner { background: rgba(29,180,176,.18); color: var(--tt-cyan); }
.st-done .ci-banner { background: rgba(168,230,236,.12); color: var(--tt-lilac); }
.st-warn .ci-banner { background: rgba(255,181,71,.14); color: var(--tt-warn); }
.st-bad .ci-banner { background: rgba(255,77,106,.14); color: var(--tt-danger); }
.ci-name { font-size: 30px; font-weight: 800; line-height: 1.2; word-break: break-word; }
.ci-handle { color: var(--tt-cyan); font-size: 17px; margin-top: 2px; }
.ci-catrow { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ci-big { min-height: 64px; font-size: 20px; }
.ci-actions { flex-wrap: wrap; }

@media (max-width: 1000px) { .ci-grid { grid-template-columns: 1fr; } .ci-cam { aspect-ratio: 16 / 10; } }

@media (max-width: 1100px) { .ad-stats, .ad-stats.five { grid-template-columns: repeat(3, minmax(0,1fr)); } .ad-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .ad-stats, .ad-stats.five { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ad-stat .num { font-size: 28px; }
  .tt-hero img.stage { max-height: 240px; }
  .tt-hero h1 { font-size: 22px; }
  .tt-info { grid-template-columns: 1fr; }
  .tt-qr img { width: 220px; height: 220px; }
}
@media print {
  .tt-decor, .tt-glow, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

/* พื้นหลังเรียบ: ใช้เฉพาะภาพหลัก ไม่มีกรอบ/แสงตกแต่ง */
.tt-decor, .tt-glow { display: none !important; }
body { background: #050608 !important; }

/* System check */
.sc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sc-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--tt-surface-2); border-left: 4px solid var(--tt-line); }
.sc-item .ic { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.sc-item .d { font-size: 13px; color: var(--tt-text-2); margin-top: 2px; word-break: break-word; }
.sc-item.ok { border-left-color: var(--tt-cyan); } .sc-item.ok .ic { background: rgba(29,180,176,.2); color: var(--tt-cyan); }
.sc-item.err { border-left-color: var(--tt-danger); } .sc-item.err .ic { background: rgba(255,77,106,.2); color: var(--tt-danger); }
.sc-item.warn { border-left-color: var(--tt-warn); } .sc-item.warn .ic { background: rgba(255,181,71,.2); color: var(--tt-warn); }
.sc-log { white-space: pre-wrap; font-family: var(--font-mono); font-size: 12px; color: var(--tt-text-2); background: #000; border: 1px solid var(--tt-line); border-radius: 12px; padding: 12px; max-height: 360px; overflow: auto; margin: 10px 0 0; }
