/* ============================================================
   GFC CampusOS — Stylesheet
   Greenfield University College, Sunyani — Ghana
   Colors sourced from gfc.edu.gh
   ============================================================ */

/* ---- 1. Variables ---- */
:root {
  /* GFC Brand Greens (exact from gfc.edu.gh) */
  --g900: #0a2416;
  --g800: #133d26;
  --g700: #1a5232;
  --g600: #2d6a4f;
  --g500: #40916c;
  --g400: #52b788;
  --g300: #74c69d;
  --g100: #d8f3dc;
  --g50:  #f0faf2;
  /* GFC Gold */
  --gold:   #c9963b;
  --gold-l: #f5e6ca;
  --gold-d: #a37828;
  /* Neutrals */
  --cream:    #faf8f3;
  --white:    #ffffff;
  --gray900:  #111827;
  --gray700:  #374151;
  --gray500:  #6b7280;
  --gray300:  #d1d5db;
  --gray200:  #e5e7eb;
  --gray100:  #f3f4f6;
  /* Semantic */
  --danger:   #dc2626;
  --danger-l: #fef2f2;
  --warn:     #d97706;
  --warn-l:   #fffbeb;
  --info:     #2563eb;
  --info-l:   #eff6ff;
  /* Typography (exact fonts from gfc.edu.gh) */
  --fd: 'Playfair Display', Georgia, serif;
  --fb: 'DM Sans', system-ui, -apple-system, sans-serif;
  /* Layout */
  --sidebar-w: 264px;
  --topbar-h:  60px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 4px rgba(10,36,22,.07);
  --shadow:    0 2px 12px rgba(10,36,22,.09);
  --shadow-md: 0 4px 24px rgba(10,36,22,.13);
  --transition: .18s ease;
}

/* ---- 2. Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: var(--fb);
  color: var(--gray900);
  background: var(--gray100);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--fb); }
input, select, textarea { font-family: var(--fb); }

/* ---- 3. Layout ---- */
#app { min-height: 100vh; }

/* Full-screen views (login, verify) */
.full-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.full-view.hidden { display: none; }

/* App shell: sidebar + main content */
#app-shell {
  display: flex;
  min-height: 100vh;
}
#app-shell.hidden { display: none; }

/* ---- 4. Sidebar ---- */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--g900);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  border-right: 1px solid rgba(201,150,59,.12);
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo-badge {
  width: 40px; height: 40px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd);
  font-size: 13px; font-weight: 700;
  color: var(--g900);
  flex-shrink: 0;
}
.sidebar-logo-text strong {
  display: block;
  font-family: var(--fd);
  font-size: 13px; font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}
.sidebar-logo-text span {
  font-size: 9.5px; font-weight: 300;
  color: rgba(255,255,255,.4);
  letter-spacing: .09em;
  text-transform: uppercase;
}

#sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 0;
}
#sidebar-nav::-webkit-scrollbar { width: 4px; }
#sidebar-nav::-webkit-scrollbar-track { background: transparent; }
#sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.nav-section-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(255,255,255,.65);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
  margin-bottom: 2px;
  user-select: none;
}
.nav-item svg { flex-shrink: 0; opacity: .65; transition: opacity var(--transition); }
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--white); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: rgba(201,150,59,.14);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 500;
}
.nav-item.active svg { opacity: 1; color: var(--gold); }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--g900);
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 12.5px; font-weight: 500;
  color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10.5px; color: rgba(255,255,255,.4);
  text-transform: uppercase; letter-spacing: .05em;
}
.btn-logout {
  width: 100%;
  padding: 7px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background var(--transition), color var(--transition);
}
.btn-logout:hover { background: rgba(220,38,38,.2); color: #fca5a5; border-color: rgba(220,38,38,.3); }

/* ---- 5. Main Content Area ---- */
#main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
#topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: sticky;
  top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
#topbar-title {
  font-family: var(--fd);
  font-size: 17px;
  font-weight: 600;
  color: var(--g800);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.online-pill {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--g50);
  color: var(--g600);
  border: 1px solid var(--g100);
}
.online-pill.offline { background: var(--warn-l); color: var(--warn); border-color: #fde68a; }
.online-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--g500); }
.online-pill.offline .online-pill-dot { background: var(--warn); }
.topbar-role-badge {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  background: var(--gold-l); color: var(--gold-d);
  letter-spacing: .03em; text-transform: uppercase;
}
.btn-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--gray200);
  border-radius: 8px; background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray500);
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--gray100); color: var(--gray900); }
#sidebar-toggle { display: none; }

