/* ============================================================
   ForthCampus CRM — Design System v2
   Professional SaaS CRM Design
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --primary:        #4f46e5;
  --primary-dark:   #3730a3;
  --primary-light:  #eef2ff;
  --primary-mid:    #6366f1;
  --secondary:      #7c3aed;

  /* Semantic Colors */
  --success:        #059669;
  --success-light:  #d1fae5;
  --warning:        #d97706;
  --warning-light:  #fef3c7;
  --danger:         #dc2626;
  --danger-light:   #fee2e2;
  --info:           #2563eb;
  --info-light:     #dbeafe;

  /* Neutrals */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-150: #eaeff6;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Sidebar */
  --sidebar-bg:      #0f172a;
  --sidebar-border:  rgba(255,255,255,.06);
  --sidebar-hover:   rgba(255,255,255,.07);
  --sidebar-active:  #4f46e5;
  --sidebar-text:    #94a3b8;
  --sidebar-active-text: #ffffff;
  --sidebar-w:       256px;

  /* Layout */
  --header-h:    60px;
  --radius-xs:   6px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   20px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
  --shadow-md:  0 8px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg:  0 20px 40px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl:  0 32px 64px rgba(0,0,0,.14);

  /* Transitions */
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --duration:  180ms;
  --transition: var(--duration) var(--ease);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f4f6fb;
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea, button { font-family: inherit; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Layout Shell ──────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.04);
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 14px; color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
}
.sidebar-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 15px; color: white; line-height: 1.2;
}
.sidebar-logo-sub { font-size: 10px; color: var(--gray-500); font-weight: 400; letter-spacing: .04em; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section { margin-bottom: 6px; }
.nav-section-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--gray-600);
  padding: 10px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 1px;
  position: relative;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}
.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79,70,229,.35);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  line-height: 1.4;
}

/* Sidebar user */
.sidebar-user {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-user-inner {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-user-inner:hover { background: var(--sidebar-hover); }
.user-avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: white;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; line-height: 1.3; }
.user-role { font-size: 11px; color: var(--gray-500); line-height: 1.3; }

/* ═══════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════ */
.header {
  height: var(--header-h);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-xs);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-title { font-size: 16px; font-weight: 700; color: var(--gray-900); font-family: 'Plus Jakarta Sans', sans-serif; }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-action {
  width: 34px; height: 34px;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  transition: all var(--transition);
  position: relative;
}
.header-action:hover { background: var(--gray-50); color: var(--gray-700); border-color: var(--gray-300); }

/* ═══════════════════════════════════════════════════════════
   PAGE CONTENT
═══════════════════════════════════════════════════════════ */
.page-content { padding: 24px; flex: 1; }

.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 21px; font-weight: 700; color: var(--gray-900); line-height: 1.3;
}
.page-subtitle { font-size: 13.5px; color: var(--gray-500); margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap; line-height: 1.4;
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 1px 3px rgba(79,70,229,.3);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(79,70,229,.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); color: var(--gray-800); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #047857; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }

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

.btn-outline {
  background: white; color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-sm  { padding: 5px 12px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg  { padding: 10px 22px; font-size: 14.5px; border-radius: var(--radius); }
.btn-icon { padding: 7px; aspect-ratio: 1; }
.btn-icon svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════ */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--stat-color, var(--primary));
  border-radius: 0 2px 2px 0;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--stat-bg, var(--primary-light));
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px; font-weight: 800; color: var(--gray-900); line-height: 1.1;
}
.stat-label { font-size: 12.5px; color: var(--gray-500); margin-top: 3px; font-weight: 500; }
.stat-trend { font-size: 11.5px; font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 3px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-trend.neutral { color: var(--gray-400); }

/* ═══════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════ */
.form-section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.form-section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.form-section-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.form-section-icon svg { width: 14px; height: 14px; color: var(--primary); }
.form-section-title { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.form-section-body { padding: 20px; }

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12.5px; font-weight: 600; color: var(--gray-700);
  margin-bottom: 5px; letter-spacing: .01em;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 8.5px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--gray-800);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  line-height: 1.5;
}
.form-control:hover { border-color: var(--gray-300); }
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control:disabled { background: var(--gray-50); color: var(--gray-500); cursor: not-allowed; }
.form-control.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
textarea.form-control { resize: vertical; min-height: 88px; }
.form-hint { font-size: 11.5px; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 11.5px; color: var(--danger); margin-top: 4px; font-weight: 500; }

