@import "tailwindcss";
@import "./identity.css";

:root {
  --bg: #f5efe3;
  --card: #fff8ec;
  --field: #fffdf7;
  --sand: #eadcc7;
  --line: #d6c7ae;
  --line2: #a98f65;
  --blue: #1e3a8a;
  --blue2: #2563eb;
  --ink: #111827;
  --muted: #475569;
  --green: #d1fae5;
  --yellow: #fef08a;
  --red: #fee2e2;
  --shadow: 0 8px 22px rgba(74, 52, 20, 0.08);
}
.faculty-evaluation{display:grid;gap:12px}.evaluation-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.evaluation-head p{max-width:760px;overflow-wrap:anywhere}.evaluation-tabs{display:flex;gap:8px}.evaluation-tabs button{padding:12px 20px}.evaluation-tabs .active{background:#255db4;color:#fff}.evaluation-section article{display:grid;grid-template-columns:minmax(340px,2fr) 100px minmax(240px,1fr) auto;gap:8px;align-items:center;padding:10px 0;border-bottom:1px solid #dfcfaf}.evaluation-section p{margin:4px 0;font-size:.9rem}.evaluation-section article>div:last-child{display:grid;gap:3px}.evaluation-actions{position:sticky;bottom:8px;display:flex;gap:8px;justify-content:center;background:#fff8;padding:10px;backdrop-filter:blur(5px)}@media(max-width:900px){.evaluation-section article{grid-template-columns:1fr}.evaluation-tabs{display:grid}.evaluation-head{align-items:stretch}}
.evaluation-profile{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:10px}.evaluation-profile h3{grid-column:1/-1}.evaluation-profile label{display:grid;gap:4px}.evaluation-section article.locked{opacity:.72;background:#f4f4f4}.evaluation-section article.locked .file-pick{pointer-events:none}@media(max-width:1100px){.evaluation-profile{grid-template-columns:repeat(2,minmax(150px,1fr))}}@media(max-width:600px){.evaluation-profile{grid-template-columns:1fr}}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 14px;
}
body {
  margin: 0;
  background: var(--bg);
  min-height: 100vh;
}
.payment-table th {
  padding: 0;
}
.payment-sort {
  display: flex;
  width: 100%;
  height: 43px;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.payment-sort:hover {
  background: #d9c29f;
}
.payment-sort:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid #2563eb;
  outline-offset: -3px;
}
.payment-sort span {
  min-width: 12px;
  color: #8b7352;
  font-size: 11px;
  opacity: 0.42;
}
.payment-sort.active {
  background: #d6e5f5;
  color: #174f82;
}
.payment-sort.active span {
  color: #174f82;
  font-size: 14px;
  opacity: 1;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
}
.login-card {
  width: min(430px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px;
  box-shadow: 0 18px 60px rgba(74, 52, 20, 0.14);
}
.login-mark {
  margin: auto;
  background: var(--blue);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
}
.login-card h1 {
  text-align: center;
  color: var(--blue);
  margin: 18px 0 6px;
}
.login-card p {
  text-align: center;
  color: var(--muted);
  margin: 0 0 26px;
}
.login-card label {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  font-weight: 700;
}
.login-card input {
  height: 46px;
}
.login-card button {
  width: 100%;
  height: 48px;
  background: var(--blue);
  color: white;
  margin-top: 12px;
}
.login-error {
  background: #fff1f0;
  color: #a52c28;
  border: 1px solid #fecaca;
  border-radius: 9px;
  padding: 10px;
  margin-top: 12px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.department-shell {
  min-height: 100vh;
  background: var(--bg);
}
.system-titlebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px;
  background: #f9f3e8;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(70, 48, 15, 0.08);
}
.titlebar-main,
.titlebar-tools,
.user-pill,
.year-control {
  display: flex;
  align-items: center;
}
.titlebar-main {
  gap: 11px;
  min-width: 350px;
}
.titlebar-main h1 {
  margin: 0;
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
}
.titlebar-main p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.app-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #ebd8a2;
  color: #174f3e;
  font-weight: 1000;
  font-size: 22px;
  border: 1px solid #d8bd79;
}
.titlebar-tools {
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.year-control {
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}
.year-control select {
  min-width: 116px;
}
.user-pill {
  gap: 8px;
  border-right: 1px solid var(--line);
  padding-right: 10px;
}
.user-pill > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e9c96f;
  color: #123e33;
  font-weight: 900;
}
.user-pill div {
  display: flex;
  flex-direction: column;
}
.user-pill b {
  font-size: 11px;
}
.user-pill small {
  font-size: 9px;
  color: var(--muted);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
input,
select,
textarea {
  background: var(--field);
  color: var(--ink);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 6px 8px;
  min-height: 32px;
  outline: none;
}
textarea {
  resize: vertical;
  min-height: 70px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue2);
  box-shadow: 0 0 0 2px #bfdbfe;
}
button,
.outline-link {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  min-height: 31px;
  background: var(--sand);
  color: var(--ink);
  font-weight: 800;
  transition: 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
button:hover,
.outline-link:hover {
  background: #f3e4ca;
  border-color: #93c5fd;
}
button:active {
  background: #bfdbfe;
  border: 2px solid var(--blue2);
  color: var(--blue);
}
.success-btn {
  background: var(--green) !important;
  color: #064e3b !important;
  border-color: #34d399 !important;
}
.action-btn {
  background: #dbeafe !important;
  color: var(--blue) !important;
  border-color: #93c5fd !important;
}
.warning-btn {
  background: var(--yellow) !important;
  color: #713f12 !important;
  border-color: #eab308 !important;
}
.outline-btn,
.outline-link {
  background: var(--card) !important;
}
.danger-link {
  background: transparent !important;
  color: #b91c1c !important;
  border-color: transparent !important;
  padding: 3px 5px !important;
}
.danger-link:hover {
  background: var(--red) !important;
}
.notice {
  position: fixed;
  z-index: 100;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 380px;
  max-width: min(800px, 90vw);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid;
  box-shadow: var(--shadow);
  font-weight: 700;
}
.notice > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.notice button {
  margin-right: auto;
  padding: 0;
  min-height: 24px;
  width: 24px;
  background: transparent;
}
.notice-success {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}
.notice-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.notice-info {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}
.loading-bar {
  position: fixed;
  top: 62px;
  right: 0;
  left: 0;
  height: 3px;
  z-index: 80;
  overflow: hidden;
}
.loading-bar i {
  display: block;
  width: 35%;
  height: 100%;
  background: var(--blue2);
  animation: loading 1.2s infinite;
}
@keyframes loading {
  from {
    transform: translateX(290%);
  }
  to {
    transform: translateX(-290%);
  }
}
.dashboard-page {
  padding: 18px;
  max-width: 1500px;
  margin: auto;
}
.dashboard-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 16px;
  margin-bottom: 14px;
}
.dashboard-intro h2 {
  margin: 0;
  color: var(--blue);
  font-size: 20px;
}
.dashboard-intro p {
  margin: 4px 0 0;
  color: var(--muted);
}
.dashboard-stats {
  display: flex;
  gap: 8px;
}
.dashboard-stats span {
  padding: 8px 13px;
  background: #f4e7d1;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.dashboard-stats b {
  color: var(--blue);
  font-size: 17px;
  margin-left: 4px;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 11px;
}
.module-card {
  position: relative;
  min-height: 116px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  text-align: right;
  display: grid;
  grid-template-columns: 47px 1fr;
  align-items: start;
  gap: 10px;
  box-shadow: 0 2px 5px rgba(70, 48, 15, 0.03);
}
.module-card:hover {
  background: #f3e4ca;
  border-color: var(--blue2);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.module-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: #f2e3c9;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 24px;
}
.module-card strong {
  font-size: 15px;
  color: var(--blue);
}
.module-card p {
  margin: 5px 0 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.active-label {
  position: absolute;
  bottom: 10px;
  right: 70px;
  background: #dcfce7;
  color: #166534;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 10px;
}
.dashboard-footnote {
  margin-top: 12px;
  padding: 9px 13px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}
.module-window {
  padding: 8px 12px 24px;
}
.module-window-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 4px 8px;
}
.module-window-heading h2 {
  margin: 0;
  color: var(--blue);
  font-size: 20px;
}
.module-window-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.working-badge {
  background: #dcfce7;
  color: #166534;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 900;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 1px 2px rgba(70, 48, 15, 0.02);
}
.card > h3,
.card-title-row h3 {
  margin: 0 0 7px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e7dcc8;
  color: var(--blue);
  font-size: 12px;
}
.compact-title {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  margin-bottom: 6px;
}
.compact-title b {
  color: var(--blue);
}
.compact-title span {
  color: var(--muted);
  font-size: 11px;
}
.students-toolbar,
.archive-toolbar,
.unit-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.students-split {
  display: grid;
  grid-template-columns: minmax(420px, 41%) minmax(600px, 59%);
  direction: rtl;
  gap: 6px;
  align-items: start;
}
.students-right,
.students-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.search-controls {
  display: grid;
  grid-template-columns: 155px minmax(160px, 1fr) 85px 100px;
  gap: 6px;
  align-items: end;
}
.search-controls label,
.threshold {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
}
.search-controls label input,
.search-controls label select {
  min-width: 0;
  width: 100%;
}
.threshold input {
  width: 60px;
}
.list-import {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #eadcc7;
}
.imported-names {
  margin-top: 6px;
  max-height: 120px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf7;
}
.imported-names button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eadcc7;
  border-radius: 0;
  background: #fffdf7;
  text-align: right;
}
.imported-names button.selected {
  background: #dbeafe;
  color: var(--blue);
}
.list-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}
.student-autocomplete {
  position: relative;
}
.student-suggestions {
  position: absolute;
  z-index: 40;
  top: 100%;
  right: 48px;
  left: 0;
  max-height: 300px;
  overflow: auto;
  background: #fffdf8;
  border: 1px solid #c9a96e;
  border-radius: 8px;
  box-shadow: 0 10px 25px #4b36231f;
}
.student-suggestions button {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  border: 0;
  border-bottom: 1px solid #eadcc7;
  border-radius: 0;
  background: #fffdf8;
  padding: 9px 11px;
  text-align: right;
}
.student-suggestions button:hover {
  background: #eef6ff;
}
.student-suggestions small {
  color: var(--muted);
  font-weight: 400;
}
.year-choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 125px;
}
.year-choice input {
  width: auto;
}
.year-match.ignored {
  opacity: 0.68;
}
.manual-student-modal {
  width: min(880px, 94vw);
}
.manual-student-modal .form-grid {
  grid-template-columns: repeat(3, 1fr);
}
.payment-layer {
  z-index: 120;
  padding: 8px;
  background: rgba(35, 42, 50, 0.45);
}
.payment-window {
  width: min(2040px, 99vw);
  height: min(970px, 97vh);
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
  background: #f7f1e6;
  border: 1px solid #c9b48f;
  border-radius: 10px;
  box-shadow: 0 24px 75px rgba(0, 0, 0, 0.32);
  padding: 9px;
}
.payment-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px;
}
.payment-title h2 {
  margin: 0;
  color: var(--blue);
  font-size: 15px;
}
.payment-title small {
  color: var(--muted);
}
.payment-title > button {
  min-width: 35px;
  font-size: 20px;
}
.payment-values,
.payment-filters {
  border: 1px solid #d9c8ac;
  border-radius: 9px;
  background: #fffaf0;
  padding: 7px 9px;
}
.payment-values h3,
.payment-filters h3 {
  margin: 0 0 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid #c6d5e8;
  color: var(--blue);
  font-size: 12px;
}
.payment-values-grid {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.payment-values-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  white-space: nowrap;
}
.payment-values-grid input {
  width: 160px;
  text-align: center;
  direction: ltr;
  font-weight: 600;
}
.payment-values-grid label:first-child input {
  width: 160px;
}
.payment-values-grid button {
  margin-inline-start: 4px;
}
.payment-filters > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.payment-filters > div > input {
  width: min(320px, 25vw);
}
.payment-filters label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  white-space: nowrap;
}
.payment-filters label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: auto;
}
.payment-filters select {
  min-width: 155px;
}
.payment-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #baa580;
  border-radius: 6px;
  background: #fff;
}
.payment-table {
  min-width: 1990px;
  font-size: 12px;
}
.payment-table th {
  top: 0;
  text-align: center;
  white-space: nowrap;
  height: 43px;
  background: #e8d7bc;
}
.payment-table td {
  height: 36px;
  padding: 3px 5px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.payment-table tbody tr:nth-child(even) {
  background: #f1f0ed;
}
.payment-table tbody tr:hover {
  background: #fff2d9;
}
.payment-table th:nth-child(-n + 5),
.payment-table td:nth-child(-n + 5) {
  width: 70px;
}
.payment-table th:nth-child(6),
.payment-table td:nth-child(6) {
  width: 75px;
  color: #667085;
}
.payment-table th:nth-child(7),
.payment-table td:nth-child(7) {
  width: 385px;
}
.payment-table th:nth-child(8),
.payment-table td:nth-child(8),
.payment-table th:nth-child(9),
.payment-table td:nth-child(9) {
  width: 120px;
}
.payment-table th:nth-child(n + 10),
.payment-table td:nth-child(n + 10) {
  width: 150px;
}
.payment-table input[type="checkbox"] {
  width: 23px;
  height: 23px;
  min-width: 23px;
  min-height: 23px;
  accent-color: #2563eb;
}
.payment-table td > input:not([type="checkbox"]) {
  width: 100%;
  min-width: 110px;
  min-height: 29px;
  text-align: center;
  direction: ltr;
  border-color: #cdbb9d;
  background: #fffdf8;
}
.payment-name {
  text-align: right !important;
  font-weight: 700;
}
.money-output {
  direction: ltr;
  font-weight: 700;
}
.payment-state {
  font-weight: 900;
}
.payment-state.paid {
  background: #dcfce7;
  color: #166534;
}
.payment-state.due {
  background: #fee2e2;
  color: #991b1b;
}
.payment-state.refund {
  background: #fef3c7;
  color: #92400e;
}
.payment-state.unknown {
  color: #64748b;
}
.payment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.payment-footer > div {
  display: flex;
  gap: 8px;
}
.payment-footer button {
  padding: 8px 15px;
}
.payment-footer .success-btn {
  font-size: 14px;
}
.matching-card > p {
  font-size: 10px;
  color: var(--muted);
  margin: 0 0 6px;
}
.year-matches {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 550px;
  overflow: auto;
}
.year-match {
  display: grid;
  grid-template-columns: 82px minmax(160px, 1fr) 75px;
  align-items: center;
  gap: 5px;
  background: #f7ead3;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px;
}
.year-match > b {
  color: var(--blue);
  direction: ltr;
}
.year-match select {
  min-width: 0;
  width: 100%;
}
.year-match label {
  white-space: nowrap;
}
.year-match.ignored {
  opacity: 0.58;
  background: #eee;
}
.group-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.group-wrap {
  display: grid;
  grid-template-columns: 1fr 35px;
  direction: rtl;
}
.group-button {
  border-radius: 0 6px 6px 0;
  background: var(--card);
}
.group-button.active {
  background: #dbeafe;
  color: var(--blue);
  border: 2px solid var(--blue2);
}
.group-arrow {
  border-radius: 6px 0 0 6px;
  background: #eadcc7;
  color: var(--blue);
  padding: 4px;
}
.column-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
  padding: 8px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 7px;
}
.column-picker > b {
  width: 100%;
  color: var(--blue);
}
.column-picker label {
  display: flex;
  align-items: center;
  gap: 4px;
}
.column-picker input {
  min-height: auto;
}
.selection-summary {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  margin: 6px 0;
}
.result-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
}
.results-card h2 {
  font-size: 17px;
  color: #1544b0;
  margin: 7px 0;
}
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
th {
  background: var(--sand);
  color: var(--blue);
  font-weight: 900;
  position: sticky;
  top: 0;
  z-index: 2;
}
th,
td {
  border: 1px solid #e5d6bd;
  padding: 6px 7px;
  text-align: right;
  vertical-align: top;
  white-space: normal;
}
tbody tr:nth-child(even) {
  background: #f0eee9;
}
tbody tr:hover {
  background: #f7e9d1;
}
td input,
td select {
  min-width: 90px;
  width: 100%;
  padding: 4px;
  min-height: 28px;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}