/* Views container */
#views-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}
.view { display: none; animation: fadeIn .2s ease; }
.view.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- 6. Login Screen ---- */
#view-login {
  background: linear-gradient(160deg, var(--g800) 0%, var(--g900) 60%, #060f09 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 48px 20px 48px;
  position: relative;
  overflow: hidden;
}
/* Vertically center when content fits in viewport */
@media (min-height: 800px) {
  #view-login { justify-content: center; }
}
/* Subtle decorative rings on the green background */
#view-login::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  border: 1px solid rgba(201,150,59,.07);
  top: -200px; right: -200px;
  pointer-events: none;
}
#view-login::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  border: 1px solid rgba(201,150,59,.05);
  bottom: -150px; left: -150px;
  pointer-events: none;
}
.login-left {
  display: none; /* branding moved inline */
}
.login-left-logo {
  display: flex; align-items: center; gap: 14px;
}
.login-left-logo-badge {
  width: 52px; height: 52px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-size: 17px; font-weight: 700;
  color: var(--g900);
}
.login-left-logo-text strong {
  display: block;
  font-family: var(--fd); font-size: 15px; font-weight: 700;
  color: var(--white);
}
.login-left-logo-text span {
  font-size: 10px; color: rgba(255,255,255,.4);
  letter-spacing: .09em; text-transform: uppercase;
}
.login-left-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; }
.login-left-body h1 {
  font-family: var(--fd);
  font-size: 32px; font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 18px;
}
.login-left-body h1 em { font-style: normal; color: var(--gold); }
.login-left-body p {
  font-size: 14px; color: rgba(255,255,255,.55);
  line-height: 1.7; max-width: 320px;
}
.login-left-footer { font-size: 11px; color: rgba(255,255,255,.25); }
.login-left-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.login-left-tag {
  font-size: 10px; padding: 4px 10px;
  border: 1px solid rgba(201,150,59,.25);
  border-radius: 20px; color: rgba(201,150,59,.7);
  letter-spacing: .05em;
}
.login-right {
  position: relative; z-index: 1;
  width: 100%; max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: transparent;
  padding: 0;
}
.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-brand-badge {
  width: 64px; height: 64px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-size: 20px; font-weight: 700;
  color: var(--g900);
  margin: 0 auto 14px;
  box-shadow: 0 4px 20px rgba(201,150,59,.4);
}
.login-brand h1 {
  font-family: var(--fd);
  font-size: 26px; font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 6px;
}
.login-brand h1 em { font-style: normal; color: var(--gold); }
.login-brand p {
  font-size: 12.5px; color: rgba(255,255,255,.45);
  letter-spacing: .05em; text-transform: uppercase;
}
.login-card {
  width: 100%;
  background: rgba(255,255,255,.97);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4), 0 0 0 1px rgba(201,150,59,.1);
  max-width: 600px;
}
.login-card-header {
  margin-bottom: 28px;
}
.login-card-header h2 {
  font-family: var(--fd);
  font-size: 22px; font-weight: 600;
  color: var(--g800);
  margin-bottom: 6px;
}
.login-card-header p { font-size: 13.5px; color: var(--gray500); }
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.role-card {
  background: var(--white);
  border: 2px solid var(--gray200);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  gap: 13px;
}
.role-card:hover { border-color: var(--g400); box-shadow: var(--shadow); transform: translateY(-1px); }
.role-card.selected { border-color: var(--g700); box-shadow: 0 0 0 3px rgba(26,82,50,.1); }
.role-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.role-info { flex: 1; min-width: 0; }
.role-name { font-size: 13.5px; font-weight: 600; color: var(--gray900); }
.role-desc { font-size: 11.5px; color: var(--gray500); margin-top: 2px; }
.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--g700);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  font-family: var(--fd);
  transition: background var(--transition), transform var(--transition);
  letter-spacing: .01em;
}
.btn-login:hover { background: var(--g800); transform: translateY(-1px); }
.btn-login:disabled { background: var(--gray300); cursor: not-allowed; transform: none; }
.login-demo-note {
  margin-top: 14px;
  padding: 11px 14px;
  background: var(--gold-l);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
  font-size: 12px; color: var(--gold-d);
}

