/* ==========================================================================
   FairTicket V2 — Design System
   Modern event marketplace + premium SaaS + Web3 trust.
   Event website first, blockchain second. Brand blue (logo) for primary
   actions, coral accent for highlights, navy for depth.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Color */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #111827;
  --text-secondary: #64748B;
  --text-tertiary: #94A3B8;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-tint: #EFF4FF;
  --navy: #0F172A;
  --navy-soft: #1E293B;
  /* Coral: --accent chi dung cho chi tiet trang tri (cham, gach chan, nen
     nhat); chu/nut tren nen trang dung --accent-strong de dat tuong phan AA. */
  --accent: #FF6B57;
  --accent-strong: #D03B27;
  --accent-tint: #FFF1EE;
  --success-bg: #ECFDF3;
  --success-text: #15803D;
  --warning-bg: #FFFBEB;
  --warning-text: #B45309;
  --neutral-bg: #F1F5F9;
  --neutral-text: #475569;
  --danger-bg: #FEF2F2;
  --danger-text: #B91C1C;

  /* Type */
  --font-sans: "Be Vietnam Pro", "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;

  /* Spacing (8px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 48px;
  --sp-7: 64px;
  --sp-8: 96px;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 20px;

  /* Shadow — soft */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  --header-h: 68px;
  --container-w: 1280px;
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

* { box-sizing: border-box; }

html, body {
  padding: 0;
  margin: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Type scale ---------- */

h1, .h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
h2, .h2 {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}
h3, .h3 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
}
p, .body { font-size: 15px; line-height: 1.6; color: var(--text); margin: 0; }
.text-sm { font-size: 13px; line-height: 1.5; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.tabular-nums { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ---------- Layout ---------- */

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.page { padding-bottom: var(--sp-8); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 var(--sp-3); }
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-h);
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--container-w);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.header-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 40px;
  width: 260px;
  padding: 0 var(--sp-3);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--neutral-bg);
  color: var(--text-tertiary);
  flex-shrink: 1;
  min-width: 0;
}
.header-search:focus-within { border-color: var(--primary); background: var(--surface); }
.header-search input {
  border: none; outline: none; background: transparent;
  font: inherit; font-size: 14px; color: var(--text);
  width: 100%; min-width: 0;
}
.header-search input::-webkit-search-cancel-button { display: none; }
.header-actions .header-icon-btn { display: none; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; flex-shrink: 0; }

/* Wallet menu */
.wallet-menu { position: relative; }
.wallet-chip__dot.wallet-chip__dot--bad { background: var(--danger-text); }
.wallet-btn { background: none; border: none; padding: 0; border-radius: var(--radius-sm); }
.wallet-btn:hover .wallet-chip { border-color: var(--text-tertiary); }
.wallet-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  z-index: 60;
}
.wallet-dropdown__head { padding: var(--sp-2) var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-1); }
.wallet-dropdown__addr { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); font-size: 13px; }
.wallet-dropdown__net { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.wallet-dropdown a, .wallet-dropdown button.menu-item {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%;
  padding: 9px var(--sp-2);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text);
  background: none; border: none; text-align: left;
}
.wallet-dropdown a:hover, .wallet-dropdown button.menu-item:hover { background: var(--neutral-bg); }
.wallet-dropdown .menu-item--danger { color: var(--danger-text); }
.copy-btn {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 6px; padding: 2px 8px; font-size: 12px; color: var(--text-secondary);
}
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  flex-shrink: 0;
}
.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex: 1;
  min-width: 0;
}
.main-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--sp-2) 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text); }
.main-nav a.active { color: var(--text); border-bottom-color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; margin-left: auto; }

@media (max-width: 1180px) {
  .header-search { display: none; }
  .header-actions .header-icon-btn { display: inline-flex; padding: 0 10px; }
}
@media (max-width: 900px) {
  .main-nav { gap: var(--sp-3); }
}
@media (max-width: 760px) {
  .header-actions .header-mytickets { display: none; }
  .site-header { height: auto; }
  .site-header__inner {
    height: auto;
    flex-wrap: wrap;
    padding: var(--sp-2) var(--sp-3);
    gap: var(--sp-2);
  }
  .brand { order: 1; }
  .header-actions { order: 2; margin-left: auto; }
  .main-nav {
    order: 3;
    width: 100%;
    flex: none;
    gap: var(--sp-4);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .main-nav::-webkit-scrollbar { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 40px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--neutral-bg); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--neutral-bg); color: var(--text); }

