/* ============================================================
   vision-dashboard.css — Full Dashboard + Vision Pro Glass
   Brand colors preserved: #e94560 / #c73652 / #f97b5a / #fbbf24
   ============================================================ */

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  /* Color Primitives */
  --clr-brand:        #e94560;
  --clr-brand-light:  #f97b5a;
  --clr-brand-dark:   #c73652;
  --clr-brand-muted:  rgba(233,69,96,0.1);
  --clr-brand-ring:   rgba(233,69,96,0.25);
  --clr-brand-glow:   rgba(233,69,96,0.35);

  --clr-navy-50:  #f0f2f8;
  --clr-navy-100: #d8ddf0;
  --clr-navy-200: #a8b3d8;
  --clr-navy-500: #3d4f7c;
  --clr-navy-700: #1e2d54;
  --clr-navy-800: #16213e;
  --clr-navy-900: #0f172a;

  --clr-slate-50:  #f8fafc;
  --clr-slate-100: #f1f5f9;
  --clr-slate-200: #e2e8f0;
  --clr-slate-300: #cbd5e1;
  --clr-slate-400: #94a3b8;
  --clr-slate-500: #64748b;
  --clr-slate-600: #475569;
  --clr-slate-700: #334155;
  --clr-slate-800: #1e293b;
  --clr-slate-900: #0f172a;

  /* Status */
  --clr-success:      #22c55e;
  --clr-success-bg:   #f0fdf4;
  --clr-success-text: #15803d;
  --clr-warning:      #f59e0b;
  --clr-warning-bg:   #fffbeb;
  --clr-warning-text: #b45309;
  --clr-danger:       #ef4444;
  --clr-danger-bg:    #fef2f2;
  --clr-danger-text:  #b91c1c;
  --clr-info:         #3b82f6;
  --clr-info-bg:      #eff6ff;
  --clr-info-text:    #1d4ed8;

  /* Vision Pro Glass Tokens */
  --blur-glass:      blur(18px) saturate(180%);
  --surface-glass:   rgba(255,255,255,0.55);
  --surface-dark-glass: rgba(15,23,42,0.65);
  --border-glass:    rgba(255,255,255,0.25);
  --shadow-glass:    0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.02);
  --shadow-glass-lg: 0 16px 48px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.04);

  /* Semantic — Light mode (glassy) */
  --bg:           #f5f7fc;
  --bg-secondary: #eef2f8;
  --bg-tertiary:  #e2e8f0;
  --bg-hover:     rgba(255,255,255,0.15);
  --bg-active:    rgba(255,255,255,0.25);
  --bg-overlay:   rgba(15,23,42,0.5);

  --surface:        var(--surface-glass);
  --surface-raised: rgba(255,255,255,0.75);

  --border:         var(--border-glass);
  --border-strong:  rgba(255,255,255,0.4);
  --border-focus:   var(--clr-brand);

  --text-primary:   #0a0e1a;
  --text-secondary: #4a5568;
  --text-tertiary:  #94a3b8;
  --text-disabled:  #cbd5e1;
  --text-inverse:   #ffffff;
  --text-brand:     var(--clr-brand);

  /* Sidebar */
  --sidebar-bg:        rgba(10,14,26,0.85);
  --sidebar-border:    rgba(255,255,255,0.06);
  --sidebar-text:      rgba(255,255,255,0.65);
  --sidebar-text-hover: rgba(255,255,255,0.92);
  --sidebar-active-bg: rgba(233,69,96,0.18);
  --sidebar-active-text: #e94560;
  --sidebar-icon:      rgba(255,255,255,0.45);
  --sidebar-w:         248px;
  --sidebar-w-collapsed: 64px;

  /* Navbar */
  --nav-h: 60px;

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

  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   17px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;

  --weight-normal:  400;
  --weight-medium:  500;
  --weight-semi:    600;
  --weight-bold:    700;
  --weight-black:   800;

  --leading-tight:  1.25;
  --leading-snug:   1.4;
  --leading-normal: 1.6;
  --leading-loose:  1.75;

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

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows (glass) */
  --shadow-xs:  0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm:  var(--shadow-glass);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.02);
  --shadow-lg:  var(--shadow-glass-lg);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.14), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-brand: 0 4px 20px var(--clr-brand-glow);

  /* Transitions */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --ease-inout: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 350ms;

  /* Z-index */
  --z-below:   -1;
  --z-base:    0;
  --z-raised:  10;
  --z-dropdown: 100;
  --z-sticky:  200;
  --z-overlay: 300;
  --z-modal:   400;
  --z-toast:   500;
}