.results-card .table-wrap {
  max-height: 610px;
}
.empty-cell,
.empty-state {
  text-align: center !important;
  color: #8792a3 !important;
  padding: 24px !important;
}
.clearing-card .unit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.clearing-card > .outline-btn {
  margin-top: 8px;
}
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(17, 24, 39, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  width: min(1000px, 95vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  padding: 12px;
}
.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.modal-head h3 {
  margin: 0;
  color: var(--blue);
}
.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
}
.modal-head > button {
  min-width: 34px;
}
.mapping-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.mapping-grid label,
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  color: #27344a;
}
.import-preview {
  margin-top: 10px;
  max-height: 250px;
  overflow: auto;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.student-review > input {
  width: 100%;
  margin-bottom: 8px;
}
.student-review .table-wrap {
  max-height: 70vh;
}
.archive-toolbar label {
  display: flex;
  align-items: center;
  gap: 5px;
}
.archive-split {
  display: grid;
  grid-template-columns: minmax(520px, 58%) minmax(480px, 42%);
  gap: 6px;
  direction: ltr;
  align-items: start;
}
.archive-split.no-file {
  grid-template-columns: 1fr;
  max-width: 1000px;
  margin: auto;
}
.archive-viewer-panel,
.archive-details {
  direction: rtl;
  min-width: 0;
}
.file-row {
  display: flex;
  gap: 5px;
}
.file-row input {
  flex: 1;
}
.viewer-tools {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0;
}
.pdf-stage {
  position: relative;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: #d8d6d0;
  border: 1px solid #b7b2a8;
  border-radius: 6px;
  padding: 12px;
}
.pdf-stage > div:first-child {
  height: 720px;
  transform-origin: center top;
  transition: 0.2s;
}
.pdf-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}
.viewer-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #667085;
  background: #f8f7f2;
}
.viewer-empty:first-letter {
  font-size: 45px;
}
.floating-pages {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: rgba(255, 248, 236, 0.95);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}
.pdf-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.pdf-actions label {
  display: flex;
  gap: 4px;
  align-items: center;
}
.pdf-actions input {
  width: 55px;
}
.pdf-actions label:last-of-type input {
  width: 150px;
}
.file-card textarea {
  width: 100%;
  margin-top: 6px;
  min-height: 60px;
}
.zone-actions {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}
.archive-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
  padding-left: 2px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.archive-form {
  grid-template-columns: 1fr 1fr;
}
.taxonomy-buttons,
.taxonomy-sub {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.taxonomy-buttons button.active,
.taxonomy-sub button.active {
  background: #dbeafe;
  color: var(--blue);
  border: 2px solid var(--blue2);
}
.taxonomy-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
.taxonomy-groups > div {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.taxonomy-groups b {
  display: block;
  color: var(--blue);
  margin-bottom: 4px;
}
.taxonomy-groups button,
.taxonomy-sub button {
  margin: 2px;
}
.name-search {
  display: flex;
  gap: 5px;
}
.name-search input {
  flex: 1;
}
.name-results {
  max-height: 140px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 5px;
}
.name-results button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fffdf7;
}
.name-results small {
  color: var(--muted);
}
.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  min-height: 34px;
  padding: 5px;
  border: 1px dashed var(--line);
  border-radius: 6px;
}
.selected-chips button {
  background: #e0f2fe;
  color: #075985;
  padding: 3px 7px;
}
.selected-chips span {
  color: var(--muted);
}
.record-actions {
  display: flex;
  gap: 5px;
}
.record-filter {
  width: 100%;
  margin: 6px 0;
}
.archive-records {
  max-height: 260px;
}
.archive-records table {
  font-size: 11px;
  min-width: 1050px;
}
.archive-records button {
  padding: 3px 5px;
  min-height: 25px;
}
.record-workspace,
.tasks-workspace,
.reports-workspace,
.permissions-workspace,
.settings-workspace {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.workspace-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
}
.workspace-summary h3 {
  margin: 0;
  color: var(--blue);
}
.workspace-summary p {
  margin: 3px 0 0;
  color: var(--muted);
}
.mini-tiles,
.week-legend,
.merge-fields {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.mini-tiles span,
.week-legend span,
.merge-fields code {
  padding: 6px 9px;
  background: #f3e4ca;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.mini-tiles b {
  color: #059669;
  margin-left: 4px;
}
.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.editor-card .form-grid {
  grid-template-columns: repeat(4, 1fr);
}
.attachment-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.attachment-row .success-btn {
  margin-right: auto;
}
.filters {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 7px;
}
.filters input {
  flex: 1;
}
.filters select {
  min-width: 150px;
}
.record-workspace table {
  min-width: 1200px;
}
.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
  background: #e0f2fe;
  color: #075985;
}
.status-منجزة {
  background: #dcfce7 !important;
  color: #166534 !important;
}
.status-مؤجلة {
  background: #fef3c7 !important;
  color: #92400e !important;
}
.status-مستعجلة {
  background: #fee2e2 !important;
  color: #991b1b !important;
}
.status-تدقيق {
  background: #ede9fe !important;
  color: #5b21b6 !important;
}
.status-مرفوعة {
  background: #dbeafe !important;
  color: #1e40af !important;
}
.followup-module-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.followup-module-grid button {
  min-height: 60px;
  background: var(--card);
}
.followup-module-grid button span {
  font-size: 20px;
}
.followup-module-grid button.active {
  background: #dbeafe;
  color: var(--blue);
  border: 2px solid var(--blue2);
}
.tasks-workspace table {
  min-width: 1250px;
}
.tasks-workspace th button {
  background: transparent;
  border: 0;
  color: var(--blue);
  padding: 0;
  min-height: 20px;
}
.task-row td {
  transition: 0.15s;
}
.task-row.status-منجزة td {
  background: #eefcf2;
}
.task-row.status-مستعجلة td {
  background: #fff1f1;
}
.task-row.status-مؤجلة td {
  background: #fff9e8;
}
.report-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.report-stats article {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px;
}
.report-stats b {
  font-size: 27px;
  color: var(--blue);
}
.report-stats span {
  color: var(--muted);
}
.report-layout {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
}
.chart-card {
  grid-row: span 2;
}
.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 50px;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.bar-row > b {
  direction: ltr;
}
.bar-row > span {
  height: 15px;
  background: #eadcc7;
  border-radius: 9px;
  overflow: hidden;
}
.bar-row i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #1d4ed8);
  border-radius: 9px;
}
.report-list > div {
  display: flex;
  justify-content: space-between;
  padding: 7px;
  border-bottom: 1px solid var(--line);
}
.audit-list {
  grid-column: 2/4;
}
.audit-list > div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 6px;
}
.audit-list small {
  color: var(--muted);
}
.permission-editor h4 {
  margin: 10px 0 5px;
  color: var(--blue);
}
.module-checks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 9px;
}
.module-checks label {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 7px;
  background: #f7ead3;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.settings-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
}
.settings-tabs button {
  background: var(--card);
}
.settings-tabs button.active {
  background: #dbeafe;
  color: var(--blue);
  border: 2px solid var(--blue2);
}
.settings-card {
  min-height: 230px;
}
.settings-card > p,
.fee-settings > p,
.backup-card > p {
  color: var(--muted);
  line-height: 1.8;
}
.file-settings {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.source-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.source-row {
  display: grid;
  grid-template-columns: 30px 140px minmax(170px, 1fr) 90px 115px 145px;
  gap: 5px;
  align-items: center;
  padding: 5px;
  background: #fbf1df;
  border: 1px solid #e2d2ba;
  border-radius: 7px;
}
.source-row > b {
  color: var(--blue);
}
.source-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}
.matching-settings .unit-head {
  display: flex;
  gap: 10px;
  align-items: end;
}
.matching-settings .unit-head > div {
  flex: 1;
}
.matching-settings .unit-head h3 {
  margin: 0;
  color: var(--blue);
}
.matching-settings .unit-head p {
  margin: 3px 0;
  color: var(--muted);
}
.matching-settings .unit-head label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.identity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
  max-height: 650px;
  overflow: auto;
}
.identity-grid article {
  padding: 8px;
  border: 1px solid var(--line);
  background: #fbf1df;
  border-radius: 7px;
}
.identity-grid article > div {
  display: flex;
  justify-content: space-between;
  gap: 5px;
}
.identity-grid code {
  direction: ltr;
  color: var(--blue);
  font-weight: 900;
}
.identity-grid p {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}
.identity-grid button {
  font-size: 10px;
  padding: 3px 6px;
}
.fee-amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fee-amount-grid > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 8px;
  background: #fbf1df;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.fee-amount-grid > div > b {
  grid-column: 1/-1;
  color: var(--blue);
}
.fee-amount-grid label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.backup-card > div {
  display: flex;
  gap: 8px;
}
.settings-save {
  position: sticky;
  bottom: 10px;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.settings-save button {
  pointer-events: auto;
  box-shadow: var(--shadow);
  font-size: 15px;
  padding: 9px 18px;
}
.fee-year-notes {
  grid-column: 1/-1;
}
.fee-year-notes textarea {
  min-height: 58px;
  resize: vertical;
}
.fee-lock-options {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  padding-top: 6px;
  border-top: 1px solid #decdb2;
}
.fee-lock-options label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
}
.fee-lock-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: #2563eb;
}
.migration-status {
  background: #f0fdf4;
  border-color: #86efac;
}
.migration-status > p {
  margin: 8px 0 0;
  color: #166534;
}
.migration-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 7px;
}
.migration-stats span {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px;
  background: #fff;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  color: var(--muted);
}
.migration-stats b {
  font-size: 19px;
  color: #166534;
}
@media (max-width: 1100px) {
  .system-titlebar {
    position: relative;
    align-items: flex-start;
  }
  .titlebar-tools {
    justify-content: flex-start;
  }
  .user-pill {
    display: none;
  }
  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .students-split,
  .archive-split {
    grid-template-columns: 1fr;
  }
  .archive-details {
    max-height: none;
  }
  .mapping-grid,
  .editor-card .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .report-layout {
    grid-template-columns: 1fr 1fr;
  }
  .chart-card,
  .audit-list {
    grid-column: auto;
    grid-row: auto;
  }
  .followup-module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .identity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .source-row {
    grid-template-columns: 30px 120px 1fr 85px;
  }
  .source-row input:nth-last-child(-n + 2) {
    display: none;
  }
}
@media (max-width: 680px) {
  html {
    font-size: 13px;
  }
  .system-titlebar {
    flex-direction: column;
    padding: 8px;
  }
  .titlebar-main {
    min-width: 0;
  }
  .titlebar-main h1 {
    font-size: 16px;
  }
  .titlebar-tools {
    width: 100%;
  }
  .year-control {
    width: 100%;
    justify-content: space-between;
  }
  .dashboard-page,
  .module-window {
    padding: 7px;
  }
  .dashboard-intro {
    flex-direction: column;
    align-items: stretch;
  }
  .dashboard-stats {
    overflow: auto;
  }
  .module-grid {
    grid-template-columns: 1fr;
  }
  .students-split {
    display: block;
  }
  .students-right,
  .students-left {
    margin-bottom: 7px;
  }
  .search-controls {
    grid-template-columns: 1fr 1fr;
  }
  .group-buttons {
    grid-template-columns: 1fr;
  }
  .form-grid,
  .archive-form,
  .editor-card .form-grid,
  .mapping-grid,
  .module-checks,
  .report-stats,
  .report-layout,
  .identity-grid,
  .fee-amount-grid,
  .migration-stats,
  .manual-student-modal .form-grid {
    grid-template-columns: 1fr;
  }
  .taxonomy-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  .followup-module-grid {
    grid-template-columns: 1fr;
  }
  .source-row {
    grid-template-columns: 28px 1fr 90px;
  }
  .source-row > span,
  .source-row input:nth-last-child(-n + 2) {
    display: none;
  }
  .notice {
    min-width: 0;
    width: 92vw;
  }
  .workspace-summary,
  .payment-status-card .card-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media print {
  .system-titlebar,
  .notice,
  .students-toolbar,
  .archive-toolbar,
  .unit-actions,
  .filters,
  .result-actions,
  .settings-tabs,
  .settings-save,
  button,
  input[type="file"] {
    display: none !important;
  }
  .module-window {
    padding: 0;
  }
  .card {
    box-shadow: none;
    break-inside: avoid;
  }
  .students-split,
  .archive-split {
    display: block;
  }
  .students-right,
  .archive-viewer-panel,
  .editor-card {
    display: none;
  }
  .students-left {
    width: 100%;
  }
  .table-wrap {
    overflow: visible;
    max-height: none !important;
    border: 0;
  }
  table {
    min-width: 0 !important;
    font-size: 9pt;
  }
  th {
    position: static;
  }
  .report-layout {
    display: block;
  }
  .report-layout > .card {
    margin-bottom: 8px;
  }
}

/* Update 92: controlled imports, year-by-year identity matrix and project study balancing */
.identity-matrix-wrap {
  max-height: 68vh;
  overflow: auto;
}
.identity-matrix {
  min-width: max-content;
}
.identity-matrix th {
  min-width: 240px;
  top: 0;
}
.identity-matrix th:first-child {
  min-width: 84px;
}
.identity-matrix th:last-child {
  min-width: 120px;
}
.identity-matrix td {
  vertical-align: top;
}
.identity-matrix td select {
  min-width: 250px;
}
.identity-current-cell {
  position: sticky;
  right: 0;
  background: #fff8e8;
  z-index: 2;
  min-width: 270px;
}
.identity-current-cell b,
.identity-current-cell small,
.identity-matrix td small {
  display: block;
}
.identity-current-cell small,
.identity-matrix td small {
  margin-top: 6px;
  color: #64748b;
}
.identity-reset-preview {
  max-width: 760px;
}
.project-balance-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.project-balance-summary span {
  background: #eef6ff;
  border: 1px solid #bfd6ee;
  border-radius: 8px;
  padding: 7px 10px;
}
.project-admin-editor {
  max-width: 900px;
}
.project-admin-editor .form-grid {
  max-height: 68vh;
  overflow: auto;
}
.import-change-table {
  max-height: 50vh;
}
.payment-import-modal {
  max-width: 1100px;
}

.correspondence-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #eee7dc;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.correspondence-tabs button {
  min-width: 88px;
  background: transparent;
  border-color: transparent;
}
.correspondence-tabs button.active {
  background: #fff;
  color: var(--blue);
  border-color: var(--blue2);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}