/* Credential display on role cards */
.role-cred {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray200);
  font-size: 10.5px;
  color: var(--gray500);
  line-height: 1.8;
}
.role-cred span { display: block; }
.role-cred .cred-email { color: var(--g600); font-weight: 500; }
.role-cred .cred-pass  { color: var(--gray400); letter-spacing: .03em; }
.role-card.selected .role-cred { border-top-color: rgba(26,82,50,.15); }
.role-card.selected .role-cred .cred-email { color: var(--g700); }

/* Login credential input fields */
.login-fields-wrap {
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px;
  background: var(--gray50);
  border-radius: 8px;
  border: 1px solid var(--gray200);
}
.login-fields-wrap .form-group { margin: 0; }
.login-fields-wrap label { font-size: 11.5px; color: var(--gray600); font-weight: 600; }

/* ---- 7. Page Header ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header-left h2 {
  font-family: var(--fd);
  font-size: 20px; font-weight: 600;
  color: var(--g800);
  line-height: 1.3;
}
.page-header-left p { font-size: 13px; color: var(--gray500); margin-top: 3px; }
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- 8. Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  font-family: var(--fb);
  border: 1.5px solid transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--g700); color: var(--white); border-color: var(--g700); }
.btn-primary:hover { background: var(--g800); border-color: var(--g800); }
.btn-gold { background: var(--gold); color: var(--g900); border-color: var(--gold); font-weight: 600; }
.btn-gold:hover { background: var(--gold-d); border-color: var(--gold-d); }
.btn-outline { background: transparent; color: var(--g700); border-color: var(--g600); }
.btn-outline:hover { background: var(--g50); }
.btn-danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--gray700); border-color: var(--gray300); }
.btn-ghost:hover { background: var(--gray100); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 9px; font-size: 11.5px; border-radius: 5px; }
.btn svg { flex-shrink: 0; }

/* ---- 9. Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray200);
}
.card-header {
  padding: 16px 20px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-header h3 {
  font-family: var(--fd);
  font-size: 15px; font-weight: 600;
  color: var(--g800);
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--gray100);
  font-size: 12.5px; color: var(--gray500);
}

/* Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--gray200);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.stat-icon.green { background: var(--g50); color: var(--g600); }
.stat-icon.gold  { background: var(--gold-l); color: var(--gold-d); }
.stat-icon.gray  { background: var(--gray100); color: var(--gray500); }
.stat-icon.info  { background: var(--info-l); color: var(--info); }
.stat-icon.warn  { background: var(--warn-l); color: var(--warn); }
.stat-number {
  font-family: var(--fd);
  font-size: 28px; font-weight: 700;
  color: var(--g800);
  line-height: 1;
  margin-bottom: 3px;
}
.stat-label { font-size: 12px; color: var(--gray500); font-weight: 500; }
.stat-change { font-size: 11px; color: var(--g500); margin-top: 4px; }

/* ---- 10. Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--gray200); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead { background: var(--g900); }
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,.7);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
thead th:first-child { border-radius: var(--radius) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
tbody tr { border-bottom: 1px solid var(--gray100); transition: background var(--transition); }
tbody tr:last-child  { border-bottom: none; }
tbody tr:hover { background: var(--g50); }
tbody td { padding: 11px 16px; color: var(--gray900); vertical-align: middle; }
.td-mono { font-size: 12px; color: var(--gray500); font-family: monospace; letter-spacing: .03em; }
tfoot td { padding: 10px 16px; background: var(--gray50); font-weight: 600; border-top: 2px solid var(--gray200); font-size: 13px; }

/* ---- 11. Forms ---- */
.form-workspace { background: var(--white); border-radius: var(--radius); border: 1px solid var(--gray200); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.form-workspace-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--gray100);
}
.form-workspace-header h3 { font-family: var(--fd); font-size: 16px; font-weight: 600; color: var(--g800); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--gray700); }
.form-group label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  padding: 9px 12px;
  border: 1.5px solid var(--gray300);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--gray900);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.form-control:focus { border-color: var(--g500); box-shadow: 0 0 0 3px rgba(64,145,108,.12); }