.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #000; }

.btn-accent { background: var(--accent-strong); color: #fff; }
.btn-accent:hover:not(:disabled) { background: #B5301E; }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-tint); }

.btn-sm { height: 34px; padding: 0 var(--sp-3); font-size: 13px; }
.btn-lg { height: 46px; padding: 0 var(--sp-5); font-size: 15px; }
.btn-block { width: 100%; }

.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 40px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}
.wallet-chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success-text); flex-shrink: 0; }

/* ---------- Spinner ---------- */

.spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.spinner-dark { border: 2px solid rgba(17,24,39,0.15); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Category bar ---------- */

.category-bar {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding: var(--sp-4) 0 var(--sp-3);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-bar::-webkit-scrollbar { display: none; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 var(--sp-3);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--text);
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cat-chip .icon-sm { color: var(--text-secondary); }
.cat-chip:hover { border-color: var(--border-strong); }
.cat-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-chip.active .icon-sm { color: #fff; }

/* ---------- Hero carousel ---------- */

.hero-carousel {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--navy);
  aspect-ratio: 21 / 8;
  min-height: 380px;
  margin-bottom: var(--sp-6);
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  display: flex;
  align-items: flex-end;
}
.hero-slide.is-active { opacity: 1; visibility: visible; }
.hero-slide__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15,23,42,0.88) 0%, rgba(15,23,42,0.55) 45%, rgba(15,23,42,0.05) 100%),
              linear-gradient(0deg, rgba(15,23,42,0.55) 0%, rgba(15,23,42,0) 45%);
}
.hero-slide__content {
  position: relative;
  padding: var(--sp-6) var(--sp-7) var(--sp-7);
  color: #fff;
  max-width: 700px;
}
.hero-slide__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.14); color: #fff;
}
.hero-slide__eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-slide h1, .hero-slide h2.hero-slide__title {
  color: #fff;
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: var(--sp-3);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-slide__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); font-size: 15px; color: rgba(255,255,255,0.88); }
.hero-slide__meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-slide p.hero-slide__lead { color: rgba(255,255,255,0.86); margin-top: var(--sp-3); font-size: 16px; max-width: 520px; }
.hero-slide__cta { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }
.hero-slide .btn-secondary { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.5); }
.hero-slide .btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.22); }

.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.92); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 2;
}
.carousel-nav:hover { background: #fff; }
.carousel-nav--prev { left: var(--sp-3); }
.carousel-nav--next { right: var(--sp-3); }
.carousel-dots {
  position: absolute; left: var(--sp-7); bottom: var(--sp-4);
  display: flex; gap: 8px; z-index: 2;
}
.carousel-dot {
  width: 8px; height: 8px; padding: 0; border-radius: 999px; border: none;
  background: rgba(255,255,255,0.45);
  transition: width 0.2s ease, background 0.2s ease;
}
.carousel-dot.is-active { width: 24px; background: #fff; }

@media (max-width: 760px) {
  .hero-carousel { aspect-ratio: auto; min-height: 460px; margin-bottom: var(--sp-5); }
  .hero-slide__scrim { background: linear-gradient(0deg, rgba(15,23,42,0.92) 0%, rgba(15,23,42,0.55) 55%, rgba(15,23,42,0.1) 100%); }
  .hero-slide__content { padding: var(--sp-4) var(--sp-4) var(--sp-6); }
  .carousel-nav { display: none; }
  .carousel-dots { left: var(--sp-4); bottom: var(--sp-3); }
}

/* ---------- Home sections ---------- */

.home-section { margin-bottom: var(--sp-7); }
@media (max-width: 640px) { .home-section { margin-bottom: var(--sp-6); } }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-3); }
@media (max-width: 1100px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
.cat-tile {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.cat-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-tile__icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-tint); color: var(--primary);
}
.cat-tile:nth-child(even) .cat-tile__icon { background: var(--accent-tint); color: var(--accent-strong); }
.cat-tile__name { font-size: 15px; font-weight: 600; }
.cat-tile__count { font-size: 13px; color: var(--text-secondary); }

