:root {
  --ink: #17211f;
  --muted: #63716d;
  --line: #dce4df;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --nav: #1f312e;
  --nav-soft: #2c4641;
  --mint: #60b892;
  --teal: #287b79;
  --gold: #d49b42;
  --rose: #c96c68;
  --blue: #517fa4;
  --shadow: 0 18px 45px rgba(25, 45, 40, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(251, 252, 248, 0.94), rgba(251, 252, 248, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='120' viewBox='0 0 180 120'%3E%3Cg fill='none' stroke='%23d7e3dd' stroke-width='2' opacity='.55'%3E%3Cpath d='M20 24h44v58H20zM28 34h28M28 44h28M28 54h20M118 22l34 18-34 18-34-18zM94 47v20c16 10 32 10 48 0V47M86 92h76M92 84h64M22 100c18-14 36-14 54 0 18-14 36-14 54 0'/%3E%3C/g%3E%3C/svg%3E");
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  color: #f5fbf7;
  background: var(--nav);
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--mint);
  color: #0e2821;
  font-weight: 900;
}

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

.brand span {
  color: #b8ccc5;
  font-size: 0.9rem;
}

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

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

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: var(--nav-soft);
}

.sidebar-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.label,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-panel .label,
.sidebar-panel small {
  color: #b8ccc5;
}

.mini-progress {
  height: 8px;
  margin: 14px 0 8px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.mini-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--mint);
}

.main {
  min-width: 0;
  padding: 30px clamp(18px, 3vw, 42px) 48px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.topbar-actions,
.calendar-tools {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.select-label,
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

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

textarea {
  resize: vertical;
}

.button,
.text-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
}

.button {
  padding: 0 16px;
}

.button.primary {
  color: #ffffff;
  background: var(--teal);
}

.button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.65);
}

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

.text-button {
  padding: 0 10px;
  color: var(--teal);
  background: transparent;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 22px;
}

.gradebook-toolbar-panel {
  padding: 10px;
}

.gradebook-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-tab {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 850;
}

.tool-tab.active,
.tool-tab:hover {
  border-color: rgba(40, 123, 121, 0.38);
  color: #fff;
  background: var(--teal);
}

.gradebook-tab-panel {
  display: none;
}

.gradebook-tab-panel.active {
  display: block;
}

.workspace-grid.gradebook-tab-panel.active {
  display: grid;
}

.attendance-tab-panel {
  display: none;
}

.attendance-tab-panel.active {
  display: block;
}

.workspace-grid.attendance-tab-panel.active {
  display: grid;
}

.report-tab-panel {
  display: none;
}

.report-tab-panel.active {
  display: block;
}

.report-tab-panel[data-report-panel="feedback"].active {
  display: grid;
  gap: 22px;
}

.hub-tab-panel {
  display: none;
}

.hub-tab-panel.active {
  display: grid;
  gap: 22px;
}

.portfolio-tab-panel {
  display: none;
}

.portfolio-tab-panel.active {
  display: grid;
  gap: 22px;
}

.report-toolbar-wrap,
.import-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

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

.metric {
  padding: 18px;
}

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

.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 2rem;
}

.missing-metric {
  border-top: 4px solid var(--rose);
}

.dashboard-layout,
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #1f4d45;
  background: #e2f2eb;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.progress-list,
.lesson-stack,
.lesson-board,
.lesson-week-board,
.editor-list,
.report-rows,
.history-list,
.student-share-grid,
.subject-card-grid,
.student-calendar-list,
.project-list {
  display: grid;
  gap: 10px;
}

.progress-row {
  display: grid;
  gap: 8px;
}

.progress-meta,
.lesson-item,
.editor-row,
.report-row,
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--teal));
}

.lesson-item,
.history-item,
.report-row,
.hub-item,
.project-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lesson-item strong,
.history-item strong {
  display: block;
}

.lesson-item small,
.history-item small,
.report-row small {
  color: var(--muted);
}

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

