/* ============================================
   UniTask Hub - Global Styles
   ============================================ */

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1320;
  --bg-card: #141826;
  --bg-card-hover: #1a2035;
  --bg-sidebar: #0c0f1c;
  --bg-input: #1e2438;
  --bg-modal: #111525;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-teal: #14b8a6;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-accent: #818cf8;

  --border-primary: #1e2d45;
  --border-secondary: #253352;
  --border-accent: rgba(99, 102, 241, 0.3);

  --glass-bg: rgba(20, 24, 38, 0.8);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-blur: blur(20px);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; }
ul { list-style: none; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
p { color: var(--text-secondary); }
small { font-size: 0.8rem; color: var(--text-muted); }

/* ============ AUTH PAGES ============ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

.auth-bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: orbFloat 8s ease-in-out infinite;
}
.auth-bg-orb.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 70%);
  top: -150px; left: -150px;
}
.auth-bg-orb.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation-delay: -3s;
}
.auth-bg-orb.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(20,184,166,0.1) 0%, transparent 70%);
  top: 50%; right: 20%;
  animation-delay: -6s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.97); }
}

.auth-grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

.auth-container {
  width: 100%;
  max-width: 460px;
  padding: 16px;
  position: relative;
  z-index: 10;
}

.auth-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: authCardIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.auth-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.auth-logo-text { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.03em; }
.auth-logo-text span { color: var(--accent-primary); }

.auth-title { font-size: 1.6rem; margin-bottom: 6px; }
.auth-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--accent-primary);
  background: rgba(99,102,241,0.05);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control-icon {
  position: relative;
}
.form-control-icon .form-control { padding-left: 42px; }
.form-control-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}
select.form-control option { background: var(--bg-secondary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Role selection cards */
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.role-card {
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background: var(--bg-input);
}
.role-card:hover { border-color: var(--accent-primary); background: rgba(99,102,241,0.05); }
.role-card.selected {
  border-color: var(--accent-primary);
  background: rgba(99,102,241,0.1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.role-card-icon { font-size: 1.8rem; margin-bottom: 6px; }
.role-card-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.role-card.selected .role-card-label { color: var(--accent-primary); }

/* Password strength */
.password-strength { margin-top: 8px; }
.strength-bar { height: 3px; border-radius: 2px; background: var(--bg-input); overflow: hidden; }
.strength-fill { height: 100%; border-radius: 2px; transition: var(--transition); }
.strength-text { font-size: 0.73rem; margin-top: 4px; color: var(--text-muted); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: var(--transition-fast);
}
.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(99,102,241,0.5); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}
.btn-secondary:hover { border-color: var(--accent-primary); background: rgba(99,102,241,0.05); }

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

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-success {
  background: rgba(16,185,129,0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16,185,129,0.25);
}
.btn-success:hover { background: rgba(16,185,129,0.25); }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 9px; border-radius: var(--radius-sm); aspect-ratio: 1; }

.btn-loading .btn-spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ AUTH DIVIDER ============ */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-primary);
}

.auth-footer-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 20px;
}
.auth-footer-text a { color: var(--accent-primary); font-weight: 600; }
.auth-footer-text a:hover { color: var(--accent-secondary); }

/* ============ DASHBOARD LAYOUT ============ */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition-slow);
  overflow: hidden;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-primary);
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.sidebar-logo-text { font-size: 1rem; font-weight: 800; white-space: nowrap; letter-spacing: -0.03em; }
.sidebar-logo-text span { color: var(--accent-primary); }
.sidebar-logo-badge {
  font-size: 0.6rem;
  background: rgba(99,102,241,0.2);
  color: var(--accent-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-left: auto;
}

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}
.sidebar-avatar .status-dot {
  position: absolute;
  width: 9px; height: 9px;
  background: var(--accent-green);
  border-radius: 50%;
  bottom: 0; right: 0;
  border: 2px solid var(--bg-sidebar);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.role-badge.admin { background: rgba(99,102,241,0.15); color: var(--accent-primary); border: 1px solid rgba(99,102,241,0.25); }
.role-badge.teacher { background: rgba(20,184,166,0.15); color: var(--accent-teal); border: 1px solid rgba(20,184,166,0.25); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
}
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 2px;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.nav-item.active {
  background: rgba(99,102,241,0.12);
  color: var(--accent-primary);
  border-color: rgba(99,102,241,0.2);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent-primary);
  border-radius: 0 3px 3px 0;
}
.nav-item-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  background: var(--accent-red);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 50% { box-shadow: 0 0 0 5px rgba(239,68,68,0); } }

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--border-primary);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 60px;
  background: rgba(10, 13, 20, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-title { font-size: 1rem; font-weight: 700; flex: 0; white-space: nowrap; }
.topbar-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}
.topbar-search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full);
  padding: 8px 16px 8px 38px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