/* Upcoming list */
.upcoming-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
@media (max-width: 860px) { .upcoming-list { grid-template-columns: 1fr; } }
.upcoming-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.upcoming-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.date-block {
  width: 60px; flex-shrink: 0; text-align: center;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
}
.date-block__month { background: var(--accent-strong); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 0; text-transform: uppercase; }
.date-block__day { font-size: 22px; font-weight: 700; padding: 4px 0 6px; font-variant-numeric: tabular-nums; }
.upcoming-item__img { width: 88px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.upcoming-item__main { flex: 1; min-width: 0; }
.upcoming-item__title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-item__meta { font-size: 13px; color: var(--text-secondary); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .upcoming-item__img { display: none; } }

/* Resale */
.resale-banner {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  color: var(--navy);
  font-size: 14px;
  margin-bottom: var(--sp-4);
}
.resale-banner .icon { color: var(--accent-strong); }
.resale-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.resale-card__img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--neutral-bg); }
.resale-card__body { padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.resale-card__title { font-size: 15px; font-weight: 600; }
.resale-card__sub { font-size: 13px; color: var(--text-secondary); }
.price-compare { display: flex; flex-direction: column; gap: 4px; padding: var(--sp-2) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 13px; }
.price-compare__row { display: flex; justify-content: space-between; gap: var(--sp-2); }
.price-compare__row span:first-child { color: var(--text-secondary); }
.price-compare__resale { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.diff-up { color: var(--warning-text); }
.diff-down { color: var(--success-text); }
.resale-card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: auto; }

/* Benefits V2 */
.benefit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
@media (max-width: 960px) { .benefit-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .benefit-grid { grid-template-columns: 1fr; } }
.benefit-card { padding: var(--sp-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.benefit-card__icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; margin-bottom: var(--sp-3); }
.benefit-card h3 { font-size: 16px; margin-bottom: 6px; }
.benefit-card p { font-size: 14px; color: var(--text-secondary); }

/* ---------- Section heading ---------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  gap: var(--sp-3);
}
.section-head p { color: var(--text-secondary); margin-top: var(--sp-1); }
.section-head .btn { flex-shrink: 0; }

/* ---------- Events toolbar ---------- */

.events-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-4);
}
.events-toolbar .field-search {
  display: flex; align-items: center; gap: var(--sp-2);
  height: 42px; flex: 1 1 280px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-tertiary);
}
.events-toolbar .field-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.events-toolbar input[type="search"] { border: none; outline: none; font: inherit; font-size: 14px; width: 100%; background: transparent; color: var(--text); }
.events-toolbar select {
  height: 42px; padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font: inherit; font-size: 14px; color: var(--text);
}
.toggle-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.result-count { font-size: 13px; color: var(--text-secondary); margin-bottom: var(--sp-3); }

/* ---------- Card ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  display: flex;
  flex-direction: column;
}
.event-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); }
.event-card__img-wrap { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--neutral-bg); }
.event-card__img { width: 100%; height: 100%; object-fit: cover; }
.event-card__tags { position: absolute; top: var(--sp-2); left: var(--sp-2); right: var(--sp-2); display: flex; justify-content: space-between; gap: var(--sp-2); }
.event-card__cat { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.94); color: var(--navy); }
.event-card__body { padding: var(--sp-3); display: flex; flex-direction: column; flex: 1; }
.event-card__date { font-size: 12px; font-weight: 600; color: var(--accent-strong); text-transform: uppercase; letter-spacing: 0.03em; }
.event-card__title {
  font-size: 16px; font-weight: 600; line-height: 1.35; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.event-card__meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); margin-top: 6px; min-width: 0; }
.event-card__meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-card__price { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); font-size: 13px; color: var(--text-secondary); margin-top: auto; padding-top: var(--sp-3); }
.event-card__price strong { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.event-card__price-wrap { border-top: 1px solid var(--border); margin-top: var(--sp-3); }

/* ---------- Badge / Status ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral-text); }
.badge-primary { background: var(--primary-tint); color: var(--primary); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-4); }
.tab {
  padding: var(--sp-2) 0 var(--sp-2);
  margin-bottom: -1px;
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  background: none; border-left: none; border-right: none; border-top: none;
}
.tab.active { color: var(--text); border-bottom-color: var(--text); }

/* ---------- Event detail ---------- */

