/* ================================================================
   CampusAI — Global Design System
   Tokens, Reset, Typography, Utilities, Shared Components
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --navy: #1B2A4A;
  --navy-light: #243459;
  --navy-dark: #0F1B30;
  --action-blue: #2563EB;
  --blue-hover: #1D4ED8;
  --blue-muted: #EFF6FF;
  --teal: #0F766E;
  --teal-light: #CCFBF1;
  --amber: #B45309;
  --amber-light: #FEF3C7;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --purple: #7C3AED;
  --purple-light: #EDE9FE;

  /* Neutral */
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* Typography */
  --font-body: 'Inter', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.10), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.10), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  --shadow-navy: 0 4px 20px rgba(27, 42, 74, 0.35);

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s var(--ease);
  --transition-slow: 0.35s var(--ease);

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --content-max: 1280px;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Typography ────────────────────────────────────────────────── */
h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-lg);
  font-weight: 600;
}

h5 {
  font-size: var(--text-base);
  font-weight: 600;
}

p {
  color: var(--gray-600);
}

small {
  font-size: var(--text-xs);
}

.mono {
  font-family: var(--font-mono);
}

/* ── Layout Shell ──────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: var(--sp-6) var(--sp-6) var(--sp-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--action-blue), #60A5FA);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.brand-name {
  color: var(--white);
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

.brand-tag {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--text-xs);
  font-weight: 400;
}

.sidebar-nav {
  padding: var(--sp-4) var(--sp-3);
  flex: 1;
}

.nav-section {
  margin-bottom: var(--sp-6);
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
  padding: 0 var(--sp-3);
  margin-bottom: var(--sp-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.65);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.25);
  color: var(--white);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--action-blue);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--sp-4) var(--sp-3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}

.user-chip:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--action-blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: rgba(255, 255, 255, 0.45);
  font-size: var(--text-xs);
}

/* Main content area */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-8);
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.topbar-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--navy);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.topbar-search {
  display: flex;
  align-items: center;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: var(--sp-2) var(--sp-4);
  gap: var(--sp-2);
  border: 1.5px solid transparent;
  transition: all var(--transition);
}

.topbar-search:focus-within {
  background: var(--white);
  border-color: var(--action-blue);
  box-shadow: var(--shadow-glow);
}

.topbar-search svg {
  width: 16px;
  height: 16px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--text-sm);
  color: var(--gray-800);
  width: 220px;
}

.topbar-search input::placeholder {
  color: var(--gray-400);
}

/* Icon Button */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: all var(--transition);
  position: relative;
}

.icon-btn:hover {
  background: var(--action-blue);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--white);
}

/* Page content */
.page-content {
  padding: var(--sp-8);
  flex: 1;
}

.page-header {
  margin-bottom: var(--sp-6);
}

.page-title {
  color: var(--navy);
  margin-bottom: var(--sp-1);
}

.page-subtitle {
  color: var(--gray-500);
  font-size: var(--text-sm);
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--navy);
}

.card-subtitle {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: 2px;
}

/* Stat Cards */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  transition: all var(--transition);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.blue {
  background: var(--blue-muted);
  color: var(--action-blue);
}

.stat-icon.teal {
  background: var(--teal-light);
  color: var(--teal);
}

.stat-icon.amber {
  background: var(--amber-light);
  color: var(--amber);
}

.stat-icon.red {
  background: var(--red-light);
  color: var(--red);
}

.stat-icon.purple {
  background: var(--purple-light);
  color: var(--purple);
}

.stat-icon.navy {
  background: rgba(27, 42, 74, 0.08);
  color: var(--navy);
}

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: var(--sp-1);
}

.stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}

.stat-change {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--sp-1);
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-change.up {
  color: var(--teal);
}

.stat-change.down {
  color: var(--red);
}

/* Grid helpers */
.grid {
  display: grid;
  gap: var(--sp-6);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-12 {
  grid-template-columns: repeat(12, 1fr);
}

.col-4 {
  grid-column: span 4;
}

.col-5 {
  grid-column: span 5;
}

.col-6 {
  grid-column: span 6;
}

.col-7 {
  grid-column: span 7;
}

.col-8 {
  grid-column: span 8;
}

.col-12 {
  grid-column: span 12;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--action-blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
  border-color: var(--action-blue);
  color: var(--action-blue);
  background: var(--blue-muted);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
}

.btn-danger:hover {
  background: #B91C1C;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  padding: var(--sp-2) var(--sp-3);
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--navy);
}

.btn-sm {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--text-base);
}

