:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #edf4f2;
  --text: #172026;
  --muted: #64717a;
  --line: #dbe3e1;
  --teal: #14776f;
  --teal-deep: #0d4f4b;
  --blue: #2f6fbb;
  --green: #248a5a;
  --red: #c54848;
  --amber: #b7791f;
  --shadow: 0 18px 50px rgba(22, 37, 47, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  min-height: 100vh;
  background: #112226;
  color: #eef7f5;
  padding: 24px 18px;
  position: sticky;
  top: 0;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #d9f2ec;
  color: var(--teal-deep);
  font-weight: 900;
}

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

.brand small {
  color: #9fbbb5;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  border-radius: 8px;
  color: #c6d8d4;
  padding: 12px 14px;
}

.nav a.active,
.nav a:hover {
  background: rgba(217, 242, 236, 0.12);
  color: #ffffff;
}

.app-shell {
  padding: 28px;
  min-width: 0;
}

.topbar,
.section-band,
.panel-heading,
.calendar-toolbar,
.setup-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 5px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.9rem;
}

h2 {
  font-size: 1.08rem;
}

.topbar-actions,
.quick-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill,
.primary-button,
.ghost-button,
.text-button,
.icon-button {
  border-radius: 8px;
  border: 1px solid var(--line);
  min-height: 40px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-size: 0.88rem;
}

.status-pill.live {
  color: var(--green);
}

.status-pill.mock {
  color: var(--amber);
}

.primary-button,
.ghost-button,
.text-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
}

.primary-button {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  font-weight: 800;
}

.ghost-button:hover,
.text-button:hover,
.icon-button:hover {
  background: var(--surface-soft);
}

.text-button {
  color: var(--teal);
  font-weight: 800;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 1.5rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel,
.setup-alert {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.setup-alert {
  border-left: 4px solid var(--amber);
  margin-bottom: 18px;
  padding: 16px 18px;
}

.setup-alert[hidden] {
  display: none;
}

.setup-alert p,
.config-callout p {
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0 0;
}

.metric {
  padding: 18px;
}

.metric span,
.helper-text,
.settings-grid span {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-heading {
  margin-bottom: 14px;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfd;
}

.item.lesson {
  border-left-color: var(--blue);
}

.item.reminder {
  border-left-color: var(--amber);
}

.item.cancelled {
  border-left-color: var(--red);
  opacity: 0.72;
}

.item h3 {
  font-size: 0.96rem;
  margin: 0 0 6px;
}

.item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.section-band {
  margin-bottom: 18px;
  padding: 16px 0;
}

.quick-form input,
.quick-form select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.calendar-toolbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-weekdays span {
  padding: 0 6px;
}

.day {
  min-height: 132px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.day.outside {
  background: #eef2f3;
  color: #94a0a7;
}

.day-number {
  font-weight: 900;
  font-size: 0.86rem;
}

.calendar-chip {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 6px;
  padding: 5px 6px;
  background: #e8f0fb;
  color: #1c4f86;
  font-size: 0.78rem;
  font-weight: 700;
}

.calendar-chip.reminder {
  background: #fff5df;
  color: #855a11;
}

.calendar-chip.cancelled {
  background: #f8e6e6;
  color: #9f3333;
}

.todo-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.todo-column {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 280px;
}

.todo-column h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.config-callout {
  border: 1px solid #f0d59a;
  border-radius: 8px;
  background: #fff9ec;
  margin-bottom: 14px;
  padding: 14px;
}

.config-callout h3 {
  font-size: 0.98rem;
  margin: 0;
}

.settings-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.settings-grid strong,
.settings-grid span {
  display: block;
}

.settings-grid strong {
  margin-top: 5px;
}

.helper-text {
  line-height: 1.55;
  margin: 16px 0 0;
}

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

  .sidebar {
    min-height: auto;
    position: static;
    padding: 16px;
  }

  .brand {
    margin-bottom: 12px;
  }

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

  .app-shell {
    padding: 20px 16px;
  }

  .metrics-grid,
  .split-layout,
  .todo-board,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    gap: 5px;
  }

  .day {
    min-height: 96px;
    padding: 6px;
  }
}

@media (max-width: 620px) {
  .topbar,
  .section-band,
  .setup-alert {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    grid-template-columns: repeat(5, 132px);
  }

  .quick-form {
    display: grid;
    grid-template-columns: 1fr;
  }
}