.student-result-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}
.student-archive-state {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid #ef4444;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.student-name-with-state {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.student-archive-row td {
  background: #fff1f2 !important;
}
.student-archive-row:hover td {
  background: #ffe4e6 !important;
}

/* Update 48: keep payment columns only as wide as their visible content. */
.payment-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.payment-table th,
.payment-table td {
  width: 1% !important;
  min-width: 0 !important;
  padding-inline: 5px !important;
  white-space: nowrap;
}
.payment-table th:nth-child(7),
.payment-table td:nth-child(7),
.payment-table th:nth-child(16),
.payment-table td:nth-child(16) {
  width: auto !important;
}
.payment-table td > input:not([type="checkbox"]) {
  width: 88px !important;
  min-width: 0 !important;
  max-width: none;
}

/* UPDATE52_PAYMENT_COMPACT_COLUMNS */
.payment-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.payment-table th,
.payment-table td {
  width: 1% !important;
  min-width: 0 !important;
  padding-inline: 5px !important;
  white-space: nowrap;
}
.payment-table th:nth-child(7),
.payment-table td:nth-child(7),
.payment-table th:nth-child(16),
.payment-table td:nth-child(16) {
  width: auto !important;
}
.payment-table td > input:not([type="checkbox"]) {
  width: 88px !important;
  min-width: 0 !important;
  max-width: none;
}

/* Update 56: independent studies, sections, vertical timetable and validation */
.teaching-workspace {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.staff-editor h3,
.schedule-board h3,
.section-settings h3,
.hours-audit h3 {
  margin: 0 0 4px;
  color: var(--blue);
}
.staff-editor p {
  margin: 0;
  color: var(--muted);
}
.teaching-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.teaching-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 800;
}
.teaching-form .wide {
  grid-column: 1/-1;
}
.teaching-form textarea {
  min-height: 64px;
}
.schedule-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  position: sticky;
  top: 67px;
  z-index: 12;
}
.schedule-toolbar > label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
}
.study-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #e8dcc8;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.study-tabs button.active {
  background: #dbeafe;
  color: var(--blue);
  border: 2px solid var(--blue2);
}
.duration-input {
  width: 78px !important;
  min-width: 78px !important;
}
.end-time {
  padding: 7px 9px;
  background: #e8f7ee;
  border: 1px solid #86c99d;
  border-radius: 7px;
  color: #14532d;
}
.section-settings {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.section-settings h3 {
  width: 100%;
}
.section-settings label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}
.section-settings select {
  min-width: 90px;
}
.schedule-warnings {
  border: 2px solid #dc2626;
  background: #fff7ed;
  color: #7f1d1d;
  max-height: 230px;
  overflow: auto;
}
.schedule-warnings h3 {
  margin: 0 0 5px;
}
.schedule-warnings p {
  margin: 3px 0;
  font-weight: 800;
}
.schedule-board {
  padding: 7px;
}
.schedule-board > h3 {
  text-align: center;
  background: #5b9bd5;
  color: #071b33;
  padding: 6px;
  border-radius: 6px;
}
.schedule-scroll {
  overflow: auto;
  max-height: calc(100vh - 250px);
  border: 1px solid #8d8578;
}
.schedule-table {
  table-layout: fixed;
  font-size: 10px;
  width: max-content;
  min-width: 100%;
}
.schedule-table th,
.schedule-table td {
  text-align: center;
  padding: 2px;
  border: 1px solid #847b6c;
}
.schedule-table thead tr:first-child th {
  background: #a8c9e8;
  color: #172033;
}
.schedule-table thead tr:nth-child(2) th {
  background: #fff99d;
}
.schedule-table .day-cell {
  width: 64px;
  min-width: 64px;
  background: #c6ddf0;
  color: #111;
  vertical-align: middle;
}
.schedule-table .time-cell {
  width: 100px;
  min-width: 100px;
  background: #fff99d;
  direction: ltr;
  font-weight: 800;
}
.schedule-table td:nth-child(n + 3) {
  width: 118px;
  min-width: 118px;
}
.schedule-table td.filled-slot {
  background: #f8c9a8;
}
.schedule-table td.conflict-slot {
  background: #fecaca !important;
  box-shadow: inset 0 0 0 2px #dc2626;
}
.schedule-table td select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  margin: 0;
  font-size: 9px;
}
.schedule-table td small {
  display: block;
  color: #7c2d12;
  font-weight: 800;
  max-width: 115px;
}
.hours-audit .table-wrap {
  max-height: 310px;
}
.hours-audit table {
  font-size: 11px;
}
.hours-ok td:last-child {
  background: #dcfce7;
  color: #166534;
  font-weight: 900;
}
.hours-bad td:last-child {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 900;
}
.course-details {
  width: min(2100px, 99vw);
}
.course-details .table-wrap {
  max-height: 74vh;
}
.course-details table {
  min-width: 3300px;
  font-size: 10px;
}
.course-details th,
.course-details td {
  white-space: nowrap;
  text-align: center;
}
.course-details td input,
.course-details td select {
  min-width: 105px;
}
.course-details .show-teacher-check {
  width: 22px !important;
  min-width: 22px !important;
  height: 22px;
  min-height: 22px;
}
.payment-status-select {
  min-width: 150px;
  width: 100%;
  font-weight: 900;
  text-align: center;
}
.payment-notes {
  min-width: 220px !important;
  text-align: right !important;
  direction: rtl !important;
}
input[type="date"] {
  direction: ltr;
  text-align: center;
}
@media (max-width: 900px) {
  .teaching-form {
    grid-template-columns: 1fr 1fr;
  }
  .schedule-toolbar {
    position: static;
  }
  .schedule-scroll {
    max-height: none;
  }
}
@media (max-width: 600px) {
  .teaching-form {
    grid-template-columns: 1fr;
  }
}

/* Update 57: merged days, 12-hour clock, copy timetable and section groups */
.schedule-table .day-cell span {
  display: inline-block;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 3px;
  font-size: 13px;
  font-weight: 900;
}
.schedule-table .time-cell {
  width: 128px;
  min-width: 128px;
  direction: rtl;
  white-space: nowrap;
}
.start-time-control span {
  display: flex;
  align-items: center;
  gap: 3px;
  direction: ltr;
}
.start-time-control select {
  min-width: 58px !important;
  width: 58px !important;
}
.start-time-control select:nth-of-type(2) {
  min-width: 64px !important;
  width: 64px !important;
}
.section-checkboxes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 105px;
}
.section-checkboxes label {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 5px;
  border: 1px solid #c8a56b;
  border-radius: 6px;
  background: #fffaf0;
  cursor: pointer;
}
.section-checkboxes input {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px;
  margin: 0;
}
.section-checkboxes strong {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 28px;
  border: 1px solid #c8a56b;
  border-radius: 6px;
  background: #fffaf0;
}

/* Update 58: horizontal day label and adjacent split section rows */
.schedule-table .day-cell {
  min-width: 72px;
  width: 72px;
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
}
.schedule-table .day-cell span {
  display: inline-block;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  letter-spacing: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
}
.schedule-table .time-cell {
  width: 128px;
  min-width: 128px;
  direction: rtl;
  white-space: nowrap;
}
.start-time-control span {
  display: flex;
  align-items: center;
  gap: 3px;
  direction: ltr;
}
.start-time-control select {
  min-width: 58px !important;
  width: 58px !important;
}
.start-time-control select:nth-of-type(2) {
  min-width: 64px !important;
  width: 64px !important;
}
.section-checkboxes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 105px;
}
.section-checkboxes label {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 5px;
  border: 1px solid #c8a56b;
  border-radius: 6px;
  background: #fffaf0;
  cursor: pointer;
}
.section-checkboxes input {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px;
  margin: 0;
}
.section-checkboxes strong {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 28px;
  border: 1px solid #c8a56b;
  border-radius: 6px;
  background: #fffaf0;
}

/* Update 59: copy menu and teaching-load reports */
.copy-menu-wrap {
  position: relative;
  display: inline-flex;
}
.copy-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 5px;
  min-width: 170px;
  padding: 7px;
  border: 1px solid #c8a56b;
  border-radius: 9px;
  background: #fffaf0;
  box-shadow: 0 8px 24px #0002;
}
.copy-menu button {
  width: 100%;
  text-align: center;
  background: #fff;
}
.workload-layer {
  z-index: 1100;
}
.workload-modal {
  width: min(1180px, 96vw);
  max-height: 94vh;
  overflow: auto;
}
.workload-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.workload-tabs button.active {
  background: #2867d7;
  color: #fff;
  border-color: #2867d7;
}
.workload-report {
  direction: rtl;
  border: 1px solid #d8c39e;
  border-radius: 10px;
  padding: 18px;
  background: #fff;
}
.workload-report > h2,
.workload-report > h3 {
  text-align: center;
  margin: 4px 0 10px;
}
.workload-report table {
  width: 100%;
  border-collapse: collapse;
}
.workload-report th {
  background: #8db2df;
  color: #111;
}
.workload-report th,
.workload-report td {
  border: 1px solid #555;
  padding: 8px;
  text-align: center;
  vertical-align: middle;
}
.workload-report tbody tr:nth-child(even) {
  background: #f4f0f8;
}
.teacher-form > label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
  font-weight: 800;
}
.teacher-form select {
  min-width: 320px;
}
.teacher-summary {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff4e3;
}
@media print {
  body * {
    visibility: hidden;
  }
  .workload-report,
  .workload-report * {
    visibility: visible;
  }
  .workload-report {
    position: absolute;
    inset: 0;
    border: 0;
  }
  .modal-actions,
  .workload-tabs,
  .modal-head {
    display: none !important;
  }
}

