:root {
  --dark:        #0b1f35;
  --dark2:       #112840;
  --teal:        #0d9488;
  --teal-soft:   #14b8a6;
  --teal-dim:    #ccfbf1;
  --bg:          #f0f5f9;
  --card:        #ffffff;
  --text:        #1a3040;
  --muted:       #5f7d90;
  --line:        #d4e3ed;
  --green:       #16a34a;
  --red:         #dc2626;
  --amber:       #d97706;
  --shadow:      0 4px 20px rgba(11,31,53,.08);
}

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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14.5px;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s;
}

.sidebar-logo {
  padding: 28px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.logo-badge {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--teal), var(--teal-soft));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.logo-name {
  font-size: 17px; font-weight: 800;
  color: #ffffff; letter-spacing: .4px;
}

.logo-sub {
  font-size: 11px; color: rgba(255,255,255,.4);
  letter-spacing: 1.2px; text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 18px 0;
  overflow-y: auto;
}

.nav-section {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  padding: 14px 22px 6px;
}

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  border-radius: 0;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}

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

.nav-link.active {
  background: rgba(13,148,136,.15);
  color: var(--teal-soft);
  border-left-color: var(--teal);
}

.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.nav-icon svg {
  width: 16px; height: 16px; flex-shrink: 0;
}

.sidebar-footer {
  padding: 18px 22px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-user {
  font-size: 12.5px; color: rgba(255,255,255,.5);
  margin-bottom: 8px;
}

.sidebar-user strong { color: rgba(255,255,255,.8); display: block; }

.sidebar-footer a {
  font-size: 12.5px; color: rgba(255,255,255,.35);
  text-decoration: none;
  transition: color .15s;
}
.sidebar-footer a:hover { color: var(--red); }

/* ── MAIN ────────────────────────────────────────────── */
.main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0;
  z-index: 50;
}

.topbar-title { font-size: 20px; font-weight: 700; color: var(--text); }
.topbar-sub   { font-size: 13px; color: var(--muted); margin-top: 1px; }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 40px;
  padding: 6px 14px 6px 8px;
}

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

.user-info { line-height: 1.2; }
.user-info strong { font-size: 13px; display: block; }
.user-info span   { font-size: 11px; color: var(--muted); }

.content {
  padding: 28px 32px;
  flex: 1;
}

/* ── FLASH ───────────────────────────────────────────── */
.flash-wrap { padding: 0 32px; margin-top: -6px; }

.flash {
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 12px;
  font-weight: 500;
}

.flash.success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.flash.error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── STAT CARDS ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stats-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  background: var(--card);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.stat-label {
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted);
  margin-bottom: 8px;
}

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

.stat-meta {
  font-size: 12px; color: var(--muted);
  margin-top: 6px;
}

.stat-value.teal   { color: var(--teal); }
.stat-value.green  { color: var(--green); }
.stat-value.red    { color: var(--red); }
.stat-value.amber  { color: var(--amber); }

/* ── PANELS ──────────────────────────────────────────── */
.panel {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

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

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

.panel-body { padding: 22px; }

/* ── TABLES ──────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  font-size: 11.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--muted);
  padding: 10px 14px; text-align: left;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f5fbfa; }

td a { color: var(--teal); text-decoration: none; font-weight: 600; }
td a:hover { text-decoration: underline; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}

.btn.teal    { background: var(--teal);  color: #fff; }
.btn.teal:hover { background: var(--teal-soft); }

.btn.ghost   { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--line); }

.btn.danger  { background: #fee2e2; color: var(--red); }
.btn.danger:hover { background: #fecaca; }

.btn.sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }

/* ── BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
}

.b-Prospect  { background: #e0f2fe; color: #0369a1; }
.b-Applied   { background: #fef9c3; color: #854d0e; }
.b-Enrolled  { background: #dcfce7; color: #15803d; }
.b-Completed { background: #f3e8ff; color: #7e22ce; }
.b-Cancelled { background: #f1f5f9; color: #64748b; }

.b-yes { background: #dcfce7; color: #15803d; }
.b-no  { background: #fee2e2; color: #b91c1c; }

/* contract status */
.cs-Active     { background: #dcfce7; color: #15803d; }
.cs-Expired    { background: #fee2e2; color: #b91c1c; }
.cs-Terminated { background: #f1f5f9; color: #475569; }
.cs-Unknown    { background: #fef9c3; color: #854d0e; }

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

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

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=url], input[type=file],
select, textarea {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font-size: 14px; color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
}

textarea { resize: vertical; min-height: 80px; }

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

.check-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px;
}
.check-row input[type=checkbox] { width: auto; }

/* ── SEARCH & FILTERS ────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap input { padding-left: 36px; }
.search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); font-size: 14px;
  pointer-events: none;
}

select.filter-sel {
  width: auto; min-width: 140px;
  padding: 8px 12px;
}

/* ── MODAL / DIALOG ──────────────────────────────────── */
dialog {
  border: none; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 0; min-width: 440px; max-width: 580px;
  width: 100%;
}

dialog::backdrop { background: rgba(11,31,53,.5); }

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: var(--muted); padding: 2px 6px;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 22px 24px; }

.modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--bg); border-radius: 0 0 16px 16px;
}

