:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e8edf3;
  --brand: #1e3a8a;
  --brand2: #2563eb;
  --brand-soft: #eff6ff;
  --orange: #ef7f1a;
  --c-budget: #059669;
  --c-contract: #2563eb;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    Roboto,
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px 24px 60px;
}

.page-title {
  margin: 6px 2px 18px;
}

.page-title h1 {
  font-size: 21px;
  margin: 0 0 4px;
  color: var(--brand);
  font-weight: 700;
}

.page-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

select,
.btn {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: inherit;
}

select {
  padding: 0 32px 0 12px;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  appearance: none;
  cursor: pointer;
  min-width: 126px;
  color: var(--ink);
}

#fUniv {
  max-width: 260px;
}

.btn {
  padding: 0 15px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--brand2);
  color: var(--brand2);
}

.btn.primary {
  background: var(--brand2);
  color: #fff;
  border-color: var(--brand2);
}

.btn.primary:hover {
  background: #1d4ed8;
  color: #fff;
}

.toolbar .spacer {
  margin-left: auto;
}

.search {
  position: relative;
}

.search input {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0 14px 0 36px;
  font-size: 14px;
  width: 250px;
  font-family: inherit;
  background: #fff;
}

.search input:focus {
  outline: none;
  border-color: var(--brand2);
}

.search svg {
  position: absolute;
  left: 11px;
  top: 11px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.stat .sl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat .sv {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.15;
}

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

.list-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.list-count {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.list-btns {
  display: flex;
  gap: 8px;
}

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

.univ-head {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  background: #fff;
  transition: background 0.15s ease;
}

.univ-head:hover {
  background: #f8fafc;
}

.chev {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.univ-card.collapsed .chev {
  transform: rotate(-90deg);
}

.univ-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  flex: 1;
  min-width: 0;
}

.univ-idx {
  color: var(--orange);
  margin-right: 4px;
}

.univ-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  white-space: nowrap;
}

.pill.plan {
  background: var(--brand-soft);
  color: var(--brand);
}

.univ-body {
  border-top: 1px solid var(--line);
  padding: 6px 18px 18px;
}

.univ-card.collapsed .univ-body {
  display: none;
}

.fac-block {
  margin-top: 14px;
}

.fac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.fac-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.fac-plan {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand2);
  white-space: nowrap;
}

.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 9px 12px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafcff;
}

td.num,
th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.spec-learning {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
}

.bk-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.bk-badge.budget {
  background: #ecfdf5;
  color: var(--c-budget);
}

.bk-badge.contract {
  background: #eff6ff;
  color: var(--c-contract);
}

.empty {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .search input {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .wrap {
    padding: 16px 12px 44px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .univ-head {
    flex-wrap: wrap;
  }
}

@media print {
  body {
    background: #fff;
  }
  .toolbar,
  .list-actions {
    display: none !important;
  }
  .univ-card.collapsed .univ-body {
    display: block !important;
  }
  .univ-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
