:root {
  --primary: #1e88e5;
  --primary-dark: #1565c0;
  --primary-light: #64b5f6;
  --bg: #eaf4fd;
  --surface: #ffffff;
  --text: #1a2b3c;
  --text-muted: #5c7080;
  --border: #d5e6f7;
  --success: #2e7d32;
  --success-bg: #e6f4ea;
  --danger: #c62828;
  --danger-bg: #fdecea;
  --warning: #ef6c00;
  --warning-bg: #fff3e0;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(30, 136, 229, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Navbar (mobile top bar) ---------- */
.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
  min-width: 0;
}
.navbar-brand:hover { text-decoration: none; }
.navbar-brand img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.navbar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hamburger -> animated icon button, clearly tappable */
.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.14);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.navbar-toggle:active { background: rgba(255,255,255,0.26); }
.navbar-toggle-icon { display: flex; flex-direction: column; gap: 4px; width: 18px; }
.navbar-toggle-icon span { display: block; height: 2px; border-radius: 2px; background: #fff; }

/* ---------- Mobile slide-in menu ---------- */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 45, 0.45);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.mobile-menu-backdrop.open { opacity: 1; pointer-events: auto; }

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 82%;
  max-width: 320px;
  background: var(--surface);
  z-index: 301;
  box-shadow: -8px 0 30px rgba(0,0,0,0.18);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border);
}
.mobile-menu-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-links { padding: 10px 12px 24px; display: flex; flex-direction: column; gap: 4px; }

/* Every nav item styled as an actual button, not a bare link */
.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}
.mobile-menu-link:hover,
.mobile-menu-link:active { background: var(--bg); text-decoration: none; }
.mobile-menu-link.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(30,136,229,0.25); }
.mobile-menu-link-primary { background: rgba(30,136,229,0.1); color: var(--primary-dark); }
.mobile-menu-link .nav-icon { width: 19px; height: 19px; }

body.menu-open { overflow: hidden; }

