:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1d2430;
  --muted: #647084;
  --line: #d8dde6;
  --accent: #216869;
  --accent-dark: #174c4d;
  --danger: #b42318;
  --warning: #9a6700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  font-weight: 700;
  font-size: 17px;
}

.subtitle,
.muted,
.message {
  color: var(--muted);
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

a,
button {
  font: inherit;
}

nav a,
button,
.button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  text-decoration: none;
}

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

button.primary:hover,
.button.primary:hover {
  background: var(--accent-dark);
}

button.danger {
  background: #fff;
  border-color: #f2b8b5;
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 56px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.panel h1,
.panel h2,
.panel h3 {
  margin: 0 0 12px;
  line-height: 1.2;
}

.panel h1 {
  font-size: 22px;
}

.panel h2 {
  font-size: 17px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 5px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  min-height: 36px;
  padding: 8px 10px;
}

textarea {
  min-height: 240px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

textarea.compact-textarea {
  min-height: 96px;
}

textarea.directions-textarea {
  min-height: 72px;
}

textarea[data-autosize] {
  min-height: 42px;
  overflow: hidden;
}

.checkbox-row {
  align-items: center;
  display: flex;
  gap: 8px;
  font-weight: 500;
}

.checkbox-row input {
  min-height: auto;
  width: auto;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  width: min(420px, 100%);
}

.login-panel h1 {
  font-size: 24px;
  margin: 8px 0 18px;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  padding: 3px 8px;
  background: #eef6f6;
  color: var(--accent-dark);
}

.pill.success {
  background: #e6f7ea;
  color: #087514;
}

.pill.info {
  background: #e7f0ff;
  color: #1d4f91;
}

.pill.neutral {
  background: #eef1f5;
  color: var(--muted);
}

.pill.warning {
  background: #fff4d6;
  color: var(--warning);
}

.pill.danger {
  background: #fde8e7;
  color: var(--danger);
}

.json-output {
  white-space: pre-wrap;
}

@media (max-width: 840px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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


.admin-notice {
  align-items: center;
  background: #eef6f6;
  border: 1px solid #b7dcda;
  border-radius: 8px;
  color: var(--text);
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
  flex-wrap: wrap;
}

.admin-notice p {
  margin: 3px 0;
}

.admin-notice code {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-block;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  padding: 6px 8px;
}

.credential-notice {
  justify-content: space-between;
}

.split-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.metric-card,
.chart-card,
.inline-card,
.resource-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric-card span,
.metric-card small,
.eyebrow-light {
  color: var(--muted);
  display: block;
}

.metric-card strong {
  color: var(--accent);
  display: block;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.bar-chart {
  display: grid;
  gap: 8px;
}

.bar-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(80px, 150px) minmax(120px, 1fr) minmax(36px, auto);
}

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

.bar-track i {
  background: linear-gradient(90deg, var(--accent), #4aa3a4);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.tight {
  gap: 10px;
}

.scroll-table {
  overflow: auto;
  width: 100%;
}

.scroll-table table {
  min-width: 760px;
}

.permissions-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 10px;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.permission-group legend {
  color: var(--muted);
  font-weight: 700;
  padding: 0 5px;
  text-transform: capitalize;
}

.permission-item {
  font-size: 13px;
  margin: 4px 0;
}

.resource-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.resource-card {
  display: grid;
  gap: 10px;
}

.resource-card.disabled {
  opacity: 0.65;
}

.resource-card img {
  border-radius: 7px;
  height: 160px;
  object-fit: cover;
  width: 100%;
}

.resource-card h3,
.inline-card p {
  margin: 0 0 8px;
}

.tag-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-list span {
  background: #eef1f5;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 3px 8px;
}

.inline-card {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-top: 10px;
}

.compact-json {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  margin: 0;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  white-space: pre-wrap;
}

.is-hidden {
  display: none !important;
}

.show-more-row {
  margin: 12px 0 0;
}

.required-hint {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 10px 12px;
}

.required-label {
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.classroom-filter-row label {
  min-width: 130px;
}

.classroom-filter-row input[type="number"] {
  max-width: 150px;
}

.classroom-overview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(520px, 2fr) minmax(240px, 0.85fr);
}

.campus-map {
  background: #e8eef2;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 520px;
  overflow: hidden;
}

.classroom-overview-grid .campus-map {
  height: min(78vh, 820px);
  min-height: 640px;
}

.small-location-map {
  background: #e8eef2;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 260px;
  overflow: hidden;
}

.map-fallback {
  padding: 16px;
}

.building-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.building-row {
  justify-content: space-between;
  text-align: left;
  width: 100%;
}

.building-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(33, 104, 105, 0.12);
}

.building-row small {
  color: var(--muted);
  display: block;
}

.room-browser {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(230px, 340px) minmax(0, 1fr);
}

.room-list-panel {
  min-width: 0;
}

.room-list {
  display: grid;
  gap: 8px;
  max-height: 720px;
  overflow: auto;
}

.room-list-item {
  justify-content: space-between;
  min-height: 58px;
  text-align: left;
  width: 100%;
}

.room-list-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(33, 104, 105, 0.12);
}

.room-list-item small {
  color: var(--muted);
  display: block;
}

.room-detail {
  background: #f9fbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.availability-timeline {
  display: grid;
  gap: 8px;
  margin: 12px 0 20px;
}

.timeline-track {
  background: linear-gradient(90deg, #dff3e8, #c8eadb);
  border: 1px solid #b7dcc6;
  border-radius: 10px;
  height: 64px;
  overflow: hidden;
  position: relative;
}

.timeline-block {
  background: #f97368;
  border-left: 1px solid rgba(255, 255, 255, 0.8);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  bottom: 0;
  display: block;
  position: absolute;
  top: 0;
}

.timeline-labels {
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.room-class-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.room-class-row {
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(110px, 150px) minmax(140px, 220px) minmax(0, 1fr);
  padding: 10px 12px;
}

.room-class-row + .room-class-row {
  border-top: 1px solid var(--line);
}

.room-class-row small {
  color: var(--muted);
}

.resource-admin-table textarea {
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

@media (max-width: 1000px) {
  .classroom-overview-grid,
  .room-browser {
    grid-template-columns: 1fr;
  }

  .classroom-overview-grid .campus-map {
    min-height: 480px;
  }
}