.topbar-search-input:focus { border-color: var(--accent-primary); background: rgba(99,102,241,0.05); }
.topbar-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-action-btn {
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-secondary);
  font-size: 16px;
  position: relative;
}
.topbar-action-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); background: rgba(99,102,241,0.05); }
.topbar-notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--accent-red);
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
  color: white;
}
.topbar-avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 2px solid transparent;
}
.topbar-avatar-btn:hover { border-color: var(--accent-primary); transform: scale(1.05); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  padding: 4px;
  cursor: pointer;
}

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 28px;
  animation: pageIn 0.3s ease;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-left { flex: 1; }
.page-title { font-size: 1.5rem; margin-bottom: 4px; }
.page-subtitle { font-size: 0.875rem; color: var(--text-muted); }
.page-actions { display: flex; align-items: center; gap: 10px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-secondary); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.card-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  transform: translate(20px, -20px);
  opacity: 0.08;
}
.stat-card.indigo::before { background: var(--accent-primary); }
.stat-card.purple::before { background: var(--accent-secondary); }
.stat-card.teal::before { background: var(--accent-teal); }
.stat-card.green::before { background: var(--accent-green); }
.stat-card.orange::before { background: var(--accent-orange); }
.stat-card.red::before { background: var(--accent-red); }

.stat-card:hover { transform: translateY(-2px); border-color: var(--border-secondary); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-icon.indigo { background: rgba(99,102,241,0.15); color: var(--accent-primary); }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: var(--accent-secondary); }
.stat-icon.teal { background: rgba(20,184,166,0.15); color: var(--accent-teal); }
.stat-icon.green { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.stat-icon.orange { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.stat-icon.red { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.stat-change {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stat-change.up { background: rgba(16,185,129,0.1); color: var(--accent-green); }
.stat-change.neutral { background: rgba(99,102,241,0.1); color: var(--accent-primary); }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border-primary); }
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(30, 45, 69, 0.5);
  vertical-align: middle;
}
tbody tr { transition: var(--transition-fast); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-badge.pending { background: rgba(245,158,11,0.12); color: var(--accent-orange); border: 1px solid rgba(245,158,11,0.25); }
.status-badge.pending::before { background: var(--accent-orange); }
.status-badge.in-progress { background: rgba(99,102,241,0.12); color: var(--accent-primary); border: 1px solid rgba(99,102,241,0.25); }
.status-badge.in-progress::before { background: var(--accent-primary); animation: pulseDot 1.5s ease-in-out infinite; }
.status-badge.completed { background: rgba(16,185,129,0.12); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.25); }
.status-badge.completed::before { background: var(--accent-green); }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== PRIORITY BADGES ===== */
.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.priority-badge.high { background: rgba(239,68,68,0.12); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.2); }
.priority-badge.medium { background: rgba(245,158,11,0.12); color: var(--accent-orange); border: 1px solid rgba(245,158,11,0.2); }
.priority-badge.low { background: rgba(16,185,129,0.12); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.2); }

