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

:root {
  --primary:     #4F46E5;
  --primary-dk:  #3730A3;
  --primary-lt:  #EEF2FF;
  --danger:      #DC2626;
  --danger-lt:   #FEF2F2;
  --success:     #16A34A;
  --success-lt:  #F0FDF4;
  --warning:     #D97706;
  --warning-lt:  #FFFBEB;
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-400:    #9CA3AF;
  --gray-600:    #4B5563;
  --gray-800:    #1F2937;
  --radius:      8px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 25px -3px rgba(0,0,0,.10), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition:  .15s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body { background: var(--gray-50); color: var(--gray-800); line-height: 1.6; }

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

/* ── Typography ───────────────────────────────────────── */
h1 { font-size: 1.875rem; font-weight: 700; }
h2 { font-size: 1.5rem;   font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }

/* ── Layout ───────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.page-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }

/* ── Card ─────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 2rem;
}
.card-sm { max-width: 460px; width: 100%; }

/* ── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; color: var(--gray-600); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .625rem .875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem; color: var(--gray-800);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9375rem; font-weight: 500;
  border: none; cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary   { background: var(--primary);   color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-danger    { background: var(--danger);    color: #fff; }
.btn-danger:hover  { background: #b91c1c; }
.btn-success   { background: var(--success);   color: #fff; }
.btn-ghost     { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost:hover { background: var(--primary-lt); }
.btn-sm        { padding: .375rem .875rem; font-size: .875rem; }
.btn-block     { width: 100%; }
.btn:disabled  { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ── Alerts ───────────────────────────────────────────── */
.alert { padding: .875rem 1rem; border-radius: var(--radius); font-size: .9375rem; margin-bottom: 1rem; }
.alert-danger  { background: var(--danger-lt);  color: var(--danger);  border: 1px solid #FCA5A5; }
.alert-success { background: var(--success-lt); color: var(--success); border: 1px solid #86EFAC; }
.alert-warning { background: var(--warning-lt); color: var(--warning); border: 1px solid #FCD34D; }

/* ── Badge ────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .625rem;
  border-radius: 99px; font-size: .75rem; font-weight: 600; text-transform: uppercase;
}
.badge-primary { background: var(--primary-lt); color: var(--primary); }
.badge-danger  { background: var(--danger-lt);  color: var(--danger); }
.badge-success { background: var(--success-lt); color: var(--success); }
.badge-warning { background: var(--warning-lt); color: var(--warning); }
.badge-gray    { background: var(--gray-100);   color: var(--gray-600); }

/* ── Navbar ───────────────────────────────────────────── */
.navbar {
  background: #fff; border-bottom: 1px solid var(--gray-200);
  padding: .875rem 0; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar-brand { font-weight: 700; font-size: 1.125rem; color: var(--primary); }
.navbar-nav   { display: flex; align-items: center; gap: 1rem; }

/* ── Table ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .8125rem; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; padding: .75rem 1rem; border-bottom: 2px solid var(--gray-200); background: var(--gray-50); }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100); font-size: .9375rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── Utility ──────────────────────────────────────────── */
.hidden   { display: none !important; }
.text-muted { color: var(--gray-400); }
.text-sm    { font-size: .875rem; }
.mb-1 { margin-bottom: .5rem; }  .mb-2 { margin-bottom: 1rem; }  .mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .5rem; }     .mt-2 { margin-top: 1rem; }     .mt-3 { margin-top: 1.5rem; }
.flex { display: flex; }
.gap-1 { gap: .5rem; }  .gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.align-center    { align-items: center; }
.text-center     { text-align: center; }
.w-full { width: 100%; }

/* ── Spinner ──────────────────────────────────────────── */
.spinner {
  width: 1.25rem; height: 1.25rem;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Logo ─────────────────────────────────────────────── */
.logo { display: flex; align-items: center; gap: .5rem; }
.logo-icon { width: 36px; height: 36px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.logo-icon svg { fill: #fff; }

/* ═══════════════════════════════════════════════════════
   MOBILE  (≤ 640px) — student-facing pages
   ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  h1 { font-size: 1.375rem; }
  h2 { font-size: 1.125rem; }

  .container { padding: 0 1rem; }

  /* Navbar: stack brand + actions on very small screens */
  .navbar .container {
    flex-wrap: wrap;
    gap: .5rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
  }
  .navbar-brand { font-size: 1rem; }

  /* Buttons in navbar shrink */
  .navbar .btn-sm { padding: .3rem .6rem; font-size: .8125rem; }

  /* Cards go full-width */
  .card { padding: 1.25rem; border-radius: 8px; }
  .card-sm { max-width: 100%; }

  /* Forms */
  .form-group input,
  .form-group select,
  .form-group textarea { font-size: .9375rem; }

  /* Tables: horizontal scroll */
  .table-wrap { -webkit-overflow-scrolling: touch; }
}