:root {
  --maroon: #7a1f3d;
  --gold: #d4a13d;
  --cream: #fdf6ec;
  --ink: #2b1620;
  --green: #1f8a3d;
  --red: #c0392b;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
}

header.topbar {
  background: linear-gradient(120deg, var(--maroon), #9c2c52);
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

header.topbar h1 { margin: 0; font-size: 1.3rem; }
header.topbar a { color: var(--gold); text-decoration: none; font-weight: 600; margin-left: 16px; }

main {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 20px 60px;
}

.card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(122,31,61,0.08);
  margin-bottom: 20px;
}

h2 { color: var(--maroon); margin-top: 0; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.9rem; }

input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

button, .btn {
  background: var(--maroon);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 18px;
  display: inline-block;
  text-decoration: none;
}

button.secondary { background: transparent; color: var(--maroon); border: 1px solid var(--maroon); }
button.green { background: var(--green); }
button.red { background: var(--red); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.pill.PENDING_PAYMENT { background: #fde9c8; color: #92600a; }
.pill.APPROVAL_PENDING { background: #dbe8ff; color: #1a4f9c; }
.pill.APPROVED { background: #d9f3e0; color: var(--green); }
.pill.REJECTED { background: #fbdedb; color: var(--red); }
.pill.ISSUED { background: #dbe8ff; color: #1a4f9c; }
.pill.USED { background: #e6e6e6; color: #555; }

.error { color: var(--red); font-size: 0.9rem; margin-top: 10px; }
.hint { color: #7a7a7a; font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eee; font-size: 0.9rem; }

#qr-scan-box { width: 100%; max-width: 360px; margin: 0 auto; }
.result-banner { padding: 20px; border-radius: var(--radius); text-align: center; font-size: 1.4rem; font-weight: 800; }
.result-banner.GREEN { background: var(--green); color: white; }
.result-banner.RED { background: var(--red); color: white; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--cream); border-radius: 8px; padding: 14px; }
.stat .num { font-size: 1.6rem; font-weight: 800; color: var(--maroon); }
.stat .label { font-size: 0.8rem; color: #777; }