/* Update 60: teaching-load sources, workdays, filters and staff quotas */
.workdays-menu label,
.filter-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  font-weight: 700;
  white-space: nowrap;
}
.workdays-menu input,
.filter-checks input,
.workload-report input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.workload-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #ddc8a4;
  border-radius: 9px;
  background: #fffaf1;
}
.workload-filters > label {
  display: grid;
  gap: 4px;
  font-weight: 800;
}
.workload-filters input[type="date"] {
  min-width: 155px;
}
.workload-filters details {
  position: relative;
}
.workload-filters summary {
  cursor: pointer;
  min-width: 150px;
  padding: 9px 12px;
  border: 1px solid #bb9862;
  border-radius: 7px;
  background: #fff;
  font-weight: 800;
}
.filter-checks {
  position: absolute;
  z-index: 40;
  top: calc(100% + 5px);
  right: 0;
  display: grid;
  min-width: 210px;
  padding: 8px;
  border: 1px solid #c8a56b;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px #0002;
}
.lecture-form-head {
  margin: 8px 0 16px;
  padding: 12px;
  border-bottom: 2px solid #444;
}
.lecture-form-head h2 {
  text-align: center;
  text-decoration: underline;
}
.lecture-form-head > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 14px;
  line-height: 1.9;
  font-weight: 700;
}
.workload-report table input[type="checkbox"] {
  accent-color: #2867d7;
}
@media (max-width: 800px) {
  .lecture-form-head > div {
    grid-template-columns: 1fr;
  }
}

/* Update 61: workload period details, practical projects and live review */
.workdays-menu label,
.filter-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  font-weight: 700;
  white-space: nowrap;
}
.workdays-menu input,
.filter-checks input,
.workload-report input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.workload-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #ddc8a4;
  border-radius: 9px;
  background: #fffaf1;
}
.workload-filters > label {
  display: grid;
  gap: 4px;
  font-weight: 800;
}
.workload-filters input[type="date"] {
  min-width: 155px;
}
.workload-filters details {
  position: relative;
}
.workload-filters summary {
  cursor: pointer;
  min-width: 150px;
  padding: 9px 12px;
  border: 1px solid #bb9862;
  border-radius: 7px;
  background: #fff;
  font-weight: 800;
}
.filter-checks {
  position: absolute;
  z-index: 40;
  top: calc(100% + 5px);
  right: 0;
  display: grid;
  min-width: 210px;
  padding: 8px;
  border: 1px solid #c8a56b;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px #0002;
}
.lecture-form-head {
  margin: 8px 0 16px;
  padding: 12px;
  border-bottom: 2px solid #444;
}
.lecture-form-head h2 {
  text-align: center;
  text-decoration: underline;
}
.lecture-form-head > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 14px;
  line-height: 1.9;
  font-weight: 700;
}
.workload-report table input[type="checkbox"] {
  accent-color: #2867d7;
}
@media (max-width: 800px) {
  .lecture-form-head > div {
    grid-template-columns: 1fr;
  }
}
.period-details-panel {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #c9a66b;
  border-radius: 10px;
  background: #fffdf7;
}
.period-details-panel > h3,
.live-review > h3 {
  margin: 6px 0 10px;
}
.period-details-table {
  min-width: 880px;
}
.period-details-table th,
.period-details-table td {
  text-align: center;
  vertical-align: middle;
}
.period-details-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
}
.period-details-table select {
  min-width: 105px;
}
.period-details-table tr.outside-period {
  background: #f1f1f1;
  color: #999;
}
.period-details-table tr.outside-period td {
  height: 36px;
}
.period-details-table tr.period-holiday {
  background: #f1d7d7;
}
.workload-nav-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0;
  direction: rtl;
}
.workload-nav-row .workload-tabs {
  margin: 0;
}
.review-button {
  min-width: 110px;
  background: #315c99 !important;
  color: #fff !important;
  border-color: #315c99 !important;
}
.review-button.active {
  background: #163965 !important;
}
.live-review {
  display: grid;
  gap: 12px;
}
.practical-project-wrap {
  max-width: 100%;
  overflow: auto;
}
.practical-project-table {
  min-width: 2400px;
  font-size: 12px;
}
.practical-project-table th {
  background: #ffda72;
  position: sticky;
  top: 0;
  z-index: 2;
}
.practical-project-table tbody th {
  right: 0;
  z-index: 1;
  min-width: 210px;
}
.practical-project-table td {
  min-width: 92px;
  height: 48px;
  padding: 3px;
  background: #fff;
}
.practical-project-table tbody tr:nth-child(even) td {
  background: #dcebd2;
}
.practical-project-table td span {
  display: block;
  padding: 2px;
  border-radius: 4px;
  background: #fff7dd;
}
.practical-project-table td small {
  display: block;
  color: #555;
}
@media (max-width: 800px) {
  .workload-nav-row {
    align-items: stretch;
    flex-direction: column;
  }
  .workload-tabs {
    display: flex;
    overflow: auto;
  }
  .period-details-table {
    min-width: 760px;
  }
}

/* Update 62: modal period, project distribution, selectable practical load and live left review */
.over-fifty-check {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
}
.over-fifty-check input {
  width: 20px !important;
  height: 20px;
}
.drag-handle {
  cursor: grab;
  font-size: 20px;
}
.dragging-row {
  opacity: 0.45;
  background: #dce8f7 !important;
}
.project-distribution {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 3px solid #8db2df;
}
.project-distribution > h3 {
  margin: 0 0 5px;
}
.project-distribution table {
  min-width: 1050px;
}
.project-distribution th {
  background: #8db2df;
}
.project-distribution input[type="number"] {
  width: 90px;
}
.project-rows {
  display: grid;
  gap: 6px;
  min-width: 560px;
}
.project-rows > div {
  display: grid;
  grid-template-columns: 28px minmax(220px, 1fr) 135px 135px;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid #e0ccb0;
  border-radius: 7px;
  background: #fffaf1;
}
.project-rows label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.nested-period-layer {
  z-index: 1300 !important;
  background: #0008;
}
.period-details-modal {
  width: min(1080px, 96vw);
  max-height: 92vh;
  overflow: auto;
}
.period-details-modal .period-details-wrap {
  max-height: 68vh;
}
.practical-project-table {
  min-width: 6200px;
}
.practical-project-table td {
  min-width: 135px;
}
.practical-project-table select {
  width: 130px;
  min-width: 130px;
  font-size: 11px;
}
.practical-project-table thead tr:nth-child(3) th {
  background: #ffe9a9;
  min-width: 135px;
}
.practical-warnings {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #d69b28;
  border-radius: 8px;
  background: #fff4d7;
  color: #6e4200;
  max-height: 160px;
  overflow: auto;
}
.practical-warnings p {
  margin: 4px 0;
}
.selection-preview {
  display: block;
  min-height: 25px;
  font-size: 11px;
}
.with-review-open {
  margin-right: 12px;
  margin-left: auto;
  width: min(47vw, 900px);
}
.workload-review-window {
  position: fixed;
  z-index: 1250;
  left: 10px;
  top: 2vh;
  width: min(51vw, 1050px);
  height: 96vh;
  overflow: auto;
  padding: 14px;
  border: 2px solid #315c99;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 40px #0005;
  direction: rtl;
}
.review-window-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  border-bottom: 2px solid #315c99;
}
.review-window-head h3,
.review-window-head p {
  margin: 0 0 6px;
}
.review-window-head button {
  font-size: 22px;
}
.review-teacher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-weight: 800;
}
.review-teacher select {
  min-width: 300px;
}
.review-profile {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid #bbb;
  background: #fff;
}
.review-execution-table {
  min-width: 1450px;
  border-collapse: collapse;
  font-size: 12px;
}
.review-weekly-table {
  min-width: 1050px;
  border-collapse: collapse;
}
.review-execution-table th,
.review-execution-table td,
.review-weekly-table th,
.review-weekly-table td {
  border: 1px solid #111;
  padding: 5px;
  text-align: center;
}
.review-execution-table th,
.review-weekly-table th {
  background: #fff;
  font-weight: 900;
}
.review-weekly-table td {
  min-width: 115px;
  height: 46px;
}
.review-weekly-table td span {
  display: block;
}
.review-weekly-table td small {
  display: block;
  color: #555;
}
@media (max-width: 1100px) {
  .with-review-open {
    width: 96vw;
  }
  .workload-review-window {
    width: 94vw;
    left: 3vw;
  }
  .review-profile {
    grid-template-columns: 1fr 1fr;
  }
}

/* Update 63: staff positions, project distribution access and one-cell practical schedule */
.over-fifty-check {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
}
.over-fifty-check input {
  width: 20px !important;
  height: 20px;
}
.drag-handle {
  cursor: grab;
  font-size: 20px;
}
.dragging-row {
  opacity: 0.45;
  background: #dce8f7 !important;
}
.project-distribution {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 3px solid #8db2df;
}
.project-distribution > h3 {
  margin: 0 0 5px;
}
.project-distribution table {
  min-width: 1050px;
}
.project-distribution th {
  background: #8db2df;
}
.project-distribution input[type="number"] {
  width: 90px;
}
.project-rows {
  display: grid;
  gap: 6px;
  min-width: 560px;
}
.project-rows > div {
  display: grid;
  grid-template-columns: 28px minmax(220px, 1fr) 135px 135px;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid #e0ccb0;
  border-radius: 7px;
  background: #fffaf1;
}
.project-rows label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.nested-period-layer {
  z-index: 1300 !important;
  background: #0008;
}
.period-details-modal {
  width: min(1080px, 96vw);
  max-height: 92vh;
  overflow: auto;
}
.period-details-modal .period-details-wrap {
  max-height: 68vh;
}
.course-details-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid #315c99;
  border-radius: 7px;
  background: #e8f1ff;
  color: #183f78;
  font-weight: 800;
  text-decoration: none;
}
.button-link:hover {
  background: #d6e7ff;
}
.project-distribution {
  scroll-margin-top: 16px;
}

/* Update 71: unified course/project editor and curricular training workflow */
.course-details > .modal-head {
  position: sticky;
  top: -12px;
  z-index: 8;
  background: var(--bg);
  padding-top: 12px;
}
.course-details-tabs {
  position: sticky;
  top: 62px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  background: #fff8ec;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
}
.course-details-tabs button.active {
  background: #315c99;
  color: #fff;
  border-color: #315c99;
}
.sticky-modal-actions {
  position: sticky;
  bottom: -12px;
  z-index: 9;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 10px 4px 12px;
  margin-top: 10px;
}
.training-workspace {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.training-actions {
  position: sticky;
  top: 67px;
  z-index: 12;
  background: var(--bg);
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.training-warning {
  border: 2px solid #e39a20;
  background: #fff7df;
  color: #713f12;
}
.training-warning p {
  margin: 5px 0 0;
}
.training-warning-tile {
  background: #fff1cf !important;
  color: #8a4b00 !important;
}
.training-table-wrap {
  max-height: 65vh;
}
.training-table {
  min-width: 1050px;
}
.training-table th,
.training-table td {
  text-align: center;
  vertical-align: middle;
}
.training-table td > input,
.training-table td > select {
  width: 100%;
  min-width: 130px;
}
.training-book-cell {
  display: grid;
  gap: 5px;
  min-width: 170px;
}
.training-student-picker {
  width: min(1150px, 96vw);
}
.training-student-picker .table-wrap {
  max-height: 65vh;
}
.student-picker-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.student-picker-tools b {
  margin-inline-start: auto;
}
.third-stage-missing {
  background: #fff8dc;
}
.training-archive-card {
  border: 2px solid #8db2df;
}
.training-name-note {
  margin: 0 0 8px;
  color: #36516f;
  font-weight: 700;
}
.practical-project-table {
  min-width: 2850px;
}
.practical-project-table td {
  min-width: 145px;
}
.practical-project-table select {
  width: 140px;
  min-width: 140px;
  font-size: 11px;
}
.practical-project-table .inventory-cell {
  min-width: 115px;
  background: #fff8df;
  font-weight: 900;
  text-align: center;
  color: #6e4200;
}
.practical-warnings {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #d69b28;
  border-radius: 8px;
  background: #fff4d7;
  color: #6e4200;
  max-height: 160px;
  overflow: auto;
}
.practical-warnings p {
  margin: 4px 0;
}
.selection-preview {
  display: block;
  min-height: 25px;
  font-size: 11px;
}
.with-review-open {
  margin-right: 12px;
  margin-left: auto;
  width: min(47vw, 900px);
}
.workload-review-window {
  position: fixed;
  z-index: 1250;
  left: 10px;
  top: 2vh;
  width: min(51vw, 1050px);
  height: 96vh;
  overflow: auto;
  padding: 14px;
  border: 2px solid #315c99;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 40px #0005;
  direction: rtl;
}
.review-window-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  border-bottom: 2px solid #315c99;
}
.review-window-head h3,
.review-window-head p {
  margin: 0 0 6px;
}
.review-window-head button {
  font-size: 22px;
}
.review-teacher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-weight: 800;
}
.review-teacher select {
  min-width: 300px;
}
.review-profile {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid #bbb;
  background: #fff;
}
.review-execution-table {
  min-width: 1450px;
  border-collapse: collapse;
  font-size: 12px;
}
.review-weekly-table {
  min-width: 1050px;
  border-collapse: collapse;
}
.review-execution-table th,
.review-execution-table td,
.review-weekly-table th,
.review-weekly-table td {
  border: 1px solid #111;
  padding: 5px;
  text-align: center;
}
.review-execution-table th,
.review-weekly-table th {
  background: #fff;
  font-weight: 900;
}
.review-weekly-table td {
  min-width: 115px;
  height: 46px;
}
.review-weekly-table td span {
  display: block;
}
.review-weekly-table td small {
  display: block;
  color: #555;
}
@media (max-width: 1100px) {
  .with-review-open {
    width: 96vw;
  }
  .workload-review-window {
    width: 94vw;
    left: 3vw;
  }
  .review-profile {
    grid-template-columns: 1fr 1fr;
  }
}