.form-control.error { border-color: var(--danger); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-actions { display: flex; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--gray100); margin-top: 8px; }
.form-hint { font-size: 11.5px; color: var(--gray500); }

/* ---- 12. Search & Filters ---- */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--gray400); pointer-events: none; }
.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1.5px solid var(--gray300);
  border-radius: 8px;
  font-size: 13.5px;
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--g500); }
.filter-select {
  padding: 8px 30px 8px 12px;
  border: 1.5px solid var(--gray300);
  border-radius: 8px;
  font-size: 13px;
  background: var(--white);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ---- 13. Badges / Status ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  white-space: nowrap;
}
.badge-green  { background: var(--g100); color: var(--g700); }
.badge-gold   { background: var(--gold-l); color: var(--gold-d); }
.badge-gray   { background: var(--gray200); color: var(--gray700); }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-blue   { background: var(--info-l); color: var(--info); }
.badge-warn   { background: var(--warn-l); color: var(--warn); }

/* Student avatar/initials */
.student-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  color: var(--white);
}
.avatar-name { display: flex; align-items: center; gap: 10px; }
.avatar-name strong { font-size: 13.5px; display: block; }
.avatar-name span { font-size: 11.5px; color: var(--gray500); }

/* Grade badges */
.grade-A  { color: #15803d; font-weight: 700; }
.grade-Bp { color: #16a34a; }
.grade-B  { color: #2563eb; }
.grade-Cp { color: #7c3aed; }
.grade-C  { color: #9333ea; }
.grade-Dp { color: #d97706; }
.grade-D  { color: #b45309; }
.grade-F  { color: var(--danger); font-weight: 700; }

/* ---- 14. Dashboard ---- */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.quick-action-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--white);
  border: 1.5px solid var(--gray200);
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  color: var(--g700);
  cursor: pointer; transition: all var(--transition);
}
.quick-action-btn:hover { background: var(--g50); border-color: var(--g300); color: var(--g700); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dashboard-grid.full { grid-template-columns: 1fr; }
.activity-list { display: flex; flex-direction: column; gap: 1px; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--gray100);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-text { flex: 1; font-size: 13px; color: var(--gray700); }
.activity-text strong { color: var(--gray900); }
.activity-time { font-size: 11px; color: var(--gray500); white-space: nowrap; }

/* ---- 15. Student Photo Placeholder ---- */
.photo-placeholder {
  width: 100px; height: 100px;
  border-radius: var(--radius);
  background: var(--g50);
  border: 2px dashed var(--g300);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; font-size: 11px; color: var(--g500);
  transition: background var(--transition);
}
.photo-placeholder:hover { background: var(--g100); }

/* ---- 16. GPA Display ---- */
.gpa-summary {
  display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.gpa-box {
  flex: 1; min-width: 140px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray200);
  padding: 18px 20px;
  text-align: center;
}
.gpa-box.cgpa { background: linear-gradient(135deg, var(--g900), var(--g700)); color: var(--white); }
.gpa-value { font-family: var(--fd); font-size: 36px; font-weight: 700; color: var(--g700); }
.gpa-box.cgpa .gpa-value { color: var(--gold); }
.gpa-label { font-size: 11.5px; color: var(--gray500); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.gpa-box.cgpa .gpa-label { color: rgba(255,255,255,.55); }
.gpa-bar { height: 6px; background: var(--gray200); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.gpa-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--g600), var(--g400)); }

/* ---- 17. Transcript Styles ---- */
.transcript-wrap {
  max-width: 800px;
  margin: 0 auto;
}
.transcript-actions {
  display: flex; gap: 10px; margin-bottom: 20px;
  flex-wrap: wrap; align-items: center;
}
#transcript-doc {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray200);
  padding: 48px 52px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.transcript-watermark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
  font-family: var(--fd);
  font-size: 72px; font-weight: 900;
  color: rgba(10,36,22,.04);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: .12em;
}
.transcript-header { text-align: center; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 3px double var(--g700); }
.transcript-logo-row {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 12px;
}
.transcript-logo-badge {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--g900);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-size: 17px; font-weight: 700;
  color: var(--gold);
}
.transcript-inst-name {
  font-family: var(--fd); font-size: 22px; font-weight: 700;
  color: var(--g900); line-height: 1.2;
}
.transcript-inst-sub { font-size: 11.5px; color: var(--gray500); letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.transcript-title {
  font-size: 13px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--g700);
  background: var(--g50);
  display: inline-block; padding: 6px 24px; border-radius: 4px;
  margin-top: 10px;
  border: 1px solid var(--g100);
}
.transcript-student-info {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px 30px;
  background: var(--g50);
  border: 1px solid var(--g100);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 13px;
}
.transcript-info-row { display: flex; gap: 8px; }
.transcript-info-row label { font-weight: 600; color: var(--g700); white-space: nowrap; min-width: 110px; }
.transcript-info-row span { color: var(--gray900); }
.transcript-semester-heading {
  font-family: var(--fd); font-size: 13.5px; font-weight: 600;
  color: var(--g700); padding: 8px 0 6px;
  border-bottom: 1px solid var(--g100); margin-bottom: 8px; margin-top: 18px;
}
.transcript-course-table { width: 100%; font-size: 12.5px; border-collapse: collapse; margin-bottom: 6px; }
.transcript-course-table th {
  background: var(--g900); color: rgba(255,255,255,.75);
  padding: 7px 12px; text-align: left;
  font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
}
.transcript-course-table td { padding: 7px 12px; border-bottom: 1px solid var(--gray100); }
.transcript-course-table tbody tr:hover { background: var(--g50); }
.transcript-course-table tfoot td { background: var(--g50); font-weight: 600; border-top: 2px solid var(--g100); }
.transcript-semester-gpa {
  text-align: right; font-size: 12px; color: var(--g600); font-weight: 600;
  margin-bottom: 4px;
}
.transcript-cgpa-block {
  background: var(--g900);
  color: var(--white);
  border-radius: 8px;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0;
}
.transcript-cgpa-label { font-size: 12px; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .08em; }
.transcript-cgpa-value { font-family: var(--fd); font-size: 28px; font-weight: 700; color: var(--gold); }
.transcript-cgpa-class { font-size: 12.5px; color: rgba(255,255,255,.7); margin-top: 2px; }
.transcript-footer-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 20px; align-items: end;
  margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--gray200);
  font-size: 12px;
}
.transcript-sig { text-align: center; }
.transcript-sig-line { border-bottom: 1px solid var(--gray400); margin-bottom: 6px; height: 36px; }
.transcript-sig-label { font-size: 11px; color: var(--gray500); text-transform: uppercase; letter-spacing: .05em; }
.transcript-verify-block { text-align: center; }
.transcript-qr { margin: 0 auto 8px; }
.transcript-code { font-family: monospace; font-size: 11.5px; color: var(--g700); letter-spacing: .1em; }
.transcript-issue-date { font-size: 11px; color: var(--gray500); margin-top: 4px; }
.transcript-stamp {
  width: 70px; height: 70px;
  border: 3px solid var(--g700);
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--g700); font-size: 8px; font-weight: 700;
  letter-spacing: .05em; text-align: center;
  margin: 0 auto;
  padding: 8px;
  opacity: .4;
}

