:root {
  --bg: #0A0A0C;
  --surface: #141418;
  --surface-2: #1C1C22;
  --line: #2A2A33;
  --ink: #F5F5F7;
  --mute: #9A9AA3;
  --accent: #FF6B2C;
  --accent-2: #E5195E;
  --cyan: #22D3EE;
  --success: #34D399;
  --danger: #F87171;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: 'Inter', system-ui, sans-serif; }

.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #17171C, #0A0A0C);
  position: sticky; top: 0; z-index: 10;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-svg { height: 32px; width: auto; display: block; color: var(--ink); }
.logo { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -0.5px; color: var(--ink); }
.logo .accent { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.badge { font-size: 10px; letter-spacing: 2px; color: var(--mute); border: 1px solid var(--line); padding: 3px 8px; border-radius: 4px; }

.mainnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; min-width: 0; overflow-x: auto; }
.mainnav a { color: var(--mute); text-decoration: none; padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: 0.15s; white-space: nowrap; }
.mainnav a:hover { color: var(--ink); background: var(--surface); }
.mainnav a.active { color: var(--ink); background: var(--surface-2); }

.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.langswitch { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.langswitch a { color: var(--mute); text-decoration: none; padding: 5px 10px; font-size: 11px; font-weight: 600; letter-spacing: 1px; border-radius: 6px; transition: color 0.12s ease, background 0.12s ease; }
.langswitch a:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.langswitch a.active { background: var(--surface-2); color: var(--ink); }

.logout { display: flex; align-items: center; gap: 12px; margin: 0; }
.who { color: var(--mute); font-size: 13px; }
.logout button { background: transparent; border: 1px solid var(--line); color: var(--ink); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.logout button:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 720px) {
  .topbar { gap: 12px; padding: 12px 16px; }
  .logo { font-size: 18px; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .mainnav::-webkit-scrollbar { display: none; }
  .topbar-actions { margin-left: auto; }
  .who { display: none; }
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.wrap-center { max-width: 400px; margin: 80px auto; padding: 0 16px; }

@media (max-width: 720px) {
  .wrap { padding: 20px 16px; }
  .wrap-center { margin: 40px auto; }
}

h1 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -0.5px; margin: 0 0 8px; }
h2 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; margin: 32px 0 12px; }
.sub { color: var(--mute); margin: 0 0 24px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.stat .label { color: var(--mute); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.stat .value { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 700; margin-top: 6px; }
.stat.accent .value { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: table; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: var(--surface-2); color: var(--mute); font-weight: 600; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* Horizontal scroll wrapper for wide tables on mobile */
.scroll-x { overflow-x: auto; border-radius: 12px; margin-bottom: 24px; -webkit-overflow-scrolling: touch; }
.scroll-x > table { margin: 0; }

@media (max-width: 720px) {
  th, td { padding: 10px 12px; font-size: 13px; white-space: nowrap; }
}

a.btn, button.btn {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff; padding: 10px 18px; border-radius: 8px;
  text-decoration: none; border: none; cursor: pointer;
  font-weight: 600; font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.15s ease;
  box-shadow: 0 2px 6px rgba(229, 25, 94, 0.15);
}
a.btn:hover, button.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(255, 107, 44, 0.35), 0 4px 12px rgba(229, 25, 94, 0.25);
  filter: brightness(1.08);
}
a.btn:active, button.btn:active { transform: translateY(0); filter: brightness(0.95); box-shadow: 0 2px 6px rgba(229, 25, 94, 0.15); }

a.btn-ghost, button.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; text-decoration: none; font-size: 13px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}
a.btn-ghost:hover, button.btn-ghost:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(255, 107, 44, 0.06);
  transform: translateY(-1px);
}
a.btn-ghost:active, button.btn-ghost:active { transform: translateY(0); }

.btn-danger {
  background: transparent; border: 1px solid var(--danger); color: var(--danger);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-danger:hover {
  background: var(--danger); color: #0A0A0C;
  box-shadow: 0 8px 20px rgba(248, 113, 113, 0.3);
  transform: translateY(-1px);
}
.btn-danger:active { transform: translateY(0); }

.logout button {
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.logout button:hover { background: rgba(255, 107, 44, 0.08); }

.row-actions { display: flex; gap: 8px; }
.row-actions form { display: inline; }

.form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; max-width: 640px; }
.field { display: block; margin-bottom: 16px; }
.field label { display: block; color: var(--mute); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--ink); padding: 10px 12px; border-radius: 8px; font-family: inherit; font-size: 14px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { min-height: 80px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; gap: 0; }
}

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; }
.pill.night { background: rgba(167, 139, 250, 0.15); color: #A78BFA; }
.pill.day { background: rgba(251, 191, 36, 0.15); color: #FBBF24; }
.pill.valid { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.pill.used { background: rgba(154, 154, 163, 0.15); color: var(--mute); }
.pill.cancelled { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.pill.pub { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.pill.draft { background: rgba(154, 154, 163, 0.15); color: var(--mute); }

.flash { background: var(--surface); border: 1px solid var(--accent); color: var(--accent); padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 48px; text-align: center; color: var(--mute); }

.page-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.page-head .filters { display: flex; gap: 8px; flex-wrap: wrap; }
.page-head .filters input, .page-head .filters select { background: var(--surface); border: 1px solid var(--line); color: var(--ink); padding: 8px 12px; border-radius: 8px; font-size: 13px; }

@media (max-width: 560px) {
  .page-head > div:last-child { width: 100%; display: flex; flex-direction: column; gap: 8px; }
  .page-head .filters { width: 100%; }
  .page-head .filters input { flex: 1; }
}

.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.login-card h1 { text-align: center; margin-bottom: 8px; }
.login-card .sub { text-align: center; }
.login-card button { width: 100%; padding: 12px; }
.login-card .hint { color: var(--mute); font-size: 12px; text-align: center; margin-top: 16px; }

.lang-inline { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.lang-inline a { color: var(--mute); text-decoration: none; padding: 4px 10px; font-size: 11px; font-weight: 600; letter-spacing: 1px; border-radius: 6px; }
.lang-inline a.active { background: var(--surface-2); color: var(--ink); }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--mute); }

/* --- Image grid for admin event edit --- */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }

.image-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.image-card:has(.image-select input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 107, 44, 0.5);
}

.image-select {
  display: block;
  cursor: pointer;
  position: relative;
}
.image-select input { position: absolute; opacity: 0; pointer-events: none; }
.image-select img { display: block; width: 100%; height: 180px; object-fit: cover; }

.image-select .check {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  color: #fff;
}
.image-select:hover .check { background: rgba(0,0,0,0.6); }
.image-card:has(.image-select input:checked) .check {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.image-select .check svg { display: none; width: 14px; height: 14px; }
.image-card:has(.image-select input:checked) .check svg { display: block; }

.image-card:has(.image-select input:checked) .primary-tag { display: inline-block; }
.primary-tag {
  display: none;
  position: absolute; top: 14px; left: 14px; z-index: 3;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 4px 8px; border-radius: 4px;
}

.image-meta {
  padding: 10px 12px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; gap: 8px;
  border-top: 1px solid var(--line);
}
.image-meta form { margin: 0; }

.primary-save {
  display: flex; justify-content: flex-end; align-items: center; gap: 12px;
  margin-bottom: 24px;
}
.primary-save .hint { color: var(--mute); font-size: 13px; }