.form-row { display: grid; gap: 14px; }
.col-2 { grid-template-columns: 1fr 1fr; }
.col-3 { grid-template-columns: 1fr 1fr 1fr; }
.col-4 { grid-template-columns: repeat(4, 1fr); }

.form-actions {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-radius: 0 0 var(--radius) var(--radius);
  position: sticky; bottom: 0; z-index: 10;
}

/* Checkbox / Toggle */
.form-check {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 4px 0;
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}
.form-check-label { font-size: 13.5px; color: var(--gray-700); }

/* ═══════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════ */
.table-container {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px; flex-wrap: wrap;
}
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--gray-500);
  padding: 10px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap; text-align: left;
}
tbody td {
  padding: 11px 16px;
  font-size: 13.5px; color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: #fafbff; }

.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.table-count { font-size: 12.5px; color: var(--gray-500); }

/* ═══════════════════════════════════════════════════════════
   SEARCH & FILTERS
═══════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--gray-100);
}
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap svg {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--gray-400);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 7.5px 12px 7.5px 32px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--gray-800);
  transition: all var(--transition); outline: none;
  background: white;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.filter-select {
  padding: 7.5px 32px 7.5px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--gray-700);
  background: white;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   BADGES & STATUS
═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap; line-height: 1.4;
}
.badge::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
  flex-shrink: 0;
}
.badge-no-dot::before { display: none; }

.badge-success  { background: var(--success-light); color: #065f46; }
.badge-danger   { background: var(--danger-light);  color: #991b1b; }
.badge-warning  { background: var(--warning-light); color: #92400e; }
.badge-info     { background: var(--info-light);    color: #1e40af; }
.badge-gray     { background: var(--gray-100);      color: var(--gray-600); }
.badge-purple   { background: #ede9fe;              color: #5b21b6; }
.badge-indigo   { background: #e0e7ff;              color: #3730a3; }
.badge-teal     { background: #ccfbf1;              color: #065f46; }

/* ── Pill Group (tab-like status) ─────────────────────────── */
.pill-group { display: flex; gap: 2px; }
.pill {
  padding: 5px 12px;
  font-size: 12.5px; font-weight: 500;
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
  color: var(--gray-500);
  background: transparent;
}
.pill:hover { background: var(--gray-100); color: var(--gray-700); }
.pill.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #c7d2fe;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════════════════ */
.tabs-bar {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
  background: white;
  padding: 0 20px;
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  font-size: 13.5px; font-weight: 500;
  color: var(--gray-500);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition);
  cursor: pointer;
}
.tab-btn:hover { color: var(--gray-800); background: var(--gray-50); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-btn .tab-count {
  background: var(--gray-100); color: var(--gray-500);
  font-size: 10.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 99px; min-width: 18px; text-align: center;
}
.tab-btn.active .tab-count { background: var(--primary-light); color: var(--primary); }
.tab-panel { display: none; padding: 20px 0; }
.tab-panel.active { display: block; }

/* ═══════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: flex-start;  /* allow modal to start from top on small screens */
  justify-content: center;
  padding: 24px 20px;
  overflow-y: auto;          /* backdrop itself scrolls if modal is taller than viewport */
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  /* Cap height so body scrolls; header+footer stay sticky */
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  animation: modalIn .18s var(--ease);
  overflow: hidden; /* clip border-radius */
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-sm  { max-width: 420px; }
.modal-md  { max-width: 560px; }
.modal-lg  { max-width: 680px; }
.modal-xl  { max-width: 840px; }

.modal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;  /* never shrink — stays sticky at top */
}
.modal-header-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-header-icon svg { width: 18px; height: 18px; color: var(--primary); }
.modal-title { font-size: 15.5px; font-weight: 700; color: var(--gray-900); flex: 1; font-family: 'Plus Jakarta Sans', sans-serif; }
.modal-close {
  width: 30px; height: 30px;
  border: none; background: var(--gray-100);
  border-radius: var(--radius-xs); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); transition: all var(--transition);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }
.modal-close svg { width: 14px; height: 14px; }