/* ---- 18. Verification View ---- */
#view-verify {
  background: linear-gradient(160deg, var(--g900), var(--g800));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.verify-header { text-align: center; margin-bottom: 32px; }
.verify-header .logo-badge {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--gold); margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-size: 20px; font-weight: 700;
  color: var(--g900);
}
.verify-header h1 {
  font-family: var(--fd); font-size: 22px; font-weight: 700;
  color: var(--white); margin-bottom: 8px;
}
.verify-header p { font-size: 13.5px; color: rgba(255,255,255,.55); max-width: 340px; }
.verify-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-md);
}
.verify-card h2 { font-family: var(--fd); font-size: 17px; font-weight: 600; color: var(--g800); margin-bottom: 18px; }
.verify-result { margin-top: 20px; padding: 18px; border-radius: 10px; font-size: 13.5px; }
.verify-result.valid   { background: var(--g50); border: 1px solid var(--g100); }
.verify-result.invalid { background: var(--danger-l); border: 1px solid #fecaca; }
.verify-result.revoked { background: var(--warn-l); border: 1px solid #fde68a; }
.verify-result-status {
  font-size: 16px; font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.verify-result.valid   .verify-result-status { color: var(--g700); }
.verify-result.invalid .verify-result-status { color: var(--danger); }
.verify-result.revoked .verify-result-status { color: var(--warn); }
.verify-result-row { display: flex; gap: 8px; margin-bottom: 7px; font-size: 13px; }
.verify-result-row label { font-weight: 600; color: var(--gray700); min-width: 120px; }
.verify-link { margin-top: 16px; font-size: 12px; color: var(--gray500); }
.verify-link a { color: var(--g500); text-decoration: underline; }

/* ---- 19. Results Entry ---- */
.results-score-input {
  width: 70px;
  padding: 5px 8px;
  border: 1.5px solid var(--gray300);
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
}
.results-score-input:focus { border-color: var(--g500); outline: none; }
.score-total { font-weight: 700; }

/* ---- 20. Reports ---- */
.reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-container { position: relative; height: 220px; }
.simple-bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { width: 160px; flex-shrink: 0; color: var(--gray700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 18px; background: var(--gray100); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--g700), var(--g500)); transition: width .5s ease; }
.bar-value { width: 36px; text-align: right; font-weight: 600; color: var(--g700); font-size: 12px; }
.bar-fill.gold { background: linear-gradient(90deg, var(--gold-d), var(--gold)); }

/* ---- 21. Settings ---- */
.settings-section { margin-bottom: 32px; }
.settings-section h3 { font-family: var(--fd); font-size: 15.5px; font-weight: 600; color: var(--g800); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--gray200); }
.grade-scale-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grade-scale-table th { background: var(--gray100); padding: 9px 14px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray500); font-weight: 600; }
.grade-scale-table td { padding: 8px 14px; border-bottom: 1px solid var(--gray100); }
.grade-scale-table tbody tr:last-child td { border-bottom: none; }
.scale-input { width: 70px; padding: 4px 8px; border: 1.5px solid var(--gray300); border-radius: 6px; text-align: center; font-size: 13px; }
.scale-input:focus { border-color: var(--g500); outline: none; }
.prototype-notice {
  background: var(--warn-l);
  border: 1px solid #fde68a;
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 12.5px; color: #92400e;
  line-height: 1.6;
}