/* ===== TASK CARDS ===== */
.tasks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.task-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  border-radius: 3px 0 0 3px;
}
.task-card.pending::before { background: var(--accent-orange); }
.task-card.in-progress::before { background: var(--accent-primary); }
.task-card.completed::before { background: var(--accent-green); }
.task-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-secondary); }
.task-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 10px; }
.task-card-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); flex: 1; }
.task-card-body { margin-bottom: 14px; }
.task-card-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.task-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-primary);
}
.assignee-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
}
.task-deadline {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.task-deadline.overdue { color: var(--accent-red); }
.task-deadline.soon { color: var(--accent-orange); }

/* ===== TEACHER LIST ===== */
.teacher-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition);
}
.teacher-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-secondary); }
.teacher-card-header { display: flex; align-items: center; gap: 14px; }
.teacher-avatar-lg {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}
.teacher-info { flex: 1; min-width: 0; }
.teacher-name { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.teacher-email { font-size: 0.775rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.teacher-stats-row { display: flex; gap: 16px; }
.teacher-stat { flex: 1; text-align: center; }
.teacher-stat-value { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); }
.teacher-stat-label { font-size: 0.7rem; color: var(--text-muted); }
.teacher-actions { display: flex; gap: 8px; }

/* ===== FILTERS ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-primary);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.filter-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.filter-btn.active { background: rgba(99,102,241,0.12); color: var(--accent-primary); border-color: rgba(99,102,241,0.35); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay.closing { animation: overlayOut 0.2s ease forwards; }
@keyframes overlayOut { from { opacity: 1; } to { opacity: 0; } }

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(-20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal.closing { animation: modalOut 0.2s ease forwards; }
@keyframes modalOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.95); } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
  margin-bottom: 20px;
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  transition: var(--transition-fast);
}
.modal-close:hover { border-color: var(--accent-red); color: var(--accent-red); background: rgba(239,68,68,0.1); }
.modal-body { padding: 0 24px 24px; }
.modal-footer { padding: 0 24px 24px; display: flex; gap: 10px; justify-content: flex-end; }

/* ===== CHAT SYSTEM ===== */
.chat-layout {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
}
.chat-sidebar {
  width: 280px;
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--bg-sidebar);
}
.chat-sidebar-header { padding: 16px; border-bottom: 1px solid var(--border-primary); }
.chat-sidebar-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; }
.chat-search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
.chat-search-input:focus { border-color: var(--accent-primary); }
.chat-search-input::placeholder { color: var(--text-muted); }
.chat-contacts { flex: 1; overflow-y: auto; padding: 8px; }
.chat-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}
.chat-contact:hover { background: var(--bg-card-hover); }
.chat-contact.active { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.2); }
.chat-contact-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}
.chat-contact-info { flex: 1; min-width: 0; }
.chat-contact-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.chat-contact-preview { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-contact-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-contact-time { font-size: 0.68rem; color: var(--text-muted); }
.chat-unread {
  background: var(--accent-primary);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}
.chat-topbar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10,13,20,0.9);
  backdrop-filter: blur(20px);
}
.chat-topbar-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.chat-topbar-info { flex: 1; }
.chat-topbar-name { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.chat-topbar-status { font-size: 0.75rem; color: var(--accent-green); display: flex; align-items: center; gap: 4px; }
.chat-topbar-status::before { content: ''; width: 7px; height: 7px; background: var(--accent-green); border-radius: 50%; }
.chat-topbar-actions { display: flex; gap: 8px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-date-divider {
  text-align: center;
  position: relative;
  margin: 12px 0;
}
.chat-date-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border-primary);
}
.chat-date-divider span {
  position: relative;
  background: var(--bg-primary);
  padding: 0 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chat-message {
  display: flex;
  gap: 8px;
  max-width: 72%;
  animation: msgIn 0.2s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chat-message.sent { flex-direction: row-reverse; margin-left: auto; }
.chat-message.received { margin-right: auto; }

.message-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  align-self: flex-end;
}

.message-content { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.message-sender-name { font-size: 0.72rem; color: var(--text-muted); padding: 0 4px; }
.sent .message-sender-name { text-align: right; }

.message-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}
.received .message-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.sent .message-bubble {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-bottom-right-radius: 4px;
}
.message-time { font-size: 0.65rem; color: var(--text-muted); padding: 0 4px; }
.sent .message-time { text-align: right; }
.message-image-preview { max-width: 220px; border-radius: 10px; overflow: hidden; margin-top: 4px; }
.message-image-preview img { width: 100%; height: auto; display: block; }
.message-file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 4px;
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-sidebar);
}
.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: 18px;
  padding: 10px 14px;
  transition: var(--transition);
}
.chat-input-wrapper:focus-within { border-color: var(--accent-primary); }
.chat-textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  resize: none;
  max-height: 120px;
  line-height: 1.5;
  font-family: inherit;
}
.chat-textarea::placeholder { color: var(--text-muted); }
.chat-input-actions { display: flex; align-items: center; gap: 8px; }
.chat-input-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 15px;
  color: var(--text-muted);
  background: transparent;
}
.chat-input-btn:hover { color: var(--accent-primary); background: rgba(99,102,241,0.1); }
.chat-send-btn {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 15px;
  transition: var(--transition-fast);
  box-shadow: 0 2px 10px rgba(99,102,241,0.4);
}
.chat-send-btn:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(99,102,241,0.6); }

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  color: var(--text-muted);
}
.chat-empty-icon { font-size: 3rem; opacity: 0.4; }
.chat-empty-title { font-size: 1rem; font-weight: 600; color: var(--text-secondary); }
.chat-empty-text { font-size: 0.85rem; text-align: center; max-width: 280px; }

