/* ============================================================
   ALUMNI CONNECT PLATFORM — DESIGN SYSTEM TOKENS & STYLES
   Inspired by AlumVerse reference: clean, crisp, professional B2B SaaS
   ============================================================ */

:root {
  --bg:            #F8FAFC;
  --surface:       #FFFFFF;
  --surface-2:     #F1F5F9;
  --surface-3:     #E9EEF5;
  --border:        #E2E8F0;
  --border-strong: #CBD5E1;

  --ink:   #0F172A;
  --ink-2: #475569;
  --ink-3: #8A98AC;

  --brand:      #2563EB;
  --brand-ink:  #1D4ED8;
  --brand-soft: #EFF6FF;
  --brand-line: #BFDBFE;

  --violet:      #7C3AED;
  --violet-ink:  #6D28D9;
  --violet-soft: #F5F3FF;
  --violet-line: #DDD6FE;

  --cyan: #0891B2;

  --good: #047857; --good-soft: #ECFDF5; --good-line: #A7F3D0;
  --warn: #B45309; --warn-soft: #FFFBEB; --warn-line: #FDE68A;
  --bad:  #B91C1C; --bad-soft:  #FEF2F2; --bad-line:  #FECACA;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,.07), 0 1px 3px rgba(15,23,42,.05);
  --shadow-lg: 0 18px 48px rgba(15,23,42,.16), 0 2px 8px rgba(15,23,42,.08);

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;

  --font: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  --rail: 240px;
  --maxw: 1200px;
}

[data-theme="dark"] {
  --bg:            #080D18;
  --surface:       #0F172A;
  --surface-2:     #172033;
  --surface-3:     #1E293B;
  --border:        #1E293B;
  --border-strong: #334155;

  --ink:   #F1F5F9;
  --ink-2: #A2B0C4;
  --ink-3: #6B7B93;

  --brand:      #60A5FA;
  --brand-ink:  #93C5FD;
  --brand-soft: #12233F;
  --brand-line: #1E3A6B;

  --violet:      #A78BFA;
  --violet-ink:  #C4B5FD;
  --violet-soft: #211744;
  --violet-line: #3B2A6B;

  --cyan: #22D3EE;

  --good: #34D399; --good-soft: #052E23; --good-line: #10553F;
  --warn: #FBBF24; --warn-soft: #33220A; --warn-line: #6B4408;
  --bad:  #F87171; --bad-soft:  #340F0F; --bad-line:  #6B1F1F;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,.45);
  --shadow-lg: 0 18px 48px rgba(0,0,0,.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Typography & Utilities */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 650; line-height: 1.25; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { color: var(--ink-2); }
a { color: var(--brand); text-decoration: none; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.num { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex-grow: 1; }
.eyebrow { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }

/* Flexbox Layouts */
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.end { justify-content: flex-end; }
.wrap { flex-wrap: wrap; }
.astart { align-items: flex-start; }
.stack { display: flex; flex-direction: column; }
.g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g16 { gap: 16px; } .g20 { gap: 20px; } .g24 { gap: 24px; }

/* Buttons & Inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font); font-weight: 550; font-size: 0.9rem;
  padding: 8px 14px; border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-violet { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn-violet:hover { background: var(--violet-ink); }
.btn-sm { font-size: 0.8rem; padding: 5px 10px; border-radius: var(--r-sm); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.input, .select, textarea.input {
  width: 100%; font-family: var(--font); font-size: 0.9rem;
  padding: 8px 12px; border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }

/* Badges & Chips */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border);
}
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.badge-violet { background: var(--violet-soft); color: var(--violet-ink); border-color: var(--violet-line); }
.badge-good { background: var(--good-soft); color: var(--good); border-color: var(--good-line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; padding: 4px 10px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--border);
}

/* Cards & Shell */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-hover:hover { border-color: var(--brand-line); transform: translateY(-1px); box-shadow: var(--shadow-md); transition: all 0.15s; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
}
.stat-val { font-size: 1.65rem; font-weight: 700; line-height: 1.1; }
.stat-lbl { font-size: 0.8rem; color: var(--ink-3); margin-top: 4px; font-weight: 500; }

/* Avatars & Crests */
.av {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 650; color: #fff; flex-shrink: 0;
}
.av-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.av-md { width: 44px; height: 44px; font-size: 0.95rem; }
.av-lg { width: 68px; height: 68px; font-size: 1.35rem; }

.crest {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-md); font-weight: 750; color: #fff;
  flex-shrink: 0;
}

