/* ============================================================
   Sootrank — Design System v2
   Complete design system for the sidebar-based ERP layout.
   Loaded AFTER Bootstrap 5.3.3 in every template.
   Does NOT target admin panel (templates/admin/*).
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-bg: #1e3a5f;
  --sidebar-bg-dark: #172e4d;
  --sidebar-text: #c8d6e5;
  --sidebar-text-bright: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-active-bg: rgba(37, 99, 235, 0.2);
  --sidebar-active-text: #ffffff;
  --sidebar-active-indicator: #2563eb;
  --sidebar-divider: rgba(255, 255, 255, 0.1);

  /* Brand / Accent */
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-light: #dbeafe;
  --brand-subtle: rgba(37, 99, 235, 0.08);
  --color-primary: #2563eb;
  --color-accent: #2563eb;
  --soot-blue: #2563eb;

  /* Surfaces */
  --bg: #f1f5f9;
  --color-bg: #f1f5f9;
  --color-surface: #ffffff;
  --surface-raised: #ffffff;

  /* Text */
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-muted: #94a3b8;
  --color-text-inverse: #ffffff;

  /* Status */
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --color-warning: #d97706;
  --color-info: #2563eb;

  /* Geometry */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --border: #e2e8f0;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.06), 0 4px 10px rgba(0, 0, 0, 0.04);
  --shadow-overlay: 0 20px 60px rgba(0, 0, 0, 0.15);

  /* Typography */
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-base: var(--font);
  --font-mono: 'Cascadia Code', 'Fira Code', monospace;

  /* Bootstrap overrides */
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: #2563eb;
  --bs-link-hover-color: #1d4ed8;
  --bs-body-font-family: var(--font);
}

/* ── Base ──────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ── Bootstrap Overrides ──────────────────────────────────── */
.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-hover);
  --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-active-bg: var(--brand-hover);
  --bs-btn-active-border-color: var(--brand-hover);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
}

.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand);
  --bs-btn-active-border-color: var(--brand);
}

.btn {
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.badge.bg-primary { background-color: var(--brand) !important; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
  padding: 1rem 1.25rem;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sr-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s ease;
}

.sr-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-divider);
  flex-shrink: 0;
}

.sr-sidebar-brand img { height: 32px; flex-shrink: 0; }

.sr-sidebar-brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--sidebar-text-bright);
  letter-spacing: 0.3px;
}

.sr-sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-divider);
  flex-shrink: 0;
}

.sr-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.sr-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.sr-profile-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--sidebar-text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-profile-meta {
  font-size: 0.6875rem;
  color: var(--sidebar-text);
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar nav */
.sr-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sr-sidebar-nav::-webkit-scrollbar { width: 4px; }
.sr-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }

.sr-nav-section {
  padding: 0 0.75rem;
  margin-bottom: 0.25rem;
}

.sr-nav-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text);
  opacity: 0.5;
  padding: 0.5rem 0.75rem 0.25rem;
}

.sr-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.5625rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  position: relative;
  margin-bottom: 2px;
}

.sr-nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-bright);
}

.sr-nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

.sr-nav-link.active::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--sidebar-active-indicator);
  border-radius: 0 3px 3px 0;
}

.sr-nav-link i {
  width: 18px;
  text-align: center;
  font-size: 0.875rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.sr-nav-link.active i,
.sr-nav-link:hover i { opacity: 1; }

.sr-nav-badge {
  margin-left: auto;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.2;
}

/* Sidebar sub-nav (collapsible) */
.sr-nav-group-toggle {
  cursor: pointer;
  user-select: none;
}

.sr-nav-group-toggle::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.5rem;
  margin-left: auto;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.sr-nav-group-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.sr-nav-sub {
  padding-left: 2.25rem;
}

.sr-nav-sub .sr-nav-link {
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
}

.sr-nav-sub .sr-nav-link.active::before { display: none; }

.sr-nav-sub .sr-nav-link.active {
  background: var(--sidebar-active-bg);
}

/* Sidebar footer */
.sr-sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--sidebar-divider);
  flex-shrink: 0;
}

.sr-sidebar-footer .sr-nav-link {
  margin-bottom: 0;
}

/* ── Main Content Area ────────────────────────────────────── */
.sr-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sr-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
}

/* ── Mobile Topbar ────────────────────────────────────────── */
.sr-mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 1050;
  background: var(--sidebar-bg);
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  box-shadow: var(--shadow-md);
}

