@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Stitch Color System */
  --primary: #004ac6;
  --primary-dark: #003ea8;
  --primary-light: #dbe1ff;
  --primary-container: #2563eb;
  --on-primary: #ffffff;
  
  --secondary: #006c4a;
  --secondary-container: #82f5c1;
  --on-secondary: #ffffff;
  
  --background: #f9f9ff;
  --surface: #f9f9ff;
  --surface-container: #e9edff;
  --surface-container-low: #f1f3ff;
  --surface-container-high: #e1e8fd;
  --surface-container-lowest: #ffffff;
  --surface-container-highest: #dce2f7;
  
  --on-surface: #141b2b;
  --on-surface-variant: #434655;
  --outline: #737686;
  --outline-variant: #c3c6d7;
  
  --error: #ba1a1a;
  --success: #006c4a;
  --warning: #943700;
  
  --text: #141b2b;
  --text-muted: #434655;
  --text-light: #737686;
  --border: #c3c6d7;
  --border-focus: #004ac6;
  
  --bg: #f9f9ff;
  --bg-card: #ffffff;
  --bg-sidebar: #004ac6;
  --bg-sidebar-hover: #003ea8;
  --bg-input: #f9f9ff;
  
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', sans-serif;

  /* Preserved Existing System Variables */
  --accent: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --text-white: #ffffff;
  
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --mono: 'JetBrains Mono', monospace;
  --sidebar-w: 260px;
  --topbar-h: 64px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ── Auth Layout ── */
.auth-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-left {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 60%, #0ea5e9 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  top: -100px;
  right: -100px;
}

.auth-left::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  bottom: -50px;
  left: -50px;
}

.auth-left-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.auth-logo {
  font-size: 56px;
  margin-bottom: 20px;
}

.auth-left h1 {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.2;
}

.auth-left p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  max-width: 380px;
}

.auth-features {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 380px;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  backdrop-filter: blur(10px);
}

.auth-feature-item .icon {
  font-size: 20px;
}

.auth-feature-item span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
}

.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 50px;
  background: #fff;
  overflow-y: auto;
}

.auth-form-wrap {
  width: 100%;
  max-width: 420px;
}

.auth-form-wrap h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-form-wrap .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── App Layout ── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo .logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}

.sidebar-logo .logo-sub {
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 400;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.06);
  margin: 12px;
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  object-fit: cover;
}

.user-info .name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.user-info .role-badge {
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 99px;
  font-weight: 600;
  display: inline-block;
  margin-top: 2px;
}