.detail-layout {
  display: grid;
  grid-template-columns: 62% 1fr;
  gap: var(--sp-5);
  align-items: start;
  margin-top: var(--sp-4);
}
@media (max-width: 920px) { .detail-layout { grid-template-columns: 1fr; } }

.info-list { display: flex; flex-direction: column; }
.info-row {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--border);
}
.info-row__label { width: 160px; flex-shrink: 0; color: var(--text-secondary); font-size: 14px; }
.info-row__value { font-size: 14px; }

.qty-control {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-control button {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: none; font-size: 16px; color: var(--text);
}
.qty-control button:hover { background: var(--neutral-bg); }
.qty-control span { width: 28px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Form ---------- */

.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.field textarea { resize: vertical; min-height: 88px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.upload-box {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ---------- Wizard ---------- */

.wizard-steps {
  display: flex; align-items: center; gap: var(--sp-2);
  margin: var(--sp-4) 0 var(--sp-6);
}
.wizard-step { display: flex; align-items: center; gap: var(--sp-2); }
.wizard-step__dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--neutral-bg); color: var(--text-tertiary);
  border: 1px solid var(--border);
}
.wizard-step.active .wizard-step__dot { background: var(--primary); color: #fff; border-color: var(--primary); }
.wizard-step.done .wizard-step__dot { background: var(--text); color: #fff; border-color: var(--text); }
.wizard-step__label { font-size: 13px; font-weight: 600; color: var(--text-tertiary); white-space: nowrap; }
.wizard-step.active .wizard-step__label, .wizard-step.done .wizard-step__label { color: var(--text); }
.wizard-divider { flex: 1; height: 1px; background: var(--border); margin: 0 var(--sp-1); min-width: var(--sp-3); }

@media (max-width: 480px) {
  .wizard-steps { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .wizard-step__label { font-size: 12px; }
}

.wizard-panel { max-width: 620px; }
.wizard-actions { display: flex; justify-content: space-between; margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border); }

.review-list { display: flex; flex-direction: column; }
.review-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; border-top: 1px solid var(--border); font-size: 14px; }
.review-row__label { color: var(--text-secondary); }
.review-row__value { font-weight: 600; }

/* ---------- My events (rows) ---------- */

.filter-row { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.chip {
  height: 32px; padding: 0 var(--sp-3);
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  display: inline-flex; align-items: center;
}
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

.event-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3);
  border-top: 1px solid var(--border);
}
.event-row:first-child { border-top: none; }
.event-row__thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; background: var(--neutral-bg); flex-shrink: 0; }
.event-row__main { flex: 1; min-width: 0; }
.event-row__title { font-size: 14px; font-weight: 600; }
.event-row__meta { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.event-row__actions { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }

@media (max-width: 640px) {
  .event-row { flex-wrap: wrap; }
  .event-row__actions { width: 100%; justify-content: flex-end; }
}

/* ---------- Checkout ---------- */

.mini-event-card { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3); margin-bottom: var(--sp-4); }
.mini-event-card img { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; }
.checkout-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; font-size: 14px; }
.checkout-row .text-secondary { font-size: 14px; }
.checkout-divider { height: 1px; background: var(--border); margin: var(--sp-2) 0; }
.checkout-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; padding-top: var(--sp-2); }
.eth-equiv { text-align: right; font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: var(--sp-3); right: var(--sp-3);
  bottom: calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
  max-width: 420px; margin: 0 auto;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  border: 1px solid var(--border);
  background: var(--surface);
}
.toast-success { background: var(--success-bg); color: var(--success-text); border-color: transparent; }
.toast-error { background: var(--danger-bg); color: var(--danger-text); border-color: transparent; }
.toast-info { background: var(--primary-tint); color: var(--primary); border-color: transparent; }

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3);
  z-index: 200;
}
.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-4);
}

