.school-year-contextual-layer {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 14px;
  background: color-mix(in srgb, var(--color-sidebar-bg, #0a2540) 28%, transparent);
  backdrop-filter: blur(5px);
}

.school-year-contextual-card {
  --workflow-strong: var(--color-sidebar-bg, #0a2540);
  --workflow-action: var(--primary, #1783e6);
  --workflow-soft: var(--primary-soft, #eaf4ff);
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
  color: var(--navy, #0a2540);
  border: 1px solid color-mix(in srgb, var(--workflow-strong) 28%, #d8e1eb);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(9, 30, 54, .28);
}

.school-year-contextual-card.loading,
.school-year-contextual-card.error {
  align-items: center;
  justify-content: center;
  min-height: 240px;
  gap: 16px;
  padding: 36px;
  text-align: center;
}

.school-year-contextual-card.loading .spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--workflow-soft);
  border-top-color: var(--workflow-action);
  border-radius: 50%;
  animation: school-year-spin .8s linear infinite;
}

@keyframes school-year-spin { to { transform: rotate(360deg); } }

.school-year-workflow-header,
.school-year-workflow-complete > header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  min-height: 104px;
  padding: 17px 28px;
  color: #fff;
  background: var(--workflow-strong);
}

.school-year-workflow-header > span,
.school-year-workflow-complete > header > svg {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

.school-year-workflow-header h2,
.school-year-workflow-complete > header h2 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.2;
}

.school-year-workflow-header p,
.school-year-workflow-complete > header p {
  margin: 5px 0 0;
  color: rgba(255,255,255,.84);
  font-size: 14px;
}

.school-year-workflow-header > button,
.school-year-workflow-complete > header > button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px;
  color: #fff;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.school-year-workflow-content {
  min-height: 0;
  padding: 18px 28px 16px;
  overflow: auto;
  background: color-mix(in srgb, var(--workflow-soft) 12%, #fff);
}

.school-year-workflow-stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 13px;
}

.school-year-workflow-stepper button {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0 5px;
  border: 0;
  color: #6b7d91;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.school-year-workflow-stepper button::before {
  content: "";
  position: absolute;
  top: 15px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: #d9e2ec;
  z-index: 0;
}

.school-year-workflow-stepper button:first-child::before { display: none; }
.school-year-workflow-stepper button.completed::before,
.school-year-workflow-stepper button.active::before { background: var(--workflow-action); }

.school-year-workflow-stepper button > span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 2px solid #c8d5e3;
  border-radius: 50%;
  color: #63758a;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.school-year-workflow-stepper button > span svg { width: 15px; height: 15px; }
.school-year-workflow-stepper button b { max-width: 118px; min-height: 30px; font-size: 11px; line-height: 1.25; }
.school-year-workflow-stepper button.active { color: var(--workflow-action); }
.school-year-workflow-stepper button.active > span,
.school-year-workflow-stepper button.completed > span { color: #fff; border-color: var(--workflow-action); background: var(--workflow-action); }
.school-year-workflow-stepper button:disabled { cursor: default; opacity: .64; }

.school-year-workflow-context {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
  border: 1px solid #d9e3ee;
  border-radius: 6px;
  background: #fff;
}

.school-year-workflow-context > span {
  min-width: 0;
  padding: 8px 12px;
  border-right: 1px solid #e2e9f1;
  font-size: 12px;
  font-weight: 700;
}

.school-year-workflow-context > span:last-child { border-right: 0; }
.school-year-workflow-context b { display: block; margin-bottom: 2px; color: #718197; font-size: 10px; font-weight: 700; }
.school-year-workflow-context .school-year-status { font-size: 10px; }

.school-year-workflow-intro {
  margin: 0 0 14px;
  color: #40566f;
  font-size: 12.5px;
  line-height: 1.5;
}

.school-year-workflow-grid,
.school-year-closure-grid {
  display: grid;
  grid-template-columns: minmax(285px, .72fr) minmax(0, 1.28fr);
  gap: 14px;
  align-items: start;
}

.school-year-workflow-grid > div { display: grid; gap: 12px; }

.school-year-workflow-panel {
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid #d8e2ed;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(22, 51, 82, .055);
}

.school-year-workflow-panel h3,
.school-year-workflow-panel h4 { margin: 0 0 11px; color: var(--navy, #0a2540); }
.school-year-workflow-panel h3 { font-size: 15px; }
.school-year-workflow-panel h4 { margin-top: 15px; font-size: 12.5px; }
.school-year-workflow-panel > p { margin: -3px 0 12px; color: #667a91; font-size: 12px; }

.school-year-workflow-checklist { display: grid; gap: 1px; }
.school-year-workflow-checklist label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-bottom: 1px solid #edf1f5;
  font-size: 12px;
  cursor: pointer;
}
.school-year-workflow-checklist label:last-child { border-bottom: 0; }
.school-year-workflow-checklist input,
.school-year-closure-checks input,
.school-year-workflow-mode input { accent-color: var(--workflow-action); }
.school-year-workflow-checklist i { color: #8395aa; }
.school-year-workflow-checklist i svg { width: 15px; height: 15px; }

.school-year-workflow-field { display: grid; gap: 5px; margin: 0 0 9px; color: #40566f; font-size: 11px; font-weight: 700; }
.school-year-workflow-field input,
.school-year-workflow-field select,
.school-year-contextual-card .school-year-select-control select {
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #cfdbe8;
  border-radius: 3px;
  color: var(--navy, #0a2540);
  background: #fff;
  font: inherit;
}

.school-year-destination { display: grid; gap: 5px; margin-top: 12px; color: #60748c; font-size: 11px; }
.school-year-destination strong { display: flex; align-items: center; gap: 7px; width: fit-content; padding: 8px 12px; color: var(--workflow-action); background: var(--workflow-soft); border-radius: 4px; font-size: 13px; }
.school-year-destination svg { width: 17px; height: 17px; }

.school-year-workflow-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.school-year-workflow-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.school-year-workflow-stats article {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  min-height: 72px;
  padding: 9px;
  border: 1px solid #dbe4ee;
  border-radius: 5px;
}
.school-year-workflow-stats article > span { grid-row: 1 / 3; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--workflow-action); background: var(--workflow-soft); }
.school-year-workflow-stats article > span.green { color: #0a9b58; background: #e2f8ee; }
.school-year-workflow-stats article > span.violet { color: #7b4ce2; background: #f1eafe; }
.school-year-workflow-stats article > span.orange { color: #d87a09; background: #fff1dc; }
.school-year-workflow-stats svg { width: 18px; height: 18px; }
.school-year-workflow-stats strong { font-size: 17px; }
.school-year-workflow-stats small { color: #62758d; font-size: 9.5px; line-height: 1.25; }

.school-year-workflow-rule,
.school-year-workflow-notice {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 9px;
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--workflow-action) 28%, #dce6f0);
  border-radius: 5px;
  color: color-mix(in srgb, var(--workflow-action) 68%, #132d49);
  background: color-mix(in srgb, var(--workflow-soft) 70%, #fff);
}
.school-year-workflow-rule > svg,
.school-year-workflow-notice > svg { width: 19px; height: 19px; }
.school-year-workflow-rule p,
.school-year-workflow-notice p { margin: 0; font-size: 10.5px; line-height: 1.45; }
.school-year-workflow-rule strong { display: block; margin-bottom: 2px; }
.school-year-workflow-notice { margin-top: 14px; }

.school-year-workflow-table { overflow-x: auto; border: 1px solid #dce4ed; border-radius: 5px; }
.school-year-workflow-table table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.school-year-workflow-table th,
.school-year-workflow-table td { padding: 7px 9px; border-bottom: 1px solid #e5ebf2; text-align: left; }
.school-year-workflow-table thead th { color: #fff; background: var(--workflow-strong); }
.school-year-workflow-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--workflow-soft) 44%, #fff); }
.warning-dot { color: #bd6a00; }
.success-dot { color: #078c50; }

.school-year-workflow-modes { display: grid; gap: 7px; }
.school-year-workflow-mode {
  display: grid;
  grid-template-columns: 18px 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 7px;
  padding: 8px;
  border: 1px solid #d9e2ec;
  border-radius: 5px;
  cursor: pointer;
}
.school-year-workflow-mode.selected { border-color: var(--workflow-action); background: var(--workflow-soft); }
.school-year-workflow-mode input { grid-row: 1 / 3; }
.school-year-workflow-mode > span { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; color: var(--workflow-action); background: #fff; border-radius: 50%; }
.school-year-workflow-mode svg { width: 17px; height: 17px; }
.school-year-workflow-mode b { font-size: 11px; }
.school-year-workflow-mode small { color: #667a91; font-size: 9.5px; }

.school-year-workflow-summary { margin: 13px 0 0; border: 1px solid #dce4ed; border-radius: 5px; }
.school-year-workflow-summary div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border-bottom: 1px solid #e5ebf2; font-size: 11px; }
.school-year-workflow-summary div:last-child { border-bottom: 0; }
.school-year-workflow-summary dt { color: #5a6f87; }
.school-year-workflow-summary dd { margin: 0; font-weight: 700; text-align: right; }

.school-year-calendar-preview { display: grid; gap: 9px; padding: 8px 0; }
.school-year-calendar-preview div { display: grid; grid-template-columns: 28px minmax(80px, 3fr) minmax(70px, 1fr); gap: 5px; align-items: center; font-size: 9.5px; }
.school-year-calendar-preview span,
.school-year-calendar-preview em { padding: 6px 8px; border-radius: 3px; font-style: normal; }
.school-year-calendar-preview span { background: color-mix(in srgb, var(--workflow-action) 20%, #fff); }
.school-year-calendar-preview em { color: #087342; background: #dcf5e9; }

.school-year-letterhead-preview { position: relative; display: grid; grid-template-columns: 55px minmax(0, 1fr); gap: 10px; min-height: 190px; padding: 18px; border: 1px solid #d9e2ec; background: #fff; overflow: hidden; }
.school-year-letterhead-preview img { width: 50px; height: 50px; object-fit: contain; }
.school-year-letterhead-preview strong { display: block; color: var(--workflow-action); font-size: 14px; }
.school-year-letterhead-preview small { color: #687b92; }
.school-year-letterhead-preview > span { position: absolute; top: 78px; right: 18px; left: 18px; height: 3px; background: var(--workflow-action); }
.school-year-letterhead-preview footer { position: absolute; right: 18px; bottom: 10px; left: 18px; padding-top: 6px; border-top: 2px solid var(--workflow-action); color: #63768c; font-size: 8px; }

.school-year-final-recap { display: grid; gap: 4px; }
.school-year-final-recap > div { display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid #e8edf3; }
.school-year-final-recap > div > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: #fff; background: #12a05c; }
.school-year-final-recap svg { width: 14px; height: 14px; }
.school-year-final-recap p { margin: 0; }
.school-year-final-recap strong,
.school-year-final-recap small { display: block; }
.school-year-final-recap strong { font-size: 11.5px; }
.school-year-final-recap small { margin-top: 2px; color: #667a91; font-size: 9.5px; }

.school-year-workflow-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 13px 28px;
  border-top: 1px solid #dce4ed;
  background: #fff;
}
.school-year-workflow-footer > div { display: flex; gap: 10px; }
.school-year-workflow-footer button { min-height: 36px; padding: 0 16px; font-size: 12px; }
.school-year-workflow-footer button svg { width: 16px; height: 16px; }

.school-year-workflow-complete { width: min(720px, calc(100vw - 28px)); }
.school-year-complete-body { display: grid; justify-items: center; padding: 40px 28px; text-align: center; }
.school-year-complete-body > span { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; color: #fff; background: #12a05c; }
.school-year-complete-body > span svg { width: 36px; height: 36px; }
.school-year-complete-body h3 { margin: 18px 0 7px; font-size: 22px; }
.school-year-complete-body p { max-width: 560px; margin: 0; color: #60748b; line-height: 1.55; }
.school-year-complete-actions { display: flex; gap: 10px; margin-top: 26px; }

.school-year-closure-grid { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); }
.school-year-closure-checks { display: grid; gap: 8px; }
.school-year-closure-checks label { display: grid; grid-template-columns: 19px minmax(0, 1fr); gap: 8px; align-items: start; cursor: pointer; }
.school-year-closure-checks label > span { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 1px 7px; }
.school-year-closure-checks svg { grid-row: 1 / 3; width: 18px; height: 18px; color: var(--workflow-action); }
.school-year-closure-checks b { font-size: 12px; }
.school-year-closure-checks small { color: #667a91; font-size: 10px; }
.school-year-closure-card ul { margin: 0; padding-left: 18px; color: #4e637b; font-size: 11.5px; line-height: 1.7; }

@media (max-width: 820px) {
  .school-year-contextual-layer { padding: 0; place-items: stretch; }
  .school-year-contextual-card { width: 100%; max-height: 100dvh; border: 0; border-radius: 0; }
  .school-year-workflow-header { grid-template-columns: 44px minmax(0, 1fr) 34px; min-height: 84px; padding: 13px 16px; }
  .school-year-workflow-header > span { width: 42px; height: 42px; padding: 10px; }
  .school-year-workflow-header h2 { font-size: 18px; }
  .school-year-workflow-header p { font-size: 12px; }
  .school-year-workflow-content { padding: 14px 14px 18px; }
  .school-year-workflow-stepper { display: flex; overflow-x: auto; padding-bottom: 6px; }
  .school-year-workflow-stepper button { flex: 0 0 105px; }
  .school-year-workflow-stepper button::before { display: none; }
  .school-year-workflow-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .school-year-workflow-context > span:nth-child(2) { border-right: 0; }
  .school-year-workflow-context > span:nth-child(-n+2) { border-bottom: 1px solid #e2e9f1; }
  .school-year-workflow-grid,
  .school-year-closure-grid { grid-template-columns: 1fr; }
  .school-year-workflow-stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .school-year-workflow-footer { padding: 10px 14px; }
  .school-year-workflow-footer > div { min-width: 0; }
  .school-year-workflow-footer button { padding: 0 10px; white-space: nowrap; }
  .school-year-workflow-footer .outline-action svg { display: none; }
}

@media (max-width: 520px) {
  .school-year-workflow-context { grid-template-columns: 1fr; }
  .school-year-workflow-context > span { border-right: 0; border-bottom: 1px solid #e2e9f1; }
  .school-year-workflow-stats,
  .school-year-workflow-stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .school-year-workflow-footer { align-items: stretch; }
  .school-year-workflow-footer > div { display: grid; grid-template-columns: 1fr 1fr; flex: 1; }
  .school-year-workflow-footer > button { width: 70px; padding: 0 8px; }
  .school-year-complete-actions { flex-direction: column; width: 100%; }
}
