/* ================================================================
   SCOOL QC — Main Design System
   Global CSS tokens, resets, utilities, components
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties (Design Tokens) ── */
:root {
  /* Colors */
  --primary:        #6C63FF;
  --primary-light:  #8B85FF;
  --primary-dark:   #4B44CC;
  --primary-glow:   rgba(108, 99, 255, 0.25);

  --accent:         #00D4AA;
  --accent-light:   #00FFCC;
  --accent-dark:    #009E7F;
  --accent-glow:    rgba(0, 212, 170, 0.2);

  --surface:        #080E1A;
  --surface-1:      #0F172A;
  --surface-2:      #1E293B;
  --surface-3:      #263347;
  --surface-4:      #334155;

  --text:           #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted:     #94A3B8;
  --text-dim:       #64748B;

  --success:        #22C55E;
  --success-bg:     rgba(34, 197, 94, 0.12);
  --warning:        #F59E0B;
  --warning-bg:     rgba(245, 158, 11, 0.12);
  --danger:         #EF4444;
  --danger-bg:      rgba(239, 68, 68, 0.12);
  --info:           #38BDF8;
  --info-bg:        rgba(56, 189, 248, 0.12);

  --border:         rgba(148, 163, 184, 0.12);
  --border-active:  rgba(108, 99, 255, 0.5);

  /* Gradients */
  --grad-primary:  linear-gradient(135deg, #6C63FF, #00D4AA);
  --grad-surface:  linear-gradient(135deg, #0F172A, #1E293B);
  --grad-card:     linear-gradient(135deg, rgba(108,99,255,0.08), rgba(0,212,170,0.05));

  /* Typography */
  --font:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:   'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Border Radius */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow:     0 4px 16px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.4);
  --shadow-primary: 0 8px 24px rgba(108, 99, 255, 0.3);
  --shadow-glow:    0 0 40px rgba(108, 99, 255, 0.15);

  /* Transitions */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --t-fast:     150ms;
  --t-base:     250ms;
  --t-slow:     400ms;

  /* Layout */
  --sidebar-w:  260px;
  --header-h:   65px;
  --content-max:1400px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--surface);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--accent); }

img, svg { max-width: 100%; display: block; }

button, input, select, textarea {
  font-family: var(--font);
  font-size: inherit;
}

ul, ol { list-style: none; }

/* ── App Layout ── */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 100vh;
}

.app-main {
  grid-column: 2;
  grid-row: 2;
  padding: var(--space-8);
  background: var(--surface);
  overflow-y: auto;
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar ── */
.sidebar {
  grid-column: 1;
  grid-row: 1 / 3;
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

.sidebar-brand {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--header-h);
}

.sidebar-brand .brand-icon {
  width: 38px;
  height: 38px;
  background: var(--grad-primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}

.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.sidebar-brand .brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

.sidebar-nav {
  padding: var(--space-4) 0;
  flex: 1;
}

.nav-section {
  padding: var(--space-4) var(--space-6) var(--space-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  position: relative;
  margin: 1px 0;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(108, 99, 255, 0.08);
}

.nav-item.active {
  color: var(--primary-light);
  background: rgba(108, 99, 255, 0.12);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--grad-primary);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.sidebar-logout {
  width: 30px;
  height: 30px;
  background: var(--danger-bg);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
}
.sidebar-logout:hover {
  background: var(--danger);
  color: white;
}

/* ── Top Header ── */
.top-header {
  grid-column: 2;
  grid-row: 1;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(12px);
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  flex: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ── Cards ── */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: border-color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
}

.card:hover {
  border-color: rgba(108, 99, 255, 0.2);
  box-shadow: var(--shadow);
}

.card-glass {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

/* ── Stat Cards ── */
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  position: relative;
  overflow: hidden;
  transition: all var(--t-base) var(--ease);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-active);
}

.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.purple { background: rgba(108, 99, 255, 0.15); }
.stat-icon.teal   { background: rgba(0, 212, 170, 0.15); }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.15); }
.stat-icon.green  { background: rgba(34, 197, 94, 0.15); }
.stat-icon.red    { background: rgba(239, 68, 68, 0.15); }
.stat-icon.blue   { background: rgba(56, 189, 248, 0.15); }

.stat-info { flex: 1; min-width: 0; }
.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -1px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.stat-trend {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ── Grid Layouts ── */
.grid-stats   { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-5); }
.grid-2       { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.grid-3       { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.grid-cards   { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-5); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity var(--t-fast);
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(108, 99, 255, 0.4);
}
.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.5);
  transform: translateY(-1px);
  color: white;
}

.btn-accent {
  background: var(--accent);
  color: var(--surface);
  box-shadow: 0 4px 14px rgba(0, 212, 170, 0.35);
  font-weight: 700;
}
.btn-accent:hover {
  background: var(--accent-light);
  color: var(--surface);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-active);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.btn-success:hover {
  background: var(--success);
  color: white;
}

.btn-sm { padding: var(--space-2) var(--space-3); font-size: 12px; }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: 16px; }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

