:root {
  --ink: #2f3438;
  --muted: #68717d;
  --canvas: #f3f5f7;
  --surface: #ffffff;
  --surface-strong: #f8fafb;
  --line: #dde2e8;
  --brand: #3d9b6a;
  --brand-deep: #2d7653;
  --school-steel: #434444;
  --school-steel-soft: #5f666d;
  --school-green: #169b70;
  --school-green-soft: #e4f6ee;
  --utility: #9aa0a6;
  --berry: #2f8f64;
  --berry-soft: #e9f7ef;
  --moss: #51b87d;
  --moss-soft: #e9f8ef;
  --gold: #ffd74a;
  --gold-soft: #fff6cf;
  --danger: #b42318;
  --danger-soft: #fff0ed;
  --control-height: 36px;
  --control-radius: 7px;
  --panel-radius: 8px;
  --shadow: 0 12px 32px rgba(30, 41, 59, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Nunito, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.38;
}

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

button {
  cursor: pointer;
}

.app-shell {
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 16px 18px;
}

.is-hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: -3px 0 3px;
  color: var(--school-steel-soft);
  font-size: 1.42rem;
  font-weight: 850;
  line-height: 1.14;
}

.reset-password-panel {
  width: min(480px, 100%);
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.form-error {
  min-height: 1.25em;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.form-success {
  min-height: 1.25em;
  margin: 0;
  color: var(--brand-deep);
  font-weight: 800;
}

.site-header {
  overflow: visible;
  background: var(--surface);
  border: 1px solid rgba(221, 226, 232, 0.9);
  border-top: 0;
  border-radius: 0 0 var(--panel-radius) var(--panel-radius);
  box-shadow: var(--shadow);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.portfolio-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 9px 20px 10px;
  background: #ffffff;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.product-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  width: max-content;
  max-width: 100%;
  color: var(--school-steel);
  line-height: 1;
}

.product-logo-main {
  color: var(--school-steel);
  font-size: 2.28rem;
  font-weight: 950;
  line-height: 0.95;
}

.product-logo-main span {
  color: var(--school-green);
}

.product-logo-sub {
  position: relative;
  top: -1px;
  padding-left: 9px;
  border-left: 2px solid var(--school-green);
  color: var(--school-green);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero-copy p {
  margin: 2px 0 0;
  color: var(--school-steel-soft);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-logo {
  margin: 0;
}

.hero-logo .product-logo-main {
  font-size: 1.48rem;
}

.hero-logo .product-logo-sub {
  font-size: 0.68rem;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.auth-user {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 760;
  margin-right: 2px;
  white-space: nowrap;
}

.auth-user strong {
  color: var(--ink);
}

.settings-menu {
  position: relative;
}

.settings-menu-trigger svg:last-child {
  width: 15px;
  height: 15px;
  transition: transform 140ms ease;
}

.settings-menu.is-open .settings-menu-trigger {
  border-color: rgba(47, 143, 100, 0.28);
  background: var(--berry-soft);
  color: var(--berry);
}

.settings-menu.is-open .settings-menu-trigger svg:last-child {
  transform: rotate(180deg);
}

.settings-menu-popover {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 3px;
  width: min(260px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  padding: 6px;
  box-shadow: 0 18px 46px rgba(30, 41, 59, 0.18);
}

.settings-menu-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 7px 9px;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 760;
}

.settings-menu-item:hover,
.settings-menu-item:focus-visible {
  background: var(--surface-strong);
  outline: none;
}

.settings-menu-item svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.settings-menu-divider {
  height: 1px;
  margin: 4px 2px;
  background: var(--line);
}

.eyebrow,
.nav-title,
.field span {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
}

.control-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(270px, 1.25fr) minmax(160px, 0.7fr) minmax(340px, auto);
  gap: 8px;
  align-items: end;
  padding: 10px 20px 12px;
  border-top: 1px solid rgba(221, 226, 232, 0.78);
}

.teacher-details {
  border-top: 1px solid rgba(221, 226, 232, 0.78);
  padding: 0 20px;
}

.teacher-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  list-style: none;
}

.teacher-details summary::-webkit-details-marker {
  display: none;
}

.teacher-details summary svg {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
}

.teacher-details[open] summary svg {
  transform: rotate(180deg);
}

.teacher-details-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(130px, 0.6fr));
  gap: 10px;
  padding: 0 0 14px;
}

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

.teacher-details textarea {
  min-height: 86px;
  resize: vertical;
}

.teacher-details #teacherCv {
  min-height: 230px;
  line-height: 1.45;
  padding-block: 8px;
}

