:root {
  --navy: #1F3864;
  --blue: #2563a8;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --bg: #f4f6fa;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: #1a1a1a;
}

.topbar {
  background: var(--navy);
  color: white;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand { font-weight: 700; font-size: 20px; }
.brand span { color: #7db6ff; }
.dash-link { color: white; text-decoration: none; font-size: 14px; border: 1px solid rgba(255,255,255,0.4); padding: 6px 12px; border-radius: 6px; }

.scanner-wrap { max-width: 480px; margin: 0 auto; padding: 16px; }

.gate-select { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.gate-select label { font-size: 13px; color: #555; }
.gate-select select { padding: 10px; font-size: 16px; border-radius: 8px; border: 1px solid #ccc; }
.gate-count { font-size: 13px; color: #555; margin-top: 4px; }
.gate-count span { font-weight: 700; color: var(--navy); }

#reader { border-radius: 12px; overflow: hidden; margin-bottom: 14px; }

.result {
  padding: 22px;
  border-radius: 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  transition: background 0.2s;
}
.result.idle { background: #e5e9f0; color: #444; }
.result.valid { background: var(--green); color: white; }
.result.invalid { background: var(--red); color: white; }

.manual-entry { display: flex; gap: 8px; margin-top: 16px; }
.manual-entry input { flex: 1; padding: 10px; font-size: 15px; border-radius: 8px; border: 1px solid #ccc; }
.manual-entry button { padding: 10px 16px; border-radius: 8px; border: none; background: var(--blue); color: white; font-weight: 600; }

.dash-wrap { max-width: 900px; margin: 0 auto; padding: 20px; }
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card { background: white; border-radius: 10px; padding: 16px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card-num { font-size: 28px; font-weight: 700; color: var(--navy); }
.card.warn .card-num { color: var(--amber); }
.card.danger .card-num { color: var(--red); }
.card-label { font-size: 13px; color: #666; margin-top: 4px; }

h2 { font-size: 16px; color: var(--navy); margin-top: 28px; }
table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
th, td { padding: 8px 12px; text-align: left; font-size: 14px; border-bottom: 1px solid #eee; }
th { background: var(--navy); color: white; font-weight: 600; }

#importForm { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
#importForm button { padding: 8px 14px; border-radius: 6px; border: none; background: var(--blue); color: white; font-weight: 600; }
.hint { font-size: 12px; color: #777; }

/* Storefront additions */
.page { max-width: 640px; margin: 0 auto; padding: 20px; }
.event-grid { display: grid; gap: 14px; }
.event-card { display: block; background: white; border-radius: 10px; padding: 16px; text-decoration: none; color: inherit; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.event-date { font-size: 12px; color: #777; }
.event-name { font-size: 18px; font-weight: 700; color: var(--navy); margin: 4px 0; }
.event-venue { font-size: 14px; color: #555; }
.event-meta { color: #666; font-size: 14px; }

.purchase-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.purchase-form label { font-size: 13px; color: #555; font-weight: 600; }
.purchase-form input, .purchase-form select, .purchase-form textarea {
  padding: 10px; border-radius: 8px; border: 1px solid #ccc; font-size: 15px; width: 100%;
}
.purchase-form button {
  padding: 12px; border-radius: 8px; border: none; background: var(--green); color: white; font-weight: 700; font-size: 16px; cursor: pointer;
}

.ticket-card { background: white; border-radius: 12px; padding: 24px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
#qrcode { display: flex; justify-content: center; margin: 16px 0; }
.ticket-code { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: var(--navy); }
.ticket-status { font-weight: 600; margin-top: 6px; }
.status-paid { color: var(--green); }
.status-used { color: var(--amber); }
.status-pending_payment { color: #777; }
.status-cancelled { color: var(--red); }

.footer { text-align: center; color: #999; font-size: 12px; padding: 24px; }
