:root {
  --ink: #17212b;
  --muted: #637083;
  --line: #d9e1ea;
  --surface: #ffffff;
  --soft: #f5f8fb;
  --nav: #132235;
  --nav-2: #1e334c;
  --accent: #2f7d68;
  --accent-2: #e5a13a;
  --danger: #bd4053;
  --focus: #4a8bd6;
  --shadow: 0 18px 45px rgba(22, 36, 54, 0.11);
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--nav), var(--nav-2));
  color: #eef5fb;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-2);
  color: #1a2430;
  font-weight: 800;
}

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

.brand span {
  color: #b6c6d8;
  font-size: 0.88rem;
}

.role-tabs {
  display: grid;
  gap: 8px;
}

.role-tab {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: #dbe7f4;
  padding: 12px;
  border-radius: 8px;
  text-align: left;
}

.role-tab.active {
  background: #f5fbff;
  color: var(--nav);
}

.login-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 20px;
}

.panel-title,
.section-heading,
.option-header,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title {
  margin-bottom: 14px;
  font-weight: 700;
}

.stack-form,
.form-grid,
.compact-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.sidebar label {
  color: #c8d7e6;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

.sidebar input {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(74, 139, 214, 0.22);
  border-color: var(--focus);
}

.workspace {
  padding: 28px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.topbar h1,
.section-heading h2 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
}

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

.status-pill {
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 9px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: stretch;
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(47, 125, 104, 0.12), rgba(229, 161, 58, 0.12)),
    #fff;
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.hero-copy p {
  margin: 0;
  max-width: 620px;
  font-size: 1.2rem;
  line-height: 1.45;
  color: #29394b;
}

.class-strip,
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.class-strip span,
.class-chip {
  border: 1px solid #cfdbe7;
  border-radius: 999px;
  background: #fff;
  padding: 9px 13px;
  font-weight: 800;
  color: #263548;
}

.study-visual {
  position: relative;
  min-height: 120px;
  border-radius: 8px;
  background: #eaf1f8;
  overflow: hidden;
}

.board {
  position: absolute;
  left: 26px;
  right: 26px;
  top: 22px;
  height: 74px;
  border: 8px solid #9a633b;
  border-radius: 6px;
  background: #2f7d68;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
}

.board span {
  height: 4px;
  background: rgba(255, 255, 255, 0.76);
  border-radius: 999px;
}

.board span:nth-child(2) {
  width: 70%;
}

.board span:nth-child(3) {
  width: 45%;
}

.desk {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 16px;
  height: 16px;
  border-radius: 6px;
  background: var(--accent-2);
}

.view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 20px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 10px 28px rgba(22, 36, 54, 0.07);
}

.wide-panel {
  grid-column: 1 / -1;
}

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

.wide {
  grid-column: 1 / -1;
}

.option-block {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.option-header span {
  color: var(--muted);
  font-size: 0.86rem;
}

.class-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.class-chip input,
.inline-check input,
.school-option input {
  width: auto;
}

.class-chip:has(input:checked) {
  border-color: var(--accent);
  background: #e9f5f1;
}

.school-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  max-height: 230px;
  overflow: auto;
  padding-right: 4px;
}

.school-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  margin-top: 18px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  padding: 13px 16px;
}

.secondary-button {
  background: #21364f;
  color: #fff;
  padding: 11px 14px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #eef4f9;
  color: var(--ink);
}

.sidebar .icon-button {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.compact-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  margin-bottom: 16px;
}

.student-form {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

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

.list-row,
.lesson-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.list-row strong,
.lesson-card strong {
  display: block;
  margin-bottom: 4px;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef4f9;
  color: #263548;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.lesson-card {
  display: grid;
  gap: 14px;
  border-top: 4px solid var(--accent);
}

.lesson-card button {
  width: max-content;
}

.toast {
  border-radius: 8px;
  border: 1px solid #bcd9cd;
  background: #edf8f3;
  color: #1f654f;
  padding: 12px 14px;
}

.toast.error {
  border-color: #efc6ce;
  background: #fff0f2;
  color: var(--danger);
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .section-heading,
  .option-header,
  .list-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .study-visual {
    min-height: 150px;
  }
}