/* Update 63: staff positions, project distribution access and one-cell practical schedule */
.over-fifty-check {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
}
.over-fifty-check input {
  width: 20px !important;
  height: 20px;
}
.drag-handle {
  cursor: grab;
  font-size: 20px;
}
.dragging-row {
  opacity: 0.45;
  background: #dce8f7 !important;
}
.project-distribution {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 3px solid #8db2df;
}
.project-distribution > h3 {
  margin: 0 0 5px;
}
.project-distribution table {
  min-width: 1050px;
}
.project-distribution th {
  background: #8db2df;
}
.project-distribution input[type="number"] {
  width: 90px;
}
.project-rows {
  display: grid;
  gap: 6px;
  min-width: 560px;
}
.project-rows > div {
  display: grid;
  grid-template-columns: 28px minmax(220px, 1fr) 135px 135px;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid #e0ccb0;
  border-radius: 7px;
  background: #fffaf1;
}
.project-rows label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.nested-period-layer {
  z-index: 1300 !important;
  background: #0008;
}
.period-details-modal {
  width: min(1080px, 96vw);
  max-height: 92vh;
  overflow: auto;
}
.period-details-modal .period-details-wrap {
  max-height: 68vh;
}
.course-details-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid #315c99;
  border-radius: 7px;
  background: #e8f1ff;
  color: #183f78;
  font-weight: 800;
  text-decoration: none;
}
.button-link:hover {
  background: #d6e7ff;
}
.project-distribution {
  scroll-margin-top: 16px;
}
.practical-project-table {
  min-width: 2850px;
}
.practical-project-table td {
  min-width: 145px;
}
.practical-project-table select {
  width: 140px;
  min-width: 140px;
  font-size: 11px;
}
.practical-project-table .inventory-cell {
  min-width: 115px;
  background: #fff8df;
  font-weight: 900;
  text-align: center;
  color: #6e4200;
}
.practical-warnings {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #d69b28;
  border-radius: 8px;
  background: #fff4d7;
  color: #6e4200;
  max-height: 160px;
  overflow: auto;
}
.practical-warnings p {
  margin: 4px 0;
}
.selection-preview {
  display: block;
  min-height: 25px;
  font-size: 11px;
}
.with-review-open {
  margin-right: 12px;
  margin-left: auto;
  width: min(47vw, 900px);
}
.workload-review-window {
  position: fixed;
  z-index: 1250;
  left: 10px;
  top: 2vh;
  width: min(51vw, 1050px);
  height: 96vh;
  overflow: auto;
  padding: 14px;
  border: 2px solid #315c99;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 40px #0005;
  direction: rtl;
}
.review-window-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  border-bottom: 2px solid #315c99;
}
.review-window-head h3,
.review-window-head p {
  margin: 0 0 6px;
}
.review-window-head button {
  font-size: 22px;
}
.review-teacher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-weight: 800;
}
.review-teacher select {
  min-width: 300px;
}
.review-profile {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid #bbb;
  background: #fff;
}
.review-execution-table {
  min-width: 1450px;
  border-collapse: collapse;
  font-size: 12px;
}
.review-weekly-table {
  min-width: 1050px;
  border-collapse: collapse;
}
.review-execution-table th,
.review-execution-table td,
.review-weekly-table th,
.review-weekly-table td {
  border: 1px solid #111;
  padding: 5px;
  text-align: center;
}
.review-execution-table th,
.review-weekly-table th {
  background: #fff;
  font-weight: 900;
}
.review-weekly-table td {
  min-width: 115px;
  height: 46px;
}
.review-weekly-table td span {
  display: block;
}
.review-weekly-table td small {
  display: block;
  color: #555;
}
@media (max-width: 1100px) {
  .with-review-open {
    width: 96vw;
  }
  .workload-review-window {
    width: 94vw;
    left: 3vw;
  }
  .review-profile {
    grid-template-columns: 1fr 1fr;
  }
}
/* Update 64: shared project base hours and project totals */
.project-base-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 12px;
  margin: 10px 0 14px;
  border: 1px solid #c8d9ee;
  border-radius: 10px;
  background: #f4f8fd;
}
.project-base-hours label {
  min-width: 230px;
  font-weight: 800;
  color: #17487d;
}
.project-base-hours input {
  margin-inline-start: 8px;
  width: 110px;
}

/* Update 65: external live review, official printing, rates, orders and DMY dates */
.dmy-date-input {
  display: inline-grid;
  grid-template-columns: 48px 8px 52px 8px 72px;
  align-items: center;
  gap: 2px;
  margin-top: 5px;
}
.dmy-date-input input {
  width: 100% !important;
  min-width: 0 !important;
  text-align: center;
  padding: 8px 3px !important;
}
.dmy-date-input b {
  font-weight: 900;
  text-align: center;
}
.workload-filters {
  overflow: visible;
}
.workload-filters > label {
  min-width: 205px;
}
.print-menu {
  position: relative;
}
.print-menu > summary {
  list-style: none;
  cursor: pointer;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid #315c99;
  border-radius: 8px;
  background: #e8f1ff;
  color: #173f78;
  font-weight: 900;
}
.print-menu > summary::-webkit-details-marker {
  display: none;
}
.print-menu > div {
  position: absolute;
  z-index: 1400;
  top: calc(100% + 4px);
  inset-inline-end: 0;
  display: grid;
  gap: 4px;
  width: 270px;
  padding: 7px;
  border: 1px solid #9a7a43;
  border-radius: 9px;
  background: #fffaf0;
  box-shadow: 0 8px 26px #0004;
}
.print-menu > div button {
  text-align: right;
  white-space: normal;
}
.workload-settings-modal {
  width: min(720px, 94vw);
  max-height: 90vh;
  overflow: auto;
}
.workload-settings-modal table {
  width: 100%;
  border-collapse: collapse;
}
.workload-settings-modal th,
.workload-settings-modal td {
  border: 1px solid #b8c6d8;
  padding: 8px;
  text-align: center;
}
.workload-settings-modal thead th {
  background: #dceaf9;
}
.workload-settings-modal input {
  width: 100%;
}
.external-review-root {
  min-height: 100vh;
  padding: 8px;
  background: #eef3f9;
  direction: rtl;
}
.external-review-root .workload-review-window {
  position: static;
  width: 100%;
  height: auto;
  min-height: calc(100vh - 16px);
  max-width: none;
  overflow: visible;
  margin: 0;
}
.external-review-root .table-wrap {
  max-width: 100%;
  overflow: auto;
}
.external-review-root .review-window-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
}
.with-review-open {
  width: min(96vw, 1500px);
  margin: auto;
}
.workload-review-window {
  resize: both;
  min-width: 520px;
  min-height: 420px;
}
.review-execution-table td[dir="ltr"] {
  white-space: nowrap;
}
.lecture-form-head [dir="ltr"] {
  display: inline-block;
}
.period-details-table td[dir="ltr"] {
  white-space: nowrap;
}
input[type="date"] {
  direction: ltr;
}
@media (max-width: 760px) {
  .dmy-date-input {
    grid-template-columns: 44px 7px 48px 7px 68px;
  }
  .print-menu > div {
    inset-inline-end: auto;
    inset-inline-start: 0;
  }
  .workload-settings-modal {
    width: 96vw;
  }
}

/* Update 66: weekly entitlement and Word template export */
.print-menu hr {
  width: 100%;
  border: 0;
  border-top: 1px solid #d8c7a4;
  margin: 5px 0;
}
.teacher-form tfoot th {
  background: #fff4db;
  font-weight: 800;
}

/* Update 72: year-safe training roster, source switch, and archive export */
.training-source-tabs {
  margin-inline-start: auto;
}
.training-source-tabs button {
  min-width: 150px;
}
.training-export-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid #b8cee8;
  border-radius: 8px;
  background: #edf5ff;
}
.training-export-actions small {
  color: #36516f;
}
.training-delete-row td,
.training-delete-row th {
  background: #fee2e2 !important;
  color: #991b1b;
}
.training-table {
  min-width: 1320px;
}
.training-archive-title-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.training-return-btn {
  background: #315c99 !important;
  color: #fff !important;
  border-color: #315c99 !important;
}
.training-name-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #edf5ff;
  border: 1px solid #8db2df;
  color: #24476f;
  padding: 9px 12px;
}
.training-name-dropdown-toggle b {
  margin-inline-start: auto;
  background: #fff;
  border: 1px solid #b8cee8;
  border-radius: 999px;
  padding: 2px 9px;
}
.training-name-dropdown {
  margin-top: 6px;
  border: 1px solid #b8cee8;
  border-radius: 8px;
  background: #fffdf8;
  padding: 7px;
}
.training-name-filter {
  width: 100%;
  margin-bottom: 6px;
}
.training-name-table-wrap {
  max-height: 360px;
}
.training-name-table {
  min-width: 620px;
}
.training-name-table th,
.training-name-table td {
  text-align: center;
  vertical-align: middle;
}
.training-name-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf5ff;
}
.training-name-table thead button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #24476f;
  padding: 5px;
}
.training-name-table tbody tr {
  cursor: pointer;
}
.training-name-table tbody tr:hover td,
.training-name-table tbody tr:hover th {
  background: #f4f8ff;
}
.training-name-table input[type="checkbox"] {
  width: 19px;
  height: 19px;
}
.training-name-selected td,
.training-name-selected th {
  background: #e0f2fe !important;
  color: #075985;
}
.training-name-picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 7px;
}
.training-name-picker-foot button {
  color: #991b1b;
}
.training-names-card {
  overflow: visible;
}
.training-details-modal {
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: auto;
}
.training-details-names {
  border: 1px solid #b8cee8;
  border-radius: 8px;
  background: #fffdf8;
  padding: 8px;
}
.training-details-names > input {
  width: 100%;
  margin-bottom: 7px;
}
.training-details-names .table-wrap {
  max-height: 340px;
}
.training-details-fields {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #d5dfeb;
  border-radius: 8px;
  background: #f8fbff;
}
.training-details-fields label {
  font-weight: 700;
}
.training-details-fields input,
.training-details-fields select {
  width: 100%;
}
@media (max-width: 760px) {
  .training-source-tabs {
    margin-inline-start: 0;
    width: 100%;
  }
  .training-source-tabs button {
    min-width: 0;
    flex: 1;
  }
  .training-export-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Update 76: complete training-document chain and previous-issue state */
.training-table {
  min-width: 2050px;
}
.training-name-issued td,
.training-name-issued th {
  background: #fef3c7 !important;
  color: #854d0e;
}
.training-name-issued:hover td,
.training-name-issued:hover th {
  background: #fde68a !important;
}
.training-company-book-ready {
  display: block;
  width: max-content;
  margin: 3px auto 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 800;
}
.training-name-table input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Update 77: Excel round-trip for selected training details */
.training-details-foot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.training-excel-menu {
  position: relative;
}
.training-excel-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 13px;
  border: 1px solid #315c99;
  border-radius: 8px;
  background: #e8f1ff;
  color: #173f78;
  font-weight: 900;
}
.training-excel-menu > summary::-webkit-details-marker {
  display: none;
}
.training-excel-menu > div {
  position: absolute;
  z-index: 1500;
  top: calc(100% + 5px);
  inset-inline-end: 0;
  display: grid;
  gap: 5px;
  width: 235px;
  padding: 7px;
  border: 1px solid #8db2df;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 9px 25px #0003;
}
.training-excel-menu button {
  text-align: right;
}
.training-excel-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
@media (max-width: 760px) {
  .training-name-picker-foot {
    align-items: stretch;
    flex-direction: column;
  }
  .training-details-foot-actions {
    justify-content: space-between;
  }
  .training-excel-menu > div {
    inset-inline-end: auto;
    inset-inline-start: 0;
  }
}
.schedule-file-menu > div {
  width: 210px;
}
.schedule-print-menu > div {
  width: 230px;
}
.schedule-toolbar .print-menu > summary {
  min-height: 36px;
  padding: 7px 11px;
}
.schedule-print-page h1,
.schedule-print-page p {
  text-align: center;
}

/* Update 82: editable admission year in payment status. */
.payment-table {
  min-width: 2090px;
}
.payment-table .payment-admission-year input {
  width: 112px !important;
  direction: ltr;
  text-align: center;
  font-weight: 800;
  border-color: #8db3df;
  background: #f4f9ff;
}
.payment-table th:nth-child(17),
.payment-table td:nth-child(17) {
  width: auto !important;
}

