:root {
  color-scheme: light only;
  /* Brand palette — light theme, Victoria University branding */
  --clr-bg:           #f5f6fa;
  --clr-surface:      #ffffff;
  --clr-surface-2:    #f0f1f7;
  --clr-surface-3:    #e9eaf2;
  --clr-border:       #e3e5ef;
  --clr-border-light: #eceef5;

  /* Accent — Victoria University red */
  --clr-accent:       #ED1C24;
  --clr-accent-dim:   #C8141B;
  --clr-accent-glow:  rgba(237, 28, 36, 0.14);
  --clr-accent-soft:  rgba(237, 28, 36, 0.08);

  /* Victoria University blue (secondary accent) */
  --clr-vu-blue:      #4FB8DE;
  --clr-vu-blue-dim:  #2E9CC4;

  /* Status colours */
  --clr-success:      #16a34a;
  --clr-success-bg:   rgba(22, 163, 74, 0.10);
  --clr-warning:      #d97706;
  --clr-warning-bg:   rgba(217, 119, 6, 0.10);
  --clr-danger:       #ED1C24;
  --clr-danger-bg:    rgba(237, 28, 36, 0.10);
  --clr-info:         #2E9CC4;
  --clr-info-bg:      rgba(79, 184, 222, 0.12);

  /* Text */
  --clr-text:         #111827;
  --clr-text-muted:   #6b7280;
  --clr-text-dim:     #9ca3af;

  /* Typography */
  --font-display:     'Syne', sans-serif;
  --font-body:        'DM Sans', sans-serif;

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

  /* Shape */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-pill:9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.35);
  --shadow-md:  0 4px 16px rgba(0,0,0,.45);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.55);
  --shadow-glow:0 0 24px var(--clr-accent-glow);

  /* Layout */
  --sidebar-w:  240px;
  --topbar-h:   60px;
  --content-max:1160px;

  /* Transitions */
  --ease:       cubic-bezier(.4,0,.2,1);
  --dur-fast:   120ms;
  --dur-base:   220ms;
  --dur-slow:   380ms;
}

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

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

body {
  background-color: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--clr-accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: #829fff; }

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

ul, ol { list-style: none; }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--clr-text);
}
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

p { color: var(--clr-text-muted); line-height: 1.7; }
/* Toggle Switch Styles */
.toggle-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 26px;
  background: #ccc;
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
  flex-shrink: 0;
  outline: none;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch:checked {
  background: var(--clr-primary, #2563eb);
}

.toggle-switch:checked::after {
  transform: translateX(22px);
}

.toggle-switch:focus-visible {
  outline: 2px solid var(--clr-primary, #2563eb);
  outline-offset: 2px;
}

/* If you want to keep the checkbox label visible */
.form-group:has(.toggle-switch) .form-label {
  display: block;
  margin-bottom: var(--sp-2);
}

.form-group:has(.toggle-switch) {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
hr {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: var(--sp-6) 0;
}

/* -------------------------------------------------------------
   3. LAYOUT — sidebar + topbar shell
   ------------------------------------------------------------- */

/* Full-page wrapper when user is authenticated */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar  topbar"
    "sidebar main";
  min-height: 100vh;
}

/* Topbar */
.topbar {
  grid-area: topbar;
  height: var(--topbar-h);
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar__brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--clr-text);
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: var(--sidebar-w);
  flex-shrink: 0;
}
.topbar__brand .brand-dot {
  width: 8px; height: 8px;
  background: var(--clr-accent);
  border-radius: 50%;
  display: inline-block;
}

.topbar__spacer { flex: 1; }

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.topbar__icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
  position: relative;
}
.topbar__icon-btn:hover {
  background: var(--clr-surface-3);
  color: var(--clr-text);
  border-color: var(--clr-border-light);
}

/* Notification badge */
.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--clr-danger);
  border-radius: 50%;
  border: 2px solid var(--clr-surface);
}

/* User avatar chip */
.topbar__user {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
  text-decoration: none;
  color: var(--clr-text);
}
.topbar__user:hover { background: var(--clr-surface-3); color: var(--clr-text); }

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--clr-accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar__user-name {
  font-size: 0.8125rem;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  padding: var(--sp-6) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  overflow-y: auto;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
}