.sr-mobile-toggle {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.sr-mobile-toggle:hover { background: var(--sidebar-bg-dark); }

.sr-mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
}

.sr-mobile-brand img {
  height: 24px;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.sr-mobile-brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #ffffff;
}

.sr-mobile-topbar-spacer {
  width: 42px;
  flex-shrink: 0;
}

.sr-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1035;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sr-sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

/* ── Mobile Responsive ────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sr-sidebar {
    transform: translateX(-100%);
  }

  .sr-sidebar.show {
    transform: translateX(0);
    box-shadow: var(--shadow-overlay);
  }

  .sr-main {
    margin-left: 0;
  }

  .sr-content {
    padding: 4rem 1rem 1.5rem;
  }

  .sr-mobile-topbar {
    display: flex;
  }

  .sr-mobile-topbar.hidden {
    display: none;
  }
}

/* ── Status Badges ────────────────────────────────────────── */
.sr-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  line-height: 1.4;
}

.sr-badge-success { background: #dcfce7; color: #166534; }
.sr-badge-warning { background: #fef9c3; color: #854d0e; }
.sr-badge-danger  { background: #fee2e2; color: #991b1b; }
.sr-badge-info    { background: var(--brand-light); color: #1e40af; }
.sr-badge-neutral { background: #f1f5f9; color: #64748b; }
.sr-badge-purple  { background: #f3e8ff; color: #6b21a8; }

.sr-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sr-badge-success .sr-badge-dot { background: #16a34a; }
.sr-badge-warning .sr-badge-dot { background: #ca8a04; }
.sr-badge-danger  .sr-badge-dot { background: #dc2626; }
.sr-badge-info    .sr-badge-dot { background: var(--brand); }
.sr-badge-neutral .sr-badge-dot { background: #94a3b8; }
.sr-badge-purple  .sr-badge-dot { background: #7c3aed; }

/* Small variant */
.sr-badge-sm {
  font-size: 0.625rem;
  padding: 2px 6px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.sr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.4;
}

.sr-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.sr-btn i { font-size: 0.75rem; }

/* Primary */
.sr-btn-primary {
  background: var(--brand);
  color: #fff;
}

.sr-btn-primary:hover { background: var(--brand-hover); color: #fff; }

.sr-btn-primary:disabled,
.sr-btn-primary.disabled {
  background: var(--border);
  color: var(--color-muted);
  cursor: not-allowed;
}

/* Ghost / Secondary */
.sr-btn-ghost {
  padding: 0.375rem 0.875rem;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.sr-btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.sr-btn-ghost i { font-size: 0.625rem; }

/* Danger / Destructive */
.sr-btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.sr-btn-danger:hover { background: #b91c1c; color: #fff; }

.sr-btn-success {
  background: var(--color-success);
  color: #fff;
}
.sr-btn-success:hover { background: #15803d; color: #fff; }

/* Danger ghost */
.sr-btn-danger-ghost {
  padding: 0.375rem 0.875rem;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.sr-btn-danger-ghost:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* Text link button */
.sr-btn-text {
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  color: var(--brand);
  font-size: 0.8125rem;
}

.sr-btn-text:hover { color: var(--brand-hover); }

/* Small CTA (pill) */
.sr-btn-cta {
  background: var(--color-text);
  color: #fff;
  border-radius: 99px;
  padding: 0.375rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.sr-btn-cta:hover { background: #1e293b; color: #fff; }

/* ── Progress Bar ────────────────────────────────────────── */
.sr-progress {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.sr-progress-sm { height: 3px; }

.sr-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--brand);
  transition: width 0.4s ease, background 0.15s ease;
}

.sr-progress-fill-success { background: var(--color-success); }
.sr-progress-fill-warning { background: var(--color-warning); }
.sr-progress-fill-danger  { background: var(--color-danger); }

/* ── Empty State ─────────────────────────────────────────── */
.sr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--color-muted);
}

.sr-empty i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.sr-empty p {
  font-size: 0.8125rem;
  margin: 0;
}

.sr-empty a {
  margin-top: 0.75rem;
}

/* ── Cards ───────────────────────────────────────────────── */
.sr-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--color-surface);
  overflow: hidden;
}

.sr-card-head {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.sr-card-head i {
  color: var(--brand);
  margin-right: 6px;
}

.sr-card-body {
  padding: 1rem;
}

/* ── Stat Block ──────────────────────────────────────────── */
.sr-stat {
  padding-left: 1rem;
  border-left: 3px solid var(--brand);
}

.sr-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 0.375rem;
}

.sr-stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text);
}

.sr-stat-hint {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

/* ── Quick Action Link ───────────────────────────────────── */
.sr-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.12s, background 0.12s;
}

.sr-action:hover {
  border-color: var(--brand);
  background: rgba(37, 99, 235, 0.02);
  color: var(--color-text);
}

.sr-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  color: var(--brand);
  flex-shrink: 0;
}

.sr-action-label {
  font-size: 0.8125rem;
  font-weight: 600;
  flex: 1;
}

.sr-action-arrow {
  font-size: 0.625rem;
  color: var(--color-muted);
  opacity: 0;
  transition: opacity 0.12s, transform 0.12s;
}

.sr-action:hover .sr-action-arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* ── Profile Header ──────────────────────────────────────── */
.sr-profile {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.sr-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow: hidden;
}

.sr-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sr-profile .sr-profile-name {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.sr-profile-detail {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

.sr-profile-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

/* ── Section Label ───────────────────────────────────────── */
.sr-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

/* ── Typography Utilities ────────────────────────────────── */
.sr-heading {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.sr-body {
  font-size: 0.8125rem;
  color: var(--color-text);
}

.sr-body-sm {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.sr-meta {
  font-size: 0.6875rem;
  color: var(--color-muted);
}

/* ── Alert Banner ────────────────────────────────────────── */
.sr-alert-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.sr-alert-banner-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.sr-alert-banner-warning i { color: #d97706; }
.sr-alert-banner-warning .sr-alert-banner-text { color: #92400e; }

.sr-alert-banner-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.sr-alert-banner-danger i { color: var(--color-danger); }
.sr-alert-banner-danger .sr-alert-banner-text { color: #991b1b; }

.sr-alert-banner-info {
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.sr-alert-banner-info i { color: var(--brand); }
.sr-alert-banner-info .sr-alert-banner-text { color: #1e40af; }

.sr-alert-banner-text {
  flex: 1;
  font-size: 0.8125rem;
}

.sr-alert-banner-text strong { font-weight: 700; }

/* ── CGPA Conditional Colors ─────────────────────────────── */
.sr-cgpa-green  { color: #16a34a; }
.sr-cgpa-yellow { color: #ca8a04; }
.sr-cgpa-red    { color: #dc2626; }
.sr-cgpa-none   { color: #94a3b8; }

/* ── Timeline Item ───────────────────────────────────────── */
.sr-timeline-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.sr-timeline-item:last-child { border-bottom: none; }

.sr-timeline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sr-timeline-dot-done    { background: #16a34a; }
.sr-timeline-dot-current { background: var(--brand); }

.sr-timeline-text {
  font-size: 0.8125rem;
  color: var(--color-text);
  flex: 1;
}

/* ── List Item (course rows, status rows) ────────────────── */
.sr-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.sr-list-item:last-child { border-bottom: none; }

/* ── Status Row ──────────────────────────────────────────── */
.sr-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sr-status-row:last-child { margin-bottom: 0; }

.sr-status-label {
  font-size: 0.75rem;
  color: var(--color-muted);
  min-width: 60px;
}

.sr-status-val {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ── Layout Grids ────────────────────────────────────────── */
.sr-grid-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sr-grid-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.sr-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 991.98px) {
  .sr-grid-2col { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .sr-grid-stats { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .sr-grid-actions { grid-template-columns: repeat(2, 1fr); }
  .sr-profile-avatar { width: 52px; height: 52px; font-size: 1.125rem; }
  .sr-profile-name { font-size: 1.125rem; }
  .sr-profile { gap: 1rem; }
}

@media (max-width: 400px) {
  .sr-grid-actions { grid-template-columns: 1fr; }
}

/* ── Context Pill ─────────────────────────────────────────── */
.sr-ctx-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(37,99,235,0.12);
  background: rgba(37,99,235,0.06);
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e40af;
}

/* ── Meta Row ─────────────────────────────────────────────── */
.sr-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.sr-meta-note {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* ── Pill Buttons ─────────────────────────────────────────── */
.sr-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 34px;
  padding: 0.375rem 0.875rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.12s ease, color 0.12s ease;
}

.sr-pill-btn-primary {
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid transparent;
}

.sr-pill-btn-primary:hover {
  background: #cfe0ff;
  color: var(--brand-hover);
}

.sr-pill-btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--color-text-secondary);
}

.sr-pill-btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.sr-pill-btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid transparent;
}

.sr-pill-btn-danger:hover {
  background: #fecaca;
}

/* ── Slot Tags ───────────────────────────────────────────── */
.sr-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  display: inline-block;
}
.sr-tag-lec { background: #dbeafe; color: #2563eb; }
.sr-tag-lab { background: #cffafe; color: #0891b2; }

/* ── Info Card ────────────────────────────────────────────── */
.sr-info-card {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  height: 100%;
}

.sr-info-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sr-info-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.sr-info-row:last-child { margin-bottom: 0; }

.sr-info-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--brand);
  font-size: 0.8125rem;
}

.sr-info-label {
  font-size: 0.6875rem;
  color: var(--color-muted);
}

.sr-info-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ── Section Card ─────────────────────────────────────────── */
.sr-section-card {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  margin-top: 1.25rem;
}

.sr-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Login Split Layout ───────────────────────────────────── */
.sr-login-wrap {
  display: flex;
  min-height: 100vh;
}

.sr-login-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.sr-login-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.sr-login-brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.5) 50%, rgba(15, 23, 42, 0.75) 100%);
}

.sr-login-brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 400px;
}

.sr-login-brand-content h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.sr-login-brand-content p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.sr-login-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: #f8fafc;
}

.sr-login-form-wrap {
  width: 100%;
  max-width: 400px;
}

.sr-login-form-wrap h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.sr-login-form-wrap .sr-login-subtitle {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-bottom: 2rem;
}

.sr-login-form-wrap .form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.375rem;
}

.sr-login-form-wrap .form-control {
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sr-login-form-wrap .form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sr-login-form-wrap .btn-primary {
  padding: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

@media (max-width: 767.98px) {
  .sr-login-wrap { flex-direction: column; }

  .sr-login-brand {
    flex: none;
    padding: 2rem 1.5rem;
    min-height: auto;
  }

  .sr-login-brand-content img { height: 48px; margin-bottom: 1rem; }
  .sr-login-brand-content h1 { font-size: 1.75rem; margin-bottom: 0.375rem; }
  .sr-login-brand-content p { font-size: 0.875rem; }

  .sr-login-form-side { padding: 2rem 1.5rem; background: var(--color-bg); }

  .sr-login-form-wrap h2,
  .sr-login-form-wrap .sr-login-subtitle {
    text-align: center;
  }
}

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

.sr-page-title {
  font-size: 1.375rem;  /* was 1.5rem — match actual template usage */
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.25rem;
}

.sr-page-sub {
  font-size: 0.8125rem;  /* was 0.875rem as sr-page-subtitle */
  color: var(--color-muted);
  margin: 0;
}

/* ── Footer ───────────────────────────────────────────────── */
.sr-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  margin-top: auto;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.sr-footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.sr-footer a:hover { color: var(--brand); }

/* Balanced 3-group footer layout */
.sr-footer-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: start;
  column-gap: 4rem;
  row-gap: 1.5rem;
}
.sr-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.sr-footer-brand img {
  height: 40px;
  width: auto;
  opacity: 0.85;
  flex-shrink: 0;
}
.sr-footer-copy {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.375rem;
}
.sr-footer-feedback {
  font-size: 0.75rem;
  color: var(--color-muted);
}
.sr-footer-head {
  font-weight: 600;
  color: var(--color-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.625rem;
}
.sr-footer-col a {
  display: block;
  line-height: 1.9;
}

@media (max-width: 767.98px) {
  .sr-footer-grid {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 1.25rem;
  }
}

/* ── Floating feedback button ─────────────────────────────── */
.sr-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1030;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--color-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 1.25rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
              background 0.15s ease, color 0.15s ease;
}
.sr-fab:hover,
.sr-fab:focus-visible {
  transform: translateY(-3px);
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
  outline: none;
}
.sr-fab:active { transform: translateY(-1px); }

@media (max-width: 767.98px) {
  .sr-fab {
    right: 1rem;
    bottom: 1rem;
    width: 48px;
    height: 48px;
    font-size: 1.125rem;
  }
}

/* ── Alerts ───────────────────────────────────────────────── */
.sr-alert {
  border-radius: var(--radius);
  border: none;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
}

/* ── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *:not(.spinner-border):not(.spinner-grow):not(.spinner) {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
