/* ==========================================================================
   College CRM — Dashboard
   Design tokens: modern material style. Solid indigo sidebar, soft-shadow
   white cards on a light lavender canvas, colored icon chips, clean Inter
   type throughout, amber badge counts.
   ========================================================================== */

:root {
  --ink: #4954e8;         /* indigo — sidebar */
  --ink-dark: #3a44c9;
  --paper: #f3f4fa;       /* light lavender-gray canvas */
  --card: #ffffff;
  --gold: #4f6bff;        /* blue accent / primary icon chip */
  --gold-soft: #e8ecff;
  --sage: #22c55e;        /* green — positive */
  --sage-soft: #e6f9ee;
  --rust: #ef4444;        /* red — alerts / negative */
  --rust-soft: #fde9e9;
  --slate: #8b5cf6;       /* violet — secondary accent */
  --slate-soft: #f1ebfe;
  --amber: #f5a524;       /* badge counts */
  --amber-soft: #fef1dc;
  --line: #eceef5;
  --text-main: #1b1e2b;
  --text-muted: #7c8092;

  --font-display: "Inter", -apple-system, sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --shadow-card: 0 1px 2px rgba(17,17,26,0.04), 0 4px 16px rgba(17,17,26,0.06);
  --shadow-pop: 0 2px 4px rgba(17,17,26,0.05), 0 8px 24px rgba(17,17,26,0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Shell ---------- */

.shell {
  display: grid;
  grid-template-columns: 252px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  background: var(--ink);
  color: #dfe2fb;
  padding: 20px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 20px;
  margin-bottom: 10px;
}

.brand-mark {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: #ffffff;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  box-shadow: var(--shadow-card);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.brand-sub {
  font-size: 11px;
  color: #c2c7f7;
}

.nav-group { margin-bottom: 4px; flex: 1; }

.nav-label {
  font-size: 10.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #a6acf3;
  padding: 14px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 13.3px;
  font-weight: 500;
  color: #dbdefa;
  cursor: pointer;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .9; }

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

.nav-item.active {
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.nav-item.active svg { opacity: 1; color: var(--ink); }

.nav-item .count {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  background: var(--amber);
  min-width: 18px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 999px;
  color: #fff;
}

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

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 13px;
  padding: 9px 10px;
  margin-top: 12px;
}

.sidebar-foot .sf-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--amber);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px;
  flex-shrink: 0;
}

.sidebar-foot .sf-name { color: #fff; font-size: 13px; font-weight: 600; }
.sidebar-foot .sf-sub { color: #c2c7f7; font-size: 11px; }
.sidebar-foot svg { width: 14px; height: 14px; color: #c2c7f7; margin-left: auto; }

/* ---------- Main ---------- */

.main { padding: 22px 30px 40px; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-heading { display: flex; flex-direction: column; gap: 3px; }

.page-heading .eyebrow {
  font-size: 12.5px;
  color: var(--text-muted);
}

.page-heading h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

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

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: none;
  box-shadow: var(--shadow-card);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 220px;
}

.search-box svg { width: 15px; height: 15px; opacity: .6; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--card);
  border: none;
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}

.icon-btn svg { width: 16px; height: 16px; color: var(--text-muted); }

.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 0 2px #fff;
}

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--amber);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 13px;
}

/* ---------- KPI row ---------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--card);
  border: none;
  box-shadow: var(--shadow-card);
  border-radius: 16px;
  padding: 16px 16px 14px;
  position: relative;
}

.kpi-card .kpi-icon {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft);
  color: var(--gold);
}

.kpi-card .kpi-icon svg { width: 15px; height: 15px; }

.kpi-row .kpi-card:nth-child(4n+2) .kpi-icon { background: var(--slate-soft); color: var(--slate); }
.kpi-row .kpi-card:nth-child(4n+3) .kpi-icon { background: var(--sage-soft); color: var(--sage); }
.kpi-row .kpi-card:nth-child(4n+4) .kpi-icon { background: var(--rust-soft); color: var(--rust); }

.kpi-card .kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-right: 30px;
}

.kpi-card .kpi-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.kpi-card .kpi-delta {
  margin-top: 9px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
}

.kpi-delta.up { color: #16833f; background: var(--sage-soft); }
.kpi-delta.down { color: #c62828; background: var(--rust-soft); }
.kpi-delta.flat { color: #6d5bc4; background: var(--slate-soft); }

/* ---------- Pipeline rail (signature element) ---------- */

.pipeline-panel {
  background: var(--card);
  border: none;
  box-shadow: var(--shadow-card);
  border-radius: 16px;
  padding: 18px 22px 20px;
  margin-bottom: 22px;
}

.pipeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pipeline-head h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.pipeline-head .pipeline-note {
  font-size: 11.5px;
  color: var(--text-muted);
}

.pipeline-rail {
  display: flex;
  align-items: stretch;
}

.pipeline-stage {
  flex: 1;
  position: relative;
  padding: 0 6px;
}

.pipeline-stage .bar-track {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.pipeline-stage .bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
}

.pipeline-stage.stage-lost .bar-fill { background: var(--rust); }
.pipeline-stage.stage-joined .bar-fill { background: var(--sage); }

.pipeline-stage .stage-count {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.pipeline-stage .stage-label {
  font-size: 10.8px;
  color: var(--text-muted);
  margin-top: 2px;
}

.pipeline-stage:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 3px;
  width: 0; height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--line);
}

/* ---------- Two column rows ---------- */

.grid-2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: var(--card);
  border: none;
  box-shadow: var(--shadow-card);
  border-radius: 16px;
  padding: 18px 20px 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.panel-head .panel-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}

.chart-wrap { position: relative; height: 230px; }

/* Counsellor leaderboard */

.leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.leader-row:last-child { border-bottom: none; }

.leader-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  width: 16px;
}

.leader-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  display: flex; align-items: center; justify-content: center;
}

.leader-info { flex: 1; min-width: 0; }
.leader-name { font-size: 13px; font-weight: 600; }
.leader-sub { font-size: 11px; color: var(--text-muted); }

.leader-metric {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}

/* Activity feed */

.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-dot.gold { background: var(--gold); }
.activity-dot.sage { background: var(--sage); }
.activity-dot.rust { background: var(--rust); }
.activity-dot.slate { background: var(--slate); }

.activity-text { font-size: 13px; line-height: 1.45; }
.activity-text b { font-weight: 600; }

.activity-time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Notifications */

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 32px; height: 32px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.notif-icon svg { width: 14px; height: 14px; }

.notif-icon.gold { background: var(--gold-soft); color: var(--gold); }
.notif-icon.rust { background: var(--rust-soft); color: var(--rust); }
.notif-icon.sage { background: var(--sage-soft); color: var(--sage); }

.notif-title { font-size: 12.8px; font-weight: 600; }
.notif-sub { font-size: 11.3px; color: var(--text-muted); margin-top: 1px; }

@media (max-width: 1180px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
