:root {
  --bg-color: #0f172a;
  --text-color: #f8fafc;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --success: #10b981;
  --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(59,130,246,0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(16,185,129,0.15), transparent 25%);
  background-attachment: fixed;
}

/* ===== NAV ===== */
.nav {
  display: flex;
  justify-content: space-around;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-item {
  color: #94a3b8;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 6px 12px;
}
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 24px; height: 24px; }

/* ===== LAYOUT ===== */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
  width: 100%;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== GLASS ===== */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* ===== BUTTONS ===== */
.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn.danger { background: var(--danger); }

/* ===== INPUTS ===== */
input[type="text"] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(15,23,42,0.6);
  color: white;
  margin-bottom: 16px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
input[type="text"]:focus { border-color: var(--primary); }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ===== HEADINGS ===== */
h2 { margin-top: 0; margin-bottom: 20px; font-size: 20px; }
h3 { margin: 0; }

/* ===== TICKET CARD ===== */
.ticket-card { text-align: center; margin-top: 20px; }

.ticket-success-label {
  font-size: 15px;
  color: var(--success);
  font-weight: 600;
  margin-bottom: 12px;
}

.qr-container {
  background: white;
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
  margin: 8px 0 12px;
}
.qr-container canvas { display: block; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card { text-align: center; }
.stat-value { font-size: 32px; font-weight: bold; color: var(--primary); }

/* ===== PROGRESS BAR ===== */
.progress-track {
  background: rgba(15,23,42,0.6);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ===== SUMMARY ROW ===== */
.summary-row {
  display: flex;
  justify-content: space-between;
  background: rgba(15,23,42,0.5);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #94a3b8;
  margin-top: 4px;
}
.summary-row strong { color: #f8fafc; }

/* ===== SCANNER ===== */
#reader {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #000;
}

/* ===== SCAN TOAST ===== */
.scan-toast {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
  padding: 20px;
  animation: fadeinout 2s forwards;
}
.scan-toast.success { background: rgba(16,185,129,0.85); }
.scan-toast.error   { background: rgba(239,68,68,0.85); }
.scan-toast h3 { color: white; margin: 0 0 8px; font-size: 22px; }
.scan-toast p  { color: rgba(255,255,255,0.9); margin: 0; font-weight: 500; }
.scan-toast svg { margin-bottom: 8px; }

@keyframes fadeinout {
  0%   { opacity: 0; transform: scale(0.95); }
  10%  { opacity: 1; transform: scale(1); }
  80%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}