/* ---------- QR ---------- */

.qr-thumb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qr-thumb svg { display: block; width: 100%; height: 100%; }

/* ---------- Banner ---------- */

.banner {
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 13px;
  line-height: 1.6;
  margin: var(--sp-3) 0;
}
.banner code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: var(--sp-7) 0 var(--sp-4);
  margin-top: 0;
  font-size: 14px;
}
.site-footer__inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: var(--sp-2); color: #fff; font-weight: 700; font-size: 17px; }
.footer-brand img { width: 30px; height: 30px; }
.footer-about { margin-top: var(--sp-3); color: rgba(255,255,255,0.65); font-size: 14px; line-height: 1.6; max-width: 360px; }
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 600; margin: 0 0 var(--sp-3); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2);
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 13px; color: rgba(255,255,255,0.55);
}
.footer-ca { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Empty state ---------- */

.empty-state { text-align: center; padding: var(--sp-7) var(--sp-3); color: var(--text-secondary); }
.empty-state h3 { color: var(--text); margin-bottom: var(--sp-1); }

/* ---------- Skeleton ---------- */

.skel { background: var(--neutral-bg); border-radius: var(--radius-sm); position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- Network banner action ---------- */

.banner-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .event-card:hover, .cat-tile:hover { transform: none; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Event detail V2 ---------- */

.link { color: var(--primary); }
.link:hover { text-decoration: underline; }
.hint-sm { font-size: 12px; color: var(--text-tertiary); margin-top: var(--sp-2); line-height: 1.5; }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-tertiary); padding: var(--sp-3) 0; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb [aria-current] { color: var(--text); max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.event-hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--navy);
  aspect-ratio: 21 / 8; min-height: 320px;
  display: flex; align-items: flex-end;
}
.event-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.event-hero__scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(15,23,42,0.9) 0%, rgba(15,23,42,0.4) 50%, rgba(15,23,42,0.05) 100%); }
.event-hero__content { position: relative; padding: var(--sp-5) var(--sp-6); color: #fff; max-width: 820px; }
.event-hero__tags { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.event-hero__title { color: #fff; font-size: clamp(26px, 4vw, 44px); line-height: 1.15; margin-top: var(--sp-3); overflow-wrap: anywhere; }
.event-hero__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); font-size: 15px; color: rgba(255,255,255,0.9); }
.event-hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) {
  .event-hero { aspect-ratio: auto; min-height: 300px; }
  .event-hero__content { padding: var(--sp-4); }
}

.detail-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-5); margin-top: var(--sp-5); }
@media (max-width: 960px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-main { min-width: 0; }

.detail-tabs {
  position: sticky; top: var(--header-h); z-index: 5;
  display: flex; gap: var(--sp-4); overflow-x: auto; scrollbar-width: none;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}
.detail-tabs::-webkit-scrollbar { display: none; }
.detail-tabs a { padding: var(--sp-3) 0; font-size: 14px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; border-bottom: 2px solid transparent; }
.detail-tabs a:hover { color: var(--text); border-bottom-color: var(--border-strong); }

.detail-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--sp-4); margin-bottom: var(--sp-4);
  scroll-margin-top: calc(var(--header-h) + 64px);
}
.detail-section > h2 { font-size: 20px; margin-bottom: var(--sp-3); }
.detail-desc { white-space: pre-line; color: var(--text); line-height: 1.7; overflow-wrap: anywhere; }
.detail-section .info-row:first-child { border-top: none; }
@media (max-width: 640px) {
  .info-row { flex-direction: column; gap: 2px; }
  .info-row__label { width: auto; font-size: 13px; }
}

.policy-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.policy-list li { display: flex; gap: var(--sp-2); font-size: 14px; line-height: 1.6; }
.policy-list .icon-sm { color: var(--primary); margin-top: 3px; }

.verify-box summary {
  display: flex; align-items: center; gap: var(--sp-2);
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--primary);
  list-style: none;
}
.verify-box summary::-webkit-details-marker { display: none; }
.verify-box[open] summary { margin-bottom: var(--sp-2); }
.verify-box .info-row__value { overflow-wrap: anywhere; }