.modal-body {
  padding: 24px;
  overflow-y: auto;  /* scrollbar appears when content overflows */
  flex: 1 1 auto;    /* grow and shrink, don't clip */
  min-height: 0;     /* CRITICAL: without this, flex child won't shrink below content height */
}
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  flex-shrink: 0;  /* never shrink — stays sticky at bottom */
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Modal sections */
.modal-section { margin-bottom: 20px; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section-title {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--gray-400); margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════
   ALERTS / FLASH
═══════════════════════════════════════════════════════════ */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--info-light);    color: #1e40af; border-color: #bfdbfe; }

/* ═══════════════════════════════════════════════════════════
   AVATAR
═══════════════════════════════════════════════════════════ */
.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; flex-shrink: 0; line-height: 1;
}
.av-xs { width: 24px; height: 24px; font-size: 9px; }
.av-sm { width: 32px; height: 32px; font-size: 12px; }
.av-md { width: 40px; height: 40px; font-size: 15px; }
.av-lg { width: 52px; height: 52px; font-size: 19px; border-radius: 14px; }
.av-xl { width: 64px; height: 64px; font-size: 24px; border-radius: 16px; }

/* ═══════════════════════════════════════════════════════════
   DETAIL PAGE — PROFILE HEADER
═══════════════════════════════════════════════════════════ */
.profile-header {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.profile-header-inner {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.profile-info { display: flex; align-items: flex-start; gap: 16px; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.profile-meta-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--gray-500);
}
.profile-meta-item svg { width: 13px; height: 13px; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

/* ── Stage Progress Bar ───────────────────────────────────── */
.stage-track {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.stage-track-inner {
  display: flex; align-items: center;
  min-width: max-content; gap: 0;
}
.stage-node {
  display: flex; align-items: center; flex-direction: column;
  position: relative;
}
.stage-node-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--gray-100);
  cursor: pointer; border: none;
  transition: all var(--transition);
  min-width: 80px; text-align: center;
}
.stage-node-btn:hover { background: var(--primary-light); }
.stage-node-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gray-300);
  transition: all var(--transition);
}
.stage-node-label {
  font-size: 11px; font-weight: 600; color: var(--gray-500);
  white-space: nowrap;
}
.stage-node.done .stage-node-dot { background: var(--success); }
.stage-node.done .stage-node-label { color: var(--success); }
.stage-node.done .stage-node-btn { background: var(--success-light); }
.stage-node.current .stage-node-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.25); }
.stage-node.current .stage-node-label { color: var(--primary); font-weight: 700; }
.stage-node.current .stage-node-btn { background: var(--primary-light); }

.stage-line { width: 36px; height: 2px; background: var(--gray-200); flex-shrink: 0; margin: 0 2px; margin-bottom: 14px; }
.stage-node.done + .stage-line { background: var(--success); }

/* ═══════════════════════════════════════════════════════════
   WORKFLOW SECTIONS (Loan/Exam/Payment etc)
═══════════════════════════════════════════════════════════ */
.workflow-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.workflow-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(to right, var(--wf-bg, var(--gray-50)), white);
  border-bottom: 1px solid var(--gray-100);
}
.workflow-card-icon {
  display: flex; align-items: center; gap: 10px;
}
.workflow-icon-box {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--wf-icon-bg, var(--primary-light));
  display: flex; align-items: center; justify-content: center;
}
.workflow-icon-box svg { width: 17px; height: 17px; color: var(--wf-color, var(--primary)); }
.workflow-card-title { font-size: 13.5px; font-weight: 700; color: var(--gray-800); }
.workflow-card-subtitle { font-size: 12px; color: var(--gray-500); margin-top: 1px; }
.workflow-card-body { padding: 18px; }

/* Detail rows inside workflow cards */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.detail-item {}
.detail-item-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); margin-bottom: 3px; }
.detail-item-value { font-size: 13.5px; font-weight: 500; color: var(--gray-800); }

/* ── Progress Bar ─────────────────────────────────────────── */
.progress { height: 6px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .5s var(--ease); }