/* ── Dark Mode (glassy) ──────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #0a0e1a;
  --bg-secondary: #0c1228;
  --bg-tertiary:  #111c35;
  --bg-hover:     rgba(255,255,255,0.04);
  --bg-active:    rgba(255,255,255,0.08);
  --bg-overlay:   rgba(0,0,0,0.7);

  --surface:        rgba(20,30,50,0.55);
  --surface-raised: rgba(25,40,65,0.75);

  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);

  --text-primary:   #e8eeff;
  --text-secondary: #8fa3c0;
  --text-tertiary:  #4a607c;
  --text-disabled:  #334155;
  --text-inverse:   #0f172a;

  --sidebar-bg:     rgba(8,15,30,0.92);
  --sidebar-border: rgba(255,255,255,0.04);

  --clr-success-bg:  rgba(34,197,94,0.12);
  --clr-warning-bg:  rgba(245,158,11,0.12);
  --clr-danger-bg:   rgba(239,68,68,0.12);
  --clr-info-bg:     rgba(59,130,246,0.12);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.4);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.5);
  --shadow-brand: 0 4px 20px rgba(233,69,96,0.3);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-secondary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--duration-base) var(--ease-inout),
              color var(--duration-base) var(--ease-inout);
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
a { color: var(--text-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
ol, ul { list-style: none; }
button { cursor: pointer; border: none; background: none; }

/* ── Typography ──────────────────────────────────────────── */
.h1 { font-size: var(--text-3xl); font-weight: var(--weight-black); letter-spacing: -0.03em; line-height: var(--leading-tight); }
.h2 { font-size: var(--text-2xl); font-weight: var(--weight-bold);  letter-spacing: -0.02em; line-height: var(--leading-tight); }
.h3 { font-size: var(--text-xl);  font-weight: var(--weight-bold);  letter-spacing: -0.01em; line-height: var(--leading-snug); }
.h4 { font-size: var(--text-lg);  font-weight: var(--weight-semi);  line-height: var(--leading-snug); }
.h5 { font-size: var(--text-md);  font-weight: var(--weight-semi);  line-height: var(--leading-snug); }
.h6 { font-size: var(--text-base); font-weight: var(--weight-semi); line-height: var(--leading-snug); }

.label-xs  { font-size: var(--text-xs);   font-weight: var(--weight-semi);   letter-spacing: 0.06em; text-transform: uppercase; }
.label-sm  { font-size: var(--text-sm);   font-weight: var(--weight-semi);   letter-spacing: 0.04em; }
.caption   { font-size: var(--text-xs);   color: var(--text-tertiary); }
.mono      { font-family: var(--font-mono); font-size: 0.9em; }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.text-brand     { color: var(--clr-brand); }
.text-success   { color: var(--clr-success-text); }
.text-warning   { color: var(--clr-warning-text); }
.text-danger    { color: var(--clr-danger-text); }
.text-info      { color: var(--clr-info-text); }