/* ---- 22. Audit Log ---- */
.audit-table tbody td:first-child { font-size: 11.5px; color: var(--gray500); font-family: monospace; }

/* ---- 23. Empty State ---- */
.empty-state {
  text-align: center; padding: 56px 20px;
  color: var(--gray500);
}
.empty-state svg { margin: 0 auto 14px; color: var(--gray300); }
.empty-state h3 { font-family: var(--fd); font-size: 16px; font-weight: 600; color: var(--gray700); margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 320px; margin: 0 auto; }

/* ---- 24. Toast Notifications ---- */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--g900);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  min-width: 280px; max-width: 380px;
  animation: toastIn .22s ease;
  border-left: 4px solid var(--g400);
}
.toast.success { border-left-color: var(--g400); }
.toast.error   { border-left-color: var(--danger); background: #1f0a0a; }
.toast.warn    { border-left-color: var(--gold); }
.toast.info    { border-left-color: var(--info); }
.toast-dismiss { margin-left: auto; background: transparent; border: none; color: rgba(255,255,255,.4); cursor: pointer; font-size: 16px; padding: 0 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
.toast.removing { animation: toastOut .18s ease forwards; }

/* ---- 25. Misc Helpers ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray500); }
.text-sm { font-size: 12.5px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--gray200); margin: 20px 0; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray200); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px;
  border: none; background: transparent;
  font-size: 13.5px; font-weight: 500;
  color: var(--gray500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--g700); }
.tab-btn.active { color: var(--g700); border-bottom-color: var(--g700); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Approval status row */
.approval-pending { background: #fffbeb !important; }
/* Approved rows are dimmed so pending ones stand out immediately */
.approval-approved {
  opacity: 0.35;
  pointer-events: none;
}
.approval-approved:hover { opacity: 0.35 !important; background: transparent !important; }
.approval-rejected { background: #fef2f2 !important; opacity: 0.5; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--white); border-top: 1px solid var(--gray100); font-size: 13px; color: var(--gray500); }
.pagination-info { font-size: 12.5px; }
.pagination-btns { display: flex; gap: 4px; }
.page-btn { padding: 4px 10px; border: 1.5px solid var(--gray300); border-radius: 6px; background: var(--white); font-size: 12.5px; cursor: pointer; color: var(--gray700); }
.page-btn:hover { background: var(--gray100); }
.page-btn.active { background: var(--g700); color: var(--white); border-color: var(--g700); }

/* ---- 26. Print Styles (Transcript) ---- */
@media print {
  body { background: white; }
  #sidebar, #topbar, #toast-container,
  .transcript-actions, .page-header-actions,
  .btn, .toolbar, #status-bar { display: none !important; }
  #main-wrap { margin-left: 0; }
  #views-container { padding: 0; }
  #transcript-doc {
    box-shadow: none;
    border: none;
    max-width: 100%;
    padding: 20mm 20mm;
  }
  @page { size: A4; margin: 10mm; }
  .view.active { display: block; }
}

/* ---- 27. Responsive ---- */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .reports-grid { grid-template-columns: 1fr; }
  .transcript-student-info { grid-template-columns: 1fr; }
  .transcript-footer-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  #sidebar {
    transform: translateX(-264px);
    width: 264px;
    z-index: 200;
  }
  #sidebar.open { transform: none; }
  #main-wrap { margin-left: 0; }
  #sidebar-toggle { display: flex; }
  .login-right { padding: 0 16px; }
  .login-card { padding: 28px 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  #views-container { padding: 16px; }
  .page-header { flex-direction: column; }
  .role-grid { grid-template-columns: 1fr; }
  #transcript-doc { padding: 24px 20px; }
  .transcript-footer-row { grid-template-columns: 1fr; gap: 24px; }
  .gpa-summary { flex-direction: column; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-actions .online-pill { display: none; }
}

/* Sidebar overlay for mobile */
#sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 150;
}
#sidebar-overlay.show { display: block; }