.field {
  display: grid;
  gap: 3px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.field.compact {
  min-width: 147px;
}

.field.is-disabled {
  opacity: 0.65;
}

.field input,
.field select,
.field textarea,
.search-field input,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--ink);
  padding: 6px 10px;
  outline: none;
  font-size: 0.94rem;
  line-height: 1.25;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.field input,
.field select,
.search-field input,
.form-grid input,
.form-grid select {
  height: var(--control-height);
}

.field select,
.form-grid select {
  padding-right: 28px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(61, 155, 106, 0.16);
}

.toolbar,
.modal-actions,
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  padding: 0 11px;
  font-size: 0.94rem;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.button svg,
.icon-button svg,
.search-field svg,
.category-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.button-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--berry);
  color: #ffffff;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1;
}

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

.button.primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.button.subtle,
.icon-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.subtle:hover,
.icon-button:hover {
  border-color: #b9c4d0;
  background: var(--surface-strong);
}

.button.danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.icon-button {
  width: var(--control-height);
  padding: 0;
}

.button:focus-visible,
.icon-button:focus-visible,
.category-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(61, 155, 106, 0.18);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.row-actions .icon-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
}

.workspace {
  padding: 12px 0 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.metric {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
  padding: 10px 12px;
}

.metric p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  color: var(--ink);
  font-size: 1.32rem;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.section-nav,
.portfolio-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
}

.section-nav {
  position: sticky;
  top: 14px;
  padding: 10px;
}

.nav-title {
  margin-bottom: 7px;
}

.category-list {
  display: grid;
  gap: 5px;
}

.category-button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  height: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--ink);
  padding: 6px 8px;
  text-align: left;
  font-weight: 720;
}

.category-button:hover {
  background: var(--surface-strong);
}

.category-button.is-active {
  border-color: rgba(47, 143, 100, 0.24);
  background: var(--berry-soft);
  color: var(--berry);
}

.category-label {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.category-count {
  min-width: 27px;
  height: 22px;
  border-radius: 999px;
  background: rgba(101, 112, 133, 0.12);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 760;
  line-height: 22px;
  text-align: center;
}

.category-button.is-active .category-count {
  background: rgba(47, 143, 100, 0.14);
  color: var(--berry);
}

.portfolio-panel {
  overflow: hidden;
  padding: 14px;
}

.panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.panel-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

.panel-head #addItemButton {
  margin-left: auto;
}

.panel-head h2,
.modal h2 {
  margin: 2px 0 0;
  font-size: 1.24rem;
  line-height: 1.2;
}

.category-note {
  max-width: 760px;
  margin: 6px 0 12px;
  color: var(--muted);
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.search-field {
  position: relative;
  display: block;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-field input {
  padding-left: 36px;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
}

.portfolio-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
}

.portfolio-table th,
.portfolio-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: middle;
  text-align: left;
}

.portfolio-table th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

.portfolio-table td {
  min-height: 40px;
  font-size: 0.93rem;
  overflow-wrap: anywhere;
}

.portfolio-table th:nth-last-child(2),
.portfolio-table td:nth-last-child(2) {
  width: 112px;
  min-width: 112px;
  white-space: nowrap;
}

.portfolio-table th:last-child,
.portfolio-table td:last-child {
  width: 104px;
  min-width: 104px;
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
}

.portfolio-table .row-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 4px;
}

.portfolio-table .row-actions .icon-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
}

.portfolio-table tr:last-child td {
  border-bottom: 0;
}

.empty-row td {
  height: 96px;
  color: var(--muted);
  text-align: center;
}

.cell-muted {
  color: var(--muted);
}