/* ── Gradient Text ───────────────────────────────────────── */
.grad-text {
  background: linear-gradient(125deg, var(--clr-brand) 0%, var(--clr-brand-light) 55%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout helpers ──────────────────────────────────────── */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--space-6); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

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

/* ── Focus visible ───────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--clr-brand); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ── Selection ───────────────────────────────────────────── */
::selection { background: var(--clr-brand-muted); color: var(--clr-brand-dark); }

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp    { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn   { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes scaleIn   { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse     { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes shimmer   { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes bounce    { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.animate-fadeIn  { animation: fadeIn  var(--duration-base) var(--ease-out) both; }
.animate-fadeUp  { animation: fadeUp  var(--duration-base) var(--ease-out) both; }
.animate-scaleIn { animation: scaleIn var(--duration-base) var(--ease-out) both; }

.delay-1 { animation-delay: 60ms; }
.delay-2 { animation-delay: 120ms; }
.delay-3 { animation-delay: 180ms; }
.delay-4 { animation-delay: 240ms; }
.delay-5 { animation-delay: 300ms; }

/* ── Skeleton loader ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-active) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-md);
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .sidebar, .navbar, .no-print { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR — Glassy
   ══════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  transition: width var(--duration-slow) var(--ease-out);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--sidebar-border);
  min-height: var(--nav-h);
  text-decoration: none;
}

.sidebar-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--clr-brand), var(--clr-brand-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-black);
  font-size: 14px;
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-brand);
}

.sidebar-brand-text {
  overflow: hidden;
  transition: opacity var(--duration-base) var(--ease-out), width var(--duration-base) var(--ease-out);
}

.sidebar-brand-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: white;
  white-space: nowrap;
  display: block;
}

.sidebar-brand-sub {
  font-size: var(--text-xs);
  color: var(--sidebar-text);
  white-space: nowrap;
  display: block;
  margin-top: 1px;
}

.sidebar.collapsed .sidebar-brand-text { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-3) 0;
}

.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-text);
  padding: var(--space-4) var(--space-4) var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--duration-base) var(--ease-out);
}

.sidebar.collapsed .sidebar-section-label { opacity: 0; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  margin: 1px var(--space-2);
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
  position: relative;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-hover);
  text-decoration: none;
}

.sidebar-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

.sidebar-item.active .sidebar-item-icon { color: var(--clr-brand); }

.sidebar-item-icon {
  width: 18px; height: 18px;
  color: var(--sidebar-icon);
  flex-shrink: 0;
  transition: color var(--duration-fast) var(--ease-out);
}

.sidebar-item:hover .sidebar-item-icon { color: var(--sidebar-text-hover); }

.sidebar-item-text {
  overflow: hidden;
  transition: opacity var(--duration-base) var(--ease-out), width var(--duration-base) var(--ease-out);
}

.sidebar.collapsed .sidebar-item-text { opacity: 0; width: 0; }

.sidebar-badge {
  margin-left: auto;
  background: var(--clr-brand);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  line-height: 1.5;
  flex-shrink: 0;
  transition: opacity var(--duration-base) var(--ease-out);
}

.sidebar.collapsed .sidebar-badge { opacity: 0; }

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.sidebar-user:hover { background: rgba(255,255,255,0.06); }

.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--clr-brand), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: white;
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
  transition: opacity var(--duration-base) var(--ease-out);
}

.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }

.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: white;
  white-space: nowrap;
  display: block;
}

.sidebar-user-role {
  font-size: var(--text-xs);
  color: var(--sidebar-text);
  white-space: nowrap;
  display: block;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
  margin-top: var(--space-2);
}

.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-hover);
}

/* ══════════════════════════════════════════════════════════
   NAVBAR — Glassy
   ══════════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--nav-h);
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  z-index: var(--z-sticky);
  transition: left var(--duration-slow) var(--ease-out);
}

.sidebar.collapsed ~ .navbar,
body.sidebar-collapsed .navbar { left: var(--sidebar-w-collapsed); }

.navbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.navbar-breadcrumb-item {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.navbar-breadcrumb-item.active {
  font-weight: var(--weight-semi);
  color: var(--text-primary);
}

.navbar-breadcrumb-sep {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.navbar-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
  position: relative;
}

.navbar-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.notification-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--clr-brand);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg);
}

.navbar-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--clr-brand), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: white;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--duration-fast);
}

.navbar-avatar:hover { border-color: var(--clr-brand); }

/* ══════════════════════════════════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  margin-top: var(--nav-h);
  padding: var(--space-8) var(--space-6);
  min-width: 0;
  transition: margin-left var(--duration-slow) var(--ease-out);
}

body.sidebar-collapsed .main-content { margin-left: var(--sidebar-w-collapsed); }

@media (max-width: 1024px) and (min-width: 769px) {
  .main-content { padding: var(--space-5) var(--space-4); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: var(--space-4) var(--space-3); }
  .navbar { left: 0; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header .page-actions { width: 100%; }
  .page-title { font-size: 20px; }
}

@media (max-width: 480px) {
  .main-content { padding: var(--space-3) var(--space-2); }
  .card-body { padding: var(--space-4); }
  .card-header { padding: var(--space-4); flex-wrap: wrap; gap: 8px; }
  .stat-card { padding: var(--space-4); }
  .stat-card-value { font-size: 26px; }
  .btn-full-mobile { width: 100%; }
}

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

.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
  line-height: var(--leading-normal);
}

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

/* ══════════════════════════════════════════════════════════
   BUTTONS — Glassy
   ══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 36px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
  text-decoration: none;
  user-select: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--clr-brand), var(--clr-brand-dark));
  color: white;
  border-color: var(--clr-brand);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: var(--clr-brand-dark);
  border-color: var(--clr-brand-dark);
  box-shadow: 0 4px 24px var(--clr-brand-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
  backdrop-filter: var(--blur-glass);
}
.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: var(--clr-danger);
  color: white;
  border-color: var(--clr-danger);
}
.btn-danger:hover { background: var(--clr-danger-text); }

.btn-success {
  background: var(--clr-success);
  color: white;
  border-color: var(--clr-success);
}
.btn-success:hover { background: var(--clr-success-text); }

.btn-outline-danger {
  background: transparent;
  color: var(--clr-danger-text);
  border-color: var(--clr-danger);
}
.btn-outline-danger:hover { background: var(--clr-danger-bg); }

.btn-sm { height: 30px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn-lg { height: 44px; padding: 0 var(--space-6); font-size: var(--text-md); }
.btn-xl { height: 52px; padding: 0 var(--space-8); font-size: var(--text-lg); font-weight: var(--weight-semi); }
.btn-full { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

/* ══════════════════════════════════════════════════════════
   FORMS — Glassy inputs
   ══════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

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

.form-control {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background var(--duration-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-control:hover { border-color: var(--border-strong); }

.form-control:focus {
  outline: none;
  border-color: var(--clr-brand);
  box-shadow: 0 0 0 3px var(--clr-brand-ring);
  background: var(--surface);
}

.form-control::placeholder { color: var(--text-tertiary); }
.form-control:disabled { background: var(--bg-tertiary); color: var(--text-tertiary); cursor: not-allowed; }

.form-control.error { border-color: var(--clr-danger); }
.form-control.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
.form-control.success { border-color: var(--clr-success); }

textarea.form-control { height: auto; min-height: 100px; padding: var(--space-3); resize: vertical; line-height: var(--leading-normal); }
select.form-control {
  background-image: 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='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Universal input styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background var(--duration-fast);
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

textarea {
  height: auto;
  min-height: 100px;
  padding: var(--space-3);
  resize: vertical;
  line-height: var(--leading-normal);
}

select {
  background-image: 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='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--clr-brand);
  box-shadow: 0 0 0 3px var(--clr-brand-ring);
}

input::placeholder,
textarea::placeholder { color: var(--text-tertiary); }

input:disabled,
textarea:disabled,
select:disabled {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.form-hint  { font-size: var(--text-xs); color: var(--text-tertiary); }
.form-error { font-size: var(--text-xs); color: var(--clr-danger-text); display: flex; align-items: center; gap: 4px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }

@media (max-width: 640px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

.form-section { padding-bottom: var(--space-6); margin-bottom: var(--space-6); border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.form-section-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.form-check-input {
  width: 16px; height: 16px;
  margin-top: 2px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--clr-brand);
}

.form-check-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  line-height: var(--leading-snug);
}

/* ══════════════════════════════════════════════════════════
   CARDS — Glassy
   ══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow var(--duration-base) var(--ease-out);
}

.card-hover:hover { box-shadow: var(--shadow-glass-lg); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  gap: var(--space-4);
}

.card-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semi);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.card-body { padding: var(--space-6); }
.card-body-sm { padding: var(--space-4); }
.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
}

/* Stat card — glassy */
.stat-card {
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}

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

.stat-card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  background: var(--bg-hover);
  backdrop-filter: var(--blur-glass);
}

.stat-card-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-card-sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  margin-top: var(--space-2);
}

.stat-card-trend.up { color: var(--clr-success-text); }
.stat-card-trend.down { color: var(--clr-danger-text); }

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .kpi-grid { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1.6;
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.badge-success  { background: var(--clr-success-bg);  color: var(--clr-success-text); }
.badge-warning  { background: var(--clr-warning-bg);  color: var(--clr-warning-text); }
.badge-danger   { background: var(--clr-danger-bg);   color: var(--clr-danger-text);  }
.badge-info     { background: var(--clr-info-bg);     color: var(--clr-info-text);    }
.badge-brand    { background: var(--clr-brand-muted); color: var(--clr-brand-dark);   }
.badge-neutral  { background: var(--bg-tertiary);     color: var(--text-secondary);   }

.badge-sm { padding: 1px 6px; font-size: 10px; }
.badge-lg { padding: 4px 12px; font-size: var(--text-sm); border-radius: var(--radius-md); }

/* ══════════════════════════════════════════════════════════
   TABLES — Glassy
   ══════════════════════════════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
}

@media (max-width: 768px) {
  .table th, .table td { padding: var(--space-2) var(--space-3); font-size: 12px; }
  .table-filter-bar { flex-direction: column; }
  .search-input { min-width: 100%; }
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: var(--surface);
}

.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text-primary); }
.table th .sort-icon { display: inline-flex; flex-direction: column; gap: 1px; margin-left: var(--space-1); vertical-align: middle; }
.table th .sort-icon span { display: block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.table th .sort-icon .asc-arrow  { border-bottom: 5px solid currentColor; }
.table th .sort-icon .desc-arrow { border-top: 5px solid currentColor; }
.table th.sort-asc  .sort-icon .asc-arrow  { color: var(--clr-brand); }
.table th.sort-desc .sort-icon .desc-arrow { color: var(--clr-brand); }

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

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-hover); }

.table-striped tbody tr:nth-child(even) td { background: var(--bg-secondary); }
.table-striped tbody tr:nth-child(even):hover td { background: var(--bg-hover); }

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

.table-empty {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-tertiary);
}

.table-empty-icon {
  width: 48px; height: 48px;
  margin: 0 auto var(--space-4);
  color: var(--border-strong);
}

.table-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.search-input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  height: 36px;
  min-width: 260px;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.search-input:focus-within {
  border-color: var(--clr-brand);
  box-shadow: 0 0 0 3px var(--clr-brand-ring);
}

.search-input input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--text-primary);
  outline: none;
}

.search-input input::placeholder { color: var(--text-tertiary); }

/* ══════════════════════════════════════════════════════════
   MODALS — Glassy
   ══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.96) translateY(8px);
  transition: transform var(--duration-base) var(--ease-out);
}

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

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border);
  gap: var(--space-4);
}

.modal-title { font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--text-primary); }
.modal-subtitle { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-1); }

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
}

.modal-lg { max-width: 720px; }
.modal-sm { max-width: 400px; }

/* ══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS — Glassy
   ══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-raised);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 380px;
  pointer-events: all;
  animation: fadeUp var(--duration-base) var(--ease-out) both;
}

.toast.removing { animation: fadeDown var(--duration-base) var(--ease-in) both; }

.toast-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--text-primary); }
.toast-message { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }

.toast-close {
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color var(--duration-fast);
}
.toast-close:hover { color: var(--text-primary); }

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

/* ══════════════════════════════════════════════════════════
   DROPDOWN — Glassy
   ══════════════════════════════════════════════════════════ */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  padding: var(--space-2);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96) translateY(-4px);
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.dropdown-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: scale(1) translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-fast);
}

.dropdown-item:hover { background: var(--bg-hover); text-decoration: none; }
.dropdown-item.danger { color: var(--clr-danger-text); }
.dropdown-item.danger:hover { background: var(--clr-danger-bg); }

.dropdown-divider { height: 1px; background: var(--border); margin: var(--space-2) 0; }
.dropdown-label {
  padding: var(--space-1) var(--space-3) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ══════════════════════════════════════════════════════════
   PROGRESS BARS — Glassy
   ══════════════════════════════════════════════════════════ */
.progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-out);
  background: var(--clr-brand);
}

.progress-success { background: var(--clr-success); }
.progress-warning { background: var(--clr-warning); }
.progress-danger  { background: var(--clr-danger); }
.progress-info    { background: var(--clr-info); }

.progress-bar-lg  { height: 10px; }
.progress-bar-sm  { height: 4px; }

/* ══════════════════════════════════════════════════════════
   AUTH PAGES — Glassy
   ══════════════════════════════════════════════════════════ */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.auth-left {
  flex: 1;
  position: relative;
  display: none;
  overflow: hidden;
  min-height: 100vh;
  height: 100%;
}

@media (min-width: 1024px) {
  .auth-left { display: flex; flex-direction: column; height: 100%; }
}

.auth-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.auth-bg-login    { background-image: url("/static/img/login.89afa5a9dc0a.jpg"); }
.auth-bg-student  { background-image: url("/static/img/student.a12b8152533a.jpg"); }
.auth-bg-lecturer { background-image: url("/static/img/lecturer.44c9be73e266.jpg"); }

.auth-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(10,18,38,0.82) 0%,
    rgba(15,23,42,0.72) 50%,
    rgba(233,69,96,0.22) 100%
  );
  z-index: 1;
}

