:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --text: #17191f;
  --muted: #646b78;
  --faint: #89909d;
  --line: #dfe3e8;
  --line-strong: #cdd3db;
  --red: #e21b2d;
  --red-dark: #b81423;
  --green: #0c8f78;
  --blue: #275f9f;
  --shadow: 0 12px 32px rgba(20, 25, 35, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  max-width: 100%;
  cursor: pointer;
}

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

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--red);
  color: white;
  font-size: 30px;
  line-height: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.topbar a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.auth-chip {
  border: 1px solid rgba(39, 95, 159, 0.18);
  border-radius: 999px;
  background: rgba(39, 95, 159, 0.06);
  color: var(--blue);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 750;
}

.auth-page {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 6px;
  background: var(--red);
  color: white;
  font-size: 36px;
  line-height: 1;
  font-weight: 800;
}

.auth-panel p {
  margin-bottom: 18px;
}

.auth-error {
  border: 1px solid rgba(226, 27, 45, 0.24);
  border-radius: 6px;
  background: rgba(226, 27, 45, 0.08);
  color: var(--red);
  padding: 10px 12px;
  font-size: 13px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--red);
  border-radius: 6px;
  background: var(--red);
  color: white;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
  min-width: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 22px;
  min-width: 0;
}

.content {
  padding: 26px;
  min-width: 0;
}

.panel,
.surface,
.stat-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 18px;
  margin-bottom: 14px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.25;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 0 11px;
  font-size: 14px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid rgba(39, 95, 159, 0.22);
  outline-offset: 2px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ghost-button,
.outline-button,
.mini-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--text);
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.ghost-button {
  color: var(--red);
  border-color: rgba(226, 27, 45, 0.25);
}

.outline-button {
  color: var(--red);
  border-color: rgba(226, 27, 45, 0.35);
}

.mini-button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--blue);
}

.danger-button {
  width: 100%;
  color: var(--red-dark);
  white-space: normal;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-size: 13px;
  font-weight: 750;
}

.employer-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.employer-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: left;
}

.employer-card.is-active {
  border-color: rgba(226, 27, 45, 0.5);
  box-shadow: 0 0 0 2px rgba(226, 27, 45, 0.08);
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 850;
}

.employer-card:nth-child(odd) .avatar {
  background: var(--red);
}

.employer-card strong,
.employer-card small {
  display: block;
}

.employer-card small {
  margin-top: 3px;
  color: var(--muted);
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(52px, 1fr));
  gap: 8px;
}

.weekday-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.weekday-grid input {
  min-height: 34px;
  padding: 0 6px;
  text-align: center;
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.content-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.content-header p {
  margin-bottom: 0;
  max-width: 720px;
  font-size: 14px;
}

.status {
  align-self: flex-start;
  border: 1px solid rgba(12, 143, 120, 0.28);
  border-radius: 999px;
  background: rgba(12, 143, 120, 0.08);
  color: var(--green);
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
}

.status.is-loading {
  border-color: rgba(39, 95, 159, 0.24);
  background: rgba(39, 95, 159, 0.08);
  color: var(--blue);
}

.status.is-error {
  border-color: rgba(226, 27, 45, 0.3);
  background: rgba(226, 27, 45, 0.08);
  color: var(--red);
}

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

.stat-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 13px;
  min-height: 108px;
  padding: 17px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(226, 27, 45, 0.08);
  color: var(--red);
}

.stat-card:nth-child(2) .stat-icon {
  background: rgba(12, 143, 120, 0.1);
  color: var(--green);
}

.stat-card:nth-child(3) .stat-icon {
  background: rgba(39, 95, 159, 0.1);
  color: var(--blue);
}

.stat-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.stat-card span span {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  font-weight: 750;
}

.stat-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}

.surface {
  padding: 18px;
  box-shadow: var(--shadow);
}

.table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 76px 110px 56px minmax(160px, 1fr) 160px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  gap: 10px;
  font-size: 13px;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-head {
  min-height: 36px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toggle {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle span {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d7dce3;
  transition: background 160ms ease;
}

.toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 160ms ease;
}

.toggle input:checked + span {
  background: var(--red);
}

.toggle input:checked + span::after {
  transform: translateX(18px);
}

.tag {
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tag.is-green {
  border-color: rgba(12, 143, 120, 0.22);
  background: rgba(12, 143, 120, 0.08);
  color: var(--green);
}

.recommendation-list {
  display: grid;
  gap: 11px;
}

.recommendation {
  display: grid;
  grid-template-columns: 114px minmax(0, 1fr) 112px;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.recommendation p {
  margin: 4px 0 8px;
  font-size: 13px;
}

.date-block {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.date-block span {
  color: var(--muted);
  font-size: 12px;
}

.day-strip {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.day-strip span {
  min-width: 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 5px;
  background: white;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.day-strip .is-vacation {
  border-color: rgba(12, 143, 120, 0.5);
  background: var(--green);
  color: white;
}

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

.school-list article {
  display: grid;
  gap: 7px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.school-list span {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  margin: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface-soft);
  color: var(--muted);
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workbench,
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .layout {
    display: block;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar,
  .content-header {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
  }

  .topbar {
    padding: 16px;
  }

  .content,
  .sidebar {
    width: 100%;
    max-width: 100vw;
    padding: 16px;
    overflow-x: hidden;
  }

  .stats-grid,
  .workbench,
  .school-list {
    grid-template-columns: 1fr;
  }

  .section-heading {
    justify-content: flex-start;
  }

  .table {
    overflow-x: auto;
  }

  .table-row {
    min-width: 720px;
  }

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