/* ═══════════════════════════════════════════════════════════
   ACTIVITY TIMELINE
═══════════════════════════════════════════════════════════ */
.timeline { padding-left: 0; }
.timeline-item {
  display: flex; gap: 14px;
  margin-bottom: 16px; position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute; left: 15px; top: 30px;
  width: 2px; bottom: -16px;
  background: var(--gray-100);
}
.timeline-icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-light); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--gray-200);
  z-index: 1;
}
.timeline-icon svg { width: 13px; height: 13px; color: var(--primary); }
.timeline-body {
  flex: 1; background: white;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.timeline-title { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.timeline-time { font-size: 11.5px; color: var(--gray-400); margin-top: 2px; }
.timeline-desc { font-size: 12.5px; color: var(--gray-600); margin-top: 5px; }

/* ═══════════════════════════════════════════════════════════
   PIPELINE / KANBAN
═══════════════════════════════════════════════════════════ */
.pipeline-wrap {
  display: flex; gap: 14px;
  overflow-x: auto; padding-bottom: 16px;
  align-items: flex-start;
}
.pipeline-col {
  flex: 0 0 270px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.pipeline-col-head {
  padding: 12px 14px;
  border-bottom: 2px solid var(--col-color, var(--gray-300));
  display: flex; align-items: center; justify-content: space-between;
}
.pipeline-col-name { font-size: 12.5px; font-weight: 700; color: var(--gray-700); }
.pipeline-col-badge {
  background: var(--col-color, var(--gray-300));
  color: white; font-size: 10px; font-weight: 800;
  padding: 1px 7px; border-radius: 99px;
}
.pipeline-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.pipeline-card {
  background: white; border: 1px solid var(--gray-200);
  border-radius: 10px; padding: 12px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
  cursor: pointer; display: block;
  border-left: 3px solid var(--col-color, var(--primary));
}
.pipeline-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pipeline-card-name { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 4px; }
.pipeline-card-sub { font-size: 11.5px; color: var(--gray-500); }
.pipeline-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--gray-100);
}
.app-no {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px; font-weight: 700; color: var(--primary);
  background: var(--primary-light); padding: 2px 7px; border-radius: 5px;
}
.time-ago { font-size: 11px; color: var(--gray-400); }

/* ═══════════════════════════════════════════════════════════
   EMPTY STATES
═══════════════════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 56px 24px; text-align: center;
}
.empty-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: var(--gray-400);
}
.empty-icon svg { width: 28px; height: 28px; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; font-family: 'Plus Jakarta Sans', sans-serif; }
.empty-desc  { font-size: 13.5px; color: var(--gray-400); max-width: 280px; margin-bottom: 20px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════ */
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  width: 33px; height: 33px;
  border: 1.5px solid var(--gray-200);
  background: white; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; color: var(--gray-600);
  transition: all var(--transition); cursor: pointer;
  text-decoration: none;
}
.page-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); font-weight: 700; }
.page-btn:disabled { opacity: .4; pointer-events: none; }

/* ═══════════════════════════════════════════════════════════
   DROPDOWN
═══════════════════════════════════════════════════════════ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 170px; z-index: 400;
  display: none; overflow: hidden;
  animation: fadeDown .15s var(--ease);
}
.dropdown.open .dropdown-menu { display: block; }
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px;
  font-size: 13.5px; color: var(--gray-700);
  transition: background var(--transition);
  cursor: pointer; background: none; border: none; width: 100%; text-align: left;
}
.dropdown-item:hover { background: var(--gray-50); color: var(--gray-900); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }
.dropdown-item svg { width: 14px; height: 14px; color: var(--gray-400); }
.dropdown-item.danger svg { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--gray-100); margin: 4px 0; }

/* ═══════════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-card {
  background: white; border-radius: var(--radius-xl);
  padding: 40px; width: 100%; max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
}
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.auth-logo-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: white;
  font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 4px 16px rgba(79,70,229,.4);
}
.auth-brand { font-size: 18px; font-weight: 800; color: var(--gray-900); font-family: 'Plus Jakarta Sans', sans-serif; }
.auth-brand-sub { font-size: 12px; color: var(--gray-400); }
.auth-title { font-size: 22px; font-weight: 800; color: var(--gray-900); font-family: 'Plus Jakarta Sans', sans-serif; margin-bottom: 6px; }
.auth-subtitle { font-size: 14px; color: var(--gray-500); margin-bottom: 28px; }

/* ═══════════════════════════════════════════════════════════
   UTILITY CLASSES
═══════════════════════════════════════════════════════════ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }

.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; } .p-5 { padding: 20px; }

.text-xs   { font-size: 11.5px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 16px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--gray-400); }
.text-dark    { color: var(--gray-900); }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capitalize { text-transform: capitalize; }
.mono { font-family: 'SF Mono', 'Consolas', monospace; }

.divider { height: 1px; background: var(--gray-100); margin: 16px 0; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; transition: transform var(--transition); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main { margin-left: 0; }
  .col-2, .col-3, .col-4 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 24px; }
}

/* ═══════════════════════════════════════════════════════════
   MISC
═══════════════════════════════════════════════════════════ */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%;
  animation: spin .6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--gray-500); margin-bottom: 16px;
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--gray-300); font-size: 12px; }
.breadcrumb-current { color: var(--gray-800); font-weight: 500; }