.role-admin {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.role-student {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.role-alumni {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.role-department_admin {
  background: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
}

.sidebar-nav {
  padding: 8px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13.5px;
  font-weight: 500;
  user-select: none;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
}

.nav-item .nav-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

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

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.topbar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Page Content ── */
.page-content {
  padding: 24px 28px;
  flex: 1;
}

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

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

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

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

.card-body {
  padding: 22px;
}

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

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow 0.2s;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-info .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.stat-info .stat-sub {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

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

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-input);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
  background: #fff;
}

.form-control::placeholder {
  color: var(--text-light);
}

select.form-control {
  cursor: pointer;
}

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

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

.input-group {
  position: relative;
}

.input-group .form-control {
  padding-right: 44px;
}

.input-group .input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  user-select: none;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-ghost {
  background: var(--bg);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}

.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-green {
  background: #d1fae5;
  color: #065f46;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.badge-yellow {
  background: #fef3c7;
  color: #92400e;
}

.badge-gray {
  background: #f1f5f9;
  color: #475569;
}

.badge-purple {
  background: #ede9fe;
  color: #5b21b6;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: #f8fafc;
}

/* ── Alert ── */
.alert {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  align-items: center;
  gap: 8px;
}

.alert.show {
  display: flex;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

.toast-success {
  background: #166534;
  color: #fff;
}

.toast-error {
  background: #991b1b;
  color: #fff;
}

.toast-info {
  background: #1e40af;
  color: #fff;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}

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

@keyframes modalIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Search & Filters ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  background: #fff;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
}

/* ── Job Card ── */
.job-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
}

.job-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.job-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.job-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.job-company {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.job-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.job-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.job-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Profile Card ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(135deg, var(--bg-sidebar), var(--primary));
  border-radius: var(--radius) var(--radius) 0 0;
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  object-fit: cover;
  font-size: 24px;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.profile-role {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Loading ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Message UI ── */
.chat-layout {
  display: flex;
  height: calc(100vh - var(--topbar-h) - 48px);
  gap: 0;
}

.chat-sidebar {
  width: 300px;
  border-right: 1px solid var(--border);
  background: #fff;
  overflow-y: auto;
  flex-shrink: 0;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  height: 100%;
  overflow: hidden;
}

.chat-header {
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0; /* allows flex:1 to shrink properly when input is visible */
}

#chat-input-container {
  flex-shrink: 0; /* never let the flex column squeeze this out */
  background: #fff;
}

.chat-input-area {
  padding: 16px 20px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-family: var(--font);
  font-size: 14px;
  outline: none;
}

.chat-input:focus {
  border-color: var(--primary);
}

.msg-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
}

.msg-bubble.sent {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg-bubble.received {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 4px;
  text-align: right;
}

.msg-received-time {
  text-align: left;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.conv-item:hover {
  background: var(--bg);
}

.conv-item.active {
  background: var(--primary-light);
}

.conv-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.conv-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.conv-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.conv-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════════════════ */

/* Hamburger button — hidden on desktop */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

@media (max-width: 768px) {

  /* ── Sidebar ── */
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: left 0.3s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay.show {
    display: block;
  }

  /* ── Main content full width ── */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* ── Topbar ── */
  .topbar {
    padding: 0 16px;
  }

  .hamburger-btn {
    display: block;
  }

  /* ── Page Content ── */
  .page-content {
    padding: 16px !important;
  }

  /* ── Stats Grid ── */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* ── Cards ── */
  .card {
    border-radius: 10px;
  }

  /* ── Forms ── */
  .form-row {
    grid-template-columns: 1fr !important;
  }

  /* ── Tables — horizontal scroll ── */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }

  /* ── Auth page ── */
  .auth-left {
    display: none !important;
  }

  .auth-right {
    width: 100% !important;
    padding: 24px 20px !important;
  }

  /* ── Modal ── */
  .modal {
    margin: 16px;
    width: calc(100% - 32px) !important;
    max-width: 100% !important;
  }

  /* ── Job Cards Grid ── */
  #jobs-grid > div,
  #alumni-grid > div {
    grid-template-columns: 1fr !important;
  }

  /* ── Chat Layout ── */
  .chat-layout {
    flex-direction: column !important;
  }

  .chat-sidebar {
    width: 100% !important;
    max-height: 200px;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }

  /* ── Landing Page ── */
  #landing-section h1 {
    font-size: 32px !important;
  }

  #landing-section nav {
    padding: 0 16px !important;
  }

  /* ── Filter Bar ── */
  .filter-bar {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .filter-bar .search-box {
    width: 100% !important;
  }

  .filter-bar .form-control {
    width: 100% !important;
  }

  /* ── Profile ── */
  .profile-header {
    flex-direction: column !important;
    text-align: center !important;
    gap: 16px !important;
  }

  /* ── Two column grids ── */
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .stat-card {
    padding: 16px !important;
  }

  .topbar-title {
    font-size: 16px !important;
  }
}

/* ── Skill Tags ── */
.skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

/* ── Tab ── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tab-item {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.tab-item:hover {
  color: var(--primary);
}

.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.page-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}

.page-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Announcement ── */
.announce-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-left: 4px solid var(--primary);
  margin-bottom: 12px;
}

.announce-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.announce-content {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.announce-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-light);
}

/* Page hidden by default */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* ── Profile Completion Banner ── */
.profile-incomplete-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Profile Header Flex Fix ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%);
  flex-wrap: wrap;
}