.clamped {
  max-width: 340px;
  white-space: pre-wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.8rem;
  font-weight: 760;
  white-space: nowrap;
}

.status-draft {
  background: var(--gold-soft);
  color: #75520b;
}

.status-review {
  background: #e9f1ff;
  color: #164b8a;
}

.status-approved {
  background: var(--moss-soft);
  color: #3e641c;
}

.modal {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  border-radius: var(--panel-radius);
  padding: 0;
  box-shadow: 0 22px 70px rgba(20, 30, 50, 0.25);
}

.modal::backdrop {
  background: rgba(17, 24, 39, 0.48);
}

.modal form,
.modal.confirm {
  padding: 18px;
}

.modal-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal .auth-note {
  margin-bottom: 12px;
}

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

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

.password-grid .current-password-field {
  grid-column: 1 / -1;
}

.form-grid textarea {
  min-height: 96px;
  resize: vertical;
}

.password-help {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface-strong);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.password-help strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.password-help ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.password-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  line-height: 1.25;
}

.password-rule::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid #aeb8c3;
  border-radius: 999px;
  background: var(--surface);
  flex: 0 0 auto;
}

.password-rule.is-ok {
  color: var(--brand-deep);
}

.password-rule.is-ok::before {
  border-color: var(--brand);
  background: var(--brand);
}

.modal-actions {
  margin-top: 14px;
}

.confirm-text {
  color: var(--muted);
}

.teachers-modal {
  width: min(1020px, calc(100vw - 32px));
  padding: 18px;
}

.categories-modal {
  width: min(920px, calc(100vw - 32px));
  padding: 18px;
}

.approvals-modal {
  width: min(1120px, calc(100vw - 32px));
  padding: 18px;
}

.settings-modal {
  width: min(940px, calc(100vw - 32px));
}

.school-years-modal {
  width: min(1040px, calc(100vw - 32px));
  padding: 18px;
}

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

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

.settings-grid textarea {
  min-height: 70px;
  resize: vertical;
}

.approvals-table-wrap {
  max-height: 520px;
}

.approvals-table {
  min-width: 900px;
}

.approvals-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: var(--control-radius);
  background: var(--surface-strong);
  color: var(--muted);
  padding: 18px;
  text-align: center;
  font-weight: 760;
}

.approval-actions .approve-action {
  color: var(--berry);
}

.approval-actions .return-action {
  color: #75520b;
}

.teacher-admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.teacher-admin-sidebar {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.teacher-admin-list {
  display: grid;
  gap: 7px;
  max-height: 470px;
  overflow: auto;
  padding-right: 4px;
}

.teacher-admin-row {
  display: grid;
  gap: 0;
  align-content: center;
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 10px 11px;
  text-align: left;
  line-height: 1.24;
}

.teacher-admin-row:hover {
  background: var(--surface-strong);
}

.teacher-admin-row.is-active {
  border-color: rgba(47, 143, 100, 0.28);
  background: var(--berry-soft);
}

.teacher-admin-row.is-inactive {
  color: var(--muted);
}

.teacher-admin-row strong,
.teacher-admin-row span,
.teacher-admin-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-admin-row span {
  display: block;
  margin-top: -1px;
  padding-bottom: 2px;
  line-height: 1.42;
}

.teacher-admin-row small {
  margin-top: -3px;
  line-height: 1.26;
}

.teacher-admin-row span,
.teacher-admin-row small,
.empty-admin-list {
  color: var(--muted);
}

.teacher-admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.teacher-admin-form .wide {
  grid-column: 1 / -1;
}

.school-year-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.school-year-card {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  padding: 10px;
}

.school-year-card.is-current {
  border-color: rgba(47, 143, 100, 0.28);
  background: var(--berry-soft);
}

.school-year-card strong {
  font-size: 1rem;
  line-height: 1.2;
}

.school-year-card span,
.school-year-card small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.32;
}

.school-year-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.school-year-form .wide {
  grid-column: 1 / -1;
}

.school-year-teacher-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.school-year-teacher-toolbar strong {
  font-size: 0.92rem;
}