.auth-left-content {
  position: relative;
  z-index: 2;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 100vh;
  flex: 1;
}

.auth-right {
  width: 100%;
  max-width: 520px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-12) var(--space-10);
  background: var(--bg-secondary);
  overflow-y: auto;
}

@media (max-width: 1024px) { .auth-right { max-width: 100%; } }

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-logo-mark {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--clr-brand), var(--clr-brand-dark));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-black);
  font-size: 18px;
  color: white;
  box-shadow: var(--shadow-brand);
  margin-bottom: var(--space-6);
}

.auth-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  line-height: var(--leading-normal);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider-text { font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; }

.auth-footer {
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: center;
}

/* Auth left panel */
.auth-brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.auth-brand-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--clr-brand), var(--clr-brand-dark));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--weight-black); font-size: 15px; color: white;
  box-shadow: var(--shadow-brand);
}
.auth-brand-name { font-size: 15px; font-weight: 700; color: #ffffff; text-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.auth-brand-sub  { font-size: 11px; color: rgba(255,255,255,0.65); }

.auth-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; }
.auth-hero-title {
  font-size: 42px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.auth-hero-title span { color: var(--clr-brand-light); }
.auth-hero-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.82);
  line-height: 1.7;
  max-width: 380px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

.auth-features { display: flex; flex-direction: column; gap: 10px; }
.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.auth-feature-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}

