/* SIAP - Sistem Absensi Panitia */
:root {
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --green: #16a34a;
  --red: #dc2626;
  --gray: #64748b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #cbd5e1;
}

* {
  box-sizing: border-box;
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: #0f172a;
}

header {
  background: var(--blue);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

header h1 {
  margin: 0;
  font-size: 18px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

main {
  max-width: 1050px;
  margin: 20px auto;
  padding: 0 16px;
}

.card {
  background: var(--card);
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
  margin-bottom: 18px;
}

.center {
  text-align: center;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.nav a {
  padding: 9px 14px;
  border-radius: 8px;
  text-decoration: none;
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 600;
  font-size: 14px;
}

.nav a.active,
.nav a:hover {
  background: var(--blue);
  color: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

label {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 5px;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}

.btn:hover {
  background: var(--blue-dark);
}

.btn.gray {
  background: var(--gray);
}

.btn.danger {
  background: var(--red);
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}

.grid.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.grid.stats .card {
  text-align: center;
}

.grid.stats h2 {
  margin: 0;
  font-size: 30px;
  color: var(--blue);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

th {
  background: #f8fafc;
}

.badge {
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.badge-admin {
  background: #7c3aed;
}

.badge-panitia {
  background: #0284c7;
}

.badge-user {
  background: var(--gray);
}

.alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
}

#reader {
  max-width: 420px;
  margin: 14px auto;
}

#qrcode {
  display: inline-block;
  padding: 14px;
  background: #fff;
  border-radius: 12px;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-card {
  width: min(420px, 92vw);
  background: var(--card);
  padding: 28px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
}

.login-card h1 {
  color: var(--blue);
  margin: 0;
}

.muted {
  color: var(--gray);
}

.small {
  font-size: 12px;
}