:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warning: #b45309;
  --danger: #b42318;
  --soft: #e8f5f3;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

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

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

.shell { min-height: calc(100vh - 46px); display: flex; }

.sidebar {
  width: 248px;
  background: #13211f;
  color: #f8fafc;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  font-weight: 800;
}

.brand strong, .brand span { display: block; }

.brand span {
  color: #a7b4b1;
  font-size: 13px;
  margin-top: 4px;
}

.nav { margin-top: 22px; display: grid; gap: 8px; }

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  color: #d7e4e1;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
}

.nav-item.active, .nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.main { flex: 1; padding: 26px; min-width: 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; }
h2 { font-size: 17px; margin-bottom: 0; }

.filters, .toolbar, .form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

label {
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 6px;
}

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: var(--ink);
  min-width: 0;
}

textarea { min-height: 82px; resize: vertical; }
.toolbar { margin-bottom: 16px; }
.toolbar input[type="search"] { min-width: 320px; }

.check {
  display: flex;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.button:hover { background: var(--accent-dark); }
.button.ghost { background: #ffffff; color: var(--ink); border: 1px solid var(--line); }
.button.small { padding: 7px 10px; font-size: 13px; }

.view { display: none; }
.view.active { display: block; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card { padding: 18px; }
.card span { color: var(--muted); font-size: 13px; }
.card strong { display: block; margin-top: 8px; font-size: 28px; }
.card.warning strong { color: var(--warning); }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.form-grid { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
.wide { min-width: 0; }
.narrow { max-width: 720px; }
.panel { padding: 18px; }

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.form { display: grid; gap: 12px; }
.form label { width: 100%; }
.form-row > label { flex: 1 1 140px; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  background: #f9fafb;
  position: sticky;
  top: 0;
}

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

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  white-space: nowrap;
}

.tag.good { background: var(--soft); color: var(--accent-dark); }
.tag.warn { background: #fff7ed; color: var(--warning); }
.tag.danger { background: #fef3f2; color: var(--danger); }

.campus-list, .compact-list { display: grid; gap: 10px; }

.campus-item, .compact-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.muted, .hint { color: var(--muted); }
.hint { margin: 14px 0 0; line-height: 1.7; }

.diagnostics {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.diagnostic-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 11px 12px;
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}

.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.link-button {
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #111827;
  color: #ffffff;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

.site-footer {
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 12px 18px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover { color: var(--accent-dark); }

@media (max-width: 980px) {
  .shell { display: block; }
  .sidebar { position: static; width: auto; height: auto; }
  .nav { display: flex; overflow: auto; }
  .nav-item { white-space: nowrap; }
  .topbar, .grid.two, .form-grid { grid-template-columns: 1fr; display: grid; }
  .cards { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .toolbar input[type="search"] { min-width: 0; width: 100%; }
}

@media (max-width: 560px) {
  .main { padding: 16px; }
  .cards { grid-template-columns: 1fr; }
}