/* ---------- Layout ---------- */
.page {
  padding: 28px 0 60px;
  min-height: calc(100vh - 60px - 70px);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

/* Any element wrapped in this class behaves like a button visually:
   used for whole cards/boxes that are actually links (e.g. level pickers). */
.tap-card {
  display: block;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.tap-card:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(30,136,229,0.16); border-color: var(--primary-light); }
.tap-card:active { transform: scale(0.98); }

.card h2, .card h3 { margin-top: 0; }

.grid {
  display: grid;
  gap: 18px;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.page-header h1 { margin: 0; color: var(--primary-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(30,136,229,0.22);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary-dark);
  box-shadow: none;
}
.btn-outline:hover { background: var(--primary-light); color: #fff; }
.btn-danger { background: var(--danger); box-shadow: 0 2px 8px rgba(198,40,40,0.22); }
.btn-danger:hover { background: #a31c1c; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 8px; }
.btn-block { display: flex; width: 100%; text-align: center; }

@media (max-width: 768px) {
  /* Comfortable thumb-sized tap targets everywhere on mobile */
  .btn { padding: 13px 20px; font-size: 1rem; min-height: 46px; }
  .btn-sm { padding: 10px 16px; min-height: 40px; }
}

/* ---------- Forms ---------- */
label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin: 14px 0 6px;
  color: var(--text-muted);
}
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=tel],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fbfdff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,136,229,0.15);
}
textarea { resize: vertical; min-height: 100px; }
form .hint { color: var(--text-muted); font-size: 0.82rem; margin-top: 4px; }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-active, .badge-approved { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-suspended, .badge-rejected { background: var(--danger-bg); color: var(--danger); }
.badge-admin { background: var(--primary-dark); color: #fff; }
.badge-student { background: var(--primary-light); color: #fff; }
.badge-alumni { background: #8e63d1; color: #fff; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-primary { background: var(--primary-light); color: #fff; }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--bg); color: var(--text-muted); }

/* ---------- Student Directory ---------- */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.directory-card {
  text-align: center;
  padding: 16px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
.directory-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
}
.directory-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.directory-avatar .avatar-placeholder { font-size: 1.6rem; }
.directory-name { font-weight: 700; font-size: 0.9rem; margin-top: 2px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
th { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }
.table-wrap { overflow-x: auto; }

/* ---------- Post / thread items ---------- */
.post-item, .thread-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 4px;
  border-radius: 8px;
  transition: background 0.12s ease;
}
.post-item:hover, .thread-item:hover { background: var(--bg); }
.post-item:last-child, .thread-item:last-child { border-bottom: none; }
.post-meta { color: var(--text-muted); font-size: 0.82rem; }
.post-type-tag {
  display: inline-block;
  background: var(--primary-light);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 9px;
  border-radius: 12px;
  text-transform: uppercase;
  font-weight: 700;
  margin-right: 6px;
}

/* ---------- Hero card ---------- */
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
@media (max-width: 640px) {
  .hero-card { padding: 22px 18px; }
  .hero-card h1 { font-size: 1.5rem; }
  .hero-actions .btn { flex: 1 1 auto; }
}

/* ---------- Stat boxes ---------- */
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.stat-box .num { font-size: 1.9rem; font-weight: 800; color: var(--primary-dark); }
.stat-box .label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* ---------- Officials grid (like university "Meet our Faculty") ---------- */
.officials-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.official-card { text-align: center; }
.official-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.official-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.official-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--bg);
}
.official-name { font-weight: 700; color: var(--text); font-size: 0.98rem; }
.official-title { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }

/* ---------- Level / class group boxes ---------- */
.level-group-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.level-group-name { font-weight: 700; color: var(--primary-dark); font-size: 1.05rem; }
.level-group-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}
.level-group-count { margin-top: 8px; font-size: 0.85rem; color: var(--text-muted); }
.level-group-alumni { background: #f3ecfb; border-color: #d9c6f0; }
.level-group-alumni .level-group-name { color: #6a3ea1; }

/* ---------- Material cards ---------- */
.material-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.material-icon {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 8px;
}
.material-title { font-weight: 600; font-size: 0.92rem; }
.material-level { color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; }

@media (max-width: 800px) {
  .officials-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Info rows (profile locked-details section) ---------- */
.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-of-type { border-bottom: none; }
.info-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.info-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.info-value { font-weight: 600; font-size: 0.92rem; word-break: break-word; }

/* ---------- Profile hero (avatar + CGPA + class of degree) ---------- */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #eaf4fd 0%, #ffffff 65%);
  border: 1px solid var(--border);
}
.profile-hero-avatar {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px var(--primary-light), 0 4px 14px rgba(30,136,229,0.18);
  background: var(--bg);
}
.profile-hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--bg);
}
.profile-hero-info { flex: 1; min-width: 200px; }

.cgpa-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cgpa-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  text-align: center;
}
.cgpa-num { font-size: 1.5rem; font-weight: 800; color: var(--primary-dark); }
.cgpa-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }

.class-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
}
.class-badge-success { background: var(--success-bg); color: var(--success); }
.class-badge-primary { background: rgba(30,136,229,0.12); color: var(--primary-dark); }
.class-badge-warning { background: var(--warning-bg); color: var(--warning); }
.class-badge-muted { background: #eef1f4; color: var(--text-muted); }

@media (max-width: 640px) {
  .profile-hero { text-align: center; justify-content: center; }
}

/* ---------- Profile hero v2 (cover banner + overlapping avatar) ---------- */
.profile-hero-v2 { padding: 0; overflow: hidden; }
.profile-cover {
  height: 110px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.profile-hero-v2-body {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  padding: 0 24px 24px;
  margin-top: -46px;
}
.profile-hero-avatar-v2 {
  width: 100px;
  height: 100px;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow);
}
.profile-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

@media (max-width: 640px) {
  .profile-hero-v2-body { flex-direction: column; align-items: center; text-align: center; margin-top: -56px; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Admin sub-nav ---------- */
.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 18px;
}
.admin-subnav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.admin-subnav a:hover { background: var(--bg); text-decoration: none; }
.admin-subnav a.active { background: var(--primary); color: #fff; }

@media (max-width: 768px) {
  .admin-subnav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-subnav a { white-space: nowrap; flex-shrink: 0; padding: 10px 14px; }
}

/* ---------- Fee items / payments ---------- */
.fee-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.fee-card-title { font-weight: 700; font-size: 1.02rem; }
.fee-card-desc { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }
.fee-card-amount { font-size: 1.4rem; font-weight: 800; color: var(--primary-dark); white-space: nowrap; }

.receipt-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 460px;
  margin: 0 auto;
}
.receipt-box .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 0.92rem; }
.receipt-box .row:last-child { border-bottom: none; }

/* ---------- Reg number whitelist ---------- */
.reg-status-used { color: var(--text-muted); }
.reg-status-open { color: var(--success); font-weight: 600; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  max-width: 440px;
  margin: 40px auto;
}
.auth-wrap .card { padding: 30px; }
.auth-wrap h1 {
  text-align: center;
  color: var(--primary-dark);
  margin-top: 0;
}

/* ---------- App shell / left sidebar (tablet & desktop) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: fixed;
  left: 0; top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 200;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* HARD mobile override: the desktop sidebar must never show on phones.
   !important here is deliberate - this is a one-line safety net so no
   later rule, cache issue, or load-order quirk can leave it half-visible. */
@media (max-width: 768px) {
  .sidebar { display: none !important; }
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.brand-name { font-weight: 800; color: var(--primary-dark); font-size: 1.02rem; line-height: 1.15; }
.brand-tagline { font-size: 0.68rem; color: var(--text-muted); }

.nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 14px 6px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 3px;
}
.nav-item:hover { background: var(--bg); text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(30,136,229,0.25); }
.nav-item.active:hover { background: var(--primary); }
.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.85;
}
.nav-icon svg { width: 100%; height: 100%; }
.nav-item.active .nav-icon,
.mobile-menu-link.active .nav-icon { opacity: 1; }

