.schedule-panel { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--panel-shadow); --person-column: 240px; --building-column: 70px; --grade-column: 70px; --teacher-column: 160px; }
.register-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 0 0 18px; }
.register-title h2 { margin: 0 0 5px; font-size: 19px; font-weight: 600; }
.meal-key { margin: 0; color: var(--muted); font-size: 12px; }
.section-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.section-actions button { min-height: 40px; padding: 9px 14px; font-size: 12px; }
.week-navigation { padding: 18px 0; border-top: 1px solid var(--line); text-align: center; }
.week-buttons { display: inline-flex; max-width: 100%; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--accent-soft); }
.week-buttons button { min-width: 110px; min-height: 38px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.week-buttons button:hover:not(:disabled) { border-color: var(--rule); color: var(--accent); }
.week-period { margin: 10px 0 0; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.week-notice { margin: 7px auto 0; max-width: 700px; font-size: 12px; }
.register-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--selected-bg); }
.register-summary h3 { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.meal-stats { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px; margin: 0; }
.meal-stats > div { display: flex; align-items: baseline; gap: 6px; }
.meal-stats dt { color: #666; font-size: 12px; }
.meal-stats dd { margin: 0; color: var(--accent); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.filter-tools { border-bottom: 0; }
#filters input[type="hidden"] { display: none; }
.filter-tools > summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 13px; }
.filters label:has(select[name="day"]) { width: 125px; }
.filters label:has(select[name="meal"]) { width: 140px; }
.fixed-filter { display: grid; gap: 5px; min-width: 55px; padding-bottom: 8px; font-size: 11px; }
.fixed-filter span { color: var(--muted); }
.fixed-filter strong { font-weight: 400; font-size: 12px; }
.schedule-help { margin-top: 17px; max-width: 800px; font-size: 12px; }
.schedule-help > summary { cursor: pointer; min-height: 32px; color: #555; }
.schedule-explanation { margin: 8px 0 0; line-height: 1.6; font-size: 12px; }
.schedule-explanation a { text-decoration: underline; text-underline-offset: 2px; }
.template-protection-note { margin: 0; padding: 9px 0; color: #666; font-size: 12px; }
.schedule-scroll { position: relative; margin-top: 4px; max-height: 66vh; border: 1px solid var(--line); border-radius: 12px; }
.schedule-table { border-spacing: 0; table-layout: fixed; min-width: calc(var(--person-column) + 430px); }
.schedule-table[data-grouped="true"] { min-width: calc(var(--person-column) + var(--building-column) + var(--grade-column) + var(--teacher-column) + 430px); }
.schedule-table[data-managed="true"] { min-width: calc(var(--person-column) + var(--building-column) + var(--grade-column) + var(--teacher-column) + 580px); }
.person-column { width: var(--person-column); }
.building-column { width: var(--building-column); }
.grade-column { width: var(--grade-column); }
.teacher-column { width: var(--teacher-column); }
.actions-column { width: 150px; }
.name-sort { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 30px; padding: 0; border: 0; background: transparent; color: inherit; font-size: 12px; text-align: left; }
.name-sort:hover:not(:disabled) { color: var(--accent); }
#name-sort-arrow { font-size: 17px; }
.schedule-table th { position: sticky; top: 0; z-index: 2; height: 55px; padding: 10px; border-bottom: 1px solid var(--line); background: var(--header-bg); color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.schedule-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.schedule-table .student-name { position: sticky; left: 0; z-index: 1; min-width: 185px; max-width: 260px; border-right: 1px solid #ddd; background: #fff; white-space: normal; line-height: 1.35; }
.schedule-table th.student-name { z-index: 3; background: #f3f3f3; }
.student-full-name { display: block; font-size: 14px; font-weight: 500; }
.schedule-table .student-building, .schedule-table .student-grade { font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.schedule-table .student-teacher { max-width: 170px; color: var(--muted); white-space: normal; font-size: 12px; }
.schedule-table .student-actions { width: 150px; white-space: nowrap; }
.schedule-table .student-actions .secondary { min-height: 30px; margin: 0 4px 0 0; padding: 5px 7px; font-size: 11px; }
.schedule-table th[data-day] { text-align: center; }
.schedule-table abbr { text-decoration: none; }
.meal-cell { min-width: 86px; border-left: 1px solid #e6e6e6; text-align: center; vertical-align: middle; }
.meal-options { display: flex; align-items: center; justify-content: center; gap: 6px; }
.meal-toggle { display: flex; align-items: center; gap: 4px; padding: 3px 1px; min-height: 30px; cursor: pointer; font-size: 12px; font-weight: 400; }
.meal-toggle input { flex: 0 0 16px; width: 16px; height: 16px; min-height: 16px; accent-color: #222; }
.meal-toggle:has(input:disabled) { cursor: default; }
.meal-code { font-size: 13px; font-variant-numeric: tabular-nums; }
.meal-code[aria-label="Не питается"] { color: #888; }
.schedule-table .selected-day { background-color: #f5f5f5; }
.schedule-table th.selected-day { background: #e8e8e8; box-shadow: inset 0 2px #222; }
.schedule-table .date-label { display: block; margin-top: 2px; color: #777; font-size: 10px; font-weight: 400; }
.schedule-table .is-override { border-bottom-style: dashed; border-bottom-color: #555; }
.override-label, .cutoff-label { display: block; margin-top: 3px; color: #777; text-align: center; font-size: 9px; font-weight: 400; white-space: normal; line-height: 1.2; }
.schedule-table .is-dirty { background: #e7e7e7; box-shadow: inset 2px 0 #111; }
.week-copy { display: inline-block; margin: 3px 10px 0 0; min-height: 24px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #666; font-size: 10px; font-weight: 400; text-decoration: underline; text-underline-offset: 2px; }
.week-copy:hover:not(:disabled) { color: #111; }
.day-caption { display: none; }
#pending-changes { font-size: 12px; }
@media (min-width: 901px) {
  .filter-tools > summary { display: none; }
  #filters .person-search { flex: 0 0 var(--person-column); min-width: 0; width: var(--person-column); }
  #filters .building-filter { flex: 0 0 var(--building-column); min-width: 0; width: var(--building-column); }
  #filters .grade-filter { flex: 0 0 var(--grade-column); min-width: 0; width: var(--grade-column); }
  #filters .person-search, #filters .building-filter { margin-right: -9px; }
}
@media (max-width: 900px) {
  .schedule-panel { padding: 20px; }
  .section-actions button { min-height: 44px; }
  .week-buttons { display: flex; gap: 10px; }
  .week-buttons button { flex: 1; min-width: 0; min-height: 44px; font-size: 12px; }
  .register-summary { align-items: start; gap: 7px; }
  .register-summary h3 { width: 100%; font-size: 12px; }
  .meal-stats { gap: 6px 14px; }
  .meal-stats dt { font-size: 11px; }
  .meal-stats dd { font-size: 19px; }
  .filters label:has(select[name="day"]), .filters label:has(select[name="meal"]) { width: auto; }
}
@media (max-width: 600px) {
  .schedule-panel { padding: 16px; border-radius: 16px; }
  .register-toolbar { gap: 10px; padding-bottom: 10px; }
  .register-title { width: 100%; }
  .register-title h2 { font-size: 16px; }
  .section-actions { width: 100%; }
  .section-actions button { flex: 1; padding: 9px 7px; font-size: 11px; }
  .section-actions .template-lock { flex-basis: 100%; justify-content: start; }
  .week-navigation { padding: 16px 0; }
  .week-buttons { gap: 5px; }
  .week-buttons button { padding: 8px 4px; }
  .week-period { font-size: 12px; }
  .week-notice { text-align: left; font-size: 11px; }
  .template-protection-note { font-size: 11px; line-height: 1.35; }
  .schedule-scroll { max-height: none; overflow: visible; margin-top: 8px; border: 0; border-radius: 0; }
  .schedule-table, .schedule-table tbody { display: block; width: 100%; min-width: 0 !important; }
  .schedule-table colgroup { display: none; }
  .schedule-table thead, .schedule-table thead tr { display: block; }
  .schedule-table thead th:not(.student-name) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .schedule-table th.student-name { display: block; height: auto; padding: 0; background: transparent; border-bottom: 1px solid var(--line); }
  .name-sort { min-height: 44px; font-size: 12px; }
  .schedule-table .student-record { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
  .schedule-table .student-name { position: static; z-index: auto; grid-column: 1 / -1; width: auto; min-width: 0; max-width: none; padding: 14px 12px 6px; border: 0; font-size: 14px; }
  .student-full-name { font-weight: 600; }
  .schedule-table .student-building { grid-column: 1 / 2; }
  .schedule-table .student-grade { grid-column: 2 / 3; }
  .schedule-table .student-building, .schedule-table .student-grade { width: auto; padding: 0 0 10px 12px; border: 0; color: var(--muted); font-size: 11px; }
  .student-building::before { content: 'Корпус '; }
  .schedule-table .student-teacher { grid-column: 3 / -1; max-width: none; padding: 0 12px 10px 0; border: 0; text-align: right; font-size: 10px; }
  .schedule-table .meal-cell { min-width: 0; padding: 6px 3px 9px; border-top: 1px solid #ddd; border-bottom: 0; border-left: 1px solid #ddd; white-space: normal; }
  .schedule-table .meal-cell:last-of-type, .schedule-table .meal-cell[data-day="friday"] { border-right: 1px solid #ddd; }
  .day-caption { display: block; margin-bottom: 5px; color: #555; font-size: 11px; line-height: 1.35; }
  .day-caption .day-date { display: block; color: #777; font-size: 10px; }
  .meal-options { flex-direction: column; gap: 0; }
  .meal-toggle { justify-content: center; gap: 5px; width: 100%; min-height: 44px; padding: 8px 2px; font-size: 12px; }
  .meal-toggle input { flex-basis: 18px; width: 18px; height: 18px; min-height: 18px; }
  .meal-code { display: flex; align-items: center; justify-content: center; min-height: 38px; font-size: 14px; }
  .override-label, .cutoff-label { margin-top: 2px; font-size: 10px; }
  .week-copy { min-height: 44px; margin: 0 14px 0 0; font-size: 11px; }
  .schedule-table .student-actions { grid-column: 1 / -1; width: auto; padding: 10px 12px; border: 0; }
  .schedule-table .student-actions .secondary { min-height: 44px; padding: 9px 13px; font-size: 12px; }
  .schedule-table .student-actions:empty { display: none; }
  .schedule-table .empty-result { display: block; padding: 18px 0; }
  .schedule-table .empty-result td { display: block; padding: 0; border: 0; white-space: normal; }
  .schedule-help > summary { min-height: 44px; padding: 10px 0; }
  .schedule-explanation { font-size: 11px; }
}
@media (max-width: 360px) {
  .week-buttons { gap: 2px; padding: 3px; }
  .week-buttons button { padding: 8px 2px; font-size: 11px; }
  .register-summary { padding: 12px; }
}