/* Ticket panel */
.ticket-panel {
  position: sticky; top: calc(var(--header-h) + var(--sp-3));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-4);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.ticket-panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.ticket-panel__head h2 { font-size: 20px; }
#tier-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.tier-option {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tier-option:hover { border-color: var(--border-strong); }
.tier-option.is-selected { border-color: var(--primary); background: var(--primary-tint); }
.tier-option.is-disabled { cursor: not-allowed; opacity: 0.55; }
.tier-option input { accent-color: var(--primary); width: 18px; height: 18px; flex-shrink: 0; margin: 0; }
.tier-option__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tier-option__name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.tier-option__sub { font-size: 12px; color: var(--text-secondary); }
.tier-option__price { font-size: 15px; font-weight: 700; white-space: nowrap; }
.supply-bar { display: block; height: 4px; border-radius: 999px; background: var(--neutral-bg); overflow: hidden; margin-top: 3px; }
.supply-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.qty-row, .total-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.qty-row { margin-top: var(--sp-4); font-size: 14px; color: var(--text-secondary); }
.total-row { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); font-size: 15px; }
.total-row strong { font-size: 20px; }
.qty-control button:disabled { opacity: 0.35; cursor: not-allowed; }
.ticket-panel .btn-block { margin-top: var(--sp-3); }

.sticky-buy { display: none; }
@media (max-width: 960px) {
  .ticket-panel { position: static; }
  .sticky-buy {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: var(--sp-2) var(--sp-3) calc(var(--sp-2) + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(15,23,42,0.08);
  }
  .sticky-buy strong { font-size: 17px; }
  body:has(.sticky-buy) .site-footer { padding-bottom: 96px; }
}

/* Organizer */
.organizer-panel { border-color: var(--primary); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: var(--sp-3); border-radius: var(--radius-sm); background: var(--neutral-bg); }
.stat__label { font-size: 12px; color: var(--text-secondary); }
.stat__value { font-size: 18px; font-weight: 700; margin-top: 4px; }
.organizer-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.checkin-box { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.checkin-box h3 { margin-bottom: 4px; }
.checkin-row { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.checkin-row input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px;
  font: inherit; font-size: 15px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.checkin-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.checkin-result { margin-top: var(--sp-3); padding: var(--sp-3); border-radius: var(--radius-sm); font-size: 14px; line-height: 1.6; }
.checkin-result--ok { background: var(--success-bg); color: var(--success-text); }
.checkin-result--bad { background: var(--danger-bg); color: var(--danger-text); }

.modal-card--wide { max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; }

/* ---------- My tickets V2 ---------- */

.balance-card {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.balance-card.has-funds { border-color: var(--success-text); background: var(--success-bg); }
.balance-card__value { font-size: 22px; font-weight: 700; margin-top: 4px; }

.ticket-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 1024px) { .ticket-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ticket-grid { grid-template-columns: 1fr; } }

.ticket-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ticket-card.is-muted .ticket-card__media img { filter: grayscale(0.7); opacity: 0.85; }
.ticket-card__media { position: relative; aspect-ratio: 16 / 7; background: var(--neutral-bg); }
.ticket-card__media img { width: 100%; height: 100%; object-fit: cover; }
.ticket-card__status { position: absolute; top: var(--sp-2); right: var(--sp-2); }
.ticket-card__body { padding: var(--sp-3) var(--sp-3) var(--sp-2); }
.ticket-card__title { font-size: 16px; line-height: 1.35; margin-top: 6px; overflow-wrap: anywhere; }
.ticket-card__tier {
  display: flex; justify-content: space-between; gap: var(--sp-2);
  margin-top: var(--sp-2); padding: 6px 10px;
  border-radius: 8px; background: var(--neutral-bg);
  font-size: 13px; font-weight: 600;
}
/* Duong rach ve: 2 nua hinh tron hai ben + net dut */
.ticket-card__perf { position: relative; height: 1px; margin: var(--sp-2) 0; border-top: 2px dashed var(--border); }
.ticket-card__perf::before, .ticket-card__perf::after {
  content: ""; position: absolute; top: -10px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
}
.ticket-card__perf::before { left: -10px; }
.ticket-card__perf::after { right: -10px; }
.ticket-card__foot { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3) var(--sp-3); }
.ticket-card__qr { width: 64px; height: 64px; flex-shrink: 0; padding: 0; cursor: pointer; }
.ticket-card__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.ticket-modal__head { display: flex; gap: var(--sp-4); align-items: flex-start; }
.ticket-modal__head .qr-thumb { width: 180px; height: 180px; flex-shrink: 0; }
.ticket-modal__info h3 { margin-top: var(--sp-2); font-size: 20px; overflow-wrap: anywhere; }
.ticket-modal__subhead { font-size: 15px; margin: var(--sp-4) 0 var(--sp-2); }
.ticket-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.ticket-timeline li { position: relative; display: flex; justify-content: space-between; gap: var(--sp-2); color: var(--text); }
.ticket-timeline li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
@media (max-width: 520px) {
  .ticket-modal__head { flex-direction: column; align-items: center; text-align: center; }
  .ticket-modal__head .qr-thumb { width: 220px; height: 220px; }
}

/* ---------- Checkout V2 ---------- */

.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-4); align-items: start; }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-card { padding: var(--sp-4); margin-bottom: var(--sp-4); border-radius: var(--radius-lg); }
.checkout-summary { position: sticky; top: calc(var(--header-h) + var(--sp-3)); }
.checkout-summary h2 { margin-bottom: var(--sp-2); }
@media (max-width: 900px) { .checkout-summary { position: static; } }