/* ===== VOICE CALL MODAL ===== */
.call-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlayIn 0.3s ease;
}
.call-modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-secondary);
  border-radius: 32px;
  width: 320px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: callModalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes callModalIn { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }
.call-avatar-wrapper {
  position: relative;
  width: 90px; height: 90px;
  margin: 0 auto 20px;
}
.call-avatar-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  opacity: 0.5;
  animation: callRing 1.5s ease-in-out infinite;
}
.call-avatar-ring:nth-child(2) { inset: -16px; animation-delay: 0.3s; }
.call-avatar-ring:nth-child(3) { inset: -24px; animation-delay: 0.6s; }
@keyframes callRing { 0% { opacity: 0.5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.2); } }
.call-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  border: 3px solid var(--accent-primary);
}
.call-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.call-status { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 8px; }
.call-duration { font-size: 1.1rem; color: var(--accent-green); font-weight: 600; font-variant-numeric: tabular-nums; }
.call-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  margin: 14px 0;
}
.call-wave-bar {
  width: 4px;
  background: var(--accent-primary);
  border-radius: 2px;
  animation: waveAnim 1s ease-in-out infinite;
}
.call-wave-bar:nth-child(1) { animation-delay: 0s; }
.call-wave-bar:nth-child(2) { animation-delay: 0.1s; }
.call-wave-bar:nth-child(3) { animation-delay: 0.2s; }
.call-wave-bar:nth-child(4) { animation-delay: 0.3s; }
.call-wave-bar:nth-child(5) { animation-delay: 0.4s; }
@keyframes waveAnim {
  0%, 100% { height: 6px; opacity: 0.5; }
  50% { height: 24px; opacity: 1; }
}
.call-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }
.call-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}
.call-btn:hover { transform: scale(1.1); }
.call-btn.mute { background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border-primary); }
.call-btn.mute.active { background: rgba(239,68,68,0.15); color: var(--accent-red); border-color: rgba(239,68,68,0.3); }
.call-btn.end { background: var(--accent-red); color: white; width: 60px; height: 60px; font-size: 1.3rem; box-shadow: 0 4px 20px rgba(239,68,68,0.5); }
.call-btn.end:hover { box-shadow: 0 6px 28px rgba(239,68,68,0.7); }
.call-btn.speaker { background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border-primary); }

/* ===== NOTIFICATION PANEL ===== */
.notif-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  width: 340px;
  background: var(--bg-modal);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  animation: notifIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 460px;
  display: flex;
  flex-direction: column;
}
@keyframes notifIn { from { opacity: 0; transform: translateY(-12px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.notif-header { padding: 16px 16px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-primary); }
.notif-title { font-size: 0.9rem; font-weight: 700; }
.notif-clear-btn { font-size: 0.75rem; color: var(--accent-primary); cursor: pointer; font-weight: 600; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30,45,69,0.5);
  transition: var(--transition-fast);
  cursor: pointer;
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { background: rgba(99,102,241,0.04); }
.notif-item-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-text { font-size: 0.82rem; color: var(--text-primary); line-height: 1.4; }
.notif-item-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }
.notif-empty { padding: 30px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-modal);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: var(--transition);
}
.toast.hiding { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-size: 0.85rem; font-weight: 700; margin-bottom: 2px; }
.toast-msg { font-size: 0.78rem; color: var(--text-muted); }
.toast-close { font-size: 14px; color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }
.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-primary); }
.toast.warning { border-left: 3px solid var(--accent-orange); }
.toast-progress { height: 2px; background: var(--border-primary); border-radius: 1px; margin-top: 8px; overflow: hidden; }
.toast-progress-bar { height: 100%; border-radius: 1px; animation: toastProgress linear forwards; }
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }
.toast.success .toast-progress-bar { background: var(--accent-green); }
.toast.error .toast-progress-bar { background: var(--accent-red); }
.toast.info .toast-progress-bar { background: var(--accent-primary); }
.toast.warning .toast-progress-bar { background: var(--accent-orange); }

