@font-face {
  font-family: 'PolySans';
  src: url('/static/polysans.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

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

:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f4f4f4;
  --gray-200: #e8e8e8;
  --gray-400: #a0a0a0;
  --gray-600: #555555;
  --gray-900: #111111;
  --green: #16a34a;
  --green-light: #dcfce7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --radius: 8px;
  --font: 'PolySans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--gray-900);
  min-height: 100vh;
  line-height: 1.5;
}

/* Layout */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 80px;
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 520px;
}

.card-wide {
  max-width: 900px;
}

/* Logo */
.logo-wrap {
  margin-bottom: 32px;
  text-align: center;
}

.logo-wrap img {
  height: 120px;
  width: auto;
}

/* Headings */
h1 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: 6px;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 28px;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--gray-200);
  margin: 24px 0;
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 16px;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--black);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; }

.btn-primary {
  background: var(--black);
  color: var(--white);
  width: 100%;
}

.btn-checkin {
  background: var(--green);
  color: var(--white);
  width: 100%;
  font-size: 1.125rem;
  padding: 16px;
  border-radius: 10px;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-900);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-pending   { background: var(--amber-light); color: var(--amber); }
.badge-confirmed { background: #dbeafe; color: #1d4ed8; }
.badge-arrived   { background: var(--green-light); color: var(--green); }

/* Detail rows */
.detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-list li {
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
}

.detail-list .label {
  color: var(--gray-400);
  min-width: 80px;
  font-size: 0.8125rem;
}

.detail-list .value {
  color: var(--gray-900);
  font-weight: 500;
}

/* QR code */
.qr-wrap {
  text-align: center;
  margin: 24px 0;
}

.qr-wrap img {
  width: 220px;
  height: 220px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

/* Success state */
.success-icon {
  width: 48px;
  height: 48px;
  background: var(--green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 20px;
}

.error-icon {
  width: 48px;
  height: 48px;
  background: var(--red-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 20px;
}

/* Admin table */
.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--gray-200);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-600);
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar select,
.filter-bar input {
  width: auto;
  min-width: 160px;
}

.filter-bar .btn {
  width: auto;
}

/* Guard scan — mobile first */
.scan-page .card {
  max-width: 440px;
}

.scan-status-bar {
  text-align: center;
  padding: 8px 0 24px;
}

/* Responsive */
@media (max-width: 540px) {
  .card { padding: 28px 20px; }
  .page { padding: 24px 16px 60px; }
}
