/* Hesas v3.24.2 — meetings, teacher ordering, and teacher-form alignment */
.setup-row-options{
  display:grid!important;
  grid-template-columns:minmax(190px,1.2fr) minmax(190px,1fr) minmax(210px,1.15fr)!important;
  gap:12px!important;
  align-items:end!important;
  width:100%;
}
.setup-row-options>.field,.setup-row-options>.check{min-width:0;margin:0!important;box-sizing:border-box}
.setup-row-options>.field select{width:100%;min-height:44px}
.setup-row-options>.check{
  min-height:44px;padding:10px 12px;border:1px solid #dbe3ee;border-radius:12px;
  background:#f8fafc;display:flex!important;align-items:center!important;gap:9px!important;
  line-height:1.45;
}
.setup-row-options>.check input{flex:0 0 auto}
.hesas-enhancement-trigger{white-space:nowrap;border:1px solid #cbd5e1!important;background:#fff!important;color:#1e293b!important}
.hesas-enhancement-trigger:hover{background:#f8fafc!important;border-color:#94a3b8!important}
.hesas-enhancement-trigger.meeting-trigger{box-shadow:inset 3px 0 0 #7c3aed}
.hesas-enhancement-trigger.order-trigger{box-shadow:inset 3px 0 0 #0f766e}
.hesas-enhancement-trigger.relief-trigger{box-shadow:inset 3px 0 0 #0284c7}
.hesas-enhancement-trigger.seventh-trigger{box-shadow:inset 3px 0 0 #db2777}
.hesas-context-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

.hesas-overlay{position:fixed;inset:0;z-index:99999;background:rgba(15,23,42,.5);display:flex;align-items:center;justify-content:center;padding:22px;direction:rtl}
.hesas-modal{width:min(1040px,96vw);max-height:92vh;overflow:auto;background:#fff;border-radius:20px;box-shadow:0 24px 70px rgba(15,23,42,.28);border:1px solid #e2e8f0}
.hesas-modal.hesas-order-modal{width:min(760px,96vw)}
.hesas-modal-head{position:sticky;top:0;z-index:4;background:#fff;border-bottom:1px solid #e2e8f0;padding:18px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.hesas-modal-head h2{margin:0;font-size:1.22rem;color:#0f172a}
.hesas-modal-head p{margin:4px 0 0;color:#64748b;font-size:.87rem}
.hesas-close{width:40px;height:40px;border-radius:10px;border:1px solid #e2e8f0;background:#fff;font-size:1.35rem;cursor:pointer}
.hesas-modal-body{padding:18px 20px 22px}
.hesas-meeting-layout{display:grid;grid-template-columns:minmax(320px,.88fr) minmax(390px,1.12fr);gap:18px;align-items:start}
.hesas-card{border:1px solid #e2e8f0;border-radius:16px;background:#fff;padding:16px}
.hesas-card h3{margin:0 0 12px;font-size:1rem;color:#0f172a}
.hesas-field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px;font-size:.86rem;color:#334155;font-weight:650}
.hesas-field select,.hesas-field input{width:100%;min-height:43px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;padding:8px 10px;font:inherit;color:#0f172a;box-sizing:border-box}
.hesas-field-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.hesas-check{display:flex;align-items:center;gap:8px;font-size:.88rem;color:#334155;margin:4px 0 14px}
.hesas-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin-top:12px}
.hesas-actions button,.hesas-row-actions button,.hesas-order-actions button{min-height:39px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;padding:7px 12px;cursor:pointer;font-weight:700;color:#334155}
.hesas-actions .primary,.hesas-order-actions .primary{background:#0f766e;color:#fff;border-color:#0f766e}
.hesas-actions .secondary{background:#f8fafc}
.hesas-list{display:flex;flex-direction:column;gap:10px}
.hesas-meeting-item{border:1px solid #e2e8f0;border-radius:14px;padding:12px 13px;display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;background:#fff}
.hesas-meeting-dot{width:11px;height:42px;border-radius:8px}
.hesas-meeting-item.department .hesas-meeting-dot{background:#7c3aed}
.hesas-meeting-item.heads_admin .hesas-meeting-dot{background:#d97706}
.hesas-meeting-item.supervisors_admin .hesas-meeting-dot{background:#0f766e}
.hesas-meeting-main b{display:block;color:#0f172a;margin-bottom:3px}
.hesas-meeting-main small{display:block;color:#64748b;line-height:1.6}
.hesas-conflict-note{color:#b91c1c!important;font-weight:700}
.hesas-inactive-note{color:#64748b!important;font-weight:700}
.hesas-row-actions{display:flex;gap:6px}
.hesas-row-actions .danger{color:#b91c1c;border-color:#fecaca;background:#fff7f7}
.hesas-empty{padding:24px 12px;text-align:center;color:#64748b;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc}
.hesas-help{font-size:.82rem;line-height:1.7;color:#64748b;background:#f8fafc;border-radius:10px;padding:9px 11px;margin-top:8px}
.hesas-toast{position:fixed;z-index:100001;bottom:24px;right:24px;max-width:min(440px,calc(100vw - 48px));padding:12px 15px;border-radius:12px;background:#0f172a;color:#fff;box-shadow:0 12px 35px rgba(15,23,42,.28);direction:rtl;font-weight:650}
.hesas-toast.error{background:#991b1b}
.hesas-toast.warn{background:#92400e}

.hesas-order-controls{display:grid;grid-template-columns:minmax(200px,1fr) auto;gap:10px;align-items:end;margin-bottom:14px}
.hesas-order-list{display:flex;flex-direction:column;gap:8px}
.hesas-order-row{display:grid;grid-template-columns:42px 1fr auto;gap:10px;align-items:center;border:1px solid #e2e8f0;border-radius:12px;padding:9px 10px;background:#fff}
.hesas-order-number{width:34px;height:34px;border-radius:9px;background:#f1f5f9;display:grid;place-items:center;font-weight:800;color:#475569}
.hesas-order-name b{display:block;color:#0f172a}.hesas-order-name small{color:#64748b}
.hesas-order-buttons{display:flex;gap:5px}.hesas-order-buttons button{width:35px;height:35px;padding:0;border:1px solid #cbd5e1;background:#fff;border-radius:9px;cursor:pointer;font-weight:800}.hesas-order-buttons button:disabled{opacity:.35;cursor:not-allowed}
.hesas-head-badge{display:inline-block;padding:2px 7px;border-radius:999px;background:#fef3c7;color:#92400e;font-size:.72rem;font-weight:800;margin-inline-start:6px}
.hesas-order-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:15px}

/* Teacher reliefs, long leave and master-table notes. */
.hesas-modal.hesas-relief-modal{width:min(1180px,97vw)}
.hesas-relief-layout{display:grid;grid-template-columns:minmax(420px,1.05fr) minmax(350px,.95fr);gap:18px;align-items:start}
.hesas-relief-assignments{display:flex;flex-direction:column;gap:9px;max-height:340px;overflow:auto;padding:4px}
.hesas-relief-assignment{display:grid;grid-template-columns:minmax(210px,1fr) minmax(190px,.8fr);align-items:center;gap:10px;border:1px solid #dbeafe;border-radius:12px;padding:10px;background:#f8fbff}
.hesas-relief-assignment .hesas-check{margin:0;align-items:flex-start}.hesas-relief-assignment .hesas-check span{display:flex;flex-direction:column;gap:2px}.hesas-relief-assignment small,.hesas-relief-item small,.hesas-return-row small{display:block;color:#64748b;font-weight:500}
.hesas-relief-assignment .hesas-field{margin:0}
.hesas-relief-item{border:1px solid #e2e8f0;border-radius:13px;padding:12px;display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff}
.hesas-relief-item>div{display:flex;flex-direction:column;align-items:flex-start;gap:5px}.hesas-relief-item button.danger{border:1px solid #fecaca;background:#fff7f7;color:#b91c1c;border-radius:9px;padding:8px 10px;font-weight:750;cursor:pointer;white-space:nowrap}
.hesas-relief-type{display:inline-flex;border-radius:999px;padding:3px 8px;background:#e0f2fe;color:#075985;font-size:.75rem;font-weight:800}
.hesas-relief-type.maternity{background:#fce7f3;color:#9d174d}.hesas-relief-type.sabbatical{background:#e0e7ff;color:#3730a3}.hesas-relief-type.medical_board{background:#fee2e2;color:#991b1b}.hesas-relief-type.childbirth{background:#fce7f3;color:#9d174d}.hesas-relief-type.long_leave,.hesas-relief-type.long_absence{background:#fef3c7;color:#92400e}.hesas-relief-type.reduced_start,.hesas-relief-type.reduced_end{background:#ecfccb;color:#3f6212}
.hesas-relief-note{display:inline-block;margin:2px 3px;padding:2px 6px;border-radius:7px;background:#e0f2fe;color:#075985;font-size:.67rem;font-weight:850;line-height:1.35;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.hesas-relief-note.maternity{background:#fce7f3;color:#9d174d}.hesas-relief-note.sabbatical{background:#e0e7ff;color:#3730a3}.hesas-relief-note.medical_board{background:#fee2e2;color:#991b1b}.hesas-relief-note.childbirth{background:#fce7f3;color:#9d174d}.hesas-relief-note.long_leave,.hesas-relief-note.long_absence{background:#fef3c7;color:#92400e}.hesas-relief-note.reduced_start,.hesas-relief-note.reduced_end{background:#ecfccb;color:#3f6212}
.hesas-cancel-card{max-width:880px;margin:auto}.hesas-return-list{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:13px 0;max-height:480px;overflow:auto}.hesas-return-row{display:flex;align-items:flex-start;gap:9px;border:1px solid #e2e8f0;border-radius:11px;padding:10px;background:#fff;cursor:pointer}.hesas-return-row b{display:block;color:#0f172a}

/* Dedicated seventh-period panel and live counters. */
.hesas-seventh-section{display:grid!important;grid-template-columns:minmax(230px,1fr) auto auto;gap:18px;align-items:center;border-color:#fbcfe8!important;background:linear-gradient(135deg,#fff 0%,#fdf2f8 100%)!important}
.hesas-seventh-section h3{margin:0 0 4px;color:#831843}.hesas-seventh-section p{margin:0;color:#64748b;font-size:.84rem}
.hesas-seventh-summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.hesas-seventh-summary span{background:#fff;border:1px solid #fbcfe8;border-radius:999px;padding:6px 9px;color:#475569;font-size:.78rem;white-space:nowrap}.hesas-seventh-summary b{color:#9d174d}.danger-text,.danger-text b{color:#b91c1c!important}
.hesas-modal.hesas-seventh-modal{width:min(960px,97vw)}.hesas-seventh-live-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}.hesas-seventh-live-head small{color:#64748b}.hesas-seventh-table-wrap{max-height:62vh;overflow:auto;border:1px solid #e2e8f0;border-radius:13px}.hesas-seventh-table-wrap table{width:100%;border-collapse:collapse}.hesas-seventh-table-wrap th{position:sticky;top:0;background:#f8fafc;z-index:2;color:#475569}.hesas-seventh-table-wrap th,.hesas-seventh-table-wrap td{padding:9px 10px;border-bottom:1px solid #e2e8f0;text-align:right}.hesas-seventh-table-wrap td>small{display:block;color:#64748b}.hesas-seventh-table-wrap select{min-width:175px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;padding:7px}.hesas-seventh-table-wrap tr.over-limit td{background:#fff1f2;color:#9f1239;font-weight:750}

/* Meeting shading: distinct, readable on screen and print. */
td.hesas-meeting-cell{position:relative!important;background-image:none!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}
td.hesas-meeting-department{background:#ede9fe!important;box-shadow:inset 0 0 0 2px #8b5cf6!important}
td.hesas-meeting-heads_admin{background:#fef3c7!important;box-shadow:inset 0 0 0 2px #f59e0b!important}
td.hesas-meeting-supervisors_admin{background:#ccfbf1!important;box-shadow:inset 0 0 0 2px #14b8a6!important}
td.hesas-meeting-conflict{box-shadow:inset 0 0 0 3px #dc2626!important}
.hesas-meeting-mark{display:block;font-size:.66rem;font-weight:800;line-height:1.15;color:#312e81;text-align:center;white-space:normal;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.hesas-meeting-heads_admin .hesas-meeting-mark{color:#78350f}.hesas-meeting-supervisors_admin .hesas-meeting-mark{color:#134e4a}
.hesas-meeting-conflict-badge{position:absolute;inset-inline-end:2px;top:2px;border-radius:999px;background:#dc2626;color:#fff;font-size:.56rem;font-weight:900;padding:1px 4px;z-index:3;line-height:1.35}
.hesas-meeting-legend{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;padding:5px 7px;margin:4px 0 0;font-size:.69rem;color:#475569;line-height:1.2}
.hesas-meeting-legend span{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.hesas-meeting-legend i{width:12px;height:9px;border-radius:3px;border:1px solid rgba(15,23,42,.18);display:inline-block}
.hesas-meeting-legend .department i{background:#ede9fe;border-color:#8b5cf6}.hesas-meeting-legend .heads_admin i{background:#fef3c7;border-color:#f59e0b}.hesas-meeting-legend .supervisors_admin i{background:#ccfbf1;border-color:#14b8a6}

@media(max-width:900px){.hesas-meeting-layout,.hesas-relief-layout{grid-template-columns:1fr}.setup-row-options{grid-template-columns:1fr 1fr!important}.hesas-modal{max-height:95vh}.hesas-seventh-section{grid-template-columns:1fr}.hesas-seventh-summary{justify-content:flex-start}}
@media(max-width:620px){.hesas-overlay{padding:8px}.hesas-modal-head,.hesas-modal-body{padding:14px}.hesas-field-grid,.setup-row-options,.hesas-relief-assignment,.hesas-return-list{grid-template-columns:1fr!important}.hesas-order-controls{grid-template-columns:1fr}.hesas-meeting-item{grid-template-columns:auto 1fr}.hesas-row-actions{grid-column:2}.hesas-modal{border-radius:14px;width:100%;max-height:97vh}.hesas-seventh-table-wrap{font-size:.8rem}.hesas-seventh-table-wrap th,.hesas-seventh-table-wrap td{padding:7px}.hesas-seventh-table-wrap select{min-width:130px}}
@media print{
  .hesas-overlay,.hesas-toast,.hesas-enhancement-trigger,.hesas-context-tools{display:none!important}
  .hesas-meeting-legend{display:flex!important;break-inside:avoid;page-break-inside:avoid}
  td.hesas-meeting-department{background:#ede9fe!important}td.hesas-meeting-heads_admin{background:#fef3c7!important}td.hesas-meeting-supervisors_admin{background:#ccfbf1!important}
}

/* Global teacher order: keep departments together in the master timetable. */
.hesas-modal.hesas-order-modal{width:min(860px,96vw)}
.hesas-order-groups{display:flex;flex-direction:column;gap:14px}
.hesas-order-group{border:1px solid #dbe3ee;border-radius:14px;background:#f8fafc;padding:10px}
.hesas-order-group-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 2px 9px}
.hesas-order-group-head>div:first-child{display:flex;align-items:baseline;gap:8px;min-width:0}
.hesas-order-group-head b{color:#0f172a;font-size:.95rem}
.hesas-order-group-head small{color:#64748b;font-size:.75rem;white-space:nowrap}
.hesas-order-group .hesas-order-list{gap:6px}
.hesas-order-group .hesas-order-row{background:#fff}
@media(max-width:620px){.hesas-order-group{padding:8px}.hesas-order-group-head>div:first-child{align-items:flex-start;flex-direction:column;gap:2px}}


/* Executable suggestions in the move/swap rejection dialog. */
.diagnosis-alternatives .diagnosis-run{display:inline-flex;align-items:center;gap:6px;color:#0f5132;background:#e8f6ee;border:1px solid #9fd5b8;border-radius:999px;padding:7px 12px;font-weight:750;cursor:pointer}
.diagnosis-alternatives .diagnosis-run:hover{background:#d3efdf}
.diagnosis-alternatives .diagnosis-run svg,.diagnosis-run-plan svg{width:16px;height:16px}
.diagnosis-plan .diagnosis-run-plan{margin-top:12px;display:inline-flex;align-items:center;gap:7px}

/* Quality report. */
.hesas-quality-trigger{white-space:nowrap;border:1px solid #cbd5e1;background:#fff;color:#1e293b;border-radius:10px;padding:7px 11px;font-weight:700;cursor:pointer;box-shadow:inset 3px 0 0 #16a34a}
.hesas-quality-trigger.link{display:block;margin-top:6px;border:0;box-shadow:none;background:none;padding:0;color:#0f766e;font-size:.78rem;text-decoration:underline}
.hesas-modal.hesas-quality-modal{width:min(980px,97vw)}
.hesas-quality{display:flex;flex-direction:column;gap:14px}
.hesas-quality-summary{display:grid;grid-template-columns:auto 1fr;gap:16px;align-items:center;border-radius:16px;padding:16px;border:1px solid #e2e8f0;background:#f8fafc}
.hesas-quality-summary h3{margin:0 0 4px}.hesas-quality-summary p{margin:0;color:#475569;line-height:1.7}
.hesas-quality-score{width:108px;height:108px;border-radius:50%;display:grid;place-content:center;text-align:center;background:#fff;border:6px solid #16a34a}
.hesas-quality-score b{font-size:1.7rem;color:#0f172a}.hesas-quality-score span{font-size:.8rem;color:#475569;font-weight:700}
.hesas-quality-summary.good .hesas-quality-score{border-color:#22c55e}.hesas-quality-summary.fair .hesas-quality-score{border-color:#f59e0b}.hesas-quality-summary.weak .hesas-quality-score{border-color:#dc2626}
.hesas-quality-hard{color:#991b1b!important;font-weight:750;margin-top:8px!important}
.hesas-quality-status{color:#475569;font-size:.85rem}
.hesas-quality-suggestions,.hesas-quality-advice{margin:0;padding-inline-start:22px;line-height:1.9;color:#334155}
.hesas-quality-issue-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.hesas-quality-issue-head small{color:#64748b;line-height:1.6}
.hesas-quality-share{text-align:center;min-width:70px}.hesas-quality-share b{display:block;font-size:1.25rem;color:#b45309}.hesas-quality-share small{color:#64748b}
.hesas-quality-bar{height:8px;border-radius:999px;background:#f1f5f9;overflow:hidden;margin:10px 0 6px}.hesas-quality-bar i{display:block;height:100%;background:linear-gradient(90deg,#f59e0b,#dc2626)}
.hesas-quality-meta{margin:0 0 8px;color:#64748b;font-size:.8rem}
.hesas-quality-issue details{margin-top:8px}.hesas-quality-issue summary{cursor:pointer;color:#0f766e;font-weight:700}
.hesas-quality-items{margin:8px 0 0;padding-inline-start:20px;max-height:260px;overflow:auto;line-height:1.8;color:#334155;font-size:.84rem}

/* Meeting slot suggestions. */
.hesas-suggest-card{margin-bottom:16px;background:linear-gradient(135deg,#fff 0%,#f5f3ff 100%);border-color:#ddd6fe}
.hesas-suggest-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;flex-wrap:wrap}.hesas-suggest-head h3{margin:0 0 4px}.hesas-suggest-head small{color:#64748b;line-height:1.6;display:block;max-width:560px}
.hesas-suggest-controls{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.hesas-suggest-controls label{display:flex;flex-direction:column;gap:4px;font-size:.8rem;color:#475569;font-weight:700}
.hesas-suggest-controls select{min-height:39px;border:1px solid #cbd5e1;border-radius:10px;padding:6px 8px;background:#fff}
.hesas-suggest-controls button,.hesas-suggest-slot button,.hesas-suggest-one button{min-height:39px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;padding:7px 12px;cursor:pointer;font-weight:700;color:#334155}
.hesas-suggest-controls .primary,.hesas-suggest-slot .primary{background:#6d28d9;border-color:#6d28d9;color:#fff}
.hesas-suggest-list{display:flex;flex-direction:column;gap:10px;margin-top:12px;max-height:460px;overflow:auto}
.hesas-suggest-row{border:1px solid #e9d5ff;border-radius:13px;background:#fff;padding:10px 12px}
.hesas-suggest-dep b{color:#0f172a}.hesas-suggest-dep small{display:block;color:#64748b;margin:2px 0 8px}
.hesas-suggest-slot{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;border-radius:10px;padding:8px 10px;margin-top:6px;border:1px solid #bbf7d0;background:#f0fdf4}
.hesas-suggest-slot.warn{border-color:#fde68a;background:#fffbeb}.hesas-suggest-slot small{display:block;color:#475569;line-height:1.6;margin-top:2px}
.hesas-suggest-row details summary{cursor:pointer;color:#6d28d9;font-weight:700;margin-top:6px}
.hesas-suggest-one{margin:-4px 0 12px}.hesas-suggest-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.hesas-suggest-chips button{border-radius:999px;padding:6px 10px;border:1px solid #bbf7d0;background:#f0fdf4;color:#14532d;font-size:.8rem;cursor:pointer}
.hesas-suggest-chips button.warn{border-color:#fde68a;background:#fffbeb;color:#78350f}.hesas-suggest-chips button.chosen{outline:2px solid #6d28d9}

/* Print header controls on the reports page. */
.hesas-print-head{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:8px 0}
.hesas-print-head label{display:flex;flex-direction:column;gap:3px;font-size:.78rem;color:#475569;font-weight:700}
.hesas-print-head input{min-height:36px;border:1px solid #cbd5e1;border-radius:9px;padding:5px 8px;min-width:140px}
.hesas-print-head small{color:#64748b;font-size:.75rem}
.hesas-print-extra{grid-column:1/-1;text-align:center;font-weight:900;font-size:13px}

/* A3 portrait with the whole week: every teacher on one page, like the school's printed sheet. */
.master-grid-a3-portrait-week{--pw-row-h:4.2mm;--pw-font:6.8pt;width:287mm;max-width:none;margin:0 auto}
.master-grid-a3-portrait-week .report-document-head{margin-bottom:2mm;gap:4mm}
.master-grid-a3-portrait-week .report-document-head h2{font-size:15pt}
.master-grid-a3-portrait-week .master-report-week-table{width:100%!important;min-width:0!important;table-layout:fixed}
.master-grid-a3-portrait-week .master-report-week-table th,.master-grid-a3-portrait-week .master-report-week-table td{height:var(--pw-row-h);padding:0 .2mm;font-size:var(--pw-font);line-height:1;border-color:#111;font-weight:700}
.master-grid-a3-portrait-week .master-report-week-table .mr-no{width:5mm}
.master-grid-a3-portrait-week .master-report-week-table .mr-department{width:6mm;padding:0}
.master-grid-a3-portrait-week .master-report-week-table .mr-department span{border-inline-start-width:0;padding:0;font-size:calc(var(--pw-font) + 1pt)}
.master-grid-a3-portrait-week .master-report-week-table .mr-teacher{width:31mm;padding-inline:1mm;overflow:hidden;text-overflow:ellipsis}
.master-grid-a3-portrait-week .master-report-week-table .mr-period{width:auto}
.master-grid-a3-portrait-week .master-report-week-table .mr-load{width:7mm}
.master-grid-a3-portrait-week .master-report-week-table .mr-notes{width:14mm;white-space:normal}
.master-grid-a3-portrait-week .master-report-week-table .mr-day-start,.master-grid-a3-portrait-week .master-report-week-table .mr-day{border-inline-start:2.6px solid #000}
.master-grid-a3-portrait-week .master-report-department tr:first-child td{border-top:2.6px solid #000}
.master-grid-a3-portrait-week td.mr-empty{color:transparent}
.master-grid-a3-portrait-week .hesas-meeting-mark{display:none}
.master-grid-a3-portrait-week .hesas-relief-note{font-size:calc(var(--pw-font) - .6pt);padding:0 1mm;margin:0}
.master-grid-a3-portrait-week .hesas-meeting-legend{font-size:7pt;padding:1mm 0 0}
/* A4 portrait, a day in every page: rows and text fill the sheet instead of sitting small at the top
   (hesas-work.js measures every day and sets the two values on it). */
/* The sheet is as wide as the paper, so the preview is the print: nothing is squeezed on the way to the printer. */
.master-grid-a4-portrait{--pd-row-h:7mm;--pd-font:10pt;width:200mm;max-width:none;margin:0 auto}
.master-grid-a4-portrait .master-report-day-table th,.master-grid-a4-portrait .master-report-day-table td{height:var(--pd-row-h);padding:.4mm .6mm;font-size:var(--pd-font);line-height:1.15}
.master-grid-a4-portrait .master-report-day-table .mr-department span{font-size:var(--pd-font)}
.master-grid-a4-portrait .master-report-day-table .mr-notes{white-space:normal;font-size:calc(var(--pd-font) - 1.5pt)}
.master-grid-a4-portrait .hesas-relief-note{font-size:calc(var(--pd-font) - 1.5pt)}
.master-grid-a4-portrait td.mr-empty{color:transparent}
/* A4 portrait: the five day tables of one department stacked on a single page. */
.master-grid-a4-portrait-week{--pw-row-h:5mm;--pw-font:7pt;width:202mm;max-width:none;margin:0 auto}
.master-grid-a4-portrait-week .master-report-day{break-after:auto!important;page-break-after:auto!important;break-inside:avoid;page-break-inside:avoid;margin:0 0 1.6mm}
/* One meeting legend for the page, under the last day. */
.master-grid-a4-portrait-week .master-report-day:not(:last-child) .hesas-meeting-legend{display:none!important}
.master-grid-a4-portrait-week .master-report-day-head{margin-bottom:.6mm;padding:0 2mm .4mm;gap:2mm;border-bottom-width:1px;box-sizing:border-box}
.master-grid-a4-portrait-week .master-report-day-head h2{font-size:9pt;padding:.5mm 8mm;border-radius:4px}
.master-grid-a4-portrait-week .master-report-day-head b{font-size:8pt}
.master-grid-a4-portrait-week .master-report-day-head small,.master-grid-a4-portrait-week .master-report-day-head>span{font-size:6.5pt}
/* The school, department and key are printed once, above the first day. */
.master-grid-a4-portrait-week .master-report-day+.master-report-day .master-report-day-head{grid-template-columns:1fr;justify-items:center}
.master-grid-a4-portrait-week .master-report-day+.master-report-day .master-report-day-head>div,.master-grid-a4-portrait-week .master-report-day+.master-report-day .master-report-day-head>span{display:none}
.master-grid-a4-portrait-week .master-report-day-table th,.master-grid-a4-portrait-week .master-report-day-table td{height:var(--pw-row-h);padding:0 .3mm;font-size:var(--pw-font);line-height:1;border-color:#111;font-weight:700}
.master-grid-a4-portrait-week .master-report-day-table .mr-department span{padding:0;border-inline-start-width:2px;font-size:var(--pw-font)}
.master-grid-a4-portrait-week .master-report-day-table .mr-notes{white-space:normal;font-size:calc(var(--pw-font) - .8pt)}
.master-grid-a4-portrait-week .master-report-department tr:first-child td{border-top:2px solid #000}
.master-grid-a4-portrait-week td.mr-empty{color:transparent}
.master-grid-a4-portrait-week .hesas-meeting-mark{display:none}
.master-grid-a4-portrait-week .hesas-relief-note{font-size:calc(var(--pw-font) - .8pt);padding:0 .5mm;margin:0}
.master-grid-a4-portrait-week .hesas-meeting-legend{font-size:6.5pt;padding:1mm 0 0}
.master-grid-a4-portrait-week .hesas-print-extra{font-size:9px}
.hs-stage-note{border:1px solid #bae6fd;background:#f0f9ff;color:#0c4a6e;border-radius:10px;padding:8px 12px;margin:8px 0;font-size:.86rem;line-height:1.6}
.hs-stage-box{border-color:#bae6fd}
/* «التحديث الذكي» sits next to «توليد ذكي» in a quieter teal. */
button.hs-smart-update{display:inline-flex;align-items:center;gap:6px;border:1px solid #0f766e!important;background:#f0fdfa!important;color:#0f766e!important;font-weight:800;border-radius:10px;padding:8px 14px;cursor:pointer;white-space:nowrap}
button.hs-smart-update:hover{background:#ccfbf1!important}
button.hs-smart-update svg{width:18px;height:18px}
.hs-joint-note{border:1px solid #fcd34d;background:#fffbeb;color:#78350f;border-radius:10px;padding:8px 12px;margin:8px 0;font-size:.86rem;line-height:1.6}
@media print{
  .hesas-quality-trigger,.hesas-print-head{display:none!important}
  .master-grid-a4-portrait-week{width:100%;break-inside:avoid;page-break-inside:avoid;break-after:page;page-break-after:always}
  .master-grid-a4-portrait-week:last-child{break-after:auto;page-break-after:auto}
  .master-grid-a4-portrait-week .master-report-day-table tr{break-inside:avoid;page-break-inside:avoid}
  .master-grid-a4-portrait-week td,.master-grid-a4-portrait-week th{print-color-adjust:exact;-webkit-print-color-adjust:exact}
  .master-grid-a4-portrait{width:100%}
  /* A day that needs more than one sheet still keeps whole rows and repeats its header; a department larger
     than what is left of the sheet continues on the next one instead of leaving it half empty. */
  .master-grid-a4-portrait .master-report-department{break-inside:auto;page-break-inside:auto}
  .master-grid-a4-portrait .master-report-day-table tr{break-inside:avoid;page-break-inside:avoid}
  .master-grid-a4-portrait .master-report-day-table thead{display:table-header-group}
  .master-grid-a4-portrait td,.master-grid-a4-portrait th{print-color-adjust:exact;-webkit-print-color-adjust:exact}
  .master-grid-a3-portrait-week{width:100%}
  .master-grid-a3-portrait-week .master-report-department{break-inside:auto}
  .master-grid-a3-portrait-week .master-report-week-table tr{break-inside:avoid;page-break-inside:avoid}
  .master-grid-a3-portrait-week td,.master-grid-a3-portrait-week th{print-color-adjust:exact;-webkit-print-color-adjust:exact}
  body.hesas-print-quality>*:not(.hesas-overlay){display:none!important}
  body.hesas-print-quality .hesas-overlay{display:block!important;position:static;background:none;padding:0}
  body.hesas-print-quality .hesas-modal{width:100%;max-height:none;overflow:visible;box-shadow:none;border:0}
  body.hesas-print-quality .hesas-close,body.hesas-print-quality .hesas-quality-actions{display:none!important}
  body.hesas-print-quality details>*{display:block}
}

/* Meeting cells in every printed master timetable: hatched in the meeting type's colour, with no text. */
.master-grid-report td.hesas-meeting-cell{box-shadow:none!important;color:transparent!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.master-grid-report td.hesas-meeting-cell.hesas-meeting-conflict{color:inherit!important;box-shadow:inset 0 0 0 1.5px #dc2626!important}
.master-grid-report td.hesas-meeting-department{background:repeating-linear-gradient(135deg,#fff 0 .55mm,#7c3aed .55mm .95mm)!important}
.master-grid-report td.hesas-meeting-heads_admin{background:repeating-linear-gradient(135deg,#fff 0 .55mm,#d97706 .55mm .95mm)!important}
.master-grid-report td.hesas-meeting-supervisors_admin{background:repeating-linear-gradient(135deg,#fff 0 .55mm,#0d9488 .55mm .95mm)!important}
.master-grid-report .hesas-meeting-legend i{width:16px;height:10px;border-radius:2px}
.master-grid-report .hesas-meeting-legend .department i{background:repeating-linear-gradient(135deg,#fff 0 2px,#7c3aed 2px 3.5px);border-color:#7c3aed}
.master-grid-report .hesas-meeting-legend .heads_admin i{background:repeating-linear-gradient(135deg,#fff 0 2px,#d97706 2px 3.5px);border-color:#d97706}
.master-grid-report .hesas-meeting-legend .supervisors_admin i{background:repeating-linear-gradient(135deg,#fff 0 2px,#0d9488 2px 3.5px);border-color:#0d9488}
@media print{
  .master-grid-report td.hesas-meeting-department{background:repeating-linear-gradient(135deg,#fff 0 .55mm,#7c3aed .55mm .95mm)!important}
  .master-grid-report td.hesas-meeting-heads_admin{background:repeating-linear-gradient(135deg,#fff 0 .55mm,#d97706 .55mm .95mm)!important}
  .master-grid-report td.hesas-meeting-supervisors_admin{background:repeating-linear-gradient(135deg,#fff 0 .55mm,#0d9488 .55mm .95mm)!important}
  .master-grid-report .hesas-meeting-legend i{print-color-adjust:exact;-webkit-print-color-adjust:exact}
}

/* Thicker lines between departments (rows) and between days (columns), on screen and in print. */
.master-report-week-table .mr-day,.master-report-week-table .mr-day-start{border-inline-start:2.6px solid #000!important}
.master-report-department tr:first-child td{border-top:2.6px solid #000!important}
.master-table .day-start,.master-table th.day-group{border-inline-start:3px solid #101c28!important}
.master-table .department-start td{border-top:3px solid #101c28!important}
.portrait-master-table .portrait-department-start td{border-top:3px solid #101c28!important}

/* Order modes and the timetable guide link. */
.hesas-order-modes{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}
.hesas-order-modes label{display:flex;flex-direction:column;gap:5px;font-size:.84rem;font-weight:700;color:#334155}
.hesas-order-modes select{min-height:41px;border:1px solid #cbd5e1;border-radius:10px;padding:6px 9px;background:#fff;font:inherit}
.hesas-order-group.entry-locked .hesas-order-buttons button,.hesas-order-groups.entry-locked>.hesas-order-group>.hesas-order-group-head .hesas-order-buttons button{opacity:.3;pointer-events:none}
.hesas-guide-link{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;border:1px solid #cbd5e1;background:#fff;color:#1e293b;border-radius:10px;padding:7px 11px;font-weight:700;text-decoration:none;box-shadow:inset 3px 0 0 #2563eb}
.hesas-guide-link:hover{background:#eff6ff}
.hesas-quality-result{border-radius:14px;padding:12px 14px;border:1px solid #bbf7d0;background:#f0fdf4;color:#14532d}
.hesas-quality-result.none{border-color:#fde68a;background:#fffbeb;color:#78350f}
.hesas-quality-result b{display:block;margin-bottom:3px}.hesas-quality-result p{margin:0;line-height:1.7}
@media(max-width:620px){.hesas-order-modes{grid-template-columns:1fr}}
@media print{.hesas-guide-link{display:none!important}}
/* repair-5: overview of teachers freed from specific periods */
.hesas-free-overview{display:grid;gap:8px;border-top:1px solid #e3eaef;padding-top:12px}
.hesas-free-overview h4{margin:0;font-size:13px;color:#24445a}
.hesas-free-overview table{width:100%}
.hesas-free-overview td small{display:block;color:#6b7f8c}
.hesas-free-overview tr.current td{background:#f1faf7}
.hesas-free-chips{display:flex;flex-wrap:wrap;gap:5px}
.hesas-free-chips span{background:#fff1f1;color:#a64141;border:1px solid #f1caca;border-radius:999px;padding:2px 8px;font-size:11px;white-space:nowrap}
.hesas-free-overview .row-actions{gap:6px}
.hesas-free-overview .row-actions button{padding:5px 10px;border-radius:7px;font-size:11px;background:#e8f1f7;color:#245f83;white-space:nowrap}
.hesas-free-overview .row-actions .danger-soft{background:#fff0f0;color:#b04444}
.viewer-mode .hesas-free-overview .danger-soft{display:none!important}

/* repair-6: one button style across injected tools and modals */
.hesas-enhancement-trigger,.hesas-quality-trigger:not(.link){display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:8px 14px!important;border-radius:10px!important;border:1px solid #d3dee7!important;background:#fff!important;color:#1f3b52!important;font-weight:700;font-size:13px;line-height:1.25;cursor:pointer;white-space:nowrap;box-shadow:0 1px 2px rgba(15,23,42,.06)!important;transition:background .15s,border-color .15s,box-shadow .15s}
.hesas-enhancement-trigger::before,.hesas-quality-trigger:not(.link)::before{content:"";width:9px;height:9px;border-radius:50%;background:var(--hs-accent,#1769aa);flex:none}
.hesas-enhancement-trigger.meeting-trigger{--hs-accent:#7c3aed}
.hesas-enhancement-trigger.order-trigger{--hs-accent:#0f766e}
.hesas-enhancement-trigger.relief-trigger{--hs-accent:#0284c7}
.hesas-enhancement-trigger.seventh-trigger{--hs-accent:#db2777}
.hesas-quality-trigger{--hs-accent:#16a34a}
.hesas-enhancement-trigger:hover,.hesas-quality-trigger:not(.link):hover{background:#f3f8fb!important;border-color:#b6c8d5!important;box-shadow:0 3px 10px rgba(15,23,42,.08)!important}
.hesas-enhancement-trigger:focus-visible,.hesas-quality-trigger:focus-visible,.hesas-ex-tool:focus-visible,.hesas-ex-list-toggle:focus-visible,.hesas-teacher-report-card button:focus-visible,.hesas-modal button:focus-visible{outline:2px solid #1769aa;outline-offset:2px}
.hesas-modal button{font-family:inherit}
.hesas-actions button,.hesas-row-actions button,.hesas-order-actions button,.hesas-suggest-controls button,.hesas-suggest-slot button,.hesas-suggest-one button{min-height:40px;border-radius:10px;padding:8px 14px;font-weight:700;transition:background .15s,border-color .15s,box-shadow .15s}
.hesas-actions button:hover:not(:disabled),.hesas-row-actions button:hover:not(:disabled),.hesas-order-actions button:hover:not(:disabled),.hesas-suggest-controls button:hover:not(:disabled),.hesas-suggest-slot button:hover:not(:disabled),.hesas-suggest-one button:hover:not(:disabled),.hesas-order-buttons button:hover:not(:disabled){background:#f3f8fb;border-color:#b6c8d5}
.hesas-actions .primary,.hesas-order-actions .primary,.hesas-report-toolbar .primary{background:#1769aa!important;border-color:#1769aa!important;color:#fff!important;box-shadow:0 5px 14px #1769aa26}
.hesas-actions .primary:hover:not(:disabled),.hesas-order-actions .primary:hover:not(:disabled),.hesas-report-toolbar .primary:hover:not(:disabled){background:#125a93!important;border-color:#125a93!important}
.hesas-relief-item button.danger{min-height:38px;transition:background .15s}
.hesas-relief-item button.danger:hover{background:#fee2e2}
.hesas-modal button:disabled{opacity:.55;cursor:wait}

/* Exceptions page */
.hesas-ex-tools{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;margin-bottom:24px}
.hesas-ex-tool{display:grid;gap:6px;align-content:start;text-align:start;padding:16px 18px;border:1px solid #d9e4ec;border-top:4px solid var(--hs-accent,#1769aa);border-radius:14px;background:#fff;color:#1f3b52;cursor:pointer;box-shadow:0 1px 3px rgba(15,23,42,.05);transition:box-shadow .15s,transform .15s}
.hesas-ex-tool b{font-size:15px}
.hesas-ex-tool small{color:#6b7f8c;font-size:12px;line-height:1.7;font-weight:500}
.hesas-ex-tool:hover:not(:disabled){box-shadow:0 8px 20px rgba(15,23,42,.1);transform:translateY(-1px)}
.hesas-ex-tool:disabled{cursor:not-allowed;opacity:.6}
.hesas-ex-tool.relief{--hs-accent:#0284c7}
.hesas-ex-tool.meeting{--hs-accent:#7c3aed}
.hesas-ex-tool.order{--hs-accent:#0f766e}
.viewer-mode .hesas-ex-tools{display:none}
.hesas-ex-head{align-items:center;gap:12px;flex-wrap:wrap}
.hesas-ex-list-toggle{display:inline-flex;align-items:center;gap:10px;min-height:40px;padding:8px 14px;border-radius:10px;border:1px solid #c9dbe8;background:#eef5fa;color:#1d5a86;font-weight:700;cursor:pointer;white-space:nowrap;transition:background .15s}
.hesas-ex-list-toggle span{min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:#1769aa;color:#fff;display:inline-grid;place-items:center;font-size:12px}
.hesas-ex-list-toggle:hover{background:#e2eef6}
.hesas-ex-list-toggle.open{background:#fff}
section.hesas-free-overview{margin-bottom:14px;padding:14px 16px;border-top:0}
.hesas-free-chips span{display:inline-flex;align-items:center}
.hesas-free-chips span button{margin-inline-start:6px;width:18px;height:18px;border-radius:50%;border:0;background:#f5d0d0;color:#9b2c2c;font-weight:800;line-height:18px;padding:0;cursor:pointer}
.hesas-free-chips span button:hover{background:#b91c1c;color:#fff}

/* Leave kept on the original teacher's row: hatched, display only */
td.hesas-kept-cell{color:transparent!important;background-color:#f8fafc!important;background-image:repeating-linear-gradient(135deg,rgba(71,85,105,.24) 0 2px,transparent 2px 7px)!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}
td.hesas-kept-cell .hesas-kept-lesson{color:#475569;font-weight:700;font-style:italic;background:rgba(255,255,255,.8);border-radius:4px;padding:0 3px}

/* Relief form and list */
.hesas-check{display:flex;gap:10px;align-items:flex-start;margin:0 0 12px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc;cursor:pointer}
.hesas-check input{margin-top:3px;width:17px;height:17px;accent-color:#1769aa;flex:none}
.hesas-check span{display:grid;gap:3px}
.hesas-check b{font-size:.86rem;color:#1e293b}
.hesas-check small{font-size:.78rem;color:#64748b;line-height:1.6;font-weight:500}
.hesas-help.warn{background:#fffbeb;color:#92400e;border:1px solid #fde68a;margin-bottom:12px}
.hesas-relief-options{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:6px}
.hesas-relief-options label{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;color:#334155;cursor:pointer}
.hesas-relief-options input{accent-color:#1769aa}
.hesas-relief-type.iddah,.hesas-relief-note.iddah{background:#f3e8ff;color:#6b21a8}
.hesas-relief-type.medical_start,.hesas-relief-type.medical_end,.hesas-relief-note.medical_start,.hesas-relief-note.medical_end{background:#ffedd5;color:#9a3412}

/* Teacher reports */
.hesas-teacher-reports{margin:18px 0;padding:16px 18px}
.hesas-teacher-reports-head h3{margin:0}
.hesas-teacher-reports-head p{margin:5px 0 12px;color:#718397;font-size:13px}
.hesas-teacher-reports-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px}
.hesas-teacher-report-card{display:flex;flex-direction:column;justify-content:space-between;gap:10px;padding:13px 14px;border:1px solid #e1e9ef;border-radius:12px;background:#f9fbfd}
.hesas-teacher-report-card b{display:block;color:#1f3b52;font-size:14px}
.hesas-teacher-report-card small{display:block;margin-top:4px;color:#6b7f8c;font-size:12px;line-height:1.6}
.hesas-teacher-report-card button{align-self:flex-start;min-height:36px;padding:7px 14px;border-radius:9px;border:1px solid #1769aa;background:#fff;color:#1769aa;font-weight:700;cursor:pointer;transition:background .15s,color .15s}
.hesas-teacher-report-card button:hover{background:#1769aa;color:#fff}
.hesas-modal.hesas-teacher-report-modal{width:min(1100px,97vw)}
.hesas-report-toolbar{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.hesas-report-toolbar .hesas-field{margin:0;min-width:240px}
.hesas-report-count{margin-inline-start:auto;color:#475569;font-weight:700;align-self:center}
.hesas-report-toolbar .primary{min-height:40px;padding:8px 20px;border-radius:10px;border:1px solid #1769aa;font-weight:700;cursor:pointer}
.hesas-report-sheet{border:1px solid #e2e8f0;border-radius:12px;padding:18px;background:#fff}
.hesas-report-sheet-head{text-align:center;margin-bottom:14px}
.hesas-report-sheet-head b{display:block;color:#334155}
.hesas-report-sheet-head h2{margin:6px 0;font-size:1.15rem;color:#0f172a}
.hesas-report-sheet-head small{color:#64748b}
.hesas-report-table{width:100%;border-collapse:collapse;font-size:.86rem}
.hesas-report-table th,.hesas-report-table td{border:1px solid #cbd5e1;padding:6px 8px;text-align:start;vertical-align:top}
.hesas-report-table th{background:#eef3f7;color:#1e293b;font-weight:800}
.hesas-report-table tbody tr:nth-child(even) td{background:#f8fafc}
.hesas-report-table td:first-child,.hesas-report-table th:first-child{width:36px;text-align:center}
.hesas-report-chip{display:inline-block;margin:1px;padding:1px 7px;border-radius:999px;background:#fff1f1;color:#a64141;border:1px solid #f1caca;font-size:.76rem;white-space:nowrap}
.hesas-report-group{margin:16px 0 6px;color:#1f3b52}
.hesas-report-group small{color:#64748b;font-weight:600}
.hesas-report-sign{display:flex;justify-content:flex-end;gap:10px;align-items:baseline;margin-top:22px;color:#334155}
@media print{
  body.hesas-print-teacher-report>*:not(.hesas-overlay){display:none!important}
  body.hesas-print-teacher-report .hesas-overlay{display:block!important;position:static;background:none;padding:0}
  body.hesas-print-teacher-report .hesas-modal{width:100%;max-height:none;overflow:visible;box-shadow:none;border:0}
  body.hesas-print-teacher-report .hesas-modal-head,body.hesas-print-teacher-report .hesas-report-toolbar{display:none!important}
  body.hesas-print-teacher-report .hesas-report-sheet{border:0;padding:0}
  body.hesas-print-teacher-report .hesas-report-table th,body.hesas-print-teacher-report .hesas-report-table td,body.hesas-print-teacher-report .hesas-report-chip{print-color-adjust:exact;-webkit-print-color-adjust:exact}
  .hesas-teacher-reports{display:none!important}
}

/* repair-6: buttons that had no padding or radius of their own (teachers, requirements, subjects, setup window, platform) */
.teaching-setup-actions button,.setup-paste button,.setup-footer button,.platform-submit,.platform-add-user button,.account-row-actions button,.platform-owner>button,.row-actions button:not(.icon){display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 16px;border-radius:10px;font-weight:700;line-height:1.3;border:1px solid #cfdde8;background:#fff;color:#153e63;cursor:pointer;transition:background .15s,border-color .15s,box-shadow .15s}
.teaching-setup-actions button.primary,.setup-paste button.primary,.setup-footer button.primary,.platform-submit,.platform-add-user button.primary{border-color:#1769aa;color:#fff}
.teaching-setup-actions button:not(.primary):hover:not(:disabled),.setup-footer button:not(.primary):hover:not(:disabled),.account-row-actions button:not(.danger):hover:not(:disabled),.platform-owner>button:hover,.row-actions button:not(.icon):hover:not(:disabled){background:#eef5fa;border-color:#b6c8d5}
.teaching-setup-actions button.primary:hover:not(:disabled),.setup-paste button.primary:hover:not(:disabled),.setup-footer button.primary:hover:not(:disabled),.platform-submit:hover:not(:disabled),.platform-add-user button.primary:hover:not(:disabled){background:#125a93!important;border-color:#125a93}
.teaching-setup-actions button svg,.setup-footer button svg,.row-actions button:not(.icon) svg,.setup-tabs button svg{width:17px;height:17px;flex:none}
.row-actions button:not(.icon){padding:6px 11px;min-height:34px;font-size:12px;background:#eef5fa;border-color:#d5e3ee;color:#1d5a86;white-space:nowrap}
.account-row-actions button{padding:7px 12px;font-size:12px}
.account-row-actions button.danger{color:#b42318;border-color:#f4c7c3;background:#fff5f4}
.account-row-actions button.danger:hover:not(:disabled){background:#fee4e2}
.platform-owner>button{background:#eef4f8;border-color:transparent}
.setup-tabs button{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border-radius:10px;font-weight:700;transition:background .15s}
.setup-tabs button:not(.active):hover{background:#e6edf3}
.modal-head>button:not(.icon){flex:none;display:inline-grid;place-items:center;width:38px;height:38px;padding:0;border-radius:10px;border:1px solid transparent;background:#f1f5f9;color:#334155;font-size:22px;line-height:1}
.modal-head>button:not(.icon):hover{background:#e2e8f0}

/* repair-6: the free-period count badge was sized like the 38px icon beside it */
.availability-current>span.badge{width:auto;height:auto;display:inline-flex;align-items:center;flex:none;padding:5px 10px;border-radius:99px;font-size:12px;font-weight:700}
.availability-current>span.badge.red{color:#c23d50;background:#ffebee}
.availability-current>span.badge.green{color:#10845b;background:#e6f8f0}

/* repair-10: notifications bell and list */
.header-actions{display:flex;align-items:center;gap:10px}
.hesas-notice-bell{position:relative;display:inline-grid;place-items:center;width:40px;height:40px;padding:0;border-radius:50%;border:1px solid #dbe3ec;background:#fff;color:#334155;cursor:pointer}
.hesas-notice-bell:hover{background:#f1f5f9}
.hesas-notice-bell.has-error{color:#c23d50;border-color:#f3c3cb;background:#fff7f7}
.hesas-notice-count{position:absolute;top:-5px;left:-5px;min-width:19px;height:19px;padding:0 5px;border-radius:99px;background:#2563eb;color:#fff;font-size:11px;font-weight:700;line-height:19px;text-align:center}
.hesas-notice-count[hidden]{display:none}
.hesas-notice-bell.has-error .hesas-notice-count{background:#dc2626}
.hesas-modal.hesas-notices-modal{width:min(780px,96vw)}
.hesas-notice-list{display:grid;gap:10px;padding:16px 20px}
.hesas-notice{border:1px solid #e2e8f0;border-inline-start:4px solid #94a3b8;border-radius:12px;padding:10px 14px;background:#fff}
.hesas-notice.error{border-inline-start-color:#dc2626;background:#fff8f8}
.hesas-notice.warning{border-inline-start-color:#d97706;background:#fffbeb}
.hesas-notice.success{border-inline-start-color:#16a34a}
.hesas-notice.info{border-inline-start-color:#2563eb}
.hesas-notice-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.hesas-notice-head b{font-size:.98rem;color:#0f172a}
.hesas-notice-level{font-size:11px;padding:2px 8px;border-radius:99px;background:#eff6ff;color:#1d4ed8}
.hesas-notice.error .hesas-notice-level{background:#fee2e2;color:#b91c1c}
.hesas-notice.success .hesas-notice-level{background:#dcfce7;color:#15803d}
.hesas-notice.warning .hesas-notice-level{background:#fef3c7;color:#b45309}
.hesas-notice-head time{margin-inline-start:auto;font-size:12px;color:#64748b}
.hesas-notice p{margin:6px 0 0;font-size:.9rem;line-height:1.8;color:#334155;white-space:pre-line}
.hesas-notice-actions{display:flex;justify-content:flex-end;padding:0 20px 16px}
@media print{.hesas-notice-bell{display:none!important}}
/* repair-12: readiness problems with one-click fixes, in the notifications list */
.hesas-readiness{margin:16px 20px 0;border-radius:12px;padding:12px 14px;border:1px solid #e2e8f0;background:#f8fafc;display:grid;gap:8px}
.hesas-readiness.ready{border-color:#bbf7d0;background:#f0fdf4;color:#166534}
.hesas-readiness.blocked{border-color:#fecaca;background:#fff}
.hesas-readiness-head{display:flex;align-items:center;gap:8px}.hesas-readiness-head b{color:#b91c1c;font-size:1rem}
.hesas-readiness-head button{margin-inline-start:auto;border:1px solid #cbd5e1;background:#fff;border-radius:8px;padding:4px 10px;cursor:pointer;font:inherit;font-size:12px}
.hesas-issue{border-top:1px dashed #fecaca;padding-top:8px}.hesas-issue>b{color:#0f172a}.hesas-issue>p{margin:4px 0 0;font-size:.88rem;line-height:1.8;color:#334155}
.hesas-fixes{display:grid;gap:6px;margin-top:8px}.hesas-fixes>span{font-size:12px;color:#475569;font-weight:700}.hesas-fixes.none{font-size:12px;color:#64748b}
.hesas-fix{display:grid;gap:2px;text-align:start;border:1px solid #bfdbfe;background:#eff6ff;border-radius:10px;padding:8px 12px;cursor:pointer;font:inherit;color:#1e3a8a}
.hesas-fix:hover:not(:disabled){background:#dbeafe}.hesas-fix:disabled{opacity:.6;cursor:wait}.hesas-fix small{color:#475569;font-size:12px;line-height:1.6}
.hesas-fix em{font-style:normal;font-size:11px;font-weight:700;color:#15803d}.hesas-fix.partial{border-color:#fde68a;background:#fffbeb;color:#78350f}.hesas-fix.partial em{color:#b45309}
.hesas-fix.busy{outline:2px solid #2563eb}.hesas-readiness-note{color:#475569}
.hesas-live-note{margin:10px 0 0;font-size:.85rem;line-height:1.7;color:#334155;max-width:520px}
.hesas-live-note.diagnosing{color:#92400e;background:#fffbeb;border:1px solid #fde68a;border-radius:10px;padding:8px 10px}
/* Smart class swaps */
button.hs-smart-update.hesas-swap-trigger{border-color:#7c3aed!important;background:#f5f3ff!important;color:#6d28d9!important}
button.hs-smart-update.hesas-swap-trigger:hover{background:#ede9fe!important}
.hesas-swaps-modal .hesas-swap-summary table{width:100%;border-collapse:collapse;font-size:.9rem}
.hesas-swaps-modal .hesas-swap-summary th,.hesas-swaps-modal .hesas-swap-summary td{padding:6px 8px;border-bottom:1px solid #e2e8f0;text-align:start}
.hesas-swaps-modal .hesas-swap-summary td.better{color:#15803d;font-weight:800}
.hesas-swap-note{color:#475569;font-size:.82rem;line-height:1.7;margin:8px 0 0}
.hesas-swap-list{display:grid;gap:8px;margin:12px 0}
.hesas-swap{display:flex;gap:10px;align-items:flex-start;border:1px solid #ddd6fe;background:#faf5ff;border-radius:10px;padding:10px 12px;cursor:pointer}
.hesas-swap input{margin-top:4px;width:18px;height:18px;flex:none}
.hesas-swap b{display:block;color:#1e293b}
.hesas-swap small{display:block;color:#64748b;margin-top:2px}
.hesas-swap ul{margin:6px 0 0;padding-inline-start:18px;color:#334155;font-size:.84rem;line-height:1.6}
.hesas-swap-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.hesas-swap-trial{margin-top:12px;border-inline-start:4px solid #7c3aed}
.hesas-swap-trial.done{border-inline-start-color:#15803d}
.hesas-swap-side{display:flex;gap:10px;flex-wrap:wrap;padding:4px 0}
.hesas-swap-side b{min-width:110px}
.hesas-swap-done{border-inline-start:4px solid #15803d}
@media (max-width:640px){.hesas-swap-side{display:block}.hesas-swaps-modal .hesas-swap-summary table{font-size:.8rem}}
@media print{.hesas-swap-trigger{display:none!important}}
/* Department timetables: one department per page; on landscape paper the table fills and is centred on the page. */
.department-report-stack>.master-grid-report{break-after:page;page-break-after:always}
.department-report-stack>.master-grid-report:last-child{break-after:auto;page-break-after:auto}
.hesas-dept-page{width:var(--dp-page-w);max-width:none;min-height:var(--dp-page-h);margin:0 auto;display:flex;flex-direction:column;justify-content:center;box-sizing:border-box}
.hesas-dept-page .report-document-head{margin-bottom:2.5mm}
.hesas-dept-page .report-document-head h2{font-size:calc(var(--dp-font) + 6pt)}
.hesas-dept-page .master-report-week-table{width:100%!important;min-width:0!important;table-layout:fixed}
.hesas-dept-page .master-report-week-table th,.hesas-dept-page .master-report-week-table td{height:var(--dp-row-h);padding:0;font-size:var(--dp-font);line-height:1.05;border-color:#111;font-weight:800;color:#000;white-space:nowrap}
.hesas-dept-page .master-report-week-table thead th{height:calc(var(--dp-font) * 1.8)}
.hesas-dept-page .master-report-week-table .mr-department{display:none}
.hesas-dept-page .master-report-week-table .mr-no{width:var(--dp-no-w)}
.hesas-dept-page .master-report-week-table .mr-teacher{width:var(--dp-teacher-w);padding-inline:1.2mm;font-size:calc(var(--dp-font) + .5pt);overflow:hidden;text-overflow:ellipsis}
.hesas-dept-page.hesas-dept-wrap .master-report-week-table td.mr-teacher{white-space:normal;line-height:1.15;text-overflow:clip}
.hesas-dept-page .master-report-week-table .mr-period{width:auto}
.hesas-dept-page .master-report-week-table .mr-load{width:var(--dp-load-w)}
.hesas-dept-page .master-report-week-table .mr-notes{width:var(--dp-notes-w);font-size:calc(var(--dp-font) - 1pt)}
.hesas-dept-page .master-report-department tr:first-child td{border-top:2px solid #000}
.hesas-dept-page td.mr-empty{color:transparent}
.hesas-dept-page .hesas-meeting-legend{padding-top:1.5mm;font-size:9pt}
@media print{
  .report-workspace:has(.hesas-dept-page){margin:0!important;padding:0!important}
  .department-report-stack:has(>.hesas-dept-page){display:block;gap:0}
  .department-report-stack>.hesas-dept-page{margin:0}
  .hesas-dept-page{width:100%;height:calc(var(--dp-page-h) - 2.5mm);min-height:0;overflow:hidden;break-inside:avoid;page-break-inside:avoid}
  .hesas-dept-page td,.hesas-dept-page th{print-color-adjust:exact;-webkit-print-color-adjust:exact}
}
[data-hesas-png]{display:inline-flex;align-items:center;gap:6px}
.hesas-names-control select{min-width:170px}
@media print{[data-hesas-png],[data-hesas-names]{display:none!important}}
.hesas-seventh-count{font-size:1.05em}
.hesas-seventh-over{color:#b91c1c;font-weight:700}
@media print{.hesas-report-sheet .hesas-report-group{break-after:avoid;page-break-after:avoid}.hesas-report-sheet table{break-inside:auto}.hesas-report-sheet tr{break-inside:avoid;page-break-inside:avoid}}
/* Extra seventh swap */
button.hs-smart-update.hesas-seventh-swap-trigger{border-color:#b45309!important;background:#fffbeb!important;color:#92400e!important}
button.hs-smart-update.hesas-seventh-swap-trigger:hover{background:#fef3c7!important}
.hesas-seventh-target h3 small{font-weight:600;color:#64748b}
.hesas-seventh-option{border-color:#fde68a;background:#fffdf5}
.hesas-seventh-option input{accent-color:#b45309}
/* Solutions centre */
button.hesas-solutions-bell{color:#b45309}
button.hesas-solutions-bell.has-solutions{color:#15803d}
button.hesas-solutions-bell.has-solutions .hesas-notice-count{background:#15803d}
.hesas-solutions-modal .hesas-solution{border-inline-start:4px solid #f59e0b}
.hesas-solutions-modal .hesas-solution.confirmed{border-inline-start-color:#15803d}
.hesas-solutions-modal .hesas-solution h3{margin:0 0 6px}
.hesas-solutions-modal .hesas-solution h3 small{color:#92400e;font-weight:600}
.hesas-solution-why,.hesas-solution-how,.hesas-solution-proof{margin:4px 0;color:#334155;font-size:.9rem;line-height:1.8}
.hesas-solution-proof{color:#15803d}
.hesas-solution-steps{margin:6px 0 0;padding-inline-start:18px;color:#1e293b;font-size:.88rem;line-height:1.8}
.hesas-solution-note{display:block;color:#64748b;margin-top:6px}
.hesas-solutions-cause{border-inline-start:4px solid #dc2626}
.hesas-solutions-cause.ok{border-inline-start-color:#15803d}
.hesas-solutions-cause p{white-space:pre-line;margin:4px 0;line-height:1.8}
.hesas-solutions-stale{border-inline-start:4px solid #b45309}
.hesas-solutions-progress{border-inline-start:4px solid #2563eb}
.hesas-solutions-attempts{margin:8px 0 0;padding-inline-start:18px;font-size:.85rem;line-height:1.8;color:#475569}
.hesas-solutions-attempts li.solved{color:#15803d;font-weight:700}
.hesas-fixes.solutions-link button{display:block;width:100%;text-align:start;border:1px solid #bbf7d0;background:#f0fdf4;border-radius:10px;padding:8px 10px;cursor:pointer}
.hesas-fixes.solutions-link button small{display:block;color:#15803d;margin-top:2px}
@media print{.hesas-solutions-bell{display:none!important}}
/* Seventh-period window: the reason for each limit, and one press to lift a block */
.hesas-seventh-scope{border:1px solid #e2e8f0;border-radius:10px;padding:10px 12px;margin-bottom:10px;background:#f8fafc}
.hesas-seventh-scope select{min-width:220px}
.hesas-seventh-reason{color:#475569;font-size:.82rem;line-height:1.6;max-width:260px}
.hesas-seventh-reason small{display:block;color:#b45309}
.hesas-seventh-actions{white-space:nowrap}
.hesas-seventh-actions button{border:1px solid #bbf7d0;background:#f0fdf4;color:#15803d;border-radius:8px;padding:4px 8px;font-size:.8rem;cursor:pointer;margin-inline-end:4px}
.hesas-seventh-actions button:hover{background:#dcfce7}
.hesas-seventh-ok{color:#94a3b8;font-size:.8rem}
.hesas-seventh-table-wrap td small{display:block;color:#64748b;font-size:.75rem}
