:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-strong: #eef4ff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1ee;
  --accent: #1264a3;
  --accent-strong: #0b4f86;
  --success: #16794c;
  --warning: #a15c00;
  --danger: #b42318;
  --soft-success: #e7f5ee;
  --soft-warning: #fff4df;
  --soft-danger: #ffebe8;
  --shadow: 0 14px 34px rgba(20, 39, 74, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #101928;
  color: #fff;
  padding: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #f1c857;
  color: #152238;
  font-weight: 800;
}

.brand-title {
  font-weight: 750;
}

.brand-subtitle {
  margin-top: 2px;
  color: #aab4c4;
  font-size: 13px;
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  color: #c7d0dd;
  font-size: 13px;
}

.select,
.input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.sidebar .select {
  border-color: #38445a;
  background: #182235;
  color: #fff;
}

.compact {
  width: min(260px, 100%);
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 24px;
}

.nav-item {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d4dbea;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.is-active {
  background: #23314a;
  color: #fff;
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 18px 28px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.content {
  padding: 24px 28px 36px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.kpi {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
}

.kpi-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 780;
}

.section {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.section-title {
  margin: 0;
  font-size: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: #f8fafd;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge.success {
  background: var(--soft-success);
  color: var(--success);
}

.badge.warning {
  background: var(--soft-warning);
  color: var(--warning);
}

.badge.danger {
  background: var(--soft-danger);
  color: var(--danger);
}

.badge.neutral {
  background: #eef2f7;
  color: #475467;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
}

.btn:hover {
  border-color: #9ab4d0;
}

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

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2f7;
  padding: 2px;
}

.segment {
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #475467;
  padding: 0 8px;
  cursor: pointer;
}

.segment.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 18px;
}

.student-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--accent-strong);
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.empty {
  padding: 28px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 16px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(88px, 1fr));
    overflow-x: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .kpi-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .content,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .segmented {
    grid-template-columns: 1fr 1fr;
  }
}