.sidebar__section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-text-dim);
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  color: var(--clr-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.nav-item i {
  width: 16px;
  text-align: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.nav-item:hover {
  background: var(--clr-surface-2);
  color: var(--clr-text);
}
.nav-item.active {
  background: var(--clr-accent-soft);
  color: var(--clr-accent);
  font-weight: 600;
}
.nav-item.active i { color: var(--clr-accent); }

.sidebar__divider {
  height: 1px;
  background: var(--clr-border);
  margin: var(--sp-3) var(--sp-3);
}

.sidebar__bottom {
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--clr-border);
}

/* Main content area */
.main-content {
  grid-area: main;
  padding: var(--sp-8) var(--sp-8);
  overflow-y: auto;
  min-width: 0; /* prevents grid blowout */
  width: 100%;
}

/* Page without sidebar (login, register, etc.) */
.page-centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  background: var(--clr-bg);
}

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

.page-header__title { margin-bottom: var(--sp-1); }
.page-header__subtitle {
  font-size: 0.875rem;
  color: var(--clr-text-muted);
}

.page-header__actions {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--clr-text-dim);
  margin-bottom: var(--sp-3);
}
.breadcrumb a { color: var(--clr-text-muted); }
.breadcrumb a:hover { color: var(--clr-text); }
.breadcrumb i { font-size: 0.625rem; }

/* -------------------------------------------------------------
   5. CARDS
   ------------------------------------------------------------- */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card--hover {
  transition: border-color var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease),
              transform var(--dur-base) var(--ease);
}
.card--hover:hover {
  border-color: var(--clr-border-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.card__title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--clr-text);
}
.card__body    { padding: var(--sp-6); }
.card__footer  {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--clr-border);
  background: var(--clr-surface-2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
}

/* Stat card */
.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.stat-card__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.stat-card__icon--accent  { background: var(--clr-accent-soft);   color: var(--clr-accent); }
.stat-card__icon--success { background: var(--clr-success-bg);    color: var(--clr-success); }
.stat-card__icon--warning { background: var(--clr-warning-bg);    color: var(--clr-warning); }
.stat-card__icon--danger  { background: var(--clr-danger-bg);     color: var(--clr-danger); }
.stat-card__icon--info    { background: var(--clr-info-bg);       color: var(--clr-info); }

.stat-card__value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--clr-text);
  line-height: 1;
}
.stat-card__label {
  font-size: 0.8125rem;
  color: var(--clr-text-muted);
  font-weight: 500;
}

/* -------------------------------------------------------------
   6. BUTTONS
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  white-space: nowrap;
  text-decoration: none;
  height: 38px;
}
.btn:active { transform: scale(.98); }
.btn i { font-size: 0.8125rem; }

/* Primary */
.btn-primary {
  background: var(--clr-accent);
  color: #fff;
  border-color: var(--clr-accent);
}
.btn-primary:hover {
  background: var(--clr-accent-dim);
  border-color: var(--clr-accent-dim);
  box-shadow: var(--shadow-glow);
  color: #fff;
}

/* Secondary (ghost) */
.btn-secondary {
  background: transparent;
  color: var(--clr-text-muted);
  border-color: var(--clr-border);
}
.btn-secondary:hover {
  background: var(--clr-surface-2);
  color: var(--clr-text);
  border-color: var(--clr-border-light);
}

/* Danger */
.btn-danger {
  background: var(--clr-danger-bg);
  color: var(--clr-danger);
  border-color: rgba(245,101,101,.25);
}
.btn-danger:hover {
  background: var(--clr-danger);
  color: #fff;
  border-color: var(--clr-danger);
}

/* Success */
.btn-success {
  background: var(--clr-success-bg);
  color: var(--clr-success);
  border-color: rgba(61,214,140,.25);
}
.btn-success:hover {
  background: var(--clr-success);
  color: #0e0f13;
  border-color: var(--clr-success);
}