/* ── Badges / Tags ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-blue {
  background: var(--blue-muted);
  color: var(--action-blue);
}

.badge-teal {
  background: var(--teal-light);
  color: var(--teal);
}

.badge-amber {
  background: var(--amber-light);
  color: var(--amber);
}

.badge-red {
  background: var(--red-light);
  color: var(--red);
}

.badge-purple {
  background: var(--purple-light);
  color: var(--purple);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-navy {
  background: rgba(27, 42, 74, 0.1);
  color: var(--navy);
}

/* ── Forms ────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--sp-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--sp-2);
}

.form-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--gray-800);
  background: var(--white);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--action-blue);
  box-shadow: var(--shadow-glow);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

/* ── Table ────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
}

.data-table th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  padding: var(--sp-3) var(--sp-4);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.data-table td {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--gray-100);
  font-size: var(--text-sm);
  color: var(--gray-700);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

.data-table .row-overdue td {
  background: #FFF8F8;
}

.data-table .row-overdue:hover td {
  background: #FFEAEA;
}

/* ── Progress Bar ─────────────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease);
}

.progress-blue {
  background: linear-gradient(90deg, var(--action-blue), #60A5FA);
}

.progress-teal {
  background: linear-gradient(90deg, var(--teal), #2DD4BF);
}

.progress-amber {
  background: linear-gradient(90deg, var(--amber), #FBBF24);
}

.progress-red {
  background: linear-gradient(90deg, var(--red), #F87171);
}

.progress-purple {
  background: linear-gradient(90deg, var(--purple), #A78BFA);
}

/* ── Tabs ─────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--sp-6);
}

.tab-btn {
  flex: 1;
  padding: var(--sp-2) var(--sp-4);
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-500);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
}

.tab-btn svg {
  width: 15px;
  height: 15px;
}

.tab-btn:hover {
  color: var(--navy);
}

.tab-btn.active {
  background: var(--white);
  color: var(--action-blue);
  box-shadow: var(--shadow-sm);
}

.tab-panel,
.career-sub,
.lib-sub,
.mentor-sub,
.chat-sub {
  display: none;
}

.tab-panel.active,
.career-sub.active,
.lib-sub.active,
.mentor-sub.active,
.chat-sub.active {
  display: block;
}

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-xl);
  transform: translateY(16px) scale(0.97);
  transition: transform var(--transition);
  overflow: hidden;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: var(--sp-6);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--navy);
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--red-light);
  color: var(--red);
}

.modal-body {
  padding: var(--sp-6);
}

.modal-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
}

/* ── Toast ─────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--teal);
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.3s var(--ease);
}

.toast.error {
  border-color: var(--red);
}

.toast.warning {
  border-color: var(--amber);
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--navy);
}

.toast-msg {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

@keyframes slideIn {
  from {
    transform: translateX(20px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--sp-12) var(--sp-8);
  color: var(--gray-400);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: var(--sp-4);
  opacity: 0.5;
}

.empty-title {
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: var(--sp-2);
}

.empty-desc {
  font-size: var(--text-sm);
}

/* ── Skeleton Loader ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ── Chip / Tag ──────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--gray-600);
  gap: 4px;
}

.chip-blue {
  background: var(--blue-muted);
  color: var(--action-blue);
}

.chip-teal {
  background: var(--teal-light);
  color: var(--teal);
}

.chip-remove {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  font-size: 12px;
}

.chip-remove:hover {
  opacity: 1;
}

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--action-blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: var(--text-xs);
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: var(--text-lg);
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: var(--sp-6) 0;
}

/* Flex helpers */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1 {
  gap: var(--sp-1);
}

.gap-2 {
  gap: var(--sp-2);
}

.gap-3 {
  gap: var(--sp-3);
}

.gap-4 {
  gap: var(--sp-4);
}

.gap-6 {
  gap: var(--sp-6);
}

.flex-1 {
  flex: 1;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.ml-auto {
  margin-left: auto;
}

.mt-2 {
  margin-top: var(--sp-2);
}

.mt-4 {
  margin-top: var(--sp-4);
}

.mb-4 {
  margin-bottom: var(--sp-4);
}

.mb-6 {
  margin-bottom: var(--sp-6);
}

.p-0 {
  padding: 0;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-gray {
  color: var(--gray-500);
}

.text-navy {
  color: var(--navy);
}

.text-blue {
  color: var(--action-blue);
}

.text-teal {
  color: var(--teal);
}

.text-red {
  color: var(--red);
}

.text-amber {
  color: var(--amber);
}

.fw-700 {
  font-weight: 700;
}

.fw-600 {
  font-weight: 600;
}

.w-full {
  width: 100%;
}

.rounded {
  border-radius: var(--radius-md);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

/* ── Mobile Hamburger ─────────────────────────────────────────── */
.hamburger {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--gray-100);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
}

.hamburger svg {
  width: 20px;
  height: 20px;
}

.overlay-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ── Chart containers ────────────────────────────────────────── */
.chart-wrap {
  position: relative;
}

.chart-wrap canvas {
  max-width: 100%;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 260px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .overlay-backdrop.visible {
    display: block;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .col-4,
  .col-5,
  .col-6,
  .col-7,
  .col-8 {
    grid-column: span 12;
  }

  .page-content {
    padding: var(--sp-4);
  }

  .topbar {
    padding: 0 var(--sp-4);
  }

  .topbar-search {
    display: none;
  }

  .tabs {
    flex-wrap: wrap;
  }
}