/* ── Form Elements ── */
.form-group { margin-bottom: var(--space-5); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  letter-spacing: 0.2px;
}

label span.required { color: var(--danger); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all var(--t-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--surface-3);
}

.input::placeholder { color: var(--text-dim); }
.textarea { resize: vertical; min-height: 100px; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.select option { background: var(--surface-2); color: var(--text); }

/* File upload area */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-12) var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
  background: var(--surface-2);
  position: relative;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(108, 99, 255, 0.05);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  display: block;
  filter: grayscale(0.3);
}

.drop-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.drop-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space-3) 0;
}

.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  transition: width var(--t-slow) var(--ease);
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

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

.table thead th {
  background: var(--surface-2);
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr {
  transition: background var(--t-fast) var(--ease);
}

.table tbody tr:hover {
  background: rgba(108, 99, 255, 0.04);
}

/* ── Badges / Chips ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-primary  { background: rgba(108, 99, 255, 0.2); color: var(--primary-light); }
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-danger   { background: var(--danger-bg); color: var(--danger); }
.badge-info     { background: var(--info-bg); color: var(--info); }
.badge-muted    { background: var(--surface-3); color: var(--text-muted); }

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-base) var(--ease);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.94) translateY(10px);
  transition: transform var(--t-base) var(--ease-spring);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: var(--surface-3);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--danger); color: white; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  min-width: 300px;
  max-width: 400px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastSlide 0.35s var(--ease-spring) both;
}

.toast.removing {
  animation: toastFade 0.25s var(--ease) forwards;
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateX(100%) scale(0.8); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastFade {
  to { opacity: 0; transform: translateX(100%); }
}

.toast-icon  { font-size: 20px; flex-shrink: 0; }
.toast-body  { flex: 1; }
.toast-title { font-size: 14px; font-weight: 700; color: var(--text); }
.toast-msg   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--info); }

/* ── Page Sections ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-header-left {}
.section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.section-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.section-divider {
  margin: var(--space-8) 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* ── Class Cards Grid ── */
.class-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--t-base) var(--ease);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.class-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transition: transform var(--t-base) var(--ease);
}

.class-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
  box-shadow: var(--shadow);
}

.class-card:hover::after { transform: scaleX(1); }

.class-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.class-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.class-count {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1;
  letter-spacing: -1px;
}

.class-school {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Student Photo Grid ── */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-4);
}

.student-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--t-base) var(--ease);
}

.student-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.student-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 40px;
}

.student-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-info {
  padding: var(--space-3);
}

.student-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-no {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.student-qc {
  padding: var(--space-2) var(--space-3);
  display: flex;
  gap: var(--space-2);
  border-top: 1px solid var(--border);
}

/* ── Upload Steps ── */
.upload-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-8);
}

.upload-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
}

.upload-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 60%;
  right: -40%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.upload-step.done:not(:last-child)::after {
  background: var(--primary);
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: all var(--t-base) var(--ease);
}

.upload-step.active .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.upload-step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.upload-step.active .step-label { color: var(--primary-light); }
.upload-step.done  .step-label  { color: var(--success); }

/* ── Alert Boxes ── */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 14px;
  margin-bottom: var(--space-4);
}

.alert-success { background: var(--success-bg); border: 1px solid rgba(34, 197, 94, 0.2); color: var(--success); }
.alert-error   { background: var(--danger-bg);  border: 1px solid rgba(239, 68, 68, 0.2); color: var(--danger); }
.alert-warning { background: var(--warning-bg); border: 1px solid rgba(245, 158, 11, 0.2); color: var(--warning); }
.alert-info    { background: var(--info-bg);    border: 1px solid rgba(56, 189, 248, 0.2); color: var(--info); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}
.empty-icon  { font-size: 56px; margin-bottom: var(--space-5); opacity: 0.5; }
.empty-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: var(--space-2); }
.empty-sub   { font-size: 14px; color: var(--text-muted); max-width: 360px; margin: 0 auto var(--space-6); }

/* ── Loading Spinner ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Utilities ── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-2       { gap: var(--space-2); }
.gap-3       { gap: var(--space-3); }
.gap-4       { gap: var(--space-4); }
.gap-5       { gap: var(--space-5); }
.mt-4        { margin-top: var(--space-4); }
.mt-6        { margin-top: var(--space-6); }
.mt-8        { margin-top: var(--space-8); }
.mb-4        { margin-bottom: var(--space-4); }
.mb-6        { margin-bottom: var(--space-6); }
.mb-8        { margin-bottom: var(--space-8); }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 11px; }
.font-bold   { font-weight: 700; }
.w-full      { width: 100%; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-h) 1fr;
  }
  .sidebar {
    display: none;
  }
  .app-main {
    grid-column: 1;
    padding: var(--space-4);
  }
  .top-header {
    grid-column: 1;
  }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .grid-cards { grid-template-columns: 1fr 1fr; }
  .app-main   { padding: var(--space-4); }
}