/* ── Section Divider Label ── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 20px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── Complete Profile Step Indicator ── */
.cp-steps {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.cp-step {
  flex: 1;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: var(--bg);
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}

.cp-step:last-child {
  border-right: none;
}

.cp-step.active {
  background: var(--primary);
  color: #fff;
}

.cp-step.done {
  background: #d1fae5;
  color: #065f46;
}

/* ── Hamburger Button (Mobile Only) ── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: var(--bg);
}

/* ── Mobile Sidebar Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 90;
}

.sidebar-overlay.show {
  display: block;
}

/* ── Mobile Responsive Media Queries ── */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Auth Page */
  .auth-wrapper {
    grid-template-columns: 1fr;
  }
  .auth-left {
    display: none; /* Hide decorative left panel on small mobile */
  }
  .auth-right {
    padding: 30px 20px;
  }

  /* Sidebar */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0,0,0,0.15);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Main Content */
  .main-content {
    margin-left: 0;
  }

  /* Topbar */
  .topbar {
    padding: 0 16px;
  }
  .hamburger-btn {
    display: block;
  }
  .topbar-subtitle {
    display: none; /* Hide subtitle on mobile to save space */
  }

  /* Dashboard Stats */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Grid layouts */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Page Content */
  .page-content {
    padding: 16px;
  }

  /* Modal */
  .modal {
    width: 95%;
    margin: 20px auto;
  }

  /* Adjust fonts */
  .topbar-title {
    font-size: 16px;
  }
  
  /* Profile Header */
  .profile-header {
    padding: 20px;
    justify-content: center;
    text-align: center;
  }
  .profile-header .user-avatar {
    margin-bottom: 12px;
  }
}

/* ── Extra Small Devices ── */
@media (max-width: 480px) {
  .topbar-actions .btn {
    display: none; /* Hide refresh text on tiny screens */
  }
  .topbar-actions .btn-sm {
    padding: 8px;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .announce-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.portfolio-spin {
  animation: spin 2s linear infinite;
  display: inline-block;
}

/* ==========================================
   STITCH DESIGN - PAGES UPDATE
   Events, Jobs, Profile, Messages
   ========================================== */

/* Cards */
.card {
  background: #ffffff;
  border: 1px solid #c3c6d7;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
  overflow: hidden;
}
.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-body {
  padding: 24px;
}

/* Filter Bar & Search */
.filter-bar {
  background: #ffffff;
  border: 1px solid #c3c6d7;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid #c3c6d7;
  border-radius: 8px;
  background: #f9f9ff;
  color: #141b2b;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus {
  border-color: #004ac6;
  box-shadow: 0 0 0 3px rgba(0,74,198,0.15);
  outline: none;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #737686;
  font-size: 16px;
}

/* Messages / Chat Layout */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  height: calc(100vh - 140px);
  background: #ffffff;
  border: 1px solid #c3c6d7;
  border-radius: 12px;
  overflow: hidden;
}
.chat-sidebar {
  border-right: 1px solid #c3c6d7;
  background: #f9f9ff;
  overflow-y: auto;
}
.chat-main {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  height: 100%;
  overflow: hidden;
}
.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid #c3c6d7;
  background: #ffffff;
  font-weight: 600;
  color: #141b2b;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f9f9ff;
}

/* Conversation Items */
.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #e9edff;
}
.conv-item:hover {
  background: #e9edff;
}
.conv-item.active {
  background: #dbe1ff;
  border-left: 3px solid #004ac6;
}
.conv-avatar {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: #004ac6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.conv-name {
  font-weight: 600;
  font-size: 14px;
  color: #141b2b;
}
.conv-preview {
  font-size: 12px;
  color: #737686;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.conv-badge {
  background: #004ac6;
  color: #ffffff;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  margin-left: auto;
}

/* Loading Spinner */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #737686;
  font-size: 14px;
  gap: 16px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e9edff;
  border-top-color: #004ac6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile Chat Layout */
@media (max-width: 767px) {
  .chat-layout {
    display: flex;
    flex-direction: column;
  }
  .chat-layout .chat-main {
    display: none;
    width: 100%;
  }
  .chat-layout .chat-sidebar {
    display: block;
    width: 100%;
  }
  .chat-layout.chat-active .chat-main {
    display: flex;
  }
  .chat-layout.chat-active .chat-sidebar {
    display: none;
  }
  .chat-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
  }
}
@media (min-width: 768px) {
  .chat-back-btn {
    display: none !important;
  }
}
