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

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --secondary: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────────────────────── */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  white-space: nowrap;
}

.nav-logo { font-size: 1.4rem; }

.nav-links {
  display: flex;
  gap: .25rem;
  flex: 1;
}

.nav-link {
  padding: .4rem .85rem;
  border-radius: 6px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s, color .15s;
}

.nav-link:hover { background: var(--gray-100); color: var(--primary); }
.nav-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.nav-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

.user-badge {
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.user-badge.teacher { background: #fef3c7; color: #92400e; }
.user-badge.student { background: #dbeafe; color: #1e40af; }
.user-badge.admin { background: #fee2e2; color: #991b1b; }
.nav-username { font-size: .9rem; color: var(--gray-700); margin-left: .25rem; }

/* ── Main Content ─────────────────────────────────────────────────────── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.main-content.login-main {
  max-width: 100%;
  padding: 0;
}

/* ── Flash Messages ───────────────────────────────────────────────────── */
.flash-container {
  position: fixed;
  top: 70px;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 380px;
  width: 100%;
}

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  font-size: .88rem;
  border-left: 4px solid;
  box-shadow: var(--shadow-md);
  animation: slideIn .25s ease;
}

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: .5;
  padding: 0;
  flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }

.alert-success { background: #d1fae5; border-color: var(--success); color: #065f46; }
.alert-danger  { background: #fee2e2; border-color: var(--danger);  color: #991b1b; }
.alert-warning { background: #fef3c7; border-color: var(--warning); color: #92400e; }
.alert-info    { background: #dbeafe; border-color: var(--secondary); color: #1e40af; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1.2rem;
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #0284c7; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-outline   { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-100); }
.btn-sm  { padding: .3rem .8rem; font-size: .82rem; }
.btn-lg  { padding: .7rem 1.8rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ── Page Header ──────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.75rem;
}

.page-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gray-900);
}

.page-header p {
  color: var(--gray-500);
  margin-top: .25rem;
  font-size: .9rem;
}

/* ── Login Page ───────────────────────────────────────────────────────── */
.login-main {
  padding: 0 !important;
}

.login-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo { font-size: 3rem; margin-bottom: .5rem; }

.login-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
}

.login-header p {
  color: var(--gray-500);
  font-size: .85rem;
  margin-top: .3rem;
}

.role-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 1.5rem;
}

.role-tab {
  flex: 1;
  padding: .5rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  color: var(--gray-500);
  transition: all .15s;
}

.role-tab.active {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.login-form .form-group { margin-bottom: 1.1rem; }

.login-form label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: .4rem;
}

.login-hint {
  margin-top: 1.25rem;
  text-align: center;
  font-size: .8rem;
  color: var(--gray-500);
}

.login-hint code {
  background: var(--gray-100);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-family: monospace;
}

/* ── Form Controls ────────────────────────────────────────────────────── */
.form-control {
  width: 100%;
  padding: .55rem .9rem;
  border: 1px solid var(--gray-300);
  border-radius: 7px;
  font-size: .9rem;
  color: var(--gray-900);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .4rem; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; }

.checkbox-group { margin: 1rem 0; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; }
.checkbox-label input { width: 16px; height: 16px; cursor: pointer; }

.select-sm { width: auto; padding: .45rem .7rem; }

/* ── Stats Grid ───────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.stat-icon { font-size: 2rem; margin-bottom: .5rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .85rem; color: var(--gray-500); margin-top: .25rem; }

/* ── Action Grid ──────────────────────────────────────────────────────── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.action-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.action-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
.action-card p  { font-size: .85rem; color: var(--gray-500); margin-bottom: 1rem; }
.action-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Section ──────────────────────────────────────────────────────────── */
.section { margin-bottom: 1.75rem; }
.section h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }

/* ── Task List ────────────────────────────────────────────────────────── */
.task-list {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  gap: 1rem;
}

.task-item:last-child { border-bottom: none; }
.task-item.status-running { background: #fffbeb; }
.task-item.status-error   { background: #fef2f2; }
.task-item.status-done    { background: #f0fdf4; }

.task-info { display: flex; gap: .75rem; align-items: center; flex: 1; min-width: 0; }
.task-type { font-weight: 600; font-size: .85rem; white-space: nowrap; }
.task-msg  { font-size: .85rem; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; gap: .75rem; align-items: center; white-space: nowrap; }
.task-time { font-size: .8rem; color: var(--gray-500); }

.task-status-badge {
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.task-status-badge.status-pending { background: #f3f4f6; color: var(--gray-700); }
.task-status-badge.status-running { background: #fef3c7; color: #92400e; }
.task-status-badge.status-done    { background: #d1fae5; color: #065f46; }
.task-status-badge.status-error   { background: #fee2e2; color: #991b1b; }

/* ── Upload Card ──────────────────────────────────────────────────────── */
.upload-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 1.25rem;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-icon { font-size: 3rem; margin-bottom: .75rem; }
.drop-zone p { color: var(--gray-500); margin-bottom: .5rem; }
.drop-zone .hint { font-size: .82rem; }

.file-list { margin-bottom: 1rem; }

.file-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .9rem;
  background: var(--gray-50);
  border-radius: 6px;
  margin-bottom: .4rem;
  font-size: .88rem;
}

.file-icon { font-size: 1.1rem; }
.file-name { flex: 1; color: var(--gray-700); }
.file-size { color: var(--gray-500); font-size: .8rem; }

.info-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-size: .88rem;
}

.info-card h4 { font-size: .95rem; margin-bottom: .5rem; color: #1e40af; }
.info-card ul { padding-left: 1.25rem; color: var(--gray-700); }
.info-card li { margin-bottom: .25rem; }

/* ── Table ────────────────────────────────────────────────────────────── */
.table-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: auto;
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.data-table th {
  background: var(--gray-50);
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

/* ── Pagination ───────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-top: 1.5rem;
}

.page-info { font-size: .88rem; color: var(--gray-500); }

/* ── Search Bar ───────────────────────────────────────────────────────── */
.search-bar {
  margin-bottom: 1.25rem;
}

.search-bar form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.search-input { flex: 1; min-width: 200px; }

/* ── Tags ─────────────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: .2rem .55rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 500;
  margin: .1rem;
}

.tag-lg { padding: .3rem .8rem; font-size: .82rem; }
.tag-sm { padding: .15rem .45rem; font-size: .72rem; }
.tag-empty { color: var(--gray-300); font-size: .8rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .5rem; }

/* ── Badges ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}

.badge-success   { background: #d1fae5; color: #065f46; }
.badge-primary   { background: var(--primary-light); color: var(--primary); }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-secondary { background: var(--gray-100); color: var(--gray-700); }

/* ── Score ────────────────────────────────────────────────────────────── */
.score { font-weight: 600; }
.score-excellent { color: #059669; }
.score-good      { color: var(--primary); }
.score-pass      { color: var(--warning); }
.score-fail      { color: var(--danger); }

.score-badge {
  display: inline-block;
  padding: .2rem .6rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  font-weight: 600;
  font-size: .85rem;
}

.score-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  margin: .5rem auto;
}

/* ── Difficulty Dots ──────────────────────────────────────────────────── */
.difficulty-dots { display: flex; gap: 3px; }
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gray-200);
}
.dot.filled { background: var(--primary); }

.dot-lg { width: 14px; height: 14px; border-radius: 50%; background: var(--gray-200); }
.dot-lg.filled { background: var(--primary); }
.difficulty-bar { display: flex; gap: 6px; justify-content: center; margin: .5rem 0; }

/* ── Project Grid ─────────────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.project-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.project-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card-header { display: flex; justify-content: flex-end; }
.project-title { font-weight: 600; font-size: .92rem; color: var(--gray-900); line-height: 1.4; }
.project-title-link { color: var(--gray-900); text-decoration: none; font-weight: 500; }
.project-title-link:hover { color: var(--primary); text-decoration: underline; }
.project-meta { font-size: .8rem; color: var(--gray-500); display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── Recommendations ──────────────────────────────────────────────────── */
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.rec-card {
  background: linear-gradient(135deg, #667eea15, #764ba215);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 1rem;
}

.rec-score {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .3rem;
}

.rec-title { font-size: .85rem; color: var(--gray-700); line-height: 1.4; }

/* ── Student Grid ─────────────────────────────────────────────────────── */
.student-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .student-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

.student-main { display: flex; flex-direction: column; gap: 1.5rem; }

/* ── Assignment Card ──────────────────────────────────────────────────── */
.assignment-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.assignment-card.assigned { border-left: 4px solid var(--success); }
.assignment-card.unassigned { border-left: 4px solid var(--warning); }

.assignment-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.assignment-header h3 { font-size: 1rem; font-weight: 600; }
.assignment-title { font-size: 1.05rem; font-weight: 600; color: var(--gray-900); margin-bottom: .75rem; }
.assignment-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--gray-500); margin-bottom: .5rem; }
.domain-hint { font-size: .85rem; color: var(--gray-500); margin-top: .5rem; }

/* ── Grades Section ───────────────────────────────────────────────────── */
.grades-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.gpa-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.student-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.sidebar-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.sidebar-card h4 { font-size: .9rem; font-weight: 600; margin-bottom: .75rem; color: var(--gray-700); }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .88rem;
}

.stat-row:last-child { border-bottom: none; }
.stat-row span { color: var(--gray-500); }
.stat-row strong { color: var(--gray-900); }

/* ── Detail Card ──────────────────────────────────────────────────────── */
.detail-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--gray-200);
}

.detail-header h2 { font-size: 1.3rem; font-weight: 700; line-height: 1.4; }
.detail-badges { display: flex; gap: .5rem; flex-shrink: 0; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 640px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-section { margin-bottom: 1.5rem; }
.detail-section h4 { font-size: .9rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .6rem; }
.detail-section p { color: var(--gray-700); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.info-item { display: flex; flex-direction: column; gap: .15rem; }
.info-label { font-size: .78rem; color: var(--gray-500); }
.info-item span:last-child { font-size: .9rem; color: var(--gray-900); }

/* ── Link ─────────────────────────────────────────────────────────────── */
.link { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ── Empty Hint ───────────────────────────────────────────────────────── */
.empty-hint { text-align: center; color: var(--gray-300); padding: 2rem; font-size: .9rem; }

/* ── Hint ─────────────────────────────────────────────────────────────── */
.hint { font-size: .82rem; color: var(--gray-500); text-align: center; margin-top: .25rem; }

/* ── Pagination Jump ──────────────────────────────────────────────────── */
.page-jump-form {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: .5rem;
}

.page-jump-input {
  width: 60px;
  padding: .3rem .5rem;
  text-align: center;
}

.page-ellipsis {
  color: var(--gray-500);
  padding: 0 .25rem;
}

/* ── Danger Card ──────────────────────────────────────────────────────── */
.danger-card {
  border-left: 4px solid var(--danger);
}

.danger-card h3 { color: var(--danger); }

/* ── Task Progress Mini ───────────────────────────────────────────────── */
.task-progress-mini {
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* ── Progress Bar ─────────────────────────────────────────────────────── */
.progress-wrap {
  background: var(--gray-100);
  border-radius: 20px;
  height: 12px;
  overflow: hidden;
  margin: .5rem 0;
}

.progress-bar {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width .4s ease;
  min-width: 4px;
}

.progress-label {
  font-size: .82rem;
  color: var(--gray-500);
  margin-top: .3rem;
  display: flex;
  justify-content: space-between;
}

.progress-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.progress-modal.active { display: flex; }

#confirm-modal { z-index: 1100; }

.progress-modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.progress-modal-box h3 { font-size: 1.1rem; margin-bottom: 1.25rem; }
.progress-modal-box .progress-wrap { height: 16px; margin: .75rem 0; }
.progress-pct { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: .5rem 0; }
.progress-step { font-size: .88rem; color: var(--gray-500); min-height: 1.4em; }
.progress-done { color: var(--success); font-weight: 600; font-size: .95rem; margin-top: .75rem; }
.progress-error { color: var(--danger); font-weight: 600; font-size: .88rem; margin-top: .75rem; }

/* ── Tag Filter Bar ───────────────────────────────────────────────────── */
.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin: .75rem 0 1rem;
}

.tag-filter-label {
  font-size: .85rem;
  color: var(--gray-500);
  white-space: nowrap;
}

.tag-checkbox {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 20px;
  border: 1px solid var(--gray-300);
  background: #fff;
  font-size: .82rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}

.tag-checkbox input[type="checkbox"] { display: none; }

.tag-checkbox:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tag-checkbox.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.tag-active {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  font-weight: 600;
}

/* ── Radar Charts ─────────────────────────────────────────────────────── */
.radar-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.radar-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}

.page-info {
  font-size: .85rem;
  color: var(--gray-500);
  white-space: nowrap;
}

.radar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.radar-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}

.radar-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.radar-sid {
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  font-family: monospace;
}

.radar-name {
  font-size: .82rem;
  color: var(--gray-700);
  flex: 1;
}

.radar-gpa {
  font-size: .78rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: .1rem .45rem;
  border-radius: 20px;
  white-space: nowrap;
}