/* Navigation Shell */
.topbar {
  position: sticky; top: 0; z-index: 40; height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 18px; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 1.15rem; color: var(--ink); cursor: pointer; }
.logo-mark { width: 28px; height: 28px; }

.shell { display: flex; min-height: calc(100vh - 56px); }
.rail {
  width: var(--rail); flex-shrink: 0; border-right: 1px solid var(--border);
  background: var(--surface); padding: 16px 10px; display: flex; flex-direction: column; gap: 20px;
}
.rail-group { display: flex; flex-direction: column; gap: 3px; }
.rail-title { padding: 4px 10px; margin-bottom: 2px; }
.rail-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md);
  color: var(--ink-2); font-weight: 550; font-size: 0.88rem; cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.rail-link:hover { background: var(--surface-2); color: var(--ink); }
.rail-link.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.main { flex-grow: 1; min-width: 0; padding: 28px; }
.page { max-width: var(--maxw); margin: 0 auto; }
.page-narrow { max-width: 780px; margin: 0 auto; }
.page-head { margin-bottom: 24px; }

/* Persona Quick Switcher Dropdown */
.persona-menu {
  position: absolute; right: 0; top: 44px; z-index: 50; width: 270px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 8px;
}
.persona-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md);
  cursor: pointer; transition: background 0.1s;
}
.persona-item:hover { background: var(--surface-2); }
.persona-item.on { background: var(--brand-soft); }

/* Tables */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.88rem; }
th { background: var(--surface-2); font-weight: 600; color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* Magnitude Bar Charts */
.cbar { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.cbar-lbl { width: 150px; flex-shrink: 0; }
.cbar-track { flex-grow: 1; height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.cbar-fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width 0.4s ease; }
.cbar-fill-violet { background: var(--violet); }
.cbar-val { width: 32px; text-align: right; color: var(--ink-3); }

/* Career Journey Timeline */
.traj { position: relative; padding: 10px 0 10px 24px; }
.traj-line { border-left: 2px solid var(--border-strong); position: relative; }
.traj-step { position: relative; padding: 0 0 20px 20px; }
.traj-step:last-child { padding-bottom: 0; }
.traj-dot {
  position: absolute; left: -7px; top: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--brand);
}
.traj-step.now .traj-dot { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.traj-year { font-size: 0.78rem; font-weight: 700; color: var(--ink-3); }
.traj-role { font-weight: 650; font-size: 0.92rem; color: var(--ink); }
.traj-co { font-size: 0.84rem; color: var(--ink-2); }

/* Modals & Scrim */
.scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; overflow: hidden;
  animation: modalIn 0.15s ease-out;
}
@keyframes modalIn { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; max-height: 75vh; overflow-y: auto; }
.modal-foot { padding: 14px 22px; background: var(--surface-2); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Toast Notification */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 120;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; padding: 10px 16px; border-radius: var(--r-md);
  background: var(--ink); color: #fff; font-size: 0.88rem; font-weight: 550;
  box-shadow: var(--shadow-md); animation: toastIn 0.2s ease-out;
}
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Grid Layouts for Directory & Cards */
.alum-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.alum-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; cursor: pointer; transition: all 0.15s; display: flex; flex-direction: column; gap: 12px;
}
.alum-card:hover { border-color: var(--brand-line); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.dir-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
@media (max-width: 860px) {
  .dir-layout { grid-template-columns: 1fr; }
  .rail { display: none; }
}

/* Hero Section */
.hero { padding: 50px 0 35px; border-bottom: 1px solid var(--border); margin-bottom: 30px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 36px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Multi-portal additions (auth portals, premium, internships)
   ============================================================ */
.small { font-size: 0.86rem; }
.tiny { font-size: 0.76rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
h4 { font-size: 0.98rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.notice {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 20px; border-radius: var(--r-md);
  font-size: 0.86rem; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border);
}
.notice-brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.notice-violet { background: var(--violet-soft); color: var(--violet-ink); border-color: var(--violet-line); }
.notice-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.notice-bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }

.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.portal-card { display: flex; flex-direction: column; color: inherit; }
.perk-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; font-size: 0.86rem; color: var(--ink-2); }
.perk-list li { display: flex; gap: 8px; align-items: flex-start; }
.perk-list li svg { flex-shrink: 0; margin-top: 3px; color: var(--good); }
.auth-card { padding: 26px; }

.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }

