:root {
  --bg: #1a1a2e;
  --fg: #e0e0e0;
  --accent: #3a7bd5;
  --card-bg: #16213e;
  --border: #0f3460;
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f1c40f;
  --muted: #7f8c8d;
  --button-text: #ffffff;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header, footer {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

header nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  border-bottom: none;
  color: var(--muted);
  font-size: 0.85rem;
}

h1 {
  margin-bottom: 0.75rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  background: var(--card-bg);
  border-radius: 6px;
  overflow-x: auto;
  display: block;
}

th, td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--accent);
  font-weight: 600;
}

tr.status-pending td { background: rgba(241, 196, 15, 0.1); }
tr.status-approved td { background: rgba(46, 204, 113, 0.1); }
tr.status-denied td { background: rgba(231, 76, 60, 0.1); }
tr.status-expired td, tr.status-cancelled td { background: rgba(127, 140, 141, 0.1); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-pending { background: var(--warning); color: #000; }
.badge-approved { background: var(--success); color: #fff; }
.badge-denied { background: var(--danger); color: #fff; }
.badge-expired, .badge-cancelled { background: var(--muted); color: #fff; }

.alert {
  padding: 0.75rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.alert-error {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid var(--danger);
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

input[type="password"] {
  width: 100%;
  padding: 0.5rem;
  background: #0f1a2f;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
}

.btn, button[type="submit"] {
  background: var(--accent);
  color: var(--button-text);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-block;
  margin-right: 0.3rem;
}

.btn:hover, button[type="submit"]:hover {
  opacity: 0.9;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.qr-image {
  display: block;
  max-width: 300px;
  margin: 1rem 0;
  border: 2px solid var(--border);
  border-radius: 6px;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
}

/* mobile */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  table {
    font-size: 0.8rem;
  }
}