/* Warning */
.btn-warning {
  background: var(--clr-warning-bg);
  color: var(--clr-warning);
  border-color: rgba(245,200,66,.25);
}
.btn-warning:hover {
  background: var(--clr-warning);
  color: #0e0f13;
  border-color: var(--clr-warning);
}

/* Ghost (text-only) */
.btn-ghost {
  background: transparent;
  color: var(--clr-accent);
  border-color: transparent;
  padding-left: var(--sp-2);
  padding-right: var(--sp-2);
}
.btn-ghost:hover {
  background: var(--clr-accent-soft);
  color: var(--clr-accent);
}

/* Sizes */
.btn-sm { height: 30px; padding: 0 var(--sp-3); font-size: 0.8125rem; }
.btn-lg { height: 46px; padding: 0 var(--sp-8); font-size: 0.9375rem; }
.btn-full { width: 100%; }

/* Icon-only */
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Disabled state */
.btn:disabled, .btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* -------------------------------------------------------------
   7. FORMS
   ------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--clr-text);
  letter-spacing: .01em;
}

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

/* All text-like inputs */
.form-control {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background-color: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color-scheme: light;
  line-height: 1.5;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.form-control::placeholder { color: var(--clr-text-dim); }
.form-control:hover  { border-color: var(--clr-border-light); }
.form-control:focus  {
  border-color: var(--clr-accent);
  background-color: var(--clr-surface-3);
  color: var(--clr-text);
  box-shadow: 0 0 0 3px var(--clr-accent-glow);
}
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--clr-text);
  -webkit-box-shadow: 0 0 0 1000px var(--clr-surface-2) inset;
  box-shadow: 0 0 0 1000px var(--clr-surface-2) inset;
  caret-color: var(--clr-text);
}
.form-control:disabled {
  opacity: .5;
  cursor: not-allowed;
  background: var(--clr-surface);
}

/* Select */
.form-select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-surface-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b8ea8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 14px center;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.5;
  outline: none;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.form-select:focus {
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-glow);
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* File input */
input[type="file"].form-control {
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  color: var(--clr-text-muted);
}
input[type="file"].form-control::-webkit-file-upload-button,
input[type="file"].form-control::file-selector-button {
  background: var(--clr-surface-3);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  padding: var(--sp-1) var(--sp-3);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  cursor: pointer;
  margin-right: var(--sp-3);
  transition: background var(--dur-fast) var(--ease);
}
input[type="file"].form-control::-webkit-file-upload-button:hover,
input[type="file"].form-control::file-selector-button:hover {
  background: var(--clr-border-light);
}

/* Checkbox & radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--clr-border-light);
  border-radius: var(--radius-sm);
  background: var(--clr-surface-2);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
  flex-shrink: 0;
  position: relative;
}
.form-check input[type="radio"] { border-radius: 50%; }
.form-check input[type="checkbox"]:checked,
.form-check input[type="radio"]:checked {
  background: var(--clr-accent);
  border-color: var(--clr-accent);
}
.form-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.form-check input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: #fff;
  border-radius: 50%;
}
.form-check__label {
  font-size: 0.875rem;
  color: var(--clr-text);
  cursor: pointer;
}

/* Help text */
.form-help {
  font-size: 0.75rem;
  color: var(--clr-text-dim);
  margin-top: var(--sp-1);
}

/* Error state */
.form-control.is-invalid,
.form-select.is-invalid  { border-color: var(--clr-danger); }
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(245,101,101,.2);
}
.form-error {
  font-size: 0.75rem;
  color: var(--clr-danger);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: var(--sp-1);
}

/* Non-field (form-level) errors */
.form-errors-global {
  background: var(--clr-danger-bg);
  border: 1px solid rgba(245,101,101,.3);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.form-errors-global ul { padding-left: var(--sp-4); }
.form-errors-global li {
  font-size: 0.875rem;
  color: var(--clr-danger);
  list-style: disc;
}

/* Score fields used in assessment */
.score-field-group {
  display: grid;
  grid-template-columns: 1fr 70px;
  align-items: center;
  gap: var(--sp-3);
}
.score-field-group input[type="range"] {
  appearance: none;
  height: 4px;
  background: var(--clr-surface-3);
  border-radius: var(--radius-pill);
  outline: none;
  cursor: pointer;
}
.score-field-group input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--clr-accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--clr-accent-glow);
}
.score-field-group .score-number {
  width: 70px;
  text-align: center;
}