/* ---------- Notification badge (e.g. unread complaint count) ---------- */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: 2px;
}

/* ---------- Print / "Download PDF" support (results, receipts) ---------- */
/* Pages that offer a "Download PDF" button rely on the browser's native
   Print dialog (choose "Save as PDF") rather than a server-side PDF
   library - this needs no extra hosting dependencies and works everywhere.
   Elements marked .no-print (buttons, forms, nav) are hidden, and the
   shell collapses to a single full-width column so only the actual
   content prints. */
@media print {
  .sidebar, .navbar, .mobile-menu, .mobile-menu-backdrop, .site-footer, .no-print { display: none !important; }
  .app-shell { display: block !important; min-height: 0 !important; }
  .main-content { margin-left: 0 !important; width: 100% !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ---------- Password show/hide toggle (login, register) ---------- */
/* Kept deliberately plain - matching the simple flat eye icon used on
   TitanPips - instead of a circular badge button. A badge introduced
   layout/centering issues; this absolute + translateY(-50%) approach
   is the same one already proven to work there. */
.pwd-field { position: relative; }
.pwd-field input { padding-right: 40px; width: 100%; box-sizing: border-box; }
.pwd-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 0;
}
.pwd-toggle:hover,
.pwd-toggle:focus-visible { color: var(--primary-dark); }
.pwd-toggle svg { width: 20px; height: 20px; display: block; }
.pwd-icon-hide { display: none; }
.pwd-toggle.is-visible .pwd-icon-show { display: none; }
.pwd-toggle.is-visible .pwd-icon-hide { display: block; }

.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg);
  margin-bottom: 6px;
}
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.sidebar-user-email { font-size: 0.68rem; color: var(--text-muted); }

.main-content { flex: 1; margin-left: 240px; min-width: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 769px) {
  .navbar, .mobile-menu, .mobile-menu-backdrop { display: none !important; }
}

@media (max-width: 768px) {
  /* Stack the shell vertically on mobile so the navbar sits as a full-width
     top bar instead of being treated as a flex item in a row alongside the
     (hidden) sidebar - that row layout was what shrank it into a tall,
     narrow blue column on the left and pushed the page content to the right. */
  .app-shell { flex-direction: column; }

  .sidebar { display: none; }
  .main-content { margin-left: 0; width: 100%; }
  .navbar { display: block; width: 100%; }
  .navbar-toggle { display: flex; }
  /* mobile-menu and its backdrop stay flex at all times on mobile;
     the .open class (JS-driven) controls visibility via transform/opacity */

  .page { padding: 18px 0; }
  .container { padding: 0 14px; }

  /* Tighter, friendlier card rhythm on small screens */
  .card { padding: 18px; border-radius: 14px; margin-bottom: 14px; }
  .page-header { margin-bottom: 16px; }

  .site-footer { padding: 16px; }
}

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .auth-wrap { margin: 20px auto; padding: 0 10px; }
}

@media (max-width: 420px) {
  .officials-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .stat-box { padding: 14px; }
  .stat-box .num { font-size: 1.5rem; }
}