/* Update 84: unified admission channel, social-care/unit fees, readable notes and archive registers */
.payment-table {
  min-width: 2050px;
}
.payment-table .payment-name {
  min-width: 360px;
}
.payment-table .payment-category-select {
  min-width: 120px;
  width: 100%;
  font-weight: 800;
  text-align: center;
  background: #fffdf8;
}
.payment-table .manual-required {
  width: 125px !important;
  border: 2px solid #c68a25 !important;
  background: #fff7df !important;
  font-weight: 900;
}
.payment-note-preview {
  display: block;
  width: 230px;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  background: #fffdf8;
  color: #667085;
  border: 1px solid #cdbb9d;
  padding: 6px 8px;
}
.payment-note-preview.has-note {
  color: #173f78;
  background: #eef6ff;
  border-color: #8db3df;
}
.payment-note-layer {
  z-index: 1500 !important;
}
.payment-note-modal {
  width: min(760px, 94vw);
}
.payment-note-modal textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.8;
  text-align: right;
}
.archive-list-button {
  background: #e8f1ff;
  color: #173f78;
  border-color: #315c99;
  font-weight: 900;
}
.archive-list-layer {
  z-index: 1450 !important;
}
.archive-list-modal {
  width: min(1500px, 97vw);
  height: min(850px, 94vh);
  display: flex;
  flex-direction: column;
}
.archive-list-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.archive-list-tools input {
  flex: 1;
}
.archive-list-tools span {
  color: var(--muted);
  font-weight: 700;
}
.archive-direction-table {
  flex: 1;
  max-height: none;
}
.archive-direction-table table {
  min-width: 1250px;
}
.archive-direction-table th button {
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  font-weight: 900;
}
.archive-direction-table td {
  vertical-align: middle;
}
.fee-lock-options {
  grid-template-columns: repeat(2, minmax(250px, 1fr));
}
@media (max-width: 760px) {
  .archive-list-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .fee-lock-options {
    grid-template-columns: 1fr;
  }
  .payment-note-preview {
    width: 180px;
    max-width: 180px;
  }
}

/* Update 85: account credentials, granular authorization, student self-service and order notes */
.payment-generated-notes {
  display: grid;
  gap: 6px;
  color: #1e3a8a;
  font-weight: 800;
}
.payment-generated-notes textarea {
  background: #eff6ff;
  min-height: 130px;
}
.permission-matrix {
  min-width: 720px;
}
.permission-matrix th,
.permission-matrix td {
  text-align: center;
}
.permission-matrix td:first-child {
  text-align: right;
  font-weight: 800;
}
.permission-matrix input {
  width: 18px;
  height: 18px;
}
.permission-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.permission-security-note {
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #166534;
  border-radius: 8px;
  padding: 12px;
  line-height: 1.8;
}
.legacy-orders-import {
  border-color: #fbbf24;
}
.readonly-year {
  display: flex;
  gap: 7px;
  align-items: center;
}
.student-self-portal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.student-self-portal table {
  min-width: 900px;
}

/* Update 86: annual student portal, messages, bulk accounts, Drive storage */
.student-message-alert {
  background: #fff1c2 !important;
  color: #7c4a00 !important;
  border-color: #e0a82e !important;
}
.student-message-alert b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-inline-start: 5px;
  border-radius: 999px;
  background: #b42318;
  color: white;
}
.student-portal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.student-portal-head h2 {
  margin: 0;
  color: var(--blue);
}
.student-portal-head p {
  margin: 5px 0 0;
}
.student-portal-head label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.student-one-page {
  display: grid;
  gap: 10px;
}
.student-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.student-panel h3 {
  margin: 0 0 9px;
  color: var(--blue);
}
.student-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.student-info {
  min-height: 70px;
  padding: 8px 10px;
  border: 1px solid #dfd1bb;
  border-radius: 8px;
  background: #fffdf7;
}
.student-info.wide {
  grid-column: 1/-1;
}
.student-info > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.student-info > div {
  white-space: pre-wrap;
  line-height: 1.65;
}
.student-info > div > b,
.student-info > div > small {
  display: block;
}
.training-self-fields,
.payment-self-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.student-message-compose textarea {
  width: 100%;
  min-height: 95px;
}
.student-message-compose > div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.student-message-compose > div > span {
  flex: 1;
  color: var(--muted);
}
.student-message-history {
  display: grid !important;
  gap: 6px;
  margin-top: 12px !important;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.student-message-history h4 {
  margin: 0;
}
.student-message-history article {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf7;
}
.student-message-history article p {
  margin: 0;
}
.student-message-history article small {
  grid-column: 2/-1;
  color: var(--muted);
}
.message-status {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}
.message-status.new {
  background: #fee2e2;
  color: #991b1b;
}
.message-status.seen {
  background: #dcfce7;
  color: #166534;
}
.bulk-account-card {
  display: flex;
  align-items: end;
  gap: 8px;
}
.bulk-account-card > div {
  flex: 1;
}
.bulk-account-card h3,
.bulk-account-card p {
  margin: 0 0 5px;
}
.bulk-account-card label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-weight: 800;
}
.drive-storage-state {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.drive-storage-state span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf7;
}
.drive-storage-state .ready {
  background: #dcfce7;
  color: #166534;
}
.drive-storage-state .not-ready {
  background: #fee2e2;
  color: #991b1b;
}
.student-messages-page {
  min-height: 100vh;
  padding: 12px;
  background: var(--bg);
}
.student-messages-page > header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
}
.student-messages-page > header > div {
  flex: 1;
}
.student-messages-page h1 {
  margin: 0;
  color: var(--blue);
}
.student-messages-page header p {
  margin: 3px 0;
  color: var(--muted);
}
.student-messages-page header label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
}
.message-page-notice {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  padding: 8px 12px;
  border: 1px solid #d4b04f;
  border-radius: 7px;
  background: #fff7d6;
}
.student-messages-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.student-messages-layout > aside,
.student-messages-layout > section {
  height: calc(100vh - 115px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  padding: 8px;
}
.student-messages-layout > aside button {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 5px;
  padding: 9px;
  text-align: right;
  background: #fffdf7;
}
.student-messages-layout > aside button.active {
  border: 2px solid var(--blue2);
  background: #eef6ff;
}
.student-messages-layout > aside button.unread:after {
  content: "جديدة";
  align-self: flex-end;
  padding: 2px 6px;
  border-radius: 999px;
  background: #b42318;
  color: white;
  font-size: 9px;
}
.student-messages-layout > aside span,
.student-messages-layout > aside small {
  color: var(--muted);
}
.message-student-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.message-student-heading h2 {
  margin: 0;
  color: var(--blue);
}
.message-student-heading p {
  margin: 4px 0;
}
.student-message-body {
  margin: 9px 0;
  padding: 10px;
  border: 1px solid #d8b15a;
  border-radius: 8px;
  background: #fff8dc;
}
.student-message-body h3,
.student-message-body p {
  margin: 0 0 7px;
}
.message-student-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.message-detail-item {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf7;
}
.message-detail-item.wide {
  grid-column: 1/-1;
}
.message-detail-item span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.message-detail-item b {
  display: block;
  margin-top: 4px;
  white-space: pre-wrap;
  line-height: 1.55;
}
@media (max-width: 900px) {
  .training-self-fields,
  .payment-self-fields,
  .message-student-detail {
    grid-template-columns: 1fr 1fr;
  }
  .student-messages-layout {
    grid-template-columns: 1fr;
  }
  .student-messages-layout > aside,
  .student-messages-layout > section {
    height: auto;
    max-height: none;
  }
  .bulk-account-card {
    align-items: stretch;
    flex-direction: column;
  }
}
@media (max-width: 620px) {
  .student-fields,
  .training-self-fields,
  .payment-self-fields,
  .message-student-detail {
    grid-template-columns: 1fr;
  }
  .student-portal-head {
    align-items: stretch;
    flex-direction: column;
  }
  .student-message-compose > div {
    align-items: stretch;
    flex-direction: column;
  }
}

/* UPDATE87_UNIFIED_STUDENT_FILE */
.student-file-layer {
  z-index: 1200;
  padding: 18px;
}
.student-file-modal {
  width: min(1240px, 98vw);
  max-width: 1240px;
  height: min(900px, 94vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.student-file-head {
  flex: 0 0 auto;
}
.student-file-head h2 {
  margin: 0 0 6px;
  color: #173f86;
}
.student-file-head p {
  margin: 0;
}
.student-file-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.student-file-identity {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 8px;
  padding: 12px;
  background: #f7ead2;
  border: 1px solid #e4c999;
  border-radius: 12px;
  margin: 10px 0;
}
.student-file-identity span {
  background: #fffaf1;
  border-radius: 8px;
  padding: 9px;
}
.student-file-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 10px;
  flex: 0 0 auto;
}
.student-file-tabs button {
  white-space: nowrap;
  border: 1px solid #d8c7aa;
  background: #fffaf1;
  color: #173f86;
  border-radius: 9px;
  padding: 8px 12px;
  font-weight: 700;
}
.student-file-tabs button.active {
  background: #1e4f9b;
  border-color: #1e4f9b;
  color: white;
}
.student-file-body {
  flex: 1 1 auto;
  overflow: auto;
  border: 1px solid #eadbc1;
  border-radius: 12px;
  padding: 12px;
  background: #fffdfa;
}
.student-file-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}
.student-file-summary article {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8ecd8, #fffaf1);
  border: 1px solid #e4c999;
}
.student-file-summary article b {
  font-size: 30px;
  color: #173f86;
}
.student-file-summary article span {
  font-weight: 700;
}
.student-file-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}
.student-file-cards article {
  border: 1px solid #e2d3ba;
  border-radius: 12px;
  background: #fffaf2;
  padding: 12px;
}
.student-file-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  color: #173f86;
}
.student-file-card-head span {
  white-space: nowrap;
  font-size: 12px;
  background: #eadcc7;
  padding: 4px 8px;
  border-radius: 999px;
}
.student-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0;
}
.student-file-meta span {
  border-radius: 999px;
  padding: 4px 8px;
  background: #f0e6d6;
  font-size: 12px;
}
.student-file-attachment {
  display: inline-flex;
  margin-top: 6px;
  font-weight: 700;
  color: #174ea6;
}
.student-file-empty,
.student-file-loading {
  padding: 42px 20px;
  text-align: center;
  color: #6b5d4b;
  font-weight: 700;
}
.student-file-timeline {
  display: grid;
  gap: 8px;
}
.student-file-timeline article {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 12px;
  border-right: 4px solid #1e4f9b;
  background: #fff8ec;
  border-radius: 8px;
  padding: 10px;
}
.student-file-timeline time {
  color: #705c3d;
  font-size: 12px;
}
.student-file-timeline div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.student-file-timeline span {
  color: #6b5d4b;
  font-size: 12px;
}
.student-file-link-report {
  flex: 0 0 auto;
  padding-top: 8px;
  color: #6b5d4b;
  font-size: 12px;
}
@media (max-width: 900px) {
  .student-file-identity {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .student-file-summary,
  .student-file-cards {
    grid-template-columns: 1fr;
  }
}

/* UPDATE89_FOUNDATION: explicit identity control, DOCX-only history and payment Excel round-trip */
.identity-management .unit-head {
  align-items: end;
}
.identity-link-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #8db2df;
  border-radius: 9px;
  background: #eef6ff;
}
.identity-link-toolbar span {
  margin-inline-end: auto;
}
.identity-grid article.identity-selected {
  outline: 3px solid #2563eb;
  background: #eff6ff;
}
.identity-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.identity-card-head label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
}
.identity-card-head input {
  width: 18px;
  height: 18px;
}
.identity-card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.identity-appearances button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.payment-import-modal {
  width: min(980px, 95vw);
  max-height: 90vh;
  overflow: auto;
}
.payment-import-errors {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0;
  padding: 8px 12px;
  border: 1px solid #ef9a9a;
  border-radius: 8px;
  background: #fff1f1;
  color: #9b1c1c;
}
.payment-import-errors p {
  margin: 4px 0;
}
.payment-import-modal table {
  min-width: 760px;
}
.payment-footer > div {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .identity-link-toolbar,
  .identity-card-head,
  .payment-footer > div {
    align-items: stretch;
    flex-direction: column;
  }
  .identity-link-toolbar span {
    margin: 0;
  }
  .identity-management .unit-head {
    align-items: stretch;
  }
}

/* UPDATE90_ARCHIVE_FOLLOWUP: immutable source PDF, save-time page selection, converted cases only */
.archive-working-pages {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 7px 0;
  padding: 9px 11px;
  border: 1px solid #8db2df;
  border-radius: 8px;
  background: #eef6ff;
  color: #173f78;
}
.archive-working-pages span {
  margin-inline-start: auto;
  color: #526b89;
  font-size: 11px;
  font-weight: 700;
}
.archive-page-save-layer {
  z-index: 1550 !important;
}
.archive-page-save-modal {
  width: min(690px, 94vw);
}
.archive-original-safe-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 12px;
  padding: 11px 13px;
  border: 1px solid #86c99a;
  border-radius: 9px;
  background: #edfdf2;
  color: #166534;
}
.archive-page-spec-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 900;
  color: #27344a;
}
.archive-page-spec-label input {
  font-size: 18px;
  text-align: center;
}
.archive-page-spec-label small {
  color: var(--muted);
}
.archive-page-selection-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.archive-page-selection-summary p {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
}
.archive-page-selection-summary .field-error {
  grid-column: 1/-1;
  border-color: #ef9a9a;
  background: #fff1f1;
  color: #9b1c1c;
}
.archive-page-save-modal .record-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .archive-working-pages span {
    width: 100%;
    margin: 0;
  }
  .archive-page-selection-summary {
    grid-template-columns: 1fr;
  }
  .archive-page-selection-summary .field-error {
    grid-column: auto;
  }
  .archive-page-save-modal .record-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* UPDATE91_FOUNDATION: explicit archive identities, annual student grid and project submission */