/* Two column form grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--sp-6);
}

/* Section divider inside a form */
.form-section-heading {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--clr-text-dim);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: var(--sp-5);
  margin-top: var(--sp-2);
}

/* Auth card (login / register) */
.auth-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-10) var(--sp-10);
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
}
.auth-card--wide { max-width: 640px; }
.auth-card--wider { max-width: 800px; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-8);
}
.auth-logo__mark {
  width: 36px; height: 36px;
  background: var(--clr-accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1rem;
}
.auth-logo__name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--clr-text);
  letter-spacing: -.02em;
}

.auth-heading { margin-bottom: var(--sp-2); }
.auth-subheading {
  color: var(--clr-text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--sp-8);
}

.auth-footer {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--clr-text-muted);
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--clr-border);
}

/* -------------------------------------------------------------
   8. TABLES
   ------------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table thead tr {
  background: var(--clr-surface-2);
}
.table th {
  padding: var(--sp-3) var(--sp-5);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--clr-text-dim);
  border-bottom: 1px solid var(--clr-border);
  white-space: nowrap;
}
.table td {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr {
  transition: background var(--dur-fast) var(--ease);
}
.table tbody tr:hover { background: var(--clr-surface-2); }

.table__actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
}

/* Empty state inside table */
.table-empty {
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
  color: var(--clr-text-dim);
}
.table-empty i {
  font-size: 2.5rem;
  margin-bottom: var(--sp-4);
  display: block;
  color: var(--clr-border-light);
}

/* -------------------------------------------------------------
   9. BADGES / PILLS
   ------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge i { font-size: 0.6rem; }

.badge--success { background: var(--clr-success-bg); color: var(--clr-success); }
.badge--warning { background: var(--clr-warning-bg); color: var(--clr-warning); }
.badge--danger  { background: var(--clr-danger-bg);  color: var(--clr-danger); }
.badge--info    { background: var(--clr-info-bg);    color: var(--clr-info); }
.badge--accent  { background: var(--clr-accent-soft);color: var(--clr-accent); }
.badge--muted   { background: var(--clr-surface-3);  color: var(--clr-text-muted); }

/* -------------------------------------------------------------
   10. ALERTS / MESSAGES
   ------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  border: 1px solid transparent;
  position: relative;
}
.alert i { flex-shrink: 0; margin-top: 2px; }
.alert__body { flex: 1; }
.alert__title { font-weight: 600; color: inherit; margin-bottom: 2px; }
.alert__close {
  position: absolute;
  top: var(--sp-3); right: var(--sp-3);
  background: none; border: none;
  color: inherit; opacity: .6;
  cursor: pointer; font-size: 0.875rem;
}
.alert__close:hover { opacity: 1; }

.alert--success {
  background: var(--clr-success-bg);
  border-color: rgba(61,214,140,.25);
  color: var(--clr-success);
}
.alert--warning {
  background: var(--clr-warning-bg);
  border-color: rgba(245,200,66,.25);
  color: var(--clr-warning);
}
.alert--danger {
  background: var(--clr-danger-bg);
  border-color: rgba(245,101,101,.25);
  color: var(--clr-danger);
}
.alert--info {
  background: var(--clr-info-bg);
  border-color: rgba(99,197,247,.25);
  color: var(--clr-info);
}

/* Django messages mapping */
.messages-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

/* -------------------------------------------------------------
   11. PROGRESS BAR
   ------------------------------------------------------------- */
.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--clr-surface-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--clr-accent);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease);
}
.progress-bar-fill--success { background: var(--clr-success); }
.progress-bar-fill--warning { background: var(--clr-warning); }
.progress-bar-fill--danger  { background: var(--clr-danger); }