.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; max-width: 980px; margin: 0 auto; }
.price-card { display: flex; flex-direction: column; gap: 6px; }
.price-card-featured { border: 2px solid var(--violet); box-shadow: var(--shadow-md); }

.lock-card { text-align: center; padding: 44px 24px; }

.mnav { display: none; }

@media (max-width: 860px) {
  .split-layout { grid-template-columns: 1fr; }
  .main { padding: 18px 16px; }
  .hide-sm { display: none !important; }
  .logo-word { display: none; }
  .mnav {
    display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 56px; z-index: 30;
  }
  .mnav a {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    padding: 6px 10px; border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 550; color: var(--ink-2);
  }
  .mnav a.on { background: var(--brand-soft); color: var(--brand-ink); }
  .cbar-lbl { width: 110px; }
}

button, input, select, textarea { font: inherit; color: inherit; }

/* ============================================================
   Institution SaaS additions
   ============================================================ */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 4px; }
.tab { border: 0; background: transparent; padding: 6px 12px; border-radius: var(--r-sm); font-size: 0.86rem; font-weight: 550; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 12px; }
.checklist-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); color: var(--ink); font-size: 0.86rem; }
.checklist-item:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.checklist-item.done { color: var(--ink-3); text-decoration: line-through; }
.check-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checklist-item.done .check-dot { background: var(--good); border-color: var(--good); color: #fff; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.quick-grid .card { color: inherit; display: block; }

.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; }
.radio-card.on, .radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-card input { margin-top: 4px; }

.feed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

.thread { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: var(--r-md); }
.msg-s { align-self: flex-start; background: var(--surface-2); }
.msg-a { align-self: flex-end; background: var(--violet-soft); }

.trend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.cols { display: flex; align-items: flex-end; gap: 8px; height: 130px; margin-top: 12px; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.col-bar { width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; min-height: 2px; }
.col-val { font-size: 0.72rem; color: var(--ink-2); }
.col-lbl { font-size: 0.7rem; color: var(--ink-3); }

.health-ring {
  --pct: 0; --tone: var(--good);
  width: 120px; height: 120px; margin: 12px auto 0; border-radius: 50%;
  background: conic-gradient(var(--tone) calc(var(--pct) * 1%), var(--surface-2) 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.health-ring::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.health-ring span { position: relative; font-size: 2rem; font-weight: 750; }

code { font-family: var(--mono); font-size: 0.8rem; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.stat-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stat-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Offline banner (fixed, updated in place) */
.net-banner {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 130;
  background: var(--bad); color: #fff; padding: 8px 16px; border-radius: var(--r-md);
  font-size: 0.86rem; font-weight: 600; box-shadow: var(--shadow-md); max-width: calc(100vw - 32px);
}