.archive-audience-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 2px solid #8db2df;
  background: #eef6ff;
}
.archive-audience-card h3,
.archive-audience-card p {
  margin: 0;
}
.archive-audience-card p {
  margin-top: 4px;
  color: #526b89;
}
.archive-audience-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.archive-audience-options button {
  padding: 10px 16px;
  border: 1px solid #8db2df;
  background: white;
  color: #173f78;
  font-weight: 900;
}
.archive-audience-options button.active {
  background: #173f78;
  color: white;
}
.archive-image-preview {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 760px;
  margin: auto;
  object-fit: contain;
}
.viewer-error {
  color: #991b1b;
}
.office-viewer-note a {
  margin-top: 10px;
}
.pdf-stage > div {
  transform-origin: center top;
}
.annual-students-layer {
  position: fixed;
  z-index: 1400;
  inset: 0;
  padding: 14px;
  background: #0007;
}
.annual-students-window {
  display: flex;
  height: calc(100vh - 28px);
  flex-direction: column;
  border-radius: 12px;
  background: #fffaf1;
  box-shadow: 0 18px 55px #0006;
  overflow: hidden;
}
.annual-students-window > .modal-head {
  padding: 12px 16px;
}
.annual-students-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-block: 1px solid #d8c7aa;
  background: #f7ead2;
}
.annual-students-tools > input {
  min-width: 260px;
  flex: 1;
}
.annual-students-tools > span {
  margin-inline-start: auto;
  color: #526b89;
  font-weight: 800;
}
.student-details-menu {
  position: relative;
}
.student-details-menu > div {
  position: absolute;
  z-index: 5;
  top: calc(100% + 5px);
  inset-inline-end: 0;
  display: grid;
  min-width: 230px;
  padding: 7px;
  border: 1px solid #8db2df;
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 30px #0003;
}
.student-details-menu > div button {
  text-align: right;
}
.annual-students-table {
  flex: 1;
  max-height: none;
}
.annual-students-table table {
  min-width: 2200px;
}
.annual-students-table thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #dceaf9;
}
.annual-students-table td {
  vertical-align: middle;
}
.annual-students-table input {
  min-width: 125px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
}
.annual-students-table input:focus {
  border-color: #2563eb;
  background: white;
}
.annual-students-table .wide-cell {
  min-width: 240px;
}
.annual-students-table .protected-cell {
  min-width: 145px;
  background: #f1ede5;
  color: #6b5d4b;
}
.annual-students-window > .modal-actions {
  padding: 8px 12px;
}
.annual-changes-layer {
  z-index: 1500 !important;
}
.annual-changes-modal {
  width: min(1420px, 97vw);
  height: min(850px, 94vh);
  display: flex;
  flex-direction: column;
}
.annual-changes-modal .table-wrap {
  flex: 1;
  max-height: none;
}
.annual-changes-modal table {
  min-width: 1100px;
}
.annual-changes-modal .approved-change td {
  background: #ecfdf5;
}
.annual-changes-modal .modal-actions {
  justify-content: flex-end;
}
.projects-workspace {
  display: grid;
  gap: 10px;
}
.project-links-card {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(480px, 2fr);
  gap: 16px;
  align-items: center;
}
.project-links-card h3,
.project-links-card p {
  margin: 0;
}
.project-links-card p {
  margin-top: 5px;
  color: var(--muted);
}
.project-link-rows {
  display: grid;
  gap: 6px;
}
.project-link-rows label {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 6px;
  align-items: center;
}
.project-link-rows input {
  direction: ltr;
  text-align: left;
}
.project-admin-tabs {
  display: flex;
  gap: 6px;
  overflow: auto;
}
.project-admin-tabs button {
  white-space: nowrap;
}
.project-admin-tabs button.active {
  background: #173f78;
  color: white;
}
.project-ranking-preview {
  width: min(1000px, 95vw);
  max-height: 90vh;
  overflow: auto;
}
.project-backup-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.project-backup-summary p {
  margin: 0;
  padding: 12px;
  border: 1px solid #b8cee8;
  border-radius: 9px;
  background: #eef6ff;
  text-align: center;
}
.project-backup-summary b {
  display: block;
  font-size: 24px;
  color: #173f78;
}
.project-eligibility-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.project-eligibility-grid > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  min-width: 0;
}
.project-eligibility-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.project-eligibility-head h4 {
  margin: 0;
}
.project-eligibility-head span {
  display: flex;
  gap: 4px;
}
.project-name-checks {
  display: grid;
  gap: 5px;
  max-height: 55vh;
  overflow: auto;
  padding: 2px;
}
.project-name-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: #fff;
}
.project-name-checks input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.project-name-checks span {
  display: grid;
}
.project-name-checks small {
  color: var(--muted);
}
.project-public-page {
  min-height: 100vh;
  padding: 18px;
  background: linear-gradient(135deg, #eaf2ff, #fff8e8);
  color: #27344a;
}
.project-public-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto 12px;
  padding: 13px 18px;
  border: 1px solid #b8cee8;
  border-radius: 13px;
  background: #fffdf8;
  box-shadow: 0 8px 28px #173f7818;
}
.project-public-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.project-public-head > div > span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 14px;
  background: #173f78;
  font-size: 26px;
}
.project-public-head h1,
.project-public-head p {
  margin: 0;
}
.project-public-head p {
  margin-top: 4px;
  color: #526b89;
}
.project-public-head > b {
  padding: 7px 11px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
}
.project-public-card {
  max-width: 1180px;
  margin: auto;
  padding: 18px;
  border: 1px solid #d8c7aa;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 10px 35px #00000015;
}
.project-public-notice {
  display: flex;
  max-width: 1180px;
  margin: 0 auto 10px;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid #86c99a;
  border-radius: 9px;
  background: #ecfdf5;
  color: #166534;
}
.project-public-notice.error {
  border-color: #ef9a9a;
  background: #fff1f1;
  color: #991b1b;
}
.project-step {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 14px 0 9px;
}
.project-step > b {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #173f78;
  color: white;
}
.project-step h2,
.project-step p {
  margin: 0;
}
.project-step p {
  margin-top: 3px;
  color: #526b89;
}
.project-identity-select {
  width: 100%;
  min-height: 46px;
  font-size: 16px;
}
.project-count-input {
  width: 130px;
}
.proposal-buttons {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.proposal-buttons button {
  min-width: 150px;
  background: #e8f1ff;
  color: #173f78;
  border-color: #8db2df;
}
.proposal-form {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #d8c7aa;
}
.proposal-form textarea {
  min-height: 92px;
}
.project-member-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 7px;
  max-height: 390px;
  overflow: auto;
  padding: 7px;
  border: 1px solid #d8c7aa;
  border-radius: 9px;
}
.project-member-grid label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px;
  padding: 9px;
  border: 1px solid #dfd1bb;
  border-radius: 8px;
  background: white;
}
.project-member-grid label.selected {
  border-color: #2563eb;
  background: #eff6ff;
}
.project-member-grid input {
  grid-row: 1/3;
  width: 18px;
  height: 18px;
}
.project-member-grid small {
  color: #526b89;
}
.project-member-count {
  padding: 7px 10px;
  border-radius: 7px;
  background: #eef6ff;
}
.project-preferences {
  display: grid;
  gap: 7px;
}
.project-preferences label {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  align-items: center;
}
.project-submission-status {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #86c99a;
  border-radius: 9px;
  background: #ecfdf5;
  color: #166534;
}
@media (max-width: 900px) {
  .archive-audience-card,
  .project-public-head {
    align-items: stretch;
    flex-direction: column;
  }
  .project-links-card,
  .project-eligibility-grid {
    grid-template-columns: 1fr;
  }
  .project-backup-summary {
    grid-template-columns: 1fr 1fr;
  }
  .project-member-grid {
    grid-template-columns: 1fr 1fr;
  }
  .annual-students-layer {
    padding: 4px;
  }
  .annual-students-window {
    height: calc(100vh - 8px);
  }
}
@media (max-width: 620px) {
  .archive-audience-options,
  .archive-audience-options button {
    width: 100%;
  }
  .annual-students-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .annual-students-tools > input {
    min-width: 0;
  }
  .student-details-menu,
  .student-details-menu > .action-btn {
    width: 100%;
  }
  .project-link-rows label,
  .project-preferences label {
    grid-template-columns: 1fr;
  }
  .project-member-grid {
    grid-template-columns: 1fr;
  }
  .project-public-page {
    padding: 7px;
  }
}
.project-count-control {
  display: inline-grid;
  grid-template-columns: 52px 72px 52px;
  direction: ltr;
  align-items: center;
  overflow: hidden;
  border: 1px solid #8db2df;
  border-radius: 10px;
  background: #fff;
}
.project-count-control button {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: #e8f1ff;
  color: #173f78;
  font-size: 26px;
  font-weight: 800;
  touch-action: manipulation;
}
.project-count-control button:disabled {
  opacity: 0.42;
}
.project-count-control output {
  display: grid;
  min-height: 48px;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
}
.proposal-buttons {
  margin-top: 10px;
}
.proposal-buttons button {
  min-height: 44px;
  touch-action: manipulation;
}
@media (max-width: 620px) {
  .project-public-card {
    padding: 12px;
  }
  .project-count-control {
    display: grid;
    width: 100%;
    grid-template-columns: 64px 1fr 64px;
  }
  .proposal-buttons {
    display: grid;
  }
  .proposal-buttons button {
    width: 100%;
    min-width: 0;
  }
}
.module-quick-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  max-width: min(38vw, 520px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  padding: 2px;
}
.module-quick-nav button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d8d4e5;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.module-quick-nav button span {
  font-size: 17px;
  line-height: 1;
}
.module-quick-nav button:hover,
.module-quick-nav button:focus-visible {
  transform: scale(1.14);
  z-index: 2;
  box-shadow: 0 4px 12px #38205f30;
}
.identity-review-panel {
  display: grid;
  gap: 14px;
}
.identity-review-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.identity-review-nav .danger-link {
  margin-inline-start: auto;
}
.identity-review-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.6fr);
  gap: 16px;
}
.identity-source-card,
.identity-candidate-card {
  border: 1px solid #ddd6ea;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}
.identity-source-card h3 {
  margin: 8px 0;
}
.identity-source-card p {
  color: #615a6b;
}
.identity-candidate-card > label {
  display: grid;
  gap: 6px;
}
.identity-candidate-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  max-height: 440px;
  overflow: auto;
}
.identity-candidate-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #e4dfeb;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}
.identity-candidate-list label.selected {
  border-color: #68409a;
  background: #f5effc;
}
.identity-candidate-list span {
  display: grid;
}
.identity-candidate-list small {
  color: #6d6675;
}
.identity-candidate-list strong {
  white-space: nowrap;
}
.match-pass {
  color: #167744;
}
.match-low {
  color: #a45b11;
}
.archive-unsaved-badge {
  background: #fff0c2;
  color: #7b5300;
  border: 1px solid #e6c55a;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
}
@media (max-width: 900px) {
  .module-quick-nav {
    max-width: 48vw;
  }
  .identity-review-body {
    grid-template-columns: 1fr;
  }
}
.matching-progress {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f5effc;
  color: #4f2c76;
}
.matching-progress progress {
  width: 100%;
  height: 12px;
}
.identity-page-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.identity-matrix-wrap {
  max-height: 68vh;
}
.identity-matrix {
  min-width: max-content;
}
.identity-matrix th,
.identity-matrix td {
  min-width: 230px;
}
.identity-matrix th:first-child,
.identity-matrix td:first-child {
  min-width: 75px;
}
.identity-matrix td select {
  width: 100%;
  max-width: 310px;
}
.identity-matrix td small {
  display: block;
  margin-top: 5px;
}
.identity-horizontal-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  height: 18px;
  margin: 4px 0 6px;
  border: 1px solid #d7c7aa;
  border-radius: 8px;
  background: #f7efe1;
  scrollbar-color: #84613d #efe1ca;
}
.identity-horizontal-scroll > div {
  height: 1px;
}
.identity-approved-row > td {
  background: #f3fbf4;
}
.identity-approved-row .identity-current-cell {
  background: #e8f7eb;
}
.identity-approved-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #16743a;
  font-weight: 800;
  white-space: nowrap;
}
.identity-approved-mark small {
  color: #3d7650;
  font-size: 11px;
}
.identity-linked-cell {
  background: #ecf9ef !important;
  box-shadow: inset 0 0 0 1px #9ed6ad;
}
.identity-linked-cell select {
  border-color: #65ad78;
  background: #f7fff8;
}
.settings-student-tools .students-toolbar {
  justify-content: flex-start;
}
.student-result-toolbar {
  position: sticky;
  top: 0;
  z-index: 8;
}
.student-result-toolbar .student-file-tabs {
  margin-top: 8px;
}
.annual-students-table th:last-child,
.annual-students-table td:last-child {
  min-width: 190px;
}
.annual-students-table td:last-child {
  display: flex;
  gap: 6px;
}
.annual-frozen-list {
  margin: 10px 0;
  border: 1px solid #d9c7a7;
  border-radius: 10px;
  background: #fff8ec;
  padding: 10px;
}
.annual-frozen-list summary {
  cursor: pointer;
  font-weight: 800;
  color: #784d20;
}
.annual-frozen-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 7px;
  border-top: 1px solid #eadcc5;
}
.academic-history-preview {
  width: min(1180px, 96vw);
}
.academic-history-preview table {
  min-width: 980px;
}
.pin-year-btn {
  white-space: nowrap;
  border: 1px solid #cfb783;
  background: #fffaf0;
  color: #72551d;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 700;
}
.pin-year-btn.pinned {
  background: #e5f7e9;
  border-color: #63b979;
  color: #17602b;
}
.instruction-alerts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.instruction-alerts span {
  background: #eef5ff;
  border: 1px solid #b9cde8;
  border-radius: 9px;
  padding: 8px 12px;
}
.instruction-alerts .near {
  background: #fff5d8;
  border-color: #dfbd58;
}
.instruction-alerts .overdue {
  background: #ffe7e4;
  border-color: #dc7d72;
  color: #8f241c;
}
.instruction-kind-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.instruction-kind-buttons button {
  padding: 14px;
  border: 1px solid #d7b982;
  border-radius: 12px;
  background: #fffaf0;
  font-weight: 800;
  color: #153b78;
}
.instruction-kind-buttons button.active {
  background: #255db4;
  color: #fff;
  border-color: #255db4;
}
.instruction-large-modal,
.instruction-list-modal {
  position: fixed !important;
  z-index: 1200;
  inset: 5vh 4vw !important;
  width: auto !important;
  max-width: none !important;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 18px 60px #0005;
  border: 2px solid #d7b982;
}
.instruction-large-modal:before,
.instruction-list-modal:before {
  content: "";
  position: fixed;
  inset: 0;
  background: #0007;
  z-index: -1;
}
.instruction-list-modal .table-wrap {
  max-height: 68vh;
}
.instruction-large-modal textarea {
  min-height: 130px;
}
@media (max-width: 700px) {
  .instruction-large-modal,
  .instruction-list-modal {
    inset: 2vh 2vw !important;
  }
  .instruction-kind-buttons {
    grid-template-columns: 1fr;
  }
  .instruction-large-modal .form-grid {
    grid-template-columns: 1fr;
  }
}