/* -------------------------------------------------------------
   12. MODAL
   ------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease);
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.98);
  transition: transform var(--dur-base) var(--ease);
}
.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}
.modal__header {
  padding: var(--sp-6);
  border-bottom: 1px solid var(--clr-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}
.modal__close {
  background: none; border: none;
  color: var(--clr-text-muted);
  cursor: pointer; font-size: 1rem;
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast) var(--ease);
}
.modal__close:hover { background: var(--clr-surface-2); color: var(--clr-text); }
.modal__body   { padding: var(--sp-6); }
.modal__footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--clr-border);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3);
}

/* -------------------------------------------------------------
   13. TIMELINE (meetings / progress)
   ------------------------------------------------------------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: var(--sp-8);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--clr-border);
}
.timeline-item {
  position: relative;
  padding-bottom: var(--sp-6);
}
.timeline-item__dot {
  position: absolute;
  left: calc(-1 * var(--sp-8) + 4px);
  top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--clr-surface-2);
  border: 2px solid var(--clr-border);
  display: flex; align-items: center; justify-content: center;
}
.timeline-item__dot--active { border-color: var(--clr-accent); background: var(--clr-accent-soft); }
.timeline-item__dot--success{ border-color: var(--clr-success); background: var(--clr-success-bg); }
.timeline-item__dot i { font-size: 0.5rem; color: var(--clr-accent); }
.timeline-item__date {
  font-size: 0.75rem;
  color: var(--clr-text-dim);
  margin-bottom: var(--sp-1);
}
.timeline-item__title {
  font-weight: 600;
  color: var(--clr-text);
  font-size: 0.875rem;
  margin-bottom: var(--sp-1);
}
.timeline-item__body { font-size: 0.8125rem; color: var(--clr-text-muted); }

/* -------------------------------------------------------------
   14. EMPTY STATE
   ------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
  gap: var(--sp-4);
}
.empty-state__icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-lg);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--clr-text-dim);
}
.empty-state__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-text);
}
.empty-state__desc {
  font-size: 0.875rem;
  color: var(--clr-text-muted);
  max-width: 320px;
}

/* -------------------------------------------------------------
   15. UTILITY CLASSES
   ------------------------------------------------------------- */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end  { justify-content: flex-end; }
.gap-1  { gap: var(--sp-1); }
.gap-2  { gap: var(--sp-2); }
.gap-3  { gap: var(--sp-3); }
.gap-4  { gap: var(--sp-4); }
.gap-6  { gap: var(--sp-6); }
.gap-8  { gap: var(--sp-8); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }

.w-full  { width: 100%; }
.mt-2  { margin-top: var(--sp-2); }
.mt-4  { margin-top: var(--sp-4); }
.mt-6  { margin-top: var(--sp-6); }
.mt-8  { margin-top: var(--sp-8); }
.mb-2  { margin-bottom: var(--sp-2); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-6  { margin-bottom: var(--sp-6); }
.mb-8  { margin-bottom: var(--sp-8); }

.text-sm    { font-size: 0.8125rem; }
.text-xs    { font-size: 0.75rem; }
.text-muted { color: var(--clr-text-muted); }
.text-dim   { color: var(--clr-text-dim); }
.text-accent{ color: var(--clr-accent); }
.text-success{color: var(--clr-success); }
.text-danger { color: var(--clr-danger); }
.text-warning{ color: var(--clr-warning); }
.text-right { text-align: right; }
.text-center{ text-align: center; }
.font-bold  { font-weight: 700; }
.font-medium{ font-weight: 500; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--clr-border);
  margin: var(--sp-6) 0;
}

/* Overlay spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--clr-border);
  border-top-color: var(--clr-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Page-enter fade */
.page-fade-in {
  animation: fadeIn var(--dur-slow) var(--ease) both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------
   16. RESPONSIVE
   ------------------------------------------------------------- */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    z-index: 150;
    width: var(--sidebar-w);
    transition: left var(--dur-base) var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { left: 0; }

  .topbar__brand { width: auto; }
  .main-content  { padding: var(--sp-5) var(--sp-4); }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .auth-card   { padding: var(--sp-6); }
}

@media (max-width: 480px) {
  :root { --sidebar-w: 100vw; }
  .btn-lg { height: 42px; padding: 0 var(--sp-6); }
}