.checkbox-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.weekday-picker legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.weekday-picker label {
  min-width: 58px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.weekday-picker input {
  width: 17px;
  min-height: 17px;
  margin: 0;
}

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

.mini-report-item {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.mini-report-item span,
.mini-report-item strong {
  display: block;
}

.mini-report-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-report-item strong {
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.focus-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.subject-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.subject-card {
  min-height: 104px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.subject-card:hover,
.subject-card.active {
  border-color: rgba(40, 123, 121, 0.5);
  background: #eef8f4;
}

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

.subject-card span {
  margin: 8px 0 3px;
  font-weight: 900;
}

.subject-card small {
  color: var(--muted);
}

.divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

.editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 38px;
  align-items: end;
}

.editor-row.scale-row {
  grid-template-columns: minmax(0, 1fr) 74px 74px 38px;
}

.editor-row.weight-row {
  grid-template-columns: minmax(0, 1fr) 92px 38px;
}

.editor-row.subject-row {
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.2fr) 110px 38px;
}

.school-year-switcher {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.inline-setup-form {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.subject-catalog {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.subject-catalog summary {
  color: var(--teal);
  font-weight: 850;
  cursor: pointer;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.catalog-grid fieldset {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.catalog-grid legend {
  padding: 0 5px;
  font-weight: 850;
}

.catalog-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.catalog-grid input {
  width: 17px;
  min-height: 17px;
  margin: 0;
}

.section-label {
  margin: 18px 0 10px;
  font-size: 0.88rem;
  text-transform: uppercase;
}

.document-settings {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.document-settings summary {
  color: var(--teal);
  font-weight: 850;
  cursor: pointer;
}

.document-settings .form-grid {
  margin-top: 14px;
}

.file-input {
  min-width: min(100%, 320px);
}

.file-input input {
  padding: 7px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

button.status-pill.graded,
.status-pill.graded {
  color: #19584a;
  background: #dff1e8;
}

button.status-pill.missing,
.status-pill.missing,
.warning-badge {
  color: #7b3d39;
  background: #f8d7d4;
}

.missing-card {
  border-left-color: var(--rose);
}

.icon-button {
  width: 38px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--rose);
  background: #fff;
  font-size: 1.1rem;
}

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

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

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.big-progress {
  display: flex;
  align-items: center;
  gap: 22px;
}

.big-progress svg {
  width: 150px;
  height: 150px;
  transform: rotate(-90deg);
}

.big-progress circle {
  fill: none;
  stroke-width: 12;
  stroke: #e9f0eb;
}

.big-progress #attendanceRing {
  stroke: var(--gold);
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  stroke-linecap: round;
}

.big-progress strong,
.big-progress span,
.big-progress small {
  display: block;
}

.big-progress strong {
  font-size: 2.5rem;
}

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

.year-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.year-month,
.off-day-list {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.year-month h3,
.off-day-list h3 {
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.year-weekdays,
.year-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.year-weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-align: center;
}

.year-day {
  min-height: 27px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #fff;
  font-size: 0.72rem;
}

.year-day.off {
  color: #7b3d39;
  background: #f8d7d4;
  font-weight: 900;
}

.year-day.planned {
  color: #19584a;
  background: #dff1e8;
  font-weight: 800;
}

.year-day.outside {
  color: #aab4b0;
  background: #edf1ee;
}

.year-day.blank {
  background: transparent;
}

.off-day-list {
  grid-column: 1 / -1;
}

.day-tile {
  min-height: 88px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.day-tile strong,
.day-tile span,
.day-tile small {
  display: block;
}

.day-tile span {
  margin: 8px 0 3px;
  font-weight: 800;
}

.day-Present,
.day-Field,
.day-Co-op {
  border-color: rgba(96, 184, 146, 0.5);
  background: #eef9f3;
}

.day-Half {
  border-color: rgba(212, 155, 66, 0.55);
  background: #fff7e8;
}

.day-Absent,
.day-Sick,
.day-Holiday,
.day-Vacation,
.day-Excused {
  border-color: rgba(201, 108, 104, 0.5);
  background: #fff0ef;
}

.lesson-board {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.soft-text {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.planner-tools {
  align-items: start;
}

.planner-panel {
  overflow: hidden;
}

.planner-head {
  align-items: flex-start;
}

.schedule-grid {
  --hour-height: 72px;
  display: grid;
  grid-template-columns: 76px repeat(7, minmax(142px, 1fr));
  min-width: 1120px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.schedule-corner,
.schedule-day-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 54px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #f8faf7;
}

.schedule-corner {
  left: 0;
  z-index: 4;
}

.schedule-day-head strong,
.schedule-day-head span {
  display: block;
}

.schedule-day-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.schedule-time-column {
  position: sticky;
  left: 0;
  z-index: 2;
  grid-column: 1;
  background: #f8faf7;
}

.time-slot {
  height: var(--hour-height);
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.schedule-day {
  position: relative;
  min-height: calc(var(--hour-height) * 8);
  border-right: 1px solid var(--line);
  background:
    repeating-linear-gradient(
      to bottom,
      #ffffff 0,
      #ffffff calc(var(--hour-height) - 1px),
      #edf1ee calc(var(--hour-height) - 1px),
      #edf1ee var(--hour-height)
    );
}

.schedule-day:last-child {
  border-right: 0;
}

.schedule-block {
  position: absolute;
  left: 7px;
  right: 7px;
  top: var(--top);
  min-height: 42px;
  height: var(--height);
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 8px;
  color: #10201d;
  background: var(--block-color);
  box-shadow: 0 8px 18px rgba(23, 33, 31, 0.12);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.schedule-block:focus-visible {
  outline: 3px solid #17211f;
  outline-offset: 2px;
}

.schedule-block strong,
.schedule-block span,
.schedule-block small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-block strong {
  font-size: 0.84rem;
  white-space: nowrap;
}

.schedule-block span,
.schedule-block small {
  font-size: 0.72rem;
  line-height: 1.18;
}

.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.task-checklist {
  display: grid;
  gap: 10px;
}

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

.record-card {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.record-card span,
.record-card small {
  margin-top: 4px;
  color: var(--muted);
}

.record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.record-actions a.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.compact-records {
  margin-top: 18px;
}

.compact-form {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.task-row {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--task-color);
  border-radius: 8px;
  background: #fff;
}

.task-row label {
  display: flex;
  align-items: center;
  gap: 11px;
}

.task-row input {
  width: 20px;
  min-height: 20px;
  margin: 0;
}

.task-row strong,
.task-row small,
.setting-message strong,
.setting-message span {
  display: block;
}

.task-row small,
.setting-message span {
  color: var(--muted);
}

.task-ready {
  color: #7a5313;
  background: #fff2cf;
}

.task-graded {
  color: #19584a;
  background: #dff1e8;
}

.task-assigned {
  color: #315a78;
  background: #e5f0f8;
}

.setting-message:not(:empty) {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.schedule-action {
  min-height: 24px;
  padding: 0 6px;
  border: 1px solid rgba(23, 33, 31, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
  color: #10201d;
  font-size: 0.68rem;
  font-weight: 900;
}

.lesson-week-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.lesson-week-board {
  grid-template-columns: repeat(7, minmax(130px, 1fr));
}

.lesson-day {
  min-height: 220px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.lesson-day h3 {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.lesson-chip {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
  padding: 9px;
  border-radius: 8px;
  background: #fff;
  border-left: 5px solid var(--teal);
}

.lesson-chip strong,
.lesson-chip span,
.lesson-chip small {
  display: block;
}

.lesson-chip span,
.lesson-chip small {
  color: var(--muted);
  font-size: 0.76rem;
}

.student-share {
  display: none;
}

.student-share.visible {
  display: block;
}

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

.share-day {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.share-day h3 {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.share-task {
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: #fff;
  border-left: 5px solid var(--blue);
}

.share-task strong,
.share-task span,
.share-task small {
  display: block;
}

.share-task span,
.share-task small {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.hub-day {
  min-height: 170px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.hub-day h3 {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.hub-day h3 span {
  color: var(--muted);
  font-weight: 700;
}

.hub-item {
  margin-bottom: 8px;
  border-left: 5px solid var(--blue);
}

.hub-item.project {
  border-left-color: var(--rose);
}

.hub-item strong,
.hub-item span,
.hub-item small,
.project-card strong,
.project-card span,
.project-card small {
  display: block;
}

.hub-item span,
.hub-item small,
.project-card span,
.project-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 5px solid var(--rose);
}

.subject-column {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.subject-column h3 {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.report-sheet {
  background: #fff;
}

.formal-report {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 46px);
}

.formal-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.formal-table {
  min-width: 680px;
  border: 1px solid var(--line);
}

.formal-table th {
  color: #fff;
  background: var(--nav);
}

.formal-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.official-identity {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.official-identity > div {
  min-height: 68px;
  padding: 11px;
  background: #fff;
}

.official-identity span,
.official-identity strong {
  display: block;
}

.official-identity span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.attendance-matrix {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin: 18px 0;
}

.attendance-matrix > strong {
  padding: 10px;
  color: #fff;
  background: var(--gold);
}

.attendance-matrix table {
  min-width: 0;
  font-size: 0.78rem;
}

.attendance-matrix th,
.attendance-matrix td {
  padding: 6px 8px;
  border: 1px solid var(--line);
}

.report-card-table th:not(:first-child),
.report-card-table td:not(:first-child) {
  width: 8%;
  text-align: center;
}

.report-card-table .semester-cell {
  background: #eef3ef;
}

.report-card-table .final-cell {
  background: #fff2cf;
}

.document-note {
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  color: var(--muted);
  background: #fff9ea;
  font-size: 0.78rem;
}

.feedback-rating-editor {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.feedback-editor-head,
.feedback-editor-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(4, 72px) 42px;
  align-items: center;
  gap: 8px;
}

.feedback-editor-head {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  text-transform: uppercase;
}

.feedback-editor-head strong:first-child {
  text-align: left;
}

.feedback-editor-row {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.skills-table th:not(:first-child),
.skills-table td:not(:first-child) {
  width: 10%;
  text-align: center;
}

.skill-subject-row th {
  color: var(--ink);
  background: #f5d58d;
}

.mastery-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8faf7;
  font-size: 0.8rem;
}

.feedback-comments {
  min-height: 120px;
  padding: 14px;
  border: 1px solid var(--line);
}

.feedback-comments p {
  white-space: pre-wrap;
}

.transcript-summary {
  margin-top: 18px;
  border: 1px solid var(--line);
}

.transcript-summary h3 {
  padding: 10px 12px;
  color: #fff;
  background: var(--nav);
  font-size: 0.85rem;
}

.transcript-summary > div {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.transcript-summary span {
  color: var(--muted);
}

.formal-table tfoot th {
  color: var(--ink);
  background: #eef3ef;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.report-summary-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8faf7;
}

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

.report-summary-grid span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.signature-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
  margin-top: 42px;
}

.signature-row span {
  padding-top: 8px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.78rem;
}

.certification {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.comparison-list {
  display: grid;
  gap: 12px;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(180px, 2fr) 70px;
  align-items: center;
  gap: 14px;
}

.comparison-row span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.comparison-bar {
  height: 15px;
  overflow: hidden;
  background: #eef3ef;
}

.comparison-bar span {
  height: 100%;
  background: var(--teal);
}

.gradebook-tab-panel .report-sheet {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-header h2 {
  margin-top: 2px;
}

.report-row strong {
  min-width: 78px;
  text-align: right;
}

.chart-wrap {
  margin-top: 16px;
  min-height: 220px;
}

canvas {
  width: 100%;
  max-width: 100%;
}

@media print {
  .sidebar,
  .topbar,
  .view:not(#reports) {
    display: none !important;
  }

  .app,
  .main,
  .workspace-grid {
    display: block;
    padding: 0;
  }

  .panel {
    break-inside: avoid;
    box-shadow: none;
  }

  body.print-gradebook .view:not(#gradebook),
  body.print-gradebook .subject-dashboard,
  body.print-gradebook .gradebook-toolbar-panel,
  body.print-gradebook [data-gradebook-panel]:not([data-gradebook-panel="reports"]) {
    display: none !important;
  }

  body.print-gradebook .view#gradebook,
  body.print-gradebook [data-gradebook-panel="reports"] {
    display: block !important;
  }

  body.print-attendance .view:not(#attendance),
  body.print-attendance .gradebook-toolbar-panel,
  body.print-attendance [data-attendance-panel]:not([data-attendance-panel="reports"]) {
    display: none !important;
  }

  body.print-attendance .view#attendance,
  body.print-attendance [data-attendance-panel="reports"] {
    display: block !important;
  }

  body.print-selected-report .view:not(#reports),
  body.print-selected-report #reports > .gradebook-toolbar-panel,
  body.print-selected-report #reports > .report-controls,
  body.print-selected-report .report-tab-panel:not(.active) {
    display: none !important;
  }

  body.print-selected-report .view#reports,
  body.print-selected-report .report-tab-panel.active {
    display: block !important;
  }

  body.print-selected-report .report-sheet {
    border: 0;
    box-shadow: none;
  }

  body.print-selected-report .formal-report {
    max-width: none;
    padding: 0;
  }

  body.print-selected-report .print-hidden {
    display: none !important;
  }

  body.print-portfolio .view:not(#portfolio),
  body.print-portfolio #portfolio > .gradebook-toolbar-panel,
  body.print-portfolio .portfolio-tab-panel:not(.active),
  body.print-portfolio form,
  body.print-portfolio button {
    display: none !important;
  }

  body.print-portfolio .view#portfolio,
  body.print-portfolio .portfolio-tab-panel.active {
    display: block !important;
  }

  body.print-selected-report .formal-table,
  body.print-selected-report .attendance-matrix table {
    min-width: 0;
    font-size: 9pt;
  }

  body.print-selected-report .formal-table th,
  body.print-selected-report .formal-table td {
    padding: 6px;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .summary-grid,
  .dashboard-layout,
  .workspace-grid,
  .focus-controls {
    grid-template-columns: 1fr;
  }

  .schedule-grid {
    min-width: 960px;
  }

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

@media (max-width: 640px) {
  .main {
    padding: 22px 14px 34px;
  }

  .topbar,
  .topbar-actions,
  .calendar-tools,
  .progress-meta,
  .lesson-item,
  .report-row {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .mini-report-grid {
    grid-template-columns: 1fr;
  }

  .report-summary-grid,
  .comparison-row,
  .signature-row,
  .official-identity,
  .transcript-identity,
  .attendance-matrix,
  .transcript-summary > div {
    grid-template-columns: 1fr;
  }

  .feedback-editor-head {
    display: none;
  }

  .feedback-editor-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .schedule-grid {
    grid-template-columns: 64px repeat(7, 128px);
    max-width: 100%;
  }

  .lesson-week-board {
    grid-template-columns: 1fr;
  }

  .editor-row,
  .editor-row.scale-row,
  .editor-row.weight-row,
  .editor-row.subject-row {
    grid-template-columns: 1fr;
  }

  .school-year-switcher,
  .task-row {
    grid-template-columns: 1fr;
  }

  .task-row {
    align-items: stretch;
    flex-direction: column;
  }

  .record-card,
  .record-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