/* ===== AVATAR COLORS ===== */
.av-indigo { background: linear-gradient(135deg, #6366f1, #818cf8); color: white; }
.av-purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); color: white; }
.av-teal { background: linear-gradient(135deg, #14b8a6, #2dd4bf); color: white; }
.av-green { background: linear-gradient(135deg, #10b981, #34d399); color: white; }
.av-orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: white; }
.av-pink { background: linear-gradient(135deg, #ec4899, #f472b6); color: white; }
.av-red { background: linear-gradient(135deg, #ef4444, #f87171); color: white; }
.av-blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); color: white; }

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}
.loading-logo { font-size: 2.5rem; animation: loadingBounce 1s ease-in-out infinite; }
@keyframes loadingBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.loading-bar { width: 200px; height: 3px; background: var(--bg-card); border-radius: 2px; overflow: hidden; }
.loading-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); border-radius: 2px; animation: loadingBar 1.5s ease-in-out infinite; }
@keyframes loadingBar { 0% { width: 0%; margin-left: 0; } 50% { width: 70%; } 100% { width: 0%; margin-left: 100%; } }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 14px;
}
.empty-icon { font-size: 3rem; opacity: 0.4; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text-secondary); }
.empty-text { font-size: 0.85rem; color: var(--text-muted); max-width: 300px; line-height: 1.6; }

/* ===== PROGRESS BARS ===== */
.progress-bar { height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-fill.indigo { background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); }
.progress-fill.green { background: linear-gradient(90deg, var(--accent-teal), var(--accent-green)); }

/* ===== PROFILE PAGE ===== */
.profile-hero {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.05));
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
}
.profile-avatar-xl {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  border: 3px solid rgba(99,102,241,0.3);
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name { font-size: 1.5rem; margin-bottom: 4px; }
.profile-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-meta-item { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-muted); }
.profile-actions { display: flex; gap: 10px; }

/* ===== SIDEBAR TOGGLE ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 95;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); z-index: 200; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: var(--transition); }
  .sidebar-overlay.open { opacity: 1; pointer-events: all; }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .chat-sidebar { width: 240px; }
}

@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .tasks-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 22px; }
  .form-row { grid-template-columns: 1fr; }
  .chat-layout { flex-direction: column; }
  .chat-sidebar { width: 100%; height: 200px; flex-shrink: 0; }
  .chat-contacts { display: flex; flex-direction: row; overflow-x: auto; padding: 8px; gap: 8px; }
  .chat-contact { flex-direction: column; min-width: 70px; align-items: center; padding: 8px; }
  .chat-contact-info { display: none; }
  .chat-contact-meta { display: none; }
  .topbar { padding: 0 16px; }
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-meta { justify-content: center; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .role-cards { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  h1 { font-size: 1.6rem; }
}

/* ===== UTILITIES ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 16px; }
.gap-2 { gap: 8px; }
.gap-1 { gap: 4px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.visible { display: flex !important; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.divider { height: 1px; background: var(--border-primary); margin: 16px 0; }
.text-accent { color: var(--accent-primary) !important; }
.text-green { color: var(--accent-green) !important; }
.text-red { color: var(--accent-red) !important; }
.text-orange { color: var(--accent-orange) !important; }
.text-muted { color: var(--text-muted) !important; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }

/* ===== TOOLTIP ===== */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  color: var(--text-primary);
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 999;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ===== DASHBOARD ACTIVITY ===== */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(30,45,69,0.5);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot-wrapper { display: flex; flex-direction: column; align-items: center; gap: 0; padding-top: 4px; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.activity-line { width: 1px; flex: 1; background: var(--border-primary); min-height: 20px; }
.activity-content { flex: 1; }
.activity-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.activity-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }

/* ===== SECTION TABS ===== */
.tab-nav { display: flex; gap: 0; border-bottom: 1px solid var(--border-primary); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
