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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f4f8;
  color: #2d3748;
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  background: #4f46e5;
  color: white;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-brand { font-size: 1.3rem; font-weight: 700; }
.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: white; }

/* ── MAIN ── */
main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-header h2 { font-size: 1.6rem; font-weight: 700; }
.date-badge {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #718096;
}

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-top: 4px solid #4f46e5;
}
.stat-card.present { border-top-color: #48bb78; }
.stat-card.absent  { border-top-color: #fc8181; }
.stat-number { font-size: 2.5rem; font-weight: 800; color: #2d3748; }
.stat-label  { font-size: 0.85rem; color: #718096; margin-top: 0.25rem; }

/* ── DASHBOARD GRID ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

/* ── CARD ── */
.card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.mb { margin-bottom: 1.5rem; }
.mt { margin-top: 1rem; }

/* ── TABLE ── */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #718096;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}
td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f7fafc;
  font-size: 0.93rem;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f7fafc; }

/* ── STATUS ── */
.status {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status.present   { background: #c6f6d5; color: #276749; }
.status.absent    { background: #fed7d7; color: #9b2c2c; }
.status.not-taken { background: #e2e8f0; color: #718096; }

/* ── BADGE ── */
.badge {
  display: inline-block;
  background: #ebf4ff;
  color: #3182ce;
  padding: 0.15rem 0.6rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── LEADERBOARD ── */
.leaderboard { display: flex; flex-direction: column; gap: 0.75rem; }
.leader-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #f7fafc;
  border-radius: 8px;
}
.rank { font-weight: 800; color: #4f46e5; width: 28px; font-size: 0.9rem; }
.leader-name { flex: 1; font-weight: 500; }
.leader-points { font-weight: 700; color: #e6b800; font-size: 0.95rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: #4a5568; }
input[type="text"], input[type="password"], input[type="date"] {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: white;
}
input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

.inline-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.inline-form input { width: auto; flex: 1; min-width: 160px; }
.inline-form label { white-space: nowrap; font-size: 0.9rem; font-weight: 600; }

.form-actions { margin-top: 1.25rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.1s;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }
.btn-primary   { background: #4f46e5; color: white; }
.btn-secondary { background: #718096; color: white; }
.btn-success   { background: #48bb78; color: white; }
.btn-warning   { background: #ed8936; color: white; }
.btn-danger    { background: #fc8181; color: white; }
.btn-full      { width: 100%; text-align: center; display: block; }
.btn-sm        { padding: 0.3rem 0.65rem; font-size: 0.8rem; border-radius: 6px; }

/* ── ALERTS ── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert-success { background: #c6f6d5; color: #276749; }
.alert-error   { background: #fed7d7; color: #9b2c2c; }
.alert-info    { background: #bee3f8; color: #2c5282; }

/* ── RADIO ATTENDANCE ── */
.radio-label { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.radio-label input[type="radio"] { margin-right: 0.4rem; }
.present-label { color: #276749; font-weight: 700; font-size: 1.1rem; }
.absent-label  { color: #9b2c2c; font-weight: 700; font-size: 1.1rem; }

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

/* ── LOGIN ── */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}
.login-box {
  background: white;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: 0.5rem; }
.login-box h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.25rem; }
.login-box p  { color: #718096; margin-bottom: 1.5rem; }
.login-box .form-group { text-align: left; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .stats-grid     { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .inline-form    { flex-direction: column; align-items: stretch; }
  .inline-form input { min-width: unset; }
}
