:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #12222f;
  --accent: #006d77;
  --muted: #58707f;
  --line: #d9e0e6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #eef5f9, #f8fafc 32%, #f4f6f8);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.hero {
  background: radial-gradient(circle at 10% -40%, #93c5d7, transparent 55%), #0f3c4d;
  color: #f5fbff;
  padding: 2rem 1rem;
}
.hero h1 { margin: 0 0 .35rem; }
.hero p { margin: 0; opacity: .9; }

.icon {
  display: inline-block;
  margin-right: .4rem;
  vertical-align: -0.05em;
}

.hero .hero-mainline {
  margin: 0 0 .35rem;
  opacity: 1;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: .01em;
}

.hero .hero-subline {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  opacity: .92;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(16, 38, 56, 0.05);
}

.status { margin-bottom: 1rem; }

.cards {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 1rem;
}

#overall-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.filter-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr;
}

.metric h3 {
  margin: 0;
  font-size: .78rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #4e6b7b;
  font-weight: 700;
}
.metric p {
  margin: .45rem 0 0;
  font-size: 1.6rem;
  line-height: 1.05;
  font-weight: 800;
  color: #0f2d3a;
}

.metric {
  border-left: 5px solid #1e6f88;
  background: linear-gradient(180deg, #ffffff, #f5fafc);
  box-shadow: 0 10px 22px rgba(12, 40, 58, 0.08);
}

.compact-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-cards .metric h3 {
  font-size: .72rem;
}

.compact-cards .metric p {
  font-size: 1.05rem;
  line-height: 1.2;
  word-break: break-word;
}

.horizontal-cards {
  display: flex;
  flex-wrap: nowrap;
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: .35rem;
}

.horizontal-cards .metric {
  flex: 0 0 220px;
}

#prof-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#prof-metrics .metric {
  border-left-width: 0;
  border-top: 5px solid #1e6f88;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
}

#prof-metrics .metric h3,
#prof-metrics .metric p {
  text-align: center;
}

.grid-two {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 980px) {
  .grid-two { grid-template-columns: 1fr 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

@media (max-width: 1200px) {
  #overall-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #prof-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  #overall-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #prof-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.controls {
  display: grid;
  gap: .4rem;
  margin-bottom: .7rem;
}

label {
  font-size: .83rem;
  color: var(--muted);
}

select {
  width: 100%;
  padding: .5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}

thead th {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: .45rem .3rem;
  color: var(--muted);
}

thead th.sortable {
  cursor: pointer;
  user-select: none;
}

thead th.sorted-asc::after {
  content: " ▲";
  font-size: .7rem;
}

thead th.sorted-desc::after {
  content: " ▼";
  font-size: .7rem;
}

tbody td {
  border-bottom: 1px solid #edf1f4;
  padding: .45rem .3rem;
}

#course-table tbody tr {
  cursor: pointer;
}

#course-table tbody tr:hover {
  background: #f4fafc;
}

#course-table tbody tr.is-selected {
  background: #e7f3f9;
}

.summary {
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: .6rem;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .55rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.toolbar-group label {
  margin: 0;
  white-space: nowrap;
}

.table-toolbar #course-page-size {
  width: auto;
  min-width: 84px;
}

.pager button {
  border: 1px solid var(--line);
  background: #fff;
  color: #103140;
  border-radius: 8px;
  padding: .38rem .62rem;
  cursor: pointer;
}

.pager button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

#course-page-info {
  color: var(--muted);
  font-size: .84rem;
  min-width: 110px;
  text-align: center;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.chart {
  display: grid;
  gap: .45rem;
  margin-top: .5rem;
}

.chart-row {
  display: grid;
  grid-template-columns: 90px 1fr 56px;
  align-items: center;
  gap: .5rem;
}

.chart-label {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-track {
  height: 12px;
  background: #e7edf2;
  border-radius: 999px;
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  background: linear-gradient(90deg, #1e6f88, #28a4a3);
}

.chart-value {
  text-align: right;
  font-size: .78rem;
  color: #1a3b4c;
  font-weight: 600;
}

.eval-header {
  margin-bottom: .7rem;
  color: var(--muted);
  font-size: .85rem;
}

.eval-grid {
  display: grid;
  gap: .5rem;
}

.eval-row {
  display: grid;
  grid-template-columns: 110px 1fr 54px 1fr 54px;
  gap: .45rem;
  align-items: center;
}

.eval-label {
  color: var(--muted);
  font-size: .8rem;
}

.eval-track {
  height: 10px;
  background: #ebf0f4;
  border-radius: 999px;
  overflow: hidden;
}

.eval-fill.instructor {
  height: 100%;
  background: linear-gradient(90deg, #0f6f8f, #1ca0c7);
}

.eval-fill.course {
  height: 100%;
  background: linear-gradient(90deg, #2e7e53, #41b37d);
}

.eval-val {
  text-align: right;
  font-size: .78rem;
  font-weight: 600;
  color: #1d3746;
}

.multi-dropdown-host {
  width: 100%;
}

.multi-dd {
  position: relative;
}

.multi-dd > summary {
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: .55rem .65rem;
  cursor: pointer;
  font-size: .88rem;
}

.multi-dd > summary::-webkit-details-marker {
  display: none;
}

.multi-dd[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.multi-dd-panel {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-top: 0;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(11, 32, 46, .12);
  padding: .35rem .45rem;
}

.multi-dd-item {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .25rem .15rem;
  font-size: .84rem;
}