.check-list, .tx-list { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.check-item { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--neutral-bg); }
.check-item > span:nth-child(2) { flex: 1; min-width: 180px; }
.check-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--text-tertiary);
}
.check-item.is-ok .check-dot { background: var(--success-text); }
.check-item.is-bad { background: var(--danger-bg); color: var(--danger-text); }
.check-item.is-bad .check-dot { background: var(--danger-text); }
.check-item.is-pending .check-dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.tx-item { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 14px; }
.tx-item__label { font-weight: 600; white-space: nowrap; }
.tx-item__state { text-align: right; color: var(--text-secondary); }
.tx-item.is-active { border-color: var(--primary); background: var(--primary-tint); }
.tx-item.is-active .tx-item__state { color: var(--primary); }
.tx-item.is-ok { border-color: transparent; background: var(--success-bg); }
.tx-item.is-ok .tx-item__state { color: var(--success-text); }
.tx-item.is-bad { border-color: transparent; background: var(--danger-bg); }
.tx-item.is-bad .tx-item__state { color: var(--danger-text); }
.tx-item.is-skip { opacity: 0.55; }

.checkout-done { margin-top: var(--sp-4); padding: var(--sp-4); border-radius: var(--radius-md); background: var(--success-bg); }
.checkout-done h3 { color: var(--success-text); }
.checkout-done p { margin-top: 4px; font-size: 14px; }
.checkout-done--bad { background: var(--danger-bg); }
.checkout-done--bad h3 { color: var(--danger-text); }
.checkout-done__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.is-disabled-link { pointer-events: none; opacity: 0.45; }

/* ---------- Organizer dashboard ---------- */

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
@media (max-width: 860px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi-grid .stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-4); }
.kpi-grid .stat__value { font-size: 22px; }
.stat__sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.org-table-wrap { overflow-x: auto; padding: 0; }
.org-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.org-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.org-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.org-table tr:last-child td { border-bottom: none; }
.org-table .supply-bar { width: 80px; }
.org-table__name { font-weight: 600; }
.org-table__actions { text-align: right; white-space: nowrap; }
.org-table__actions .btn + .btn { margin-left: 6px; }
@media (max-width: 760px) {
  .org-table thead { display: none; }
  .org-table, .org-table tbody, .org-table tr, .org-table td { display: block; width: 100%; }
  .org-table tr { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
  .org-table td { border: none; padding: 4px 0; display: flex; justify-content: space-between; gap: var(--sp-2); }
  .org-table td::before { content: attr(data-label); color: var(--text-secondary); font-size: 13px; }
  .org-table__actions { justify-content: flex-end !important; padding-top: 8px !important; }
  .org-table__actions::before { content: none !important; }
}

/* ---------- Check-in ---------- */

.checkin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); align-items: start; }
@media (max-width: 860px) { .checkin-grid { grid-template-columns: 1fr; } }
.scanner {
  position: relative; margin: var(--sp-3) 0;
  aspect-ratio: 4 / 3; border-radius: var(--radius-md); overflow: hidden;
  background: var(--navy);
}
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner__placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: rgba(255,255,255,0.6); font-size: 14px; }
.checkin-result--warn { background: var(--warning-bg); color: var(--warning-text); }
.checkin-result--info { background: var(--primary-tint); color: var(--primary); }
.checkin-log { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }

.checkin-code { margin-top: var(--sp-3); }
#modal-qr.is-dynamic { width: 240px; height: 240px; border-color: var(--accent-strong); border-width: 2px; }
#modal-qr.is-expired { opacity: 0.2; filter: blur(2px); }
@media (max-width: 520px) { #modal-qr.is-dynamic { width: 260px; height: 260px; } }
.ticket-card__cat { position: absolute; top: var(--sp-2); left: var(--sp-2); }

/* ---------- Ban do ---------- */

.map-frame { display: block; width: 100%; height: 100%; border: 0; }
.map-wrap { margin: var(--sp-3) 0; height: 320px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); background: var(--neutral-bg); }
.map-picker { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.map-picker__preview { height: 220px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--neutral-bg); }
.map-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-tertiary); font-size: 13px; }
@media (max-width: 640px) { .map-wrap { height: 240px; } }

/* ---------- Dia chi kieu TMDT ---------- */

.addr-fieldset { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-3); margin: 0 0 var(--sp-4); background: var(--surface); }
.addr-fieldset legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
.addr-box .field-row { margin-bottom: 0; }
.field select:disabled, .field input:disabled { background: var(--neutral-bg); color: var(--text-tertiary); cursor: not-allowed; }

/* ---------- Ma QR phong to ---------- */

.qr-fullscreen {
  position: fixed; inset: 0; z-index: 300;
  background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3);
  padding: var(--sp-3);
  cursor: pointer;
}
.qr-fullscreen__code { width: min(92vw, 78vh, 560px); aspect-ratio: 1; }
.qr-fullscreen__code svg { display: block; width: 100%; height: 100%; }
.qr-fullscreen__label { font-size: 14px; color: var(--text-secondary); text-align: center; }

/* ---------- Check-in lien tuc ---------- */

.ci-auto { display: flex; gap: var(--sp-2); align-items: flex-start; max-width: 760px; margin: 0 0 var(--sp-4); padding: var(--sp-3); border-radius: var(--radius-md); background: var(--primary-tint); font-size: 14px; line-height: 1.5; cursor: pointer; }
.ci-auto input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.ci-status { padding: var(--sp-4) var(--sp-3); border-radius: var(--radius-md); font-size: 18px; font-weight: 700; line-height: 1.4; text-align: center; margin-bottom: var(--sp-3); }
.ci-status--idle { background: var(--neutral-bg); color: var(--text-secondary); font-weight: 600; font-size: 16px; }
.ci-status--info { background: var(--primary-tint); color: var(--primary); }
.ci-status--ok { background: var(--success-text); color: #fff; }
.ci-status--warn { background: var(--warning-bg); color: var(--warning-text); }
.ci-status--bad { background: var(--danger-text); color: #fff; }
.ci-stats { font-size: 14px; margin-top: var(--sp-3); }
.text-danger { color: var(--danger-text); }
.ci-log-item { display: flex; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; background: var(--neutral-bg); }
.ci-log-item--ok { background: var(--success-bg); }
.ci-log-item--fail { background: var(--danger-bg); color: var(--danger-text); }

/* ---------- CTV soat ve ---------- */

.staff-list { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.staff-item { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 8px 12px; border-radius: var(--radius-sm); background: var(--neutral-bg); font-size: 14px; }
.staff-item__actions { display: flex; align-items: center; gap: 6px; }
