/* ── Top bar ───────────────────────────────── */
.topbar {
  background: var(--brand);
  color: #fff;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 4px solid var(--gold);
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-brand img { height: 40px; width: 40px; object-fit: contain; filter: brightness(0) invert(1); }
.topbar-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-brand-text .school { font-size: 0.7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.topbar-brand-text .page-title { font-size: 1.05rem; font-weight: 700; }
.topbar-right { display: flex; gap: 12px; align-items: center; }

/* ── Body layout ───────────────────────────── */
.page { padding: 40px 32px; max-width: 1200px; margin: 0 auto; }
@media(max-width:640px) { .page { padding: 24px 16px; } .topbar { padding: 0 16px; } }

.welcome-header { margin-bottom: 40px; text-align: center; }
.welcome-header h1 { font-size: 2rem; color: var(--brand); margin-bottom: 8px; }
.welcome-header p { color: var(--muted); font-size: 1.1rem; }

/* ── Dashboard Grid ────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.dash-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.dash-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,.12); }

.card-icon { font-size: 3.5rem; margin-bottom: 20px; }
.dash-card h3 { font-size: 1.4rem; color: var(--brand); margin-bottom: 24px; }

.card-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  width: 100%;
  justify-content: center;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat .num { font-size: 2.2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat .lbl { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }

.card-actions { width: 100%; margin-top: auto; }
.card-actions .btn { width: 100%; display: block; text-decoration: none; text-align: center; }

/* ── Login overlay ─────────────────────────── */
.login-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.login-overlay.hidden { display: none; }
.login-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 32px rgba(0,0,0,.14);
  width: 100%; max-width: 400px;
  padding: 40px 36px;
  text-align: center;
}
.login-card img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 12px; }
.login-card .school-name {
  font-size: 0.8rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px;
}
.login-card h2 { font-size: 1.3rem; color: var(--brand); margin-bottom: 8px; }
.login-card .login-sub { font-size: 0.85rem; color: var(--muted); margin-bottom: 28px; }
.login-divider {
  width: 40px; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  border-radius: 2px; margin: 0 auto 28px;
}
.login-error { color: var(--danger); font-size: 0.83rem; margin-bottom: 14px; min-height: 18px; }

.btn-login {
  width: 100%; padding: 12px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: opacity .2s;
}
.btn-login:hover { opacity: .88; }
.btn-login:disabled { opacity: .55; cursor: not-allowed; }
