/* =========================================================
   LUCKY DRAW – Aero Glass UI
   ========================================================= */

:root {
  --c1: #ff3cac;
  --c2: #784ba0;
  --c3: #2b86c5;
  --c4: #22e1ff;
  --gold: #ffd23f;
  --lime: #a6ff4d;
  --ink: #1d1335;
  --ink-2: #4b3f6b;
  --ink-3: #7d7399;
  --glass: rgba(255, 255, 255, .62);
  --glass-2: rgba(255, 255, 255, .38);
  --glass-line: rgba(255, 255, 255, .75);
  --shadow: 0 18px 50px -18px rgba(54, 16, 110, .45), 0 2px 6px rgba(54, 16, 110, .12);
  --radius: 20px;
  --radius-s: 12px;
  --bg: #efe9ff;
  --danger: #ff3b6b;
  --ok: #10c98f;
  --warn: #ffab2e;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Montserrat', 'Be Vietnam Pro', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c3); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0 0 .5em; letter-spacing: -.01em; }

/* ---------- Aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
  radial-gradient(1200px 800px at 10% -10%, #ffd1f1 0%, transparent 60%),
  radial-gradient(900px 700px at 110% 10%, #c9f1ff 0%, transparent 55%),
  radial-gradient(900px 900px at 50% 120%, #e2d4ff 0%, transparent 60%),
  linear-gradient(160deg, #f8f2ff, #eef6ff); }
.aurora i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 18s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 520px; height: 520px; left: -120px; top: 20%; background: var(--c1); }
.aurora i:nth-child(2) { width: 460px; height: 460px; right: -100px; top: -80px; background: var(--c4); animation-delay: -6s; }
.aurora i:nth-child(3) { width: 380px; height: 380px; left: 40%; bottom: -160px; background: #9b5cff; animation-delay: -12s; }
.aurora i:nth-child(4) { width: 260px; height: 260px; right: 20%; bottom: 15%; background: var(--gold); opacity: .35; animation-delay: -3s; }
@keyframes float { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(60px, -40px) scale(1.15); } }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
}
.card { padding: 20px 22px; }
.card + .card { margin-top: 18px; }
.card h3 { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.hidden { display: none !important; }

/* ---------- Glossy aero buttons ---------- */
.btn {
  --b1: #8e5cff; --b2: #5b2bd6;
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid rgba(255, 255, 255, .55);
  padding: 9px 18px; min-height: 40px;
  border-radius: 999px;
  font: 600 14px/1 var(--font);
  color: #fff; text-decoration: none; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: 0 8px 20px -8px var(--b2), inset 0 -3px 8px rgba(0, 0, 0, .15), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.btn::before { /* vệt bóng kính */
  content: ''; position: absolute; left: 6%; right: 6%; top: 1px; height: 50%;
  border-radius: 999px 999px 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .08));
  pointer-events: none;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.07) saturate(1.1); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.pink { --b1: #ff6ac1; --b2: #e2177e; }
.btn.blue { --b1: #49c6ff; --b2: #1a6fe0; }
.btn.green { --b1: #3cf0b0; --b2: #0aa676; }
.btn.gold { --b1: #ffe066; --b2: #f59f00; color: #4a2a00; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.btn.red { --b1: #ff7a95; --b2: #e3123f; }
.btn.ghost { background: rgba(255, 255, 255, .55); color: var(--ink); text-shadow: none; box-shadow: 0 4px 14px -8px rgba(60, 20, 120, .5), inset 0 1px 0 #fff; border-color: rgba(120, 75, 160, .18); }
.btn.ghost::before { opacity: .5; }
.btn.sm { padding: 6px 12px; min-height: 32px; font-size: 13px; }
.btn.xs { padding: 4px 9px; min-height: 26px; font-size: 12px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.lg { padding: 14px 28px; min-height: 52px; font-size: 16px; }

/* ---------- Forms ---------- */
label.f { display: block; }
label.f > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid rgba(120, 75, 160, .22);
  background: rgba(255, 255, 255, .78);
  border-radius: var(--radius-s);
  padding: 10px 13px; min-height: 42px;
  font: 500 14px var(--font); color: var(--ink);
  box-shadow: inset 0 2px 4px rgba(60, 20, 120, .06);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: #9b5cff; background: #fff; box-shadow: 0 0 0 4px rgba(155, 92, 255, .18); }
input[type=color].input { padding: 4px; height: 42px; cursor: pointer; }
input[type=range] { width: 100%; accent-color: #9b5cff; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: #9b5cff; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 44px; height: 26px; border-radius: 99px; background: rgba(120, 75, 160, .25); position: relative; transition: .25s; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .15); }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(#fff, #eee); box-shadow: 0 2px 5px rgba(0, 0, 0, .25); transition: .25s; }
.switch input:checked + i { background: linear-gradient(90deg, var(--c1), #9b5cff); }
.switch input:checked + i::after { left: 21px; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; border-radius: var(--radius-s); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); padding: 10px 12px; background: rgba(255, 255, 255, .55); position: sticky; top: 0; z-index: 1; }
table.t td { padding: 10px 12px; border-top: 1px solid rgba(120, 75, 160, .1); vertical-align: middle; }
table.t tr:hover td { background: rgba(255, 255, 255, .45); }
table.t td.num, table.t th.num { text-align: right; }
.code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-weight: 700; color: var(--c2); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: rgba(120, 75, 160, .12); color: var(--c2); white-space: nowrap; }
.badge.ok { background: rgba(16, 201, 143, .15); color: #08835e; }
.badge.warn { background: rgba(255, 171, 46, .18); color: #a3610a; }
.badge.danger { background: rgba(255, 59, 107, .14); color: #c0123d; }
.badge.blue { background: rgba(43, 134, 197, .15); color: #1a5e8f; }
.badge.gold { background: linear-gradient(90deg, #ffe680, #ffc94a); color: #6b3d00; }

/* ---------- Layout: admin shell ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; gap: 0; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.side .glass { padding: 16px; height: 100%; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 4px 16px; }
.brand img { width: 46px; height: 46px; border-radius: 14px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(226, 23, 126, .35)); }
.brand b { font-family: var(--display); font-weight: 900; font-size: 20px; letter-spacing: .02em; background: linear-gradient(90deg, var(--c1), #9b5cff, var(--c3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 600; letter-spacing: .08em; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--ink-2); text-decoration: none; font-weight: 600; transition: .2s; }
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: rgba(255, 255, 255, .6); color: var(--ink); }
.nav a.active { color: #fff; background: linear-gradient(135deg, var(--c1), #9b5cff 60%, var(--c3)); box-shadow: 0 10px 24px -10px #9b5cff, inset 0 1px 0 rgba(255, 255, 255, .5); }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(120, 75, 160, .12); }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c3)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 10px -4px var(--c2); flex: none; }
.main { padding: 22px 26px 0; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { font-size: 26px; margin: 0; }
.topbar .crumb { color: var(--ink-3); font-weight: 600; text-decoration: none; }
.menu-btn { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; width: 280px; transform: translateX(-105%); transition: transform .3s; }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 16px 16px 0; }
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; padding: 6px; border-radius: 99px; background: rgba(255, 255, 255, .45); border: 1px solid rgba(255, 255, 255, .7); width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; padding: 9px 18px; border-radius: 99px; font: 600 14px var(--font); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tabs button.active { background: #fff; color: var(--c2); box-shadow: 0 6px 16px -8px rgba(120, 75, 160, .6); }

/* ---------- Event cards (3D tilt) ---------- */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; perspective: 1200px; }
.ev-card { position: relative; overflow: hidden; padding: 0; transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; transform-style: preserve-3d; cursor: pointer; }
.ev-card:hover { transform: rotateX(4deg) rotateY(-5deg) translateY(-4px); box-shadow: 0 30px 60px -20px rgba(120, 30, 180, .55); }
.ev-cover { height: 132px; position: relative; background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 14px 16px; }
.ev-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .25), transparent 45%, rgba(20, 0, 40, .55)); }
.ev-cover h3 { position: relative; z-index: 1; color: #fff; font-size: 19px; margin: 0; text-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.ev-cover .style-chip { position: absolute; right: 12px; top: 12px; z-index: 1; }
.ev-body { padding: 14px 16px 16px; }
.ev-stats { display: flex; gap: 16px; margin: 4px 0 12px; }
.ev-stats div { font-size: 12px; color: var(--ink-3); }
.ev-stats b { display: block; font-size: 20px; font-family: var(--display); color: var(--ink); }
.ev-new { display: grid; place-items: center; min-height: 260px; border: 2px dashed rgba(155, 92, 255, .45); background: rgba(255, 255, 255, .35); color: var(--c2); font-weight: 700; }
.ev-new .plus { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; color: #fff; margin: 0 auto 10px; background: linear-gradient(135deg, var(--c1), #9b5cff); box-shadow: 0 12px 26px -10px #9b5cff, inset 0 2px 0 rgba(255, 255, 255, .6); }

/* stat tiles */
.stat { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.stat .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.stat .ic svg { width: 24px; height: 24px; }
.stat b { display: block; font: 800 24px var(--display); }
.stat span { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }

/* prize items */
.prize-list { display: flex; flex-direction: column; gap: 10px; }
.prize-item { display: grid; grid-template-columns: 28px 64px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; background: rgba(255, 255, 255, .6); border: 1px solid rgba(255, 255, 255, .85); border-radius: 16px; }
.prize-item.drag-over { outline: 2px dashed #9b5cff; }
.prize-item .handle { cursor: grab; color: var(--ink-3); font-size: 18px; text-align: center; }
.prize-item img { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: linear-gradient(135deg, #fff5d6, #ffe3f3); }
.prize-item h4 { margin: 0; font-size: 16px; }
@media (max-width: 620px) { .prize-item { grid-template-columns: 50px 1fr; } .prize-item .handle { display: none; } .prize-item .acts { grid-column: 1 / -1; } }

/* media picker */
.media-field { display: flex; gap: 12px; align-items: center; }
.media-prev { width: 120px; height: 68px; flex: none; border-radius: 12px; background: repeating-conic-gradient(#f2ecff 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px solid rgba(120, 75, 160, .2); background-size: cover; background-position: center; display: grid; place-items: center; overflow: hidden; color: var(--ink-3); font-size: 11px; }
.media-prev img { width: 100%; height: 100%; object-fit: contain; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; max-height: 50vh; overflow: auto; }
.media-grid .m { border-radius: 12px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #fff; position: relative; }
.media-grid .m:hover { border-color: #9b5cff; }
.media-grid .m img, .media-grid .m .au { width: 100%; height: 90px; object-fit: cover; display: grid; place-items: center; background: #f5f0ff; }
.media-grid .m span { display: block; font-size: 11px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* style picker */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pick { position: relative; padding: 14px; border-radius: 16px; cursor: pointer; border: 2px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .55); transition: .2s; text-align: center; }
.pick:hover { transform: translateY(-2px); }
.pick.on { border-color: #9b5cff; background: #fff; box-shadow: 0 12px 24px -12px #9b5cff; }
.pick.on::after { content: '✓'; position: absolute; right: 10px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--c1), #9b5cff); color: #fff; font-size: 13px; display: grid; place-items: center; }
.pick .pv { height: 70px; margin-bottom: 8px; display: grid; place-items: center; }
.pick b { display: block; font-size: 14px; }
.pick small { color: var(--ink-3); font-size: 12px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(28, 10, 60, .35); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal { width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 22px 24px; animation: pop .25s cubic-bezier(.2, 1.2, .4, 1); background: rgba(255, 255, 255, .9); }
.modal.wide { width: min(900px, 100%); }
.modal h3 { font-size: 19px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(10px); } }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 12px 18px; border-radius: 14px; color: #fff; font-weight: 600; box-shadow: var(--shadow); background: linear-gradient(135deg, #9b5cff, #5b2bd6); animation: pop .25s; max-width: 380px; }
.toast.ok { background: linear-gradient(135deg, #2fe0a6, #0aa676); }
.toast.err { background: linear-gradient(135deg, #ff7a95, #e3123f); }

/* ---------- Footer ---------- */
.footer { margin-top: auto; padding: 22px 0 18px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.footer .fl { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; border-radius: 99px; background: rgba(255, 255, 255, .45); border: 1px solid rgba(255, 255, 255, .7); }
.footer .heart { color: var(--c1); }
.footer a { color: inherit; font-weight: 700; text-decoration: none; }

/* language switch */
.lang { display: inline-flex; border-radius: 99px; padding: 3px; background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .8); }
.lang button { border: 0; background: transparent; border-radius: 99px; padding: 5px 11px; font: 700 12px var(--font); color: var(--ink-3); cursor: pointer; }
.lang button.on { background: linear-gradient(135deg, var(--c1), #9b5cff); color: #fff; }

/* empty */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty .big { font-size: 46px; }

/* pager */
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; }

/* spinner */
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { position: relative; display: grid; place-items: center; padding: 40px; overflow: hidden; perspective: 900px; }
.login-hero .orb3d { width: min(420px, 70vw); aspect-ratio: 1; border-radius: 50%; position: relative; transform-style: preserve-3d; animation: orb 14s linear infinite; }
.login-hero .orb3d span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); box-shadow: 0 0 30px rgba(255, 60, 172, .25) inset; }
@keyframes orb { to { transform: rotateY(360deg) rotateX(20deg); } }
.login-title { position: absolute; text-align: center; z-index: 2; }
.login-title h1 { font-size: clamp(42px, 7vw, 92px); font-weight: 900; line-height: .95; margin: 0; background: linear-gradient(100deg, #ff3cac, #ff8a00 30%, #ffd23f 45%, #9b5cff 65%, #22e1ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 8px 18px rgba(155, 92, 255, .35)); background-size: 200% auto; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.login-title p { font-weight: 700; color: var(--ink-2); letter-spacing: .3em; text-transform: uppercase; font-size: 13px; }
.login-box { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(20px, 6vw, 80px); }
.login-box .glass { padding: 34px; max-width: 440px; width: 100%; margin: 0 auto; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { min-height: 300px; } }

/* print */
@media print {
  .no-print, .side, .topbar .btn, .toasts { display: none !important; }
  .aurora { display: none; }
  body { background: #fff; }
  .glass { box-shadow: none; backdrop-filter: none; background: #fff; border: 1px solid #ddd; }
}