.committee-workspace { display: grid; gap: 12px; }
.committee-warning { background: #fff0d6; border: 1px solid #db9b2d; color: #7a4300; padding: 12px 16px; border-radius: 11px; font-weight: 800; }
.committee-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.committee-toolbar h3, .committee-toolbar p { margin: 0 0 5px; }
.committee-toolbar .button-row { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.committee-toolbar label, .committee-order-meta label, .committee-name-row label { display: grid; gap: 5px; font-weight: 700; }
.committee-order-meta { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 10px; }
.committee-builder { display: grid; gap: 14px; }
.committee-card { padding: 0; overflow: hidden; }
.committee-card > header { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; background: #e8f1ff; border-bottom: 1px solid #b8cce8; }
.committee-card > header div, .member-row > span:last-child { display: flex; gap: 5px; }
.committee-card button { white-space: nowrap; }
.committee-name-row { display: grid; grid-template-columns: minmax(260px, 1fr) auto 150px; gap: 10px; align-items: end; padding: 12px; }
.committee-members { padding: 0 12px 12px; overflow-x: auto; }
.member-head, .member-row { display: grid; grid-template-columns: 45px minmax(310px, 2fr) minmax(190px, 1fr) 90px; gap: 7px; min-width: 700px; align-items: center; padding: 6px; border-bottom: 1px solid #e0cfac; }
.member-head { background: #f5ead4; color: #153b78; font-weight: 800; }
.committee-add { justify-self: center; padding: 13px 26px; border: 1px dashed #278653; background: #e9fff2; border-radius: 12px; color: #17602b; font-weight: 800; }
.workload-summary > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 7px; max-height: 320px; overflow: auto; }
.workload-summary span { display: flex; justify-content: space-between; gap: 8px; padding: 8px; background: #fffaf0; border: 1px solid #e3d2b2; border-radius: 8px; }
.workload-summary small { color: #52647b; }
.saved-formations td:last-child { display: flex; gap: 7px; align-items: center; }
.saved-formations em { color: #a13b25; font-style: normal; font-weight: 700; }
@media (max-width: 850px) {
  .committee-toolbar { align-items: stretch; flex-direction: column; }
  .committee-order-meta, .committee-name-row { grid-template-columns: 1fr; }
}

.evaluation-table-scroll{overflow-x:auto;max-width:100%}.evaluation-table-scroll table{width:100%;min-width:900px;border-collapse:collapse}.evaluation-table-scroll td{padding:10px;border:1px solid #dac9ac;vertical-align:top;min-width:110px;white-space:normal}.evaluation-input{display:grid;gap:5px}.evaluation-input span{font-size:12px}.evaluation-input textarea{min-width:130px;min-height:65px;width:100%}.evaluation-input input{min-width:80px;width:100%}.evaluation-evidence{min-width:160px;display:grid;gap:7px}.evaluation-evidence input{max-width:170px}.evaluation-evidence a{overflow-wrap:anywhere}.evaluation-tabs{flex-wrap:wrap}
/* Update102 original inventory document editor */
.inventory-document-modal{max-width:96vw!important;width:1500px!important;height:94vh;display:flex;flex-direction:column;overflow:hidden}.inventory-document-scroll{overflow:auto;flex:1;background:#e8e8e8;padding:20px}.inventory-paper{box-sizing:border-box;margin:auto;background:white;color:black;padding:28pt 24pt;box-shadow:0 2px 8px #0002;direction:rtl}.inventory-paper p{white-space:pre-wrap;min-height:10pt;margin:0;line-height:1.25}.inventory-paper table{margin:4pt 0}.inventory-paper td{color:black!important;min-width:0;overflow-wrap:anywhere;line-height:1.25}.inventory-paper [contenteditable=true]:focus{outline:2px solid #467bbb;background:#f0f6ff}.inventory-editor-tools{display:flex;flex-wrap:wrap;gap:5px;padding:8px;background:#f5f8fc}.inventory-editor-tools button{font-size:13px;padding:6px}.inventory-document-modal>p{margin:5px;font-size:12px}

.performance-layout{display:grid;grid-template-columns:minmax(500px,1.35fr) minmax(300px,1fr);gap:18px;align-items:start;direction:ltr}.performance-page{position:relative;width:100%;background:white;box-shadow:0 1px 8px #0002}.performance-page>img{width:100%;height:100%;display:block}.performance-overlay{position:absolute!important;padding:0!important;margin:0!important;border:1px dashed #448abb66!important;border-radius:0!important;color:#123!important;background:#d8f1ff66;font:clamp(6px,.85vw,13px) Arial!important;line-height:1.1!important;overflow:hidden;white-space:pre-wrap!important;direction:rtl}.performance-overlay.computed{background:#edf6dc66}.performance-inputs{direction:rtl;max-height:1050px;overflow:auto}.performance-field{padding:12px;border:1px solid #cbd5e1;border-radius:8px;margin-bottom:10px;scroll-margin:20px}.performance-field textarea,.performance-field input,.performance-field select{width:100%;display:block}.performance-field small{display:block;color:#64748b}.performance-field details p{white-space:pre-wrap}@media(max-width:950px){.performance-layout{display:flex;flex-direction:column}.performance-page{min-width:540px}.performance-layout{overflow:auto}.performance-inputs{width:100%;max-height:none}}@media print{.performance-inputs,.performance-overlay{display:none}}

/* Update104: locale-independent dates and committee approvals */
.date-input{direction:ltr;unicode-bidi:isolate;text-align:center;min-width:10rem;font-variant-numeric:tabular-nums}
.date-input[aria-invalid="true"]{border:2px solid #b42318;background:#fff3f0}
.committee-approval{border-top:1px solid #cbd5e1;padding-top:12px;margin-top:12px}
.saved-formations details>summary{cursor:pointer;font-weight:700;padding:10px}
.saved-formations .committee-approval{min-width:330px}

/* BEGIN course-details-scroll-fix-20261009 */
/* Scoped to the course/project editor. No data or application logic changes. */
@media screen {
  .modal-layer:has(> .modal.course-details) {
    padding: 4px;
    min-width: 0;
    min-height: 0;
  }
  .modal.course-details {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: calc(100vh - 8px);
    height: calc(100dvh - 8px);
    max-height: none;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    padding: 8px;
  }
  .modal.course-details > .modal-head,
  .modal.course-details > .course-details-tabs,
  .modal.course-details > .modal-actions {
    position: static;
    min-width: 0;
  }
  .modal.course-details > .modal-head {
    padding-top: 0;
    margin-bottom: 6px;
  }
  .modal.course-details > .course-details-tabs {
    flex-wrap: wrap;
    padding: 6px;
    margin-bottom: 6px;
  }
  .modal.course-details > .modal-actions {
    flex-wrap: wrap;
    padding: 6px 0 0;
    margin-top: 6px;
  }
  .modal.course-details > .table-wrap,
  .modal.course-details > .project-distribution {
    min-width: 0;
    min-height: 0;
    max-height: none;
    margin: 0;
    overflow: scroll;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    scrollbar-color: #887553 #f5efe3;
  }
  .modal.course-details > .table-wrap::-webkit-scrollbar,
  .modal.course-details > .project-distribution::-webkit-scrollbar {
    width: 16px;
    height: 16px;
  }
  .modal.course-details > .table-wrap::-webkit-scrollbar-thumb,
  .modal.course-details > .project-distribution::-webkit-scrollbar-thumb {
    background: #887553;
    border: 3px solid #f5efe3;
    border-radius: 8px;
  }
  .modal.course-details > .table-wrap::-webkit-scrollbar-track,
  .modal.course-details > .project-distribution::-webkit-scrollbar-track {
    background: #f5efe3;
  }
  /* Keep both header rows together; sticky cells at top:0 overlapped. */
  .modal.course-details > .table-wrap > table > thead {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .modal.course-details th {
    position: static;
  }
  /* One scroll owner for the project introduction and its complete table. */
  .modal.course-details > .project-distribution > .table-wrap {
    width: max-content;
    min-width: 100%;
    max-height: none;
    overflow: visible;
  }
  .modal.course-details > .project-distribution > .table-wrap > table {
    min-width: 1500px;
  }
  @media (max-height: 600px) {
    .modal.course-details > .modal-head p { display: none; }
    .modal.course-details > .modal-head { padding-bottom: 4px; }
    .modal.course-details > .course-details-tabs { padding: 3px; }
  }
}
/* Content-sized columns; keep the viewport and scroll owners from v2. */
@media screen {
  .modal.course-details > .table-wrap > table,
  .modal.course-details > .project-distribution > .table-wrap > table {
    table-layout: auto;
    width: max-content;
    min-width: 0;
  }
  .modal.course-details > .project-distribution > .table-wrap {
    min-width: 0;
  }
  .modal.course-details th,
  .modal.course-details td {
    padding: 3px 4px;
    height: auto;
    vertical-align: middle;
    white-space: nowrap;
  }
  .modal.course-details td input:not([type="checkbox"]),
  .modal.course-details td select {
    min-width: 0;
    max-width: none;
    min-height: 26px;
    height: auto;
    padding: 2px 5px;
    font: inherit;
    line-height: 1.4;
  }
  /* Fallback widths for browsers without field-sizing support. */
  .modal.course-details td input:not([type="checkbox"]):not([type="number"]) {
    width: 24ch;
  }
  .modal.course-details td select {
    width: auto;
  }
  .modal.course-details td input[type="number"] {
    width: 7ch;
    min-width: 7ch;
  }
  @supports (field-sizing: content) {
    .modal.course-details td input:not([type="checkbox"]),
    .modal.course-details td select {
      field-sizing: content;
      width: auto;
      min-width: 4ch;
    }
    .modal.course-details td input[type="number"] {
      min-width: 7ch;
    }
  }
  .modal.course-details .section-checkboxes {
    gap: 3px;
    min-width: 0;
  }
  .modal.course-details .section-checkboxes label,
  .modal.course-details .section-checkboxes strong {
    padding: 2px 4px;
    min-width: 0;
    min-height: 26px;
  }
  .modal.course-details .show-teacher-check {
    width: 18px !important;
    min-width: 18px !important;
    height: 18px;
    min-height: 18px;
    margin: 0;
    vertical-align: middle;
  }
  .modal.course-details td > button {
    min-height: 26px;
    padding: 2px 6px;
  }
  .modal.course-details .project-rows {
    min-width: 0;
    gap: 3px;
  }
  .modal.course-details .project-rows > div {
    grid-template-columns: max-content max-content max-content max-content;
    gap: 4px;
    padding: 3px;
    width: max-content;
  }
}

/* v4: fixed narrow hour fields, including all five teacher assignments. */
@media screen {
  .modal.course-details input[type="number"] {
    field-sizing: fixed;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    padding-inline: 3px;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
  }
  .modal.course-details input[type="number"]::-webkit-inner-spin-button,
  .modal.course-details input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .modal.course-details > .table-wrap > table > tbody > tr > td:nth-child(7),
  .modal.course-details > .table-wrap > table > tbody > tr > td:nth-child(8),
  .modal.course-details > .table-wrap > table > tbody > tr > td:nth-child(3n + 10):nth-child(-n + 22) {
    width: 56px;
    min-width: 0;
    padding-inline: 3px;
  }
}
/* END course-details-scroll-fix-20261009 */