/* ══════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--duration-fast), border-color var(--duration-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--clr-brand); border-bottom-color: var(--clr-brand); }

/* ══════════════════════════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-2xl);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  margin-bottom: var(--space-6);
}

.empty-state-title { font-size: var(--text-lg); font-weight: var(--weight-semi); color: var(--text-primary); margin-bottom: var(--space-2); }
.empty-state-desc  { font-size: var(--text-sm); color: var(--text-secondary); max-width: 360px; line-height: var(--leading-normal); margin-bottom: var(--space-6); }

/* ══════════════════════════════════════════════════════════
   AVATAR
   ══════════════════════════════════════════════════════════ */
.avatar {
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  background: linear-gradient(135deg, var(--clr-brand), #8b5cf6);
  color: white;
  flex-shrink: 0;
  user-select: none;
}

.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 64px; height: 64px; font-size: 20px; }

/* ══════════════════════════════════════════════════════════
   LOADING SPINNER
   ══════════════════════════════════════════════════════════ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--clr-brand);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner-sm { width: 14px; height: 14px; border-width: 1.5px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

/* ══════════════════════════════════════════════════════════
   DASHBOARD GRIDS
   ══════════════════════════════════════════════════════════ */
.dash-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}
.dash-3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (max-width: 1024px) { .dash-3col { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px)  { .dash-2col, .dash-3col { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════
   CHARTS
   ══════════════════════════════════════════════════════════ */
.chart-card {
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.chart-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.chart-title { font-size: var(--text-md); font-weight: var(--weight-semi); color: var(--text-primary); }
.chart-sub   { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }

.chart-body { padding: var(--space-5) var(--space-6); }

/* ══════════════════════════════════════════════════════════
   PENDING STEPS
   ══════════════════════════════════════════════════════════ */
.steps { display: flex; flex-direction: column; gap: 0; }
.step  { display: flex; gap: var(--space-4); position: relative; padding-bottom: var(--space-6); }
.step:last-child { padding-bottom: 0; }

.step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.step:last-child::before { display: none; }

.step-indicator {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--text-tertiary);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step.done .step-indicator { background: var(--clr-success); border-color: var(--clr-success); color: white; }
.step.active .step-indicator { background: var(--clr-brand); border-color: var(--clr-brand); color: white; }

.step-content { flex: 1; padding-top: 6px; }
.step-title { font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--text-primary); }
.step-desc  { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════
   DETAIL GRID
   ══════════════════════════════════════════════════════════ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.detail-label { font-size: var(--text-xs); color: var(--text-tertiary); font-weight: var(--weight-semi); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-1); }
.detail-value { font-size: var(--text-sm); color: var(--text-primary); font-weight: var(--weight-medium); }

/* ══════════════════════════════════════════════════════════
   LOG ENTRY CARD — Glassy
   ══════════════════════════════════════════════════════════ */
.log-entry-card {
  background: var(--surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: box-shadow var(--duration-fast), transform var(--duration-fast);
  cursor: pointer;
}
.log-entry-card:hover { box-shadow: var(--shadow-glass-lg); transform: translateY(-1px); }

.log-entry-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.log-entry-date { font-size: var(--text-xs); font-weight: var(--weight-semi); color: var(--text-tertiary); }
.log-entry-title { font-size: var(--text-md); font-weight: var(--weight-semi); color: var(--text-primary); margin-bottom: var(--space-2); }
.log-entry-desc { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-normal); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ══════════════════════════════════════════════════════════
   GRADE DISPLAY
   ══════════════════════════════════════════════════════════ */
.grade-circle {
  width: 64px; height: 64px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  flex-shrink: 0;
}

.grade-A { background: var(--clr-success-bg); color: var(--clr-success-text); }
.grade-B { background: var(--clr-info-bg);    color: var(--clr-info-text); }
.grade-C { background: var(--clr-warning-bg); color: var(--clr-warning-text); }
.grade-D { background: rgba(245,158,11,0.15); color: #b45309; }
.grade-E { background: rgba(139,92,246,0.1);  color: #7c3aed; }
.grade-F { background: var(--clr-danger-bg);  color: var(--clr-danger-text); }