/* Note Cards */
.note-card {
  background: white; border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm); padding: 14px;
  margin-bottom: 10px; transition: box-shadow var(--transition);
  border-left: 3px solid var(--note-color, var(--gray-200));
}
.note-card:hover { box-shadow: var(--shadow-sm); }
.note-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.note-text { font-size: 13.5px; color: var(--gray-700); line-height: 1.65; }

/* Info Row for detail pages */
.info-row {
  display: flex; padding: 9px 0;
  border-bottom: 1px solid var(--gray-100); gap: 12px;
  align-items: flex-start;
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 12px; color: var(--gray-400); min-width: 130px; flex-shrink: 0; font-weight: 500; padding-top: 1px; }
.info-value { font-size: 13.5px; color: var(--gray-800); font-weight: 500; flex: 1; min-width: 0; }

/* Toast */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500; color: white;
  box-shadow: var(--shadow-lg); min-width: 240px; max-width: 360px;
  animation: toastIn .3s var(--ease);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-success { background: var(--success); }
.toast-danger  { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* User card grid */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.user-card {
  background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.user-card:hover { box-shadow: var(--shadow-md); }

/* Program grid */
.program-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.program-card {
  background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
  border-top: 3px solid var(--primary);
}
.program-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.program-card.inactive { opacity: .55; border-top-color: var(--gray-300); }

/* Pill tabs for filters */
.status-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.status-pill {
  padding: 4px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--gray-200); background: white; color: var(--gray-600);
  transition: all var(--transition);
  text-decoration: none; display: inline-block;
}
.status-pill:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.status-pill.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Missing utility classes fix ──────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--gray-500);
  margin-bottom: 16px; transition: color var(--transition);
}
.back-link:hover { color: var(--primary); }

.profile-avatar { border-radius: 14px; }
.profile-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px; font-weight: 800; color: var(--gray-900);
}

/* Sidebar scrollbar fix */
.sidebar-nav {
  overflow-y: auto !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { display: block !important; width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* Sidebar full height flex fix */
.sidebar {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0;
}
.sidebar-nav { flex: 1; min-height: 0; }

/* ── Page Header shorthand (ph) ─────────────────────────────── */
.ph {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.ph-left {}
.ph-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px; font-weight: 700; color: var(--gray-900);
}
.ph-sub { font-size: 13.5px; color: var(--gray-500); margin-top: 3px; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Tabs nav (alias for tabs-bar) ──────────────────────────── */
.tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  scrollbar-width: none;
  background: white;
  padding: 0;
  margin-bottom: 0;
  gap: 0;
}
.tabs-nav::-webkit-scrollbar { display: none; }
.tabs-nav .tab-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 16px;
  font-size: 13.5px; font-weight: 500;
  color: var(--gray-500);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition);
  cursor: pointer;
}
.tabs-nav .tab-btn:hover { color: var(--gray-800); background: var(--gray-50); }
.tabs-nav .tab-btn.active {
  color: var(--primary); border-bottom-color: var(--primary); font-weight: 600;
}
.tabs-nav .tab-count {
  background: var(--gray-100); color: var(--gray-500);
  font-size: 10.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 99px; min-width: 18px; text-align: center;
}
.tabs-nav .tab-btn.active .tab-count {
  background: var(--primary-light); color: var(--primary);
}

/* Tab panels */
.tab-panel { display: none; padding: 20px 0; }
.tab-panel.active { display: block; }

/* ── Sidebar scroll guarantee ───────────────────────────────── */
.sidebar {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden;
}
.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto !important;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12); border-radius: 2px;
}
.sidebar-user { flex-shrink: 0; }