/* ── PROGRESS BAR ────────────────────────────────────── */
.progress-wrap {
  background: var(--bg); border-radius: 4px;
  height: 6px; overflow: hidden; margin-top: 6px;
}
.progress-bar {
  height: 100%; border-radius: 4px;
  background: var(--teal);
  transition: width .3s;
}
.progress-bar.full { background: var(--green); }
.progress-bar.low  { background: var(--amber); }

/* ── DETAIL CARDS ────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.info-card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
}

.info-card h3 {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); margin-bottom: 16px;
}

.info-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-row .label  { font-size: 12.5px; color: var(--muted); flex-shrink: 0; }
.info-row .value  { font-size: 13.5px; font-weight: 600; text-align: right; }

/* ── COMMISSION HIGHLIGHT ────────────────────────────── */
.comm-highlight {
  background: linear-gradient(135deg, var(--dark), var(--dark2));
  border-radius: 14px;
  padding: 26px;
  color: #fff;
  margin-bottom: 24px;
}

.comm-highlight .label  { font-size: 12px; color: rgba(255,255,255,.5); margin-bottom: 4px; }
.comm-highlight .amount { font-size: 36px; font-weight: 800; color: var(--teal-soft); }
.comm-highlight .rate   { font-size: 13px; color: rgba(255,255,255,.4); margin-top: 4px; }

.comm-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 16px; margin-top: 20px;
}

.comm-mini { background: rgba(255,255,255,.06); border-radius: 10px; padding: 14px; }
.comm-mini .cm-label { font-size: 11px; color: rgba(255,255,255,.4); margin-bottom: 4px; }
.comm-mini .cm-value { font-size: 18px; font-weight: 700; color: #fff; }
.comm-mini .cm-value.teal  { color: var(--teal-soft); }
.comm-mini .cm-value.red   { color: #f87171; }
.comm-mini .cm-value.green { color: #86efac; }

/* ── LEGAL DOCS ──────────────────────────────────────── */
.doc-ext {
  display: inline-block;
  padding: 2px 7px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}
.ext-pdf  { background: #fee2e2; color: #b91c1c; }
.ext-doc,
.ext-docx { background: #dbeafe; color: #1d4ed8; }
.ext-jpg,
.ext-jpeg,
.ext-png  { background: #fef9c3; color: #854d0e; }
.ext-file { background: var(--bg); color: var(--muted); }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty {
  text-align: center; padding: 52px 24px;
  color: var(--muted);
}
.empty .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty p { font-size: 14px; }

/* ── PAGE HEADER ─────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px; gap: 12px;
}
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--text); }
.page-header p  { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── MOBILE NAV ──────────────────────────────────────── */
.mobile-bar {
  display: none;
  background: var(--dark);
  padding: 12px 18px;
  align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
}
.mobile-logo { color: #fff; font-size: 16px; font-weight: 800; }
.hamburger {
  background: none; border: none; cursor: pointer;
  color: #fff; font-size: 20px; padding: 4px;
}

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 90;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop.open {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .mobile-bar {
    display: flex;
  }
  .content {
    padding: 20px 16px;
  }
  .topbar {
    padding: 14px 16px;
    display: none;
  }
  .flash-wrap { padding: 0 16px; }
  .stats-grid,
  .stats-grid.cols-4,
  .stats-grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row,
  .form-row.cols-3 {
    grid-template-columns: 1fr;
  }
  .detail-grid { grid-template-columns: 1fr; }
  .comm-row    { grid-template-columns: 1fr 1fr; }
  dialog       { min-width: unset; width: calc(100vw - 32px); }
}

@media (max-width: 520px) {
  .stats-grid,
  .stats-grid.cols-4 {
    grid-template-columns: 1fr;
  }
  .comm-row { grid-template-columns: 1fr; }
}

/* ── UNIVERSITY BAR CHART ────────────────────────────── */
.bar-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.bar-row:last-child { border-bottom: none; }
.bar-label { font-size: 13px; font-weight: 600; min-width: 160px; max-width: 200px; }
.bar-track { flex: 1; background: var(--bg); border-radius: 4px; height: 8px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 4px; background: var(--teal); }
.bar-val   { font-size: 12.5px; font-weight: 700; min-width: 90px; text-align: right;
             font-variant-numeric: tabular-nums; }
