:root {
  --bg-main: #0a0d14;
  --bg-card: #111724;
  --bg-card-surface: #172033;
  --bg-input: #0e1422;
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-gold: #fbbf24;
  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --accent-green: #10b981;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  padding: 32px 20px 60px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1180px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-card);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.brand-wordmark-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
  margin-bottom: 2px;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.system-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
}

.status-live {
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.device-pill {
  color: var(--text-secondary);
}

/* Grid Layout */
.passes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 480px) {
  .passes-grid {
    grid-template-columns: 1fr;
  }
}

/* Panel Card */
.pass-card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-gold {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-cyan {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.panel-serial {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Wallet Card Visual Preview */
.wallet-card-preview {
  position: relative;
  border-radius: 20px;
  padding: 20px;
  color: #ffffff;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.membership-card {
  background: linear-gradient(145deg, #131722, #0c0e14);
}

.ticket-card {
  background: linear-gradient(145deg, #0e172a, #090e1a);
}

.card-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.glow-cyan {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, transparent 70%);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.card-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-logo-img {
  height: 24px;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.card-pass-type {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.highlight-gold {
  color: var(--accent-gold);
}

.highlight-cyan {
  color: var(--accent-cyan);
}

.highlight-white {
  color: #fff;
}

.field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.field-value {
  font-size: 15px;
  font-weight: 600;
}

.card-primary-field .field-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.card-secondary-row, .card-auxiliary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}

.ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.align-right {
  text-align: right;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Event Ticket Graphic Strip */
.ticket-strip-graphic {
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.strip-lights {
  position: absolute;
  top: -20px;
  left: 20%;
  width: 60%;
  height: 80px;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.4), transparent 70%);
  transform: rotate(-10deg);
}

.strip-content {
  position: relative;
  z-index: 2;
}

.light-cyan {
  color: #7dd3fc;
}

.event-title {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 4px;
}

/* Card Barcode Area */
.card-barcode-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  color: #111827;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 128px;
  min-width: 128px;
}

.qr-container img, .qr-container canvas {
  width: 128px;
  height: 128px;
  object-fit: contain;
}

.barcode-alt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #1e293b;
}

/* Actions */
.panel-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.btn-wallet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.btn-wallet:hover {
  background: #111111;
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.btn-wallet:active {
  transform: translateY(0);
}

.btn-wallet-cyan:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.scan-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* Test Controls */
.test-controls-box {
  background: var(--bg-card-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.controls-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-row label, .control-col label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-with-action {
  display: flex;
  gap: 8px;
}

input, select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.btn-quick-bump {
  white-space: nowrap;
  padding: 0 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-quick-bump:hover {
  background: rgba(56, 189, 248, 0.25);
}

.control-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.control-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-update {
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.btn-update:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

.btn-push-only {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-push-only:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

/* Activity Console */
.activity-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.activity-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
}

.activity-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.log-count {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-tool {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.activity-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.meta-card {
  background: var(--bg-card-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.meta-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.meta-value {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 2px;
}

.activity-log-box {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  max-height: 220px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.log-time {
  color: var(--text-muted);
  white-space: nowrap;
}

.log-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-update { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-reg { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-pass { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-apns { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.badge-err { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.log-msg {
  color: #e2e8f0;
  word-break: break-word;
}

.empty-log {
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
  font-style: italic;
}