.school-year-teacher-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.school-year-teacher-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  padding: 8px 9px;
}

.school-year-teacher-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--berry);
}

.school-year-teacher-row span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.school-year-teacher-row strong,
.school-year-teacher-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-year-teacher-row small {
  color: var(--muted);
  font-size: 0.8rem;
}

.form-section-title {
  margin: 4px 0 -2px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
}

.category-admin-list {
  display: grid;
  gap: 7px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.category-admin-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 8px;
}

.category-admin-row.is-hidden-category {
  background: var(--surface-strong);
  color: var(--muted);
}

.category-admin-row svg {
  width: 17px;
  height: 17px;
}

.category-admin-title {
  display: grid;
  gap: 1px;
}

.category-admin-title strong {
  color: var(--ink);
}

.category-admin-title small {
  color: var(--muted);
}

.category-admin-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.category-admin-actions .button {
  height: 32px;
  min-height: 32px;
  padding: 0 9px;
  font-size: 0.86rem;
}

.category-admin-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.45fr);
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.category-admin-form .wide,
.category-admin-form .checkbox-field,
.category-admin-form .modal-actions {
  grid-column: 1 / -1;
}

.category-admin-form textarea {
  min-height: 70px;
  resize: vertical;
}

.checkbox-field {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: var(--control-height);
  color: var(--ink);
  font-weight: 700;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--berry);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: 368px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  padding: 10px 14px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.print-portfolio {
  display: none;
}

@media (max-width: 1420px) {
  .portfolio-hero {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .auth-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 1240px) {
  .control-row {
    grid-template-columns: minmax(150px, 0.7fr) minmax(260px, 1.35fr) minmax(150px, 0.7fr);
  }

  .toolbar {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .section-nav {
    position: static;
  }

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

@media (max-width: 1120px) {
  .control-row,
  .summary-grid,
  .workspace-layout {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar,
  .section-nav,
  .portfolio-panel {
    grid-column: 1 / -1;
  }

  .section-nav {
    position: static;
  }

  .toolbar {
    justify-content: flex-start;
  }

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

@media (max-width: 760px) {
  .portfolio-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 14px 18px 13px;
  }

  .auth-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 0 12px 12px;
  }

  .site-header,
  .control-row,
  .teacher-details {
    max-width: calc(100vw - 24px);
  }

  .control-row,
  .teacher-details {
    padding: 12px;
  }

  .control-row,
  .summary-grid,
    .filter-row,
    .form-grid,
    .settings-grid,
    .teacher-admin-layout,
  .teacher-admin-form,
  .category-admin-form,
  .school-year-list,
  .school-year-form,
  .school-year-teacher-list,
  .teacher-details-grid,
  .category-list {
    grid-template-columns: 1fr;
  }

  .school-year-teacher-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-admin-row {
    grid-template-columns: 24px 1fr;
  }

  .category-admin-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .control-row > * {
    min-width: 0;
  }

  .portfolio-hero {
    padding: 12px 16px;
  }

  .toolbar,
  .auth-actions {
    justify-content: flex-start;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-head #addItemButton {
    margin-left: 0;
    width: 100%;
  }

  .toast {
    right: 12px;
    left: 12px;
    max-width: none;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .app-shell,
  .toast,
  .modal {
    display: none !important;
  }

  .print-portfolio {
    display: block;
    padding: 22px;
    color: #111827;
    font-family: "Segoe UI", Arial, sans-serif;
  }

  .print-portfolio h1 {
    margin: 0 0 4px;
    font-size: 24px;
  }

  .print-portfolio h2 {
    margin: 24px 0 8px;
    font-size: 18px;
    page-break-after: avoid;
  }

  .print-portfolio p {
    margin: 0 0 16px;
  }

  .print-portfolio table {
    width: 100%;
    margin-bottom: 18px;
    border-collapse: collapse;
    page-break-inside: avoid;
  }

  .print-portfolio th,
  .print-portfolio td {
    border: 1px solid #cfd6df;
    padding: 7px;
    vertical-align: top;
    text-align: left;
  }

  .print-portfolio th {
    background: #eef2f7;
  }
}
