:root {
  --teal: #38BDF8;
  --blue: #818CF8;
  --purple: #C084FC;
  --green: #34D399;
  --orange: #FBBF24;
  --red: #FB7185;
  --navy: #1E3A8A;
  --gray: #334155;
  --dark: #0F172A;
  --white: #ffffff;
  --ink: #F8FAFC;

  --bg-app: #0B1120;
  --border-light: #1E293B;
  --card-bg: #111827;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg-app);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg-app);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  transition: all 0.2s ease;

  cursor: pointer;
}

.toast {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 18px;
  border-radius: 12px;
  color: #fff;
  background: rgba(29, 38, 48, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  transform: translateY(-130%);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast.error {
  background: #E11D48;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(3px);
}

.system-modal {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #F8FAFC;
  background: #111827;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.system-modal h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.system-modal p {
  margin: 0;
  color: #CBD5E1;
  font-size: 14px;
  line-height: 1.45;
}

.system-modal label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 800;
}

.system-modal input {
  min-height: 42px;
  border: 1px solid #475569;
  border-radius: 10px;
  padding: 8px 10px;
  color: #F8FAFC;
  background: #0F172A;
}

.modal-warning {
  padding: 10px 12px;
  border-left: 4px solid #FB7185;
  border-radius: 8px;
  color: #FFE4E6;
  background: rgba(225, 29, 72, 0.16);
  font-size: 13px;
  font-weight: 900;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #0B1120, #1E293B);
}

.login-card {
  width: min(500px, 100%);
  display: grid;
  gap: 16px;
  padding: 36px;
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.1;
}

.login-card label,
.scheduler-card label,
.data-panel label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.login-card input,
.scheduler-card input,
.scheduler-card select,
.data-panel input,
.data-panel select {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 6px 9px;
  color: #ffffff;
  background: #025763;
}

.login-card input:disabled,
.scheduler-card input:disabled,
.scheduler-card select:disabled,
.data-panel input:disabled,
.data-panel select:disabled,
.locked-select {
  background: var(--border-light) !important;
  color: var(--ink) !important;
  opacity: 0.8;
}

.password-rule {
  color: #CBD5E1;
  font-size: 12px;
  line-height: 1.35;
}

.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.primary-action,
.secondary-action,
.danger-action,
.panel-submit {
  border: 0;
  border-radius: 12px;
  min-height: 38px;
  padding: 8px 14px;
  font-weight: 800;
}

.primary-action {
  color: #fff;
  background: var(--navy);
}

.secondary-action {
  color: #fff;
  background: #5f6670;
}

.danger-action {
  color: #fff;
  background: #BE123C;
}

.app-shell {
  min-height: 100vh;
  zoom: 0.85;
}

.topbar {
  min-height: 116px;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr auto;
  align-items: center;
  gap: 26px;
  padding: 18px 38px;
  color: #fff;
  background: var(--teal);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: 0;
}

.department-sort {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 29px;
}

.department-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.dept-toggle {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 0;
  color: #fff;
  background: transparent;
  padding: 0;
}

.dept-pill {
  min-width: 84px;
  padding: 11px 17px;
  border-radius: 22px;
  font-size: 32px;
  font-weight: 800;
  text-align: center;
}

.dept-check {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 7px solid var(--card-bg);
  border-radius: 6px;
  color: #fff;
  background: #10B981;
  font-size: 31px;
  line-height: 1;
}

.dept-check::before {
  content: "";
  width: 23px;
  height: 13px;
  border-left: 8px solid #fff;
  border-bottom: 8px solid #fff;
  transform: rotate(-45deg) translate(2px, -2px);
}

.dept-toggle.off .dept-check {
  background: #5f6670;
}

/* ── User Box ─────────────────────────────── */
.user-box {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.user-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0F172A;
  border: 2.5px solid rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

#user-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.user-role-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.user-box-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.logout-btn {
  transition: all 0.22s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.logout-btn svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.logout-btn:hover {
  background: #fff;
  border-color: #fff;
  color: #0F172A;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.logout-btn:hover svg {
  stroke: #0F172A;
}

.logout-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* kept for any other .icon-button usages */
.icon-button {
  transition: all 0.22s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.icon-button.dark {
  background: var(--navy);
}

.work-area {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  padding: 32px 30px 20px;
  background: var(--gray);
}

.side-rail {
  display: grid;
  align-content: center;
  gap: 50px;
}

.rail-action {
  display: grid;
  justify-items: center;
  gap: 18px;
  border: 0;
  color: #3B82F6;
  background: transparent;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.clock-face {
  width: 112px;
  height: 112px;
  position: relative;
  border-radius: 50%;
  background: #475569;
}

.clock-face::before,
.clock-face::after {
  content: "";
  position: absolute;
  left: 52px;
  top: 28px;
  width: 6px;
  height: 44px;
  border-radius: 99px;
  background: #c8d0e7;
  transform-origin: bottom;
}

.clock-face::after {
  height: 32px;
  transform: rotate(128deg);
}

.download-mark {
  width: 114px;
  height: 114px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #F8FAFC;
  background: var(--red);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.schedule-wrap {
  min-width: 0;
  border: 36px solid var(--bg-app);
  background: var(--card-bg);
}

.date-strip {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: #34D399;
  font-size: 31px;
  font-weight: 900;
}

.date-strip input {
  width: 210px;
  border: 0;
  color: #fff;
  background: #64748B;
  padding: 6px 10px;
  font-size: 28px;
  font-weight: 900;
}

.calendar-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  color: var(--teal);
  background: var(--card-bg);
  font-size: 15px;
  font-weight: 900;
}

.lane-headings {
  display: flex;
  min-height: 62px;
  gap: 6px;
  padding-top: 4px;
  overflow: hidden;
}

.lane-heading {
  flex: 1 0 230px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 31px;
  font-weight: 900;
}

.lane-heading.form-heading {
  flex: 0 0 min(540px, 92vw);
}

.board-scroll {
  min-height: 570px;
  display: flex;
  gap: 6px;
  overflow: auto;
  border-bottom: 24px solid var(--border-light);
  scrollbar-color: #F97316 #CBD5E1;
}

.scheduler-card {
  flex: 0 0 min(540px, 92vw);
  padding: 14px 12px 20px;
  color: #fff;
  background: var(--blue);
}

.scheduler-card form {
  display: grid;
  gap: 14px;
}

.form-line {
  display: grid;
  gap: 12px;
}

.form-line.two {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

.form-line.module-line {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(130px, 0.65fr);
}

.form-line.compact {
  grid-template-columns: 1fr 1fr auto auto;
  align-items: end;
}

.form-line.notes-line {
  grid-template-columns: 1fr;
}

.form-line.notes-line label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#exam-notes {
  width: 100%;
  resize: vertical;
  min-height: 56px;
  padding: 8px 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.09);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 150ms ease, background 150ms ease;
}

#exam-notes::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

#exam-notes:focus {
  outline: none;
  border-color: #F97316;
  background: rgba(255, 255, 255, 0.14);
}

.self-addition-checkbox {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.34);
  cursor: pointer;
}

.self-addition-checkbox input {
  width: 20px;
  height: 20px;
  margin: 0;
  justify-self: center;
  accent-color: #10B981;
}

.self-addition-checkbox strong,
.self-addition-checkbox small {
  display: block;
}

.self-addition-checkbox strong {
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.self-addition-checkbox small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.self-addition-checkbox:has(input:disabled) {
  opacity: 0.62;
  cursor: not-allowed;
}

.check-label {
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  gap: 7px;
  min-height: 34px;
}

.check-label input {
  width: 28px;
  height: 28px;
  accent-color: #10B981;
}

.mds-target-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #F8FAFC;
  background: rgba(15, 23, 42, 0.45);
}

.mds-target-box strong {
  margin-right: 4px;
  font-size: 14px;
  font-weight: 900;
}

.mds-target-box label {
  min-height: 32px;
  display: inline-flex;
  grid-template-columns: none;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #0F172A;
  font-size: 14px;
  font-weight: 900;
}

.mds-target-box input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: #10B981;
}

.existing-box {
  display: grid;
  gap: 8px;
  padding: 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
}

.existing-list {
  display: grid;
  gap: 6px;
  color: #CBD5E1;
}

.existing-item {
  padding: 7px 8px;
  border-left: 5px solid var(--orange);
  background: var(--card-bg);
}

.hall-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  color: #fff;
  background: #F97316;
  font-size: 20px;
  font-weight: 900;
}

.round-plus {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--navy);
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}

.hall-allocations {
  display: grid;
  gap: 12px;
}

.allocation-summary {
  padding: 9px 11px;
  border-radius: 12px;
  color: #fff;
  background: #E11D48;
  font-size: 15px;
  font-weight: 900;
}

.allocation-summary.complete {
  background: #059669;
}

.allocation-summary.problem {
  background: #E11D48;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hall-card {
  display: grid;
  gap: 10px;
  padding: 11px;
  background: #475569;
}

.hall-card-header {
  display: grid;
  grid-template-columns: 1fr 120px 38px;
  gap: 10px;
  align-items: end;
}

.capacity-note {
  font-size: 12px;
  color: #e9dcff;
}

.staff-grid {
  display: grid;
  gap: 8px;
}

.staff-row {
  display: grid;
  grid-template-columns: minmax(135px, 0.8fr) minmax(170px, 1fr) 32px;
  gap: 8px;
  align-items: center;
}

.remove-button {
  transition: all 0.2s ease;

  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #F43F5E;
  font-weight: 900;
}

.add-staff-button {
  transition: all 0.2s ease;

  justify-self: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #475569;
  background: var(--card-bg);
  font-size: 23px;
  font-weight: 900;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.exam-lanes {
  display: flex;
  gap: 6px;
}

.exam-lane {
  flex: 1 0 330px;
  min-height: 570px;
  padding: 14px;
  color: #fff;
}

.exam-lane.empty {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 800;
}

.exam-card {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 11px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(1px);
}

.exam-card strong {
  font-size: 18px;
}

.exam-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 12px;
  color: #F8FAFC;
  background: var(--card-bg);
  font-weight: 800;
}

.attendance-box {
  display: grid;
  grid-template-columns: 90px minmax(90px, 1fr) minmax(120px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.attendance-box input,
.attendance-box select {
  min-height: 30px;
  border: 0;
  border-radius: 3px;
  padding: 5px 7px;
}

.bottom-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 24px;
  padding: 16px 22px 10px;
  background: var(--bg-app);
}

.bottom-panels.three-col {
  grid-template-columns: minmax(360px, 1fr) minmax(520px, 1.35fr) minmax(260px, 0.65fr);
}

.data-panel {
  position: relative;
  color: #fff;
  background: var(--red);
}

.module-panel {
  background: var(--blue);
}

.panel-title {
  margin: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 4px 12px;
  color: #fff;
  background: var(--navy);
}

.data-panel h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  text-align: center;
}

.module-panel .panel-title {
  background: #4f77f0;
}

.panel-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 12px 14px 18px;
}

.module-panel .panel-fields {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.hall-panel .panel-fields {
  grid-template-columns: repeat(2, minmax(110px, 210px));
  justify-content: center;
  gap: 10px;
  padding: 10px 12px 16px;
}

.bottom-panels .hall-panel label {
  font-size: 16px;
}

.bottom-panels .hall-panel input,
.bottom-panels .hall-panel select {
  min-height: 28px;
  font-size: 13px;
}

.data-panel label {
  text-align: center;
  font-size: 18px;
  line-height: 1.05;
  gap: 5px;
  font-weight: 900;
  min-width: 0;
}

.data-panel input,
.data-panel select {
  width: 100%;
  max-width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 14px;
}

.panel-submit {
  width: auto;
  min-width: 56px;
  height: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  align-self: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: #F97316;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.panel-toggle {
  height: 28px;
  min-height: 28px;
  align-self: center;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  background: #64748B;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.lookup-editing .panel-toggle {
  background: #059669;
}

.csv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 12px;
  justify-content: flex-end;
}

.csv-action {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: #fff;
  background: #0D9488;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.csv-action.muted {
  background: #475569;
}

.csv-action:hover,
.csv-action:focus-visible {
  background: #14B8A6;
  transform: translateY(-1px);
}

.csv-action.muted:hover,
.csv-action.muted:focus-visible {
  background: #64748B;
}

.lookup-suggestions {
  display: grid;
  gap: 5px;
  margin: 0 14px 12px;
  max-height: 180px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.12);
}

.lookup-suggestion {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  border-left: 5px solid #F97316;
  padding: 7px 9px;
  color: #F8FAFC;
  background: var(--card-bg);
  text-align: left;
  font-size: 13px;
}

.lookup-suggestion:hover,
.lookup-suggestion:focus {
  color: #fff;
  background: #0b5bbd;
}

.lookup-suggestion span {
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  padding: 20px 30px 36px;
  background: var(--bg-app);
}

.full-width-card {
  grid-column: 1 / -1;
}

.dashboard-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 23px;
}

.collapsible-card {
  transition: padding 0.18s ease, box-shadow 0.18s ease;
}

.collapsible-card.is-collapsed {
  gap: 0;
  padding-block: 12px;
}

.collapsible-card.is-collapsed .collapsible-body {
  display: none;
}

.collapse-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.collapse-toggle span {
  display: block;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}

.collapsible-card.is-collapsed .collapse-toggle span {
  transform: rotate(0deg);
}

.collapse-toggle:hover,
.collapse-toggle:focus-visible {
  background: #2563EB;
  outline: 2px solid rgba(59, 130, 246, 0.32);
  outline-offset: 2px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}

th {
  color: #fff;
  background: var(--dark);
  font-size: 13px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.staff-reference-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.staff-category-card {
  padding: 14px;
}

.lookup-table {
  min-width: 700px;
}

.lookup-table.compact {
  min-width: 560px;
}

.lookup-table th,
.lookup-table td {
  padding: 6px;
}

.lookup-table th {
  font-size: 12px;
}

.table-input {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 4px 7px;
  color: #F8FAFC;
  background: var(--card-bg);
  font-size: 13px;
}

.table-input.wide {
  min-width: 170px;
}

.table-input:disabled {
  color: #CBD5E1;
  background: var(--border-light);
}

.table-save {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: #fff;
  background: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 28px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  font-weight: 900;
}

.empty-cell {
  color: #687384;
  font-weight: 800;
  text-align: center;
}

.user-management-card {
  grid-column: 1 / -1;
}

.secure-note {
  color: #5c6878;
  font-size: 13px;
  font-weight: 900;
}

.credential-gate {
  display: grid;
  grid-template-columns: minmax(180px, 320px) auto;
  justify-content: start;
  gap: 10px;
  align-items: center;
}

.credential-gate input {
  min-height: 38px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 7px 10px;
}

.user-table {
  min-width: 980px;
}

.login-status {
  display: block;
  margin-top: 3px;
  color: #647084;
  font-size: 12px;
  font-weight: 800;
}

.table-checkbox {
  width: 20px;
  height: 20px;
}

.center-cell {
  text-align: center;
}

.dept-ET {
  background: #1E40AF;
}

.dept-ICT {
  background: #6B21A8;
}

.dept-BST {
  background: #065F46;
}

.dept-MDS {
  background: #92400E;
}

.dept-TMS {
  background: #3730A3;
}

.danger-text {
  color: #E11D48;
  font-weight: 800;
}

@media (max-width: 1150px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .department-sort {
    justify-content: flex-start;
  }

  .work-area,
  .bottom-panels,
  .bottom-panels.three-col,
  .dashboard-grid,
  .staff-reference-grid {
    grid-template-columns: 1fr;
  }

  .full-width-card {
    grid-column: 1;
  }

  .side-rail {
    grid-template-columns: repeat(2, 1fr);
    align-content: stretch;
  }

  .rail-action {
    align-content: center;
  }
}

@media (max-width: 720px) {

  .topbar,
  .work-area,
  .bottom-panels,
  .dashboard-grid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .schedule-wrap {
    border-width: 16px;
  }

  .date-strip {
    flex-wrap: wrap;
    padding: 10px;
    font-size: 24px;
  }

  .date-strip input {
    width: 180px;
    font-size: 22px;
  }

  .form-line.two,
  .form-line.module-line,
  .form-line.compact,
  .hall-card-header,
  .staff-row,
  .panel-fields,
  .module-panel .panel-fields,
  .credential-gate,
  .attendance-box {
    grid-template-columns: 1fr;
  }

  .data-panel label {
    font-size: 22px;
  }
}

/* Updated admin timetable layout */
.topbar {
  min-height: 126px;
  grid-template-columns: minmax(320px, 485px) minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 28px;
  padding: 0 18px 0 0;
  color: #fff;
  background: #94A3B8;
}

.admin-banner {
  display: grid;
  place-items: center;
  min-height: 108px;
  padding: 18px;
  border-bottom-right-radius: 32px;
  background: #64748B;
}

.admin-banner h1 {
  margin: 0;
  font-size: 48px;
  letter-spacing: 0;
}

.timetable-head {
  min-width: 0;
  padding: 20px 0 10px;
}

.timetable-head h1 {
  margin: 0 0 22px;
  font-size: clamp(36px, 3vw, 50px);
  line-height: 1;
  letter-spacing: 0;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.filter-controls {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.semester-filter {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 5px 8px 5px 14px;
  border-radius: 20px;
  color: #F8FAFC;
  background: #475569;
  font-size: 16px;
  font-weight: 900;
}

.semester-filter select {
  min-height: 42px;
  width: 225px;
  max-width: 225px;
  border: 0;
  border-radius: 16px;
  padding: 6px 12px;
  color: #F8FAFC;
  background: #1E293B;
  font-size: 16px;
  font-weight: 900;
}

.search-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-controls input {
  width: min(290px, 26vw);
  min-height: 40px;
  border: 0;
  padding: 8px 14px;
  font-size: 20px;
  font-weight: 800;
}

.search-button,
.pill-action {
  min-height: 42px;
  border: 0;
  border-radius: 22px;
  padding: 8px 20px;
  color: #CBD5E1;
  background: var(--card-bg);
  font-size: 19px;
  font-weight: 900;
}

.pill-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tool-circle,
.mini-download,
.mini-clock {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #F8FAFC;
  background: var(--card-bg);
  font-size: 30px;
  font-weight: 900;
}

.tool-circle.muted {
  color: #59616c;
  background: var(--border-light);
}

.mini-download {
  width: 38px;
  height: 38px;
  color: #F8FAFC;
  background: var(--red);
  font-size: 18px;
}

.mini-clock {
  position: relative;
  width: 38px;
  height: 38px;
  background: #475569;
}

.mini-clock::before,
.mini-clock::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 15px;
  border-radius: 99px;
  background: #ffffff;
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
}

.mini-clock::after {
  width: 4px;
  height: 11px;
  transform: translate(-50%, -100%) rotate(135deg);
}

.topbar .department-filter {
  margin-left: 0;
}

.topbar .dept-pill {
  min-width: 78px;
  padding: 8px 17px;
  border-radius: 20px;
  font-size: 30px;
}

.topbar .dept-check {
  width: 42px;
  height: 42px;
  border-width: 6px;
}

.topbar .dept-check::before {
  width: 18px;
  height: 10px;
  border-left-width: 6px;
  border-bottom-width: 6px;
}

.topbar .user-box {
  align-self: start;
  padding-top: 18px;
}

.work-area {
  grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  padding: 36px 18px;
  background: var(--border-light);
}

.supervisor-mode .work-area {
  grid-template-columns: minmax(0, 1fr);
}

.scheduler-card {
  flex: initial;
  width: 100%;
  min-width: 0;
  padding: 0 14px 22px;
  background: #475569;
}

.scheduler-card h2 {
  margin: 0 -14px 16px;
  min-height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #64748B;
  font-size: 31px;
  letter-spacing: 0;
}

.scheduler-card form {
  gap: 13px;
}

.form-line.date-line {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.scheduler-card .date-line label {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  color: #fff;
  font-size: 21px;
}

.scheduler-card .date-line input {
  min-height: 34px;
  color: #fff;
  background: #5f6670;
  font-size: 22px;
  font-weight: 900;
}

.schedule-wrap {
  min-width: 0;
  border: 12px solid var(--border-light);
  border-radius: 12px;
  ;
  background: var(--card-bg);
}

.timetable-date-nav {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 8px solid var(--border-light);
  background: #0F172A;
}

.date-nav-button {
  min-width: 44px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  color: #FFFFFF;
  background: #1D4ED8;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.date-nav-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.date-nav-go {
  min-width: 54px;
  background: #F97316;
  font-size: 16px;
}

.date-jump-control {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 12px;
  border-radius: 999px;
  color: #E2E8F0;
  background: #1E293B;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.date-jump-control input {
  width: 145px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  color: #FFFFFF;
  background: #334155;
  font-size: 14px;
  font-weight: 900;
}

.timetable-top-scrollbar {
  height: 22px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 6px solid var(--border-light);
  background: #111827;
  scrollbar-color: #F97316 #334155;
}

.timetable-top-scrollbar::-webkit-scrollbar {
  height: 14px;
}

.timetable-top-scrollbar::-webkit-scrollbar-track {
  background: #334155;
}

.timetable-top-scrollbar::-webkit-scrollbar-thumb {
  background: #F97316;
  border-radius: 999px;
}

.timetable-top-scrollbar-spacer {
  height: 1px;
  min-width: 100%;
}

.board-scroll {
  min-height: 660px;
  display: block;
  overflow: auto;
  border-bottom: 12px solid var(--border-light);
  scrollbar-color: #F97316 #94A3B8;
}

.exam-lanes {
  width: max-content;
  min-width: 100%;
  display: flex;
  gap: 12px;
  padding: 8px;
}

.date-group {
  flex: 0 0 auto;
  min-width: 644px;
  border: 6px solid #64748B;
  background: var(--card-bg);
}

.date-bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: #64748B;
  font-size: 31px;
  font-weight: 900;
}

.date-bar .date-value {
  padding: 4px 10px;
  color: #fff;
  background: #1E293B;
  border-radius: 6px;
}

.date-bar .calendar-mark {
  width: 42px;
  height: 42px;
}

.dept-grid {
  display: grid;
  grid-template-columns: repeat(var(--department-count, 4), minmax(0, 1fr));
  align-items: stretch;
}

.dept-column {
  min-height: 525px;
  display: grid;
  grid-template-rows: auto minmax(470px, 1fr);
  border-right: 3px solid #fff;
  min-width: 0;
}

.dept-column:last-child {
  border-right: 0;
}

.dept-column-head {
  min-height: 56px;
  display: grid;
  place-items: center;
  color: #fff;
  border-bottom: 5px solid var(--border-light);
  font-size: 31px;
  font-weight: 900;
}

.slot-list {
  display: grid;
  grid-template-rows: minmax(190px, 1fr) minmax(70px, auto) minmax(190px, 1fr);
  gap: 0;
  align-content: stretch;
  min-height: 470px;
  padding: 0;
}

.time-sector {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  padding: 10px;
}

.time-sector-middle {
  align-content: center;
  padding-top: 6px;
  padding-bottom: 6px;
}

.time-sector-slots {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  overflow: visible;
}

.time-sector-middle .time-sector-slots {
  align-content: center;
}

.time-slot-row {
  display: grid;
  grid-template-columns: repeat(var(--parallel-slot-count, 1), minmax(150px, 1fr));
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.dept-column.empty-dept {
  min-width: 0;
}

.dept-column.empty-dept .dept-column-head {
  font-size: 21px;
  padding-inline: 2px;
}

.dept-column.empty-dept .slot-list {
  grid-template-rows: 1fr 42px 1fr;
}

.dept-column.empty-dept .time-sector {
  padding-left: 4px;
  padding-right: 4px;
}

.dept-column.empty-dept .slot-empty,
.dept-column.empty-dept .empty-slot {
  display: none;
}

.slot-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 5px 8px 8px;
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.slot-time-bar {
  width: calc(100% + 8px);
  justify-self: center;
  margin: -5px -4px 2px;
  padding: 5px 8px 6px;
  border-radius: 6px 6px 3px 3px;
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.64);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.10);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.slot-card:hover {
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.slot-card.slot-editing {
  border-color: #F97316;
  background: rgba(255, 255, 255, 0.34);
}

.student-shell .slot-card {
  cursor: default;
}

.student-shell .slot-card:hover {
  border-color: transparent;
  transform: none;
}

.student-shell .slot-title,
.student-shell .slot-pill,
.student-shell .slot-extra-modules {
  overflow-wrap: anywhere;
  font-weight: 900;
}

.student-shell .date-header {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  background: #111827;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.student-shell .slot-card {
  gap: 9px;
  padding: 6px 12px 12px;
}

.student-shell .slot-time-bar {
  width: calc(100% + 12px);
  margin: -6px -6px 2px;
  padding: 7px 10px 8px;
  border-radius: 7px 7px 4px 4px;
  font-size: 15px;
}

.student-shell .slot-title {
  font-size: 16px;
  line-height: 1.18;
}

.student-shell .slot-pill {
  font-size: 14px;
  line-height: 1.2;
}

.student-shell .slot-extra-modules {
  font-size: 14px;
  line-height: 1.25;
}

.student-shell .slot-note {
  font-size: 13px;
}

.student-shell .empty-slot {
  font-size: 16px;
  font-weight: 900;
}

.scheduler-card.editing-mode h2 {
  background: #F97316;
}

.slot-title {
  font-size: 11px;
  font-weight: 900;
  text-wrap: balance;
}

.slot-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.slot-pill {
  min-height: 16px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #CBD5E1;
  background: var(--card-bg);
  font-size: 9px;
  font-weight: 900;
}

.slot-halls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.slot-hall {
  display: grid;
  gap: 4px;
}

.slot-empty {
  padding: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.slot-note {
  margin-top: 2px;
  padding: 5px 7px;
  border-left: 3px solid #F97316;
  border-radius: 0 4px 4px 0;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.88);
  font-size: 9px;
  font-style: italic;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.active-date {
  box-shadow: 0 0 0 4px #F97316 inset;
}

@media (max-width: 1300px) {
  .topbar {
    grid-template-columns: 1fr;
    padding: 0 18px 18px;
  }

  .admin-banner {
    margin: 0 -18px;
    border-radius: 0 0 24px 0;
  }

  .topbar .user-box {
    padding-top: 0;
  }

  .work-area {
    grid-template-columns: 1fr;
  }

  .scheduler-card {
    max-width: 680px;
  }
}

@media (max-width: 980px) {
  .staff-requirements {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {

  .search-controls,
  .table-actions {
    align-items: stretch;
  }

  .search-controls input,
  .search-button,
  .pill-action {
    width: 100%;
  }

  .date-group {
    min-width: 100%;
  }
}

/* Form tightening and typed module suggestions */
.work-area {
  grid-template-columns: minmax(560px, 640px) minmax(0, 1fr);
  gap: 20px;
  padding-left: 14px;
  padding-right: 12px;
}

.scheduler-card label,
.hall-card label {
  min-width: 0;
}

.scheduler-card input,
.scheduler-card select,
.hall-card input,
.hall-card select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.scheduler-card .check-label input {
  width: 28px;
  max-width: 28px;
  min-width: 28px;
}

.scheduler-card .form-line.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
}

.scheduler-card .form-line.module-line {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.7fr) minmax(120px, 0.55fr);
}

.module-field-wrap {
  position: relative;
  overflow: visible;
}

.module-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 3px);
  z-index: 25;
  display: grid;
  max-height: 210px;
  overflow: auto;
  border: 1px solid #7b8794;
  background: var(--card-bg);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.module-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  padding: 8px 10px;
  color: #F8FAFC;
  background: var(--card-bg);
  text-align: left;
  font-size: 14px;
}

.module-suggestion:hover,
.module-suggestion:focus {
  color: #fff;
  background: #2563EB;
}

.module-suggestion.unavailable {
  color: #657080;
  background: #f3f5f8;
  cursor: not-allowed;
}

.module-suggestion span {
  white-space: nowrap;
}

.hall-card-header {
  grid-template-columns: minmax(0, 1fr) minmax(112px, 138px) 30px;
}

.staff-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 30px;
}

.date-group {
  min-width: 500px;
}

.slot-card {
  gap: 8px;
  padding: 10px;
}

.slot-title {
  font-size: 13px;
  line-height: 1.15;
}

.slot-pills {
  display: grid;
  gap: 3px;
}

.slot-pill {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  font-size: 12px;
  line-height: 1.18;
  font-weight: 900;
}

.slot-pill.self-addition-open {
  color: #BBF7D0;
}

.slot-pill.self-addition-locked {
  color: #FECACA;
}

.slot-halls {
  grid-template-columns: 1fr;
  gap: 8px;
}

.slot-hall {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
}

.slot-hall .slot-pill:first-child {
  font-size: 13px;
  text-transform: uppercase;
}

/* Ratio-based hall and staff panel */
.hall-card {
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #475569;
}

.hall-card-title-bar {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(210px, auto) 34px;
  gap: 8px;
  align-items: center;
  padding: 5px 7px;
  color: #fff;
  background: #F97316;
}

.hall-card-title {
  font-size: 20px;
  font-weight: 900;
}

.hall-student-total {
  display: grid;
  grid-template-columns: auto 48px;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.hall-student-total input {
  min-height: 24px;
  padding: 2px 5px;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  background: var(--card-bg);
}

.hall-card-header {
  grid-template-columns: minmax(0, 1fr);
  padding: 10px 12px 4px;
}

.hall-card-header label {
  font-size: 13px;
}

.staff-grid {
  padding: 0 12px 12px;
}

.staff-requirements {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
}

.staff-column {
  display: grid;
  align-content: start;
  gap: 12px;
}

.role-section {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.role-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  min-height: 22px;
}

.needed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 2px 4px;
  color: var(--ink);
  background: var(--border-light);
  font-size: 9px;
  font-weight: 900;
}

.needed-badge strong {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 18px;
  color: var(--ink);
  background: var(--dark);
}

.role-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.role-supervisor .role-selects,
.role-permanent_invigilator .role-selects {
  grid-template-columns: minmax(0, 1fr);
}

.role-staff-select {
  min-height: 32px;
  padding: 4px 28px 4px 7px;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-staff-select.missing-staff {
  border: 2px solid #FB7185;
  color: #FFE4E6;
  background: rgba(127, 29, 29, 0.72);
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.18);
}

.locked-select {
  cursor: not-allowed;
}

@media (max-width: 720px) {

  .hall-card-title-bar,
  .staff-requirements {
    grid-template-columns: 1fr;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 138px) 30px;
  }

  .staff-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 30px;
  }

  .date-group {
    min-width: 500px;
  }

  .slot-card {
    gap: 8px;
    padding: 10px;
  }

  .slot-title {
    font-size: 13px;
    line-height: 1.15;
  }

  .slot-pills {
    display: grid;
    gap: 3px;
  }

  .slot-pill {
    min-height: 0;
    padding: 0;
    border-radius: 0;
    color: #fff;
    background: transparent;
    font-size: 12px;
    line-height: 1.18;
    font-weight: 900;
  }

  .slot-halls {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .slot-hall {
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.45);
  }

  .slot-hall .slot-pill:first-child {
    font-size: 13px;
    text-transform: uppercase;
  }

}

/* Ratio-based hall and staff panel */
.hall-card {
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #475569;
}

.hall-card-title-bar {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(210px, auto) 34px;
  gap: 8px;
  align-items: center;
  padding: 5px 7px;
  color: #fff;
  background: #F97316;
}

.hall-card-title {
  font-size: 20px;
  font-weight: 900;
}

.hall-student-total {
  display: grid;
  grid-template-columns: auto 48px;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.hall-student-total input {
  min-height: 24px;
  padding: 2px 5px;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  background: var(--card-bg);
}

.hall-card-header {
  grid-template-columns: minmax(0, 1fr);
  padding: 10px 12px 4px;
}

.hall-card-header label {
  font-size: 13px;
}

.staff-grid {
  padding: 0 12px 12px;
}

.staff-requirements {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
}

.staff-column {
  display: grid;
  align-content: start;
  gap: 12px;
}

.role-section {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.role-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  min-height: 22px;
}

.needed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 2px 4px;
  color: var(--ink);
  background: var(--border-light);
  font-size: 9px;
  font-weight: 900;
}

.needed-badge strong {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 18px;
  color: var(--ink);
  background: var(--dark);
}

.role-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.role-supervisor .role-selects,
.role-permanent_invigilator .role-selects {
  grid-template-columns: minmax(0, 1fr);
}

.role-staff-select {
  min-height: 32px;
  padding: 4px 28px 4px 7px;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-staff-select.missing-staff {
  border: 2px solid #FB7185;
  color: #FFE4E6;
  background: rgba(127, 29, 29, 0.72);
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.18);
}

.locked-select {
  cursor: not-allowed;
}

@media (max-width: 720px) {

  .hall-card-title-bar,
  .staff-requirements {
    grid-template-columns: 1fr;
  }

  .hall-student-total {
    grid-template-columns: minmax(0, 1fr) 58px;
  }
}

#my-modules-button {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
}

#my-modules-button.active-filter {
  background-color: #0F766E !important;
  color: #F8FAFC !important;
}

input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.6);
  opacity: 1;
}

.self-enrollment-card {
  border: 2px solid #F97316;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(15, 23, 42, 0.96));
}

.self-enrollment-controls {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 1fr) minmax(250px, 300px) 110px;
  gap: 18px;
  align-items: center;
  margin-top: 14px;
}

.self-enrollment-controls label {
  color: #F8FAFC;
  font-weight: 900;
}

.self-toggle {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 50px;
  cursor: pointer;
}

.self-toggle input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 60px;
  height: 32px;
  border-radius: 999px;
  background: #059669;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.16);
  transition: background 0.18s ease;
}

.toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #F8FAFC;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease;
}

.self-toggle input:checked+.toggle-track {
  background: #E11D48;
}

.self-toggle input:checked+.toggle-track .toggle-thumb {
  transform: translateX(28px);
}

.global-self-toggle .toggle-track {
  background: #334155;
}

.global-self-toggle input:checked+.toggle-track {
  background: #059669;
}

.lecturer-only-self-panel {
  display: block;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(251, 191, 36, 0.48);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.22), rgba(15, 23, 42, 0.72));
}

.lecturer-only-toggle {
  width: 100%;
  min-height: 58px;
  padding: 4px 2px;
}

.lecturer-only-toggle .toggle-track {
  background: #334155;
}

.lecturer-only-toggle input:checked+.toggle-track {
  background: #F97316;
}

.lecturer-only-toggle .toggle-copy strong {
  color: #FDE68A;
  font-size: 18px;
}

.lecturer-only-toggle .toggle-copy small {
  max-width: 920px;
}

.toggle-copy {
  display: grid;
  gap: 4px;
}

.toggle-copy strong {
  font-size: 17px;
  line-height: 1.1;
}

.toggle-copy small {
  color: rgba(248, 250, 252, 0.78);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.deadline-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0;
}

.deadline-control span {
  white-space: nowrap;
  font-size: 15px;
}

.self-enrollment-controls input[type="datetime-local"] {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  color: #F8FAFC;
  background: #0F172A;
  font-weight: 800;
}

#save-enrollment-settings {
  min-height: 42px;
  width: 100%;
  padding: 0 18px;
  white-space: nowrap;
}

.self-enrollment-status {
  border-radius: 999px;
  padding: 8px 14px;
  background: #059669;
  color: #F8FAFC;
  font-weight: 900;
}

.self-enrollment-status.blocked {
  background: #E11D48;
}

.staff-reset-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(244, 63, 94, 0.42);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
}

.staff-reset-panel strong {
  display: block;
  color: #F8FAFC;
  font-size: 17px;
  font-weight: 900;
}

.staff-reset-panel small {
  display: block;
  margin-top: 4px;
  color: rgba(248, 250, 252, 0.72);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .self-enrollment-controls {
    grid-template-columns: 1fr;
  }

  .staff-reset-panel {
    grid-template-columns: 1fr;
  }

  .lecturer-only-toggle {
    grid-template-columns: 56px minmax(0, 1fr);
  }
}
/* Header polish */
.topbar {
  min-height: 0;
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
  padding: 14px 18px;
  color: #F8FAFC;
  background: #8FA0B4;
}

.brand-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 0 0 26px 0;
  background: #64748B;
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.16);
}

.brand-logos {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  padding: 5px;
  border-radius: 10px;
  background: #FFFFFF;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.1;
}

.system-kicker,
.brand-copy span:last-child {
  color: rgba(248, 250, 252, 0.78);
  font-size: 14px;
  font-weight: 800;
}

.brand-copy strong {
  color: #FFFFFF;
  font-size: 22px;
  font-weight: 900;
}

.role-title {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 6px 0 0;
  padding: 8px 18px;
  border-radius: 18px;
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.42);
  font-size: 34px;
  line-height: 1;
}

.timetable-head {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 0 0;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.timetable-head h1 {
  margin: 0;
  color: #FFFFFF;
  font-size: 42px;
  line-height: 1;
}

.table-actions {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) auto;
  align-items: center;
  gap: 10px 12px;
}

.search-controls,
.download-controls,
.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.download-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-controls {
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 10px;
}

.search-controls input {
  width: 300px;
  min-height: 38px;
  border-radius: 0;
  padding: 7px 12px;
  font-size: 18px;
}

.search-button,
.pill-action {
  min-height: 40px;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 16px;
  line-height: 1;
}

.pill-action {
  gap: 8px;
}

.tool-circle,
.mini-download,
.mini-clock {
  width: 40px;
  height: 40px;
  font-size: 25px;
}

.mini-download {
  width: 34px;
  height: 34px;
  font-size: 17px;
}

.mini-clock {
  width: 34px;
  height: 34px;
}

.semester-filter {
  min-height: 44px;
  padding: 4px 7px 4px 12px;
  border-radius: 18px;
  font-size: 14px;
}

.semester-filter select {
  width: 210px;
  max-width: 210px;
  min-height: 36px;
  border-radius: 14px;
  font-size: 14px;
}

.topbar .department-filter {
  gap: 8px;
}

.topbar .dept-toggle {
  gap: 7px;
}

.topbar .dept-pill {
  min-width: 66px;
  padding: 7px 14px;
  border-radius: 18px;
  font-size: 24px;
}

.topbar .dept-check {
  width: 38px;
  height: 38px;
  border-width: 5px;
}

.topbar .dept-check::before {
  width: 16px;
  height: 9px;
  border-left-width: 5px;
  border-bottom-width: 5px;
}

.topbar .user-box {
  align-self: auto;
  padding-top: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.16);
}

.supervisor-slot-count {
  margin-left: 0;
  padding: 4px 8px;
  border-radius: 999px;
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.4);
  font-weight: 900;
}

@media (max-width: 1500px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    grid-template-columns: auto minmax(0, 1fr) auto;
    border-radius: 0 0 22px 0;
  }

  .role-title {
    grid-column: auto;
    margin: 0;
  }
}

@media (max-width: 980px) {
  .topbar-title-row,
  .table-actions,
  .brand-panel {
    grid-template-columns: 1fr;
  }

  .topbar-title-row {
    align-items: flex-start;
  }

  .download-controls {
    justify-content: flex-start;
  }

  .table-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .search-controls,
  .download-controls,
  .filter-controls {
    flex-wrap: wrap;
  }
}

/* Header compact pass */
.topbar {
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 16px;
}

.brand-panel {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 12px;
  padding: 12px 14px;
}

.brand-logo {
  width: 54px;
  height: 54px;
}

.brand-copy {
  gap: 3px;
}

.system-kicker {
  font-size: 13px;
}

.brand-copy strong {
  font-size: 24px;
  line-height: 1.05;
}

.brand-copy span:last-child {
  font-size: 15px;
}

.role-title {
  grid-column: auto;
  align-self: start;
  justify-self: end;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 16px;
  letter-spacing: 0;
  background: rgba(15, 23, 42, 0.36);
}

.topbar-title-row {
  align-items: flex-start;
}

.table-actions {
  grid-template-columns: minmax(430px, max-content) minmax(360px, 1fr);
  gap: 10px 14px;
}

.search-controls {
  justify-content: flex-start;
}

.download-controls {
  justify-content: flex-end;
}

.filter-controls {
  justify-content: flex-start;
}

@media (max-width: 1500px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
}

/* Keep desktop header compact at normal laptop/desktop widths */
.topbar .role-title {
  grid-column: auto;
  align-self: start;
  justify-self: end;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0;
}

.topbar .brand-copy strong {
  font-size: 25px;
}

.topbar .brand-copy span:last-child {
  font-size: 16px;
}

@media (min-width: 1101px) {
  .topbar {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .brand-panel {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .table-actions {
    grid-template-columns: minmax(390px, max-content) minmax(380px, 1fr);
  }
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
  }
}

/* Final header spacing adjustment */
.brand-panel {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr);
  padding-right: 70px;
}

.topbar .role-title {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 14px;
}

.topbar .brand-copy strong {
  font-size: 23px;
}

.topbar .brand-copy span:last-child {
  font-size: 15px;
}

@media (min-width: 1101px) {
  .topbar {
    grid-template-columns: 365px minmax(0, 1fr);
  }

  .download-controls {
    margin-left: auto;
  }
}

/* Reference-style admin/supervisor header */
.topbar {
  display: block;
  min-height: 0;
  padding: 0;
  color: #F8FAFC;
  background: #080E1C;
}

.brand-panel {
  position: relative;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  border-radius: 0;
  background: #111827;
  box-shadow: none;
}

.brand-logos {
  gap: 10px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-copy {
  display: block;
  line-height: 1.08;
}

.brand-copy .system-kicker,
.brand-copy strong {
  display: block;
  color: #FFFFFF;
  font-size: 19px;
  font-weight: 900;
}

.role-title {
  display: none;
}

.timetable-head {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 34px 28px 34px;
  background: #080E1C;
}

.topbar-title-row {
  display: block;
}

.timetable-head h1 {
  margin: 0;
  color: #FFFFFF;
  font-size: 48px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.topbar .user-box {
  position: absolute;
  top: 18px;
  right: 20px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.28);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 10px;
}

.search-controls,
.download-controls,
.filter-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.search-controls {
  order: 1;
}

.download-controls {
  order: 2;
  justify-content: flex-start;
  margin-left: 0;
}

.filter-controls {
  order: 3;
  flex-basis: 100%;
  justify-content: flex-start;
}

.search-controls input {
  width: 270px;
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 0;
  color: #111827;
  background: #FFFFFF;
  font-size: 18px;
  font-weight: 900;
}

.tool-circle,
.search-button,
.pill-action {
  border: 0;
  color: #F8FAFC;
  background: #111827;
  box-shadow: none;
}

.tool-circle {
  width: 40px;
  height: 40px;
  font-size: 26px;
}

.search-button,
.pill-action {
  min-height: 40px;
  border-radius: 22px;
  padding: 8px 18px;
  font-size: 17px;
  font-weight: 900;
}

.pill-action {
  gap: 9px;
}

.mini-download,
.mini-clock {
  width: 34px;
  height: 34px;
}

.semester-filter {
  min-height: 48px;
  padding: 5px 6px 5px 12px;
  border-radius: 18px;
  color: #F8FAFC;
  background: #475569;
  font-size: 16px;
  font-weight: 900;
}

.semester-filter select {
  width: 215px;
  max-width: 215px;
  min-height: 38px;
  border-radius: 14px;
  color: #FFFFFF;
  background: #1E293B;
  font-size: 15px;
  font-weight: 900;
}

.topbar .department-filter {
  gap: 11px;
}

.topbar .dept-pill {
  min-width: 78px;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 28px;
}

.topbar .dept-check {
  width: 42px;
  height: 42px;
  border-width: 6px;
  background: #10B981;
}

.topbar .dept-toggle.off .dept-check {
  background: #4B5563;
}

.schedule-wrap {
  border: 10px solid #111827;
  border-radius: 8px;
  background: #111827;
}

.board-scroll {
  border: 12px solid #172236;
  border-radius: 8px;
  background: #111827;
}

.exam-lanes {
  gap: 18px;
  padding: 12px;
}

.date-group {
  min-width: 680px;
  border: 4px solid #64748B;
  background: transparent;
}

.date-bar {
  min-height: 20px;
  justify-content: flex-start;
  gap: 4px;
  padding: 0 4px;
  color: #FFFFFF;
  background: transparent;
  font-size: 14px;
  line-height: 1;
}

.date-bar .date-value {
  padding: 0;
  border-radius: 0;
  color: #FFFFFF;
  background: transparent;
}

.dept-column {
  min-height: 540px;
}

.dept-column-head {
  min-height: 50px;
  font-size: 29px;
}

@media (max-width: 1100px) {
  .brand-panel {
    min-height: 74px;
    padding: 12px 18px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .brand-copy .system-kicker,
  .brand-copy strong {
    font-size: 16px;
  }

  .timetable-head {
    padding: 28px 18px;
  }

  .timetable-head h1 {
    font-size: 38px;
  }

  .topbar .user-box {
    position: static;
    margin-top: 14px;
    display: inline-flex;
  }
}

/* Fit timetable groups into the visible panel like the reference view */
.exam-lanes {
  width: 100%;
  min-width: 100%;
}

.date-group {
  flex: 0 0 min(980px, 100%);
  min-width: min(680px, 100%);
  overflow: hidden;
}

.dept-grid {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.dept-column {
  overflow: hidden;
}

.time-slot-row {
  grid-template-columns: repeat(var(--parallel-slot-count, 1), minmax(0, 1fr));
}

.active-date {
  box-shadow: none;
}

@media (max-width: 1400px) {
  .date-group {
    flex-basis: 100%;
    min-width: 100%;
  }
}

/* Header action balance */
.brand-panel {
  min-height: 82px;
}

.brand-copy {
  min-width: 0;
  white-space: nowrap;
}

.brand-copy .system-kicker {
  display: none;
}

.brand-copy strong {
  display: block;
  overflow: hidden;
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timetable-head {
  padding-top: 28px;
}

.timetable-head h1 {
  font-size: 54px;
}

.table-actions {
  display: grid;
  grid-template-columns: minmax(390px, max-content) minmax(520px, 1fr);
  align-items: center;
  gap: 14px 16px;
}

.search-controls {
  grid-column: 1;
  order: initial;
}

.download-controls {
  grid-column: 2;
  order: initial;
  justify-content: flex-end;
  margin-left: 0;
}

.filter-controls {
  grid-column: 1 / -1;
  order: initial;
}

.pill-action {
  min-width: 0;
  padding-inline: 16px;
}

@media (max-width: 1320px) {
  .table-actions {
    display: flex;
  }

  .download-controls {
    margin-left: auto;
  }
}

/* Two-line timetable header controls */
.brand-copy strong {
  font-size: 28px;
}

.timetable-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title user"
    "controls controls";
  gap: 18px 18px;
  padding: 28px 28px 28px;
}

.topbar-title-row {
  display: contents;
}

.timetable-head h1 {
  grid-area: title;
  align-self: center;
  white-space: nowrap;
}

.topbar .user-box {
  position: static;
  grid-area: user;
  align-self: start;
  justify-self: end;
}

.table-actions {
  grid-area: controls;
  width: 100%;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px 16px;
}

.search-controls {
  grid-column: 1;
}

.filter-controls {
  grid-column: 2;
  grid-row: 1;
  flex-basis: auto;
  min-width: 0;
}

.download-controls {
  grid-column: 3;
  grid-row: 1;
  justify-content: flex-end;
  margin-left: 0;
}

@media (max-width: 1600px) {
  .table-actions {
    grid-template-columns: max-content minmax(0, 1fr);
  }

  .download-controls {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-end;
  }
}

@media (max-width: 1180px) {
  .timetable-head {
    display: flex;
  }

  .topbar-title-row {
    display: block;
  }

  .topbar .user-box {
    display: inline-flex;
  }

  .table-actions {
    display: flex;
  }
}

/* Larger date label in timetable view */
.date-bar {
  min-height: 34px;
  justify-content: center;
  padding: 5px 8px;
  font-size: 22px;
  line-height: 1.1;
}

/* Student timetable should mirror the admin timetable header rhythm, with fewer actions. */
.student-shell .table-actions {
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-areas:
    "search filters"
    "downloads downloads";
  align-items: center;
  gap: 12px 16px;
}

.student-shell .search-controls {
  grid-area: search;
}

.student-shell .filter-controls {
  grid-area: filters;
  grid-column: auto;
  grid-row: auto;
}

.student-shell .download-controls {
  grid-area: downloads;
  grid-column: auto;
  grid-row: auto;
  justify-content: flex-end;
  margin-left: 0;
}

.student-shell .schedule-wrap {
  border-color: #172236;
}

.student-shell,
.student-shell button,
.student-shell input,
.student-shell select,
.student-shell textarea {
  font-family: 'Montserrat', 'Inter', Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.student-shell {
  line-height: 1.05;
}

.student-shell .topbar {
  gap: 14px;
  padding: 10px 18px 12px;
}

.student-shell .brand-panel {
  min-height: 64px;
  padding: 10px 18px;
}

.student-shell .brand-logo {
  width: 48px;
  height: 48px;
}

.student-shell .brand-copy strong {
  font-size: 26px;
  line-height: 1;
}

.student-shell .timetable-head {
  gap: 12px;
  padding: 18px 28px;
}

.student-shell .timetable-head h1 {
  font-size: 50px;
  line-height: 0.95;
}

.student-shell .table-actions {
  gap: 8px 14px;
}

.student-shell .work-area {
  gap: 18px;
  padding-top: 24px;
  padding-bottom: 18px;
}

.student-shell .schedule-wrap {
  border-width: 10px;
}

.student-shell .date-header {
  min-height: 34px;
}

.student-shell .dept-column-head {
  min-height: 44px;
}

.student-shell .slot-list {
  gap: 0;
  padding: 0;
}

.student-shell .time-sector {
  padding: 12px 10px;
}

.student-shell .time-sector-middle {
  padding-top: 6px;
  padding-bottom: 6px;
}

.student-shell .slot-card {
  gap: 4px;
  padding: 5px 7px 7px;
  line-height: 1.38;
}

.student-shell .slot-title {
  line-height: 1.42;
}

.student-shell .slot-course-supervisor,
.student-shell .slot-extra-modules,
.student-shell .slot-extra-modules strong,
.student-shell .slot-meta-row,
.student-shell .slot-hall-code,
.student-shell .slot-note {
  line-height: 1.34;
}

.student-shell .slot-meta-row {
  margin-top: 4px;
  margin-bottom: 4px;
}

.student-shell .slot-halls {
  margin-top: 4px;
}

.student-shell .student-hall-code {
  cursor: default;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .student-shell .table-actions {
    display: flex;
  }
}

.extra-modules-box {
  display: grid;
  gap: 8px;
  margin: 8px 0 10px;
}

.extra-modules-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  color: #fff;
  background: #0F766E;
  font-size: 15px;
  font-weight: 900;
}

.extra-modules-list {
  display: grid;
  gap: 8px;
}

.extra-module-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.7fr) minmax(100px, 0.55fr) 34px;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 118, 110, 0.26);
}

.extra-module-row .module-suggestions {
  top: calc(100% + 2px);
}

.extra-module-remove {
  width: 34px;
  height: 34px;
  align-self: end;
}

.slot-extra-modules,
.table-submodule {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.25;
}

.table-submodule {
  color: inherit;
  font-size: 12px;
}
.semester-visibility-panel {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.46);
}

.semester-visibility-panel strong {
  display: block;
  color: #F8FAFC;
  font-size: 18px;
  font-weight: 900;
}

.semester-visibility-panel small {
  display: block;
  margin-top: 4px;
  color: rgba(248, 250, 252, 0.72);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.semester-visibility-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.semester-visibility-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #F8FAFC;
  background: rgba(15, 23, 42, 0.74);
  font-weight: 900;
  cursor: pointer;
}

.semester-visibility-option input {
  width: 18px;
  height: 18px;
  accent-color: #10B981;
}

@media (max-width: 900px) {
  .semester-visibility-panel {
    grid-template-columns: 1fr;
  }
}

/* Final collapsed exam-slot sidebar treatment */
.scheduler-collapse-toggle,
.scheduler-card.is-collapsed .scheduler-collapse-toggle {
  color: #FFFFFF;
  background: transparent;
  box-shadow: none;
}

.scheduler-collapse-toggle::before,
.scheduler-collapse-toggle::after,
.scheduler-card.is-collapsed .scheduler-collapse-toggle::before,
.scheduler-card.is-collapsed .scheduler-collapse-toggle::after,
.scheduler-card.is-collapsed .scheduler-bottom-arrows::before,
.scheduler-card.is-collapsed .scheduler-bottom-arrows::after {
  display: none;
}

.scheduler-collapse-toggle span {
  left: 50%;
  width: 18px;
  height: 18px;
  border-top-width: 7px;
  border-right-width: 7px;
  opacity: 1;
  animation: single-arrow-left 1.15s ease-in-out infinite;
}

.scheduler-card.is-collapsed,
.scheduler-card.is-collapsed .scheduler-card-heading {
  background: #0B1220;
}

.scheduler-card.is-collapsed .scheduler-card-heading {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.scheduler-card.is-collapsed .scheduler-collapse-toggle,
.scheduler-card.is-collapsed .scheduler-bottom-arrows {
  width: 58px;
  height: 46px;
  color: #FFFFFF;
}

.scheduler-card.is-collapsed .scheduler-collapse-toggle span,
.scheduler-card.is-collapsed .scheduler-bottom-arrows > span {
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border-top: 7px solid currentColor;
  border-right: 7px solid currentColor;
  opacity: 1;
  animation: single-arrow-right 1.15s ease-in-out infinite;
}

.scheduler-card.is-collapsed .scheduler-bottom-arrows > span {
  position: absolute;
  display: block;
}

@keyframes single-arrow-left {
  0% {
    transform: translate(6px, -50%) rotate(-135deg);
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: translate(-6px, -50%) rotate(-135deg);
    opacity: 0.55;
  }
}

@keyframes single-arrow-right {
  0% {
    transform: translate(-6px, -50%) rotate(45deg);
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: translate(6px, -50%) rotate(45deg);
    opacity: 0.55;
  }
}

/* Collapsible add/edit exam panel */
.scheduler-card-heading {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 68px;
  align-items: center;
  gap: 10px;
  margin: 0 -14px 16px;
  min-height: 52px;
  padding: 0 12px 0 18px;
  color: #FFFFFF;
  background: #64748B;
}

.scheduler-card.editing-mode .scheduler-card-heading {
  background: #F97316;
}

.scheduler-card-heading h2,
.scheduler-card.editing-mode .scheduler-card-heading h2 {
  grid-column: 2;
  margin: 0;
  min-height: 0;
  display: block;
  color: #FFFFFF;
  background: transparent;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
}

.scheduler-collapse-toggle {
  grid-column: 3;
  position: relative;
  width: 68px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: #FF8A1D;
  background: transparent;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  overflow: visible;
}

.scheduler-collapse-toggle span,
.scheduler-collapse-toggle::before,
.scheduler-collapse-toggle::after {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  display: block;
  border-top: 6px solid currentColor;
  border-right: 6px solid currentColor;
  font-size: 0;
  line-height: 0;
  transform: translateY(-50%) rotate(-135deg);
  animation: scheduler-arrow-left 1.25s ease-in-out infinite;
}

.scheduler-collapse-toggle::before,
.scheduler-collapse-toggle::after {
  content: "";
}

.scheduler-collapse-toggle::after {
  left: 5px;
  opacity: 0.28;
  animation-delay: 0.32s;
}

.scheduler-collapse-toggle::before {
  left: 23px;
  opacity: 0.55;
  animation-delay: 0.16s;
}

.scheduler-collapse-toggle span {
  left: 41px;
  opacity: 0.92;
}

.scheduler-collapse-toggle:hover {
  background: transparent;
  color: #FDBA35;
}

.scheduler-bottom-arrows {
  display: none;
}

.work-area.scheduler-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: stretch;
}

.scheduler-card.is-collapsed {
  min-width: 64px;
  max-width: 64px;
  height: 100%;
  align-self: stretch;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.scheduler-card.is-collapsed .csv-toolbar,
.scheduler-card.is-collapsed #exam-form {
  display: none;
}

.scheduler-card.is-collapsed .scheduler-card-heading {
  position: relative;
  grid-template-columns: 1fr;
  grid-template-rows: 54px minmax(0, auto) 54px;
  align-content: center;
  justify-items: center;
  gap: 18px;
  width: 64px;
  min-height: 100%;
  height: 100%;
  margin: 0;
  padding: 18px 0;
}

.scheduler-card.is-collapsed .scheduler-bottom-arrows {
  display: block;
  grid-row: 3;
  position: relative;
  width: 58px;
  height: 42px;
  color: #FF8A1D;
}

.scheduler-card.is-collapsed .scheduler-bottom-arrows > span,
.scheduler-card.is-collapsed .scheduler-bottom-arrows::before,
.scheduler-card.is-collapsed .scheduler-bottom-arrows::after {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  display: block;
  border-top: 6px solid currentColor;
  border-right: 6px solid currentColor;
  font-size: 0;
  line-height: 0;
  transform: translateY(-50%) rotate(45deg);
  animation: scheduler-arrow-right 1.25s ease-in-out infinite;
}

.scheduler-card.is-collapsed .scheduler-bottom-arrows::before,
.scheduler-card.is-collapsed .scheduler-bottom-arrows::after {
  content: "";
}

.scheduler-card.is-collapsed .scheduler-bottom-arrows > span {
  left: 2px;
  opacity: 0.92;
}

.scheduler-card.is-collapsed .scheduler-bottom-arrows::before {
  left: 20px;
  opacity: 0.55;
  animation-delay: 0.16s;
}

.scheduler-card.is-collapsed .scheduler-bottom-arrows::after {
  left: 38px;
  opacity: 0.28;
  animation-delay: 0.32s;
}

.scheduler-card.is-collapsed .scheduler-card-heading h2 {
  grid-column: auto;
  grid-row: 2;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}

.scheduler-card.is-collapsed .scheduler-collapse-toggle {
  grid-column: auto;
  grid-row: 1;
  width: 58px;
  height: 42px;
  color: #FF8A1D;
}

.scheduler-card.is-collapsed .scheduler-collapse-toggle span {
  left: 2px;
  transform: translateY(-50%) rotate(45deg);
  animation: scheduler-arrow-right 1.25s ease-in-out infinite;
}

.scheduler-card.is-collapsed .scheduler-collapse-toggle::before,
.scheduler-card.is-collapsed .scheduler-collapse-toggle::after {
  border-color: currentColor;
  transform: translateY(-50%) rotate(45deg);
  animation: scheduler-arrow-right 1.25s ease-in-out infinite;
}

.scheduler-card.is-collapsed .scheduler-collapse-toggle::before {
  left: 20px;
  animation-delay: 0.16s;
}

.scheduler-card.is-collapsed .scheduler-collapse-toggle::after {
  left: 38px;
  animation-delay: 0.32s;
}

.scheduler-card.is-collapsed .scheduler-collapse-toggle:hover {
  background: transparent;
}

@keyframes scheduler-arrow-left {
  0% {
    opacity: 0.18;
    transform: translate(5px, -50%) rotate(-135deg);
  }

  45% {
    opacity: 1;
  }

  100% {
    opacity: 0.28;
    transform: translate(-5px, -50%) rotate(-135deg);
  }
}

@keyframes scheduler-arrow-right {
  0% {
    opacity: 0.18;
    transform: translate(-5px, -50%) rotate(45deg);
  }

  45% {
    opacity: 1;
  }

  100% {
    opacity: 0.28;
    transform: translate(5px, -50%) rotate(45deg);
  }
}

@media (max-width: 1300px) {
  .work-area.scheduler-collapsed {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .scheduler-card.is-collapsed {
    max-width: 56px;
    min-width: 56px;
  }

  .scheduler-card.is-collapsed .scheduler-card-heading {
    width: 56px;
  }
}

@media (max-width: 980px) {
  .work-area.scheduler-collapsed {
    grid-template-columns: 1fr;
  }

  .scheduler-card.is-collapsed {
    max-width: 100%;
    min-width: 0;
  }

  .scheduler-card.is-collapsed .scheduler-card-heading {
    grid-template-columns: minmax(0, 1fr) 42px;
    width: auto;
    min-height: 56px;
    height: auto;
    padding: 0 12px 0 18px;
  }

  .scheduler-card.is-collapsed .scheduler-card-heading h2 {
    writing-mode: horizontal-tb;
    transform: none;
    white-space: normal;
  }
}

/* Winning override: dark collapsed sidebar with one white animated arrow. */
.scheduler-collapse-toggle,
.scheduler-card.is-collapsed .scheduler-collapse-toggle {
  color: #FFFFFF;
  background: transparent;
  box-shadow: none;
}

.scheduler-collapse-toggle::before,
.scheduler-collapse-toggle::after,
.scheduler-card.is-collapsed .scheduler-collapse-toggle::before,
.scheduler-card.is-collapsed .scheduler-collapse-toggle::after,
.scheduler-card.is-collapsed .scheduler-bottom-arrows::before,
.scheduler-card.is-collapsed .scheduler-bottom-arrows::after {
  display: none;
}

.scheduler-collapse-toggle span {
  left: 50%;
  width: 18px;
  height: 18px;
  border-top-width: 7px;
  border-right-width: 7px;
  opacity: 1;
  animation: single-arrow-left 1.15s ease-in-out infinite;
}

.scheduler-card.is-collapsed,
.scheduler-card.is-collapsed .scheduler-card-heading {
  background: #0B1220;
}

.scheduler-card.is-collapsed {
  cursor: pointer;
}

.scheduler-card.is-collapsed .scheduler-card-heading {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.scheduler-card.is-collapsed .scheduler-collapse-toggle,
.scheduler-card.is-collapsed .scheduler-bottom-arrows {
  width: 58px;
  height: 46px;
  color: #FFFFFF;
}

.scheduler-card.is-collapsed .scheduler-collapse-toggle span,
.scheduler-card.is-collapsed .scheduler-bottom-arrows > span {
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border-top: 7px solid currentColor;
  border-right: 7px solid currentColor;
  opacity: 1;
  animation: single-arrow-right 1.15s ease-in-out infinite;
}

.scheduler-card.is-collapsed .scheduler-bottom-arrows > span {
  position: absolute;
  display: block;
}

/* Sticky Manage Exam Slots header with a scrollable form body */
.work-area {
  align-items: stretch;
}

.scheduler-card {
  display: flex;
  flex-direction: column;
  height: min(1020px, calc(100dvh - 90px));
  max-height: calc(100dvh - 90px);
  min-height: 0;
  padding: 0 14px;
  overflow: hidden;
}

.schedule-wrap {
  align-self: stretch;
}

.scheduler-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  flex: 0 0 auto;
  display: grid;
  gap: 9px;
  margin: 0 -14px;
  padding: 0 14px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.18);
  background: #475569;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.26);
}

.scheduler-sticky-header .scheduler-card-heading {
  margin: 0 -14px;
}

.scheduler-sticky-header .allocation-summary {
  margin: 0;
}

.scheduler-sticky-header .form-actions {
  align-items: center;
  gap: 8px;
}

.scheduler-sticky-header .form-actions button {
  min-height: 36px;
  padding: 8px 12px;
}

.scheduler-sticky-header .csv-toolbar {
  margin: 0;
  justify-content: flex-end;
}

.scheduler-card form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.scheduler-form-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 13px;
  overflow-y: auto;
  padding: 14px 2px 22px 0;
  overscroll-behavior: contain;
  scrollbar-color: #F97316 rgba(15, 23, 42, 0.25);
  scrollbar-width: thin;
}

.scheduler-form-body::-webkit-scrollbar {
  width: 8px;
}

.scheduler-form-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.22);
  border-radius: 999px;
}

.scheduler-form-body::-webkit-scrollbar-thumb {
  background: #F97316;
  border-radius: 999px;
}

.scheduler-card.is-collapsed .scheduler-sticky-header {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0B1220;
  box-shadow: none;
}

.scheduler-card.is-collapsed .allocation-summary,
.scheduler-card.is-collapsed .form-actions,
.scheduler-card.is-collapsed .csv-toolbar,
.scheduler-card.is-collapsed #exam-form {
  display: none;
}

@media (max-width: 980px) {
  .scheduler-card {
    max-height: none;
    overflow: visible;
  }

  .scheduler-form-body {
    overflow: visible;
    max-height: none;
  }
}

/* Equal department column heights across timetable days */
.exam-lanes {
  align-items: stretch;
}

.date-group {
  display: flex;
  flex-direction: column;
}

.dept-grid {
  flex: 1 1 auto;
  height: 100%;
  align-items: stretch;
}

.dept-column {
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.slot-list {
  min-height: 0;
  height: 100%;
}


/* Compact horizontal halls inside exam slot cards */
.slot-card {
  gap: 4px;
  padding: 5px 7px 7px;
}

.slot-title {
  line-height: 1.12;
}

.slot-pills {
  gap: 3px;
}

.slot-pill {
  min-height: 14px;
  padding: 1px 5px;
  line-height: 1.12;
}

.slot-halls {
  display: flex;
  grid-template-columns: none;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 3px;
  scrollbar-width: thin;
}

.slot-halls::-webkit-scrollbar {
  height: 4px;
}

.slot-halls::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.32);
  border-radius: 999px;
}

.slot-hall {
  flex: 0 0 92px;
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 92px;
  padding: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.14);
}

.slot-hall-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.slot-hall-code {
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.62);
  font-size: 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.slot-hall-staff {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.staff-details {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(15, 23, 42, 0.28);
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

.slot-note {
  max-height: 38px;
  overflow: hidden;
  padding: 4px 6px;
  line-height: 1.18;
}


/* Slot halls fit without internal scrolling */
.slot-card {
  min-width: max(100%, calc((var(--slot-hall-count, 1) * 108px) + 18px));
  width: 100%;
}

.slot-halls {
  overflow: visible;
  overflow-x: visible;
  overflow-y: visible;
  scrollbar-width: none;
}

.slot-halls::-webkit-scrollbar {
  display: none;
}

.slot-hall {
  flex: 0 0 102px;
  min-width: 102px;
}


/* Condensed slot card metadata, hall menu, and allocation states */
.slot-card {
  border-width: 2px;
}

.slot-card.allocation-incomplete {
  border-color: #EF4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.65);
}

.slot-card.allocation-complete {
  border-color: #22C55E;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.65);
}

.slot-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 5px;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.12;
}

.slot-meta-row span:not(:last-child)::after {
  content: "|";
  margin-left: 5px;
  color: rgba(255, 255, 255, 0.62);
}

.slot-course-supervisor {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.12;
}

.slot-extra-modules,
.slot-extra-modules strong {
  font-weight: 900;
}

.slot-halls {
  display: grid;
  grid-template-columns: repeat(var(--slot-hall-columns, 1), minmax(0, 1fr));
  gap: 5px;
  overflow: visible;
  padding: 2px 0;
}

.slot-hall {
  min-width: 0;
  flex: initial;
  padding: 3px;
}

.slot-hall-head {
  gap: 4px;
}

.slot-hall-code {
  width: 100%;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.slot-hall-code:hover,
.slot-hall-code:focus-visible {
  background: rgba(15, 23, 42, 0.86);
  outline: 1px solid rgba(255, 255, 255, 0.65);
}

.slot-hall-staff,
.staff-details {
  display: none !important;
}

.slot-context-menu {
  position: absolute;
  z-index: 10000;
  min-width: 210px;
  max-width: 280px;
  padding: 3px;
  border: 1px solid #9CA3AF;
  border-radius: 2px;
  color: #111827;
  background: #F8FAFC;
  box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.slot-context-menu-item {
  display: grid;
  grid-template-columns: minmax(78px, auto) 1fr;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  white-space: nowrap;
}

.slot-context-menu-item:hover {
  color: #FFFFFF;
  background: #2563EB;
}

.slot-context-menu-item strong {
  font-size: 11px;
  font-weight: 700;
}

.slot-context-menu-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-context-menu-item.empty {
  display: block;
  color: #6B7280;
}

.self-addition-open,
.self-addition-locked {
  display: none !important;
}


/* Cap slot width to visible hall columns */
.slot-card {
  min-width: max(100%, calc((var(--slot-hall-columns, 1) * 112px) + 18px));
}

/* Slot text readability spacing */
.slot-card {
  line-height: 1.22;
}

.slot-title {
  line-height: 1.24;
}

.slot-course-supervisor,
.slot-extra-modules,
.slot-meta-row,
.slot-hall-code,
.slot-note {
  line-height: 1.22;
}

.slot-extra-modules strong {
  line-height: 1.22;
}

/* Keep hall plus buttons circular */
.slot-hall-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
}

.slot-hall-head .enroll-btn {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  flex: 0 0 22px !important;
  padding: 0 !important;
  font-size: 15px !important;
  line-height: 1 !important;
  display: grid !important;
  place-items: center !important;
}

.slot-hall-code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Structured slot metadata emphasis */
.slot-meta-row {
  font-weight: 700;
}

.slot-meta-row > span:not(:last-child)::after {
  content: "|";
  margin-left: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 700;
  letter-spacing: 0;
}

.slot-meta-row span:not(:last-child)::after {
  content: none;
}

.slot-meta-row > span:not(:last-child)::after {
  content: "|";
}

.slot-meta-semester {
  font-weight: 700;
}

.slot-meta-type {
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.slot-meta-students {
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.slot-meta-target {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.slot-meta-target-label {
  margin-right: 1px;
  font-weight: 800;
}

.target-dept-pill {
  display: inline-flex;
  align-items: center;
  min-height: 13px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.36);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

/* Slot text readability spacing v2 */
.slot-card {
  line-height: 1.3;
}

.slot-title {
  line-height: 1.32;
  margin-bottom: 1px;
}

.slot-course-supervisor,
.slot-extra-modules,
.slot-extra-modules strong {
  line-height: 1.28;
}

.slot-meta-row {
  line-height: 1.28;
  margin-top: 2px;
  margin-bottom: 2px;
}

.slot-halls {
  margin-top: 2px;
}

.slot-note {
  line-height: 1.28;
  margin-top: 4px;
}

/* Highlight module names inside slot cards */
.slot-title {
  display: inline;
  padding: 1px 4px 2px;
  border-radius: 4px;
  color: #FFF7ED;
  background: rgba(15, 23, 42, 0.34);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.slot-extra-modules strong {
  display: inline;
  padding: 1px 4px 2px;
  border-radius: 4px;
  color: #FEF3C7;
  background: rgba(15, 23, 42, 0.24);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Slot text readability spacing v3 */
.slot-card {
  line-height: 1.38;
}

.slot-title {
  line-height: 1.42;
  margin-bottom: 3px;
}

.slot-course-supervisor {
  line-height: 1.34;
  margin-top: 3px;
}

.slot-extra-modules,
.slot-extra-modules strong {
  line-height: 1.36;
}

.slot-meta-row {
  line-height: 1.34;
  margin-top: 4px;
  margin-bottom: 4px;
}

.slot-halls {
  margin-top: 4px;
}

.slot-note {
  line-height: 1.34;
  margin-top: 5px;
}


/* Full supervisor names and extra module spacing */
.slot-course-supervisor {
  display: block;
  margin-top: 4px;
  margin-bottom: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.slot-extra-modules {
  display: block;
  margin-top: 5px;
}

.slot-context-menu {
  max-width: 360px;
}

.slot-context-menu-item {
  grid-template-columns: minmax(96px, auto) minmax(150px, 1fr);
  white-space: normal;
}

.slot-context-menu-item span {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* Course supervisor duty rejection controls */
.slot-header-actions {
  gap: 8px;
}

.slot-duty-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  margin-left: 6px;
}

.slot-duty-action {
  border: 0;
  border-radius: 999px;
  padding: 4px 9px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
  white-space: nowrap;
}

.slot-duty-action.reject {
  background: #E11D48;
}

.slot-duty-action.readd {
  background: #059669;
}

.slot-duty-action:hover,
.slot-duty-action:focus-visible {
  filter: brightness(1.08);
}

.slot-duty-lock,
.slot-duty-alert {
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
}

.slot-duty-lock {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  color: #FDE68A;
  background: rgba(15, 23, 42, 0.38);
  white-space: nowrap;
}

.slot-duty-alert {
  margin-top: 5px;
  padding: 5px 7px;
  color: #FFF7ED;
  background: rgba(190, 18, 60, 0.82);
  border-left: 3px solid #FDE68A;
}

/* Keep timetable cards centered inside their department tracks. */
.time-sector-slots,
.time-slot-row {
  justify-items: center;
}

.time-slot-row {
  --slot-card-min-width: 220px;
  display: grid;
  grid-template-columns: repeat(var(--slot-card-columns, var(--parallel-slot-count, 1)), minmax(var(--slot-card-min-width), var(--slot-card-basis, 1fr)));
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}

.time-slot-row::-webkit-scrollbar {
  height: 8px;
}

.time-slot-row::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.28);
  border-radius: 999px;
}

.time-slot-row::-webkit-scrollbar-thumb {
  background: #F97316;
  border-radius: 999px;
}

.slot-card {
  justify-self: center;
  width: 100%;
  min-width: var(--slot-card-min-width, 220px);
  max-width: none;
  margin-inline: auto;
}

.packed-slot-row .slot-card {
  width: 100%;
  max-width: none;
}

/* Inline timetable editing */
.slot-card.inline-edit-card {
  gap: 7px;
  padding: 8px;
  cursor: default;
  background: rgba(100, 116, 139, 0.44);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.36), 0 10px 24px rgba(15, 23, 42, 0.32);
}

.inline-time-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.inline-slot-input,
.inline-slot-select,
.inline-student-input,
.inline-hall-card input,
.inline-hall-card select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(226, 232, 240, 0.22);
  border-radius: 5px;
  color: #FFFFFF;
  background: #0F172A;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
}

.inline-slot-input,
.inline-slot-select,
.inline-hall-card input,
.inline-hall-card select {
  min-height: 30px;
  padding: 6px 8px;
}

.inline-module-select {
  color: #F8FAFC;
  background: #075E68;
}

.inline-student-input {
  display: inline-block;
  width: 56px;
  min-height: 22px;
  margin-right: 3px;
  padding: 2px 5px;
  text-align: center;
}

.inline-meta-row {
  align-items: center;
}

.inline-slot-halls {
  grid-template-columns: repeat(var(--slot-hall-columns, 1), minmax(0, 1fr));
}

.inline-hall-button {
  min-height: 24px;
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.72);
}

.inline-hall-count {
  display: inline-grid;
  min-width: 28px;
  min-height: 22px;
  place-items: center;
  border-radius: 5px;
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.68);
  font-size: 0.68rem;
  font-weight: 900;
}

.inline-add-hall {
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  color: #FFFFFF;
  background: #0EA5E9;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.inline-add-hall:hover,
.inline-add-hall:focus-visible {
  background: #0284C7;
}

.inline-edit-warning {
  border-radius: 6px;
  padding: 6px 8px;
  color: #FEE2E2;
  background: rgba(190, 18, 60, 0.78);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
}

.inline-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.compact-action {
  min-height: 28px;
  padding: 5px 12px;
  font-size: 0.75rem;
}

.inline-hall-modal {
  width: min(820px, 96vw);
  max-height: 88vh;
  overflow: auto;
}

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

.inline-modal-head .icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #FFFFFF;
  background: #E11D48;
  font-weight: 900;
  cursor: pointer;
}

.inline-hall-card {
  margin: 0;
  background: #4B5D73;
}

.inline-hall-card .hall-card-title-bar {
  margin: 0;
}

.inline-hall-card .hall-card-header {
  margin-top: 8px;
}

.inline-hall-card .capacity-note {
  display: block;
  margin-top: 4px;
}

.inline-staff-requirements {
  gap: 14px;
  margin-top: 8px;
}

.inline-staff-requirements .role-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.role-title-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.inline-staff-requirements .add-extra-staff {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #FFFFFF;
  background: #3B82F6;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
}

.inline-role-select-wrap {
  display: flex;
  gap: 5px;
  min-width: 0;
}

.inline-role-select-wrap .inline-staff-select {
  flex: 1 1 auto;
}

.inline-remove-staff {
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  border-radius: 5px;
}

.inline-staff-select.missing-staff {
  border-color: #FB7185;
  background: #7F1D1D;
}

/* Keep the morning/evening divider compact, roughly one inch. */
.slot-list {
  grid-template-rows: auto minmax(92px, auto) auto;
  align-content: start;
}

.time-sector-middle {
  padding-top: 4px;
  padding-bottom: 4px;
}

.time-sector,
.time-sector-slots,
.time-sector-middle .time-sector-slots,
.time-sector-morning .time-sector-slots,
.time-sector-afternoon .time-sector-slots {
  align-content: start;
  align-items: start;
}

.dept-column.empty-dept .slot-list {
  grid-template-rows: auto 92px auto;
  align-content: start;
}

/* Student timetable cards share the same slot component rhythm as admin cards. */
.student-shell .slot-card.student-slot-card {
  gap: 4px;
  padding: 5px 7px 7px;
  line-height: 1.38;
}

.student-shell .student-slot-card .slot-time-bar {
  width: calc(100% + 8px);
  margin: -5px -4px 2px;
  padding: 5px 8px 6px;
  border-radius: 6px 6px 3px 3px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.student-shell .student-slot-card .slot-title {
  font-size: 11px;
  font-weight: 900;
  line-height: 1.42;
  margin-bottom: 3px;
}

.student-shell .student-slot-card .slot-course-supervisor {
  font-size: 9px;
  font-weight: 900;
  line-height: 1.34;
  margin-top: 4px;
  margin-bottom: 6px;
}

.student-shell .student-slot-card .slot-extra-modules,
.student-shell .student-slot-card .slot-extra-modules strong {
  font-size: 9px;
  line-height: 1.36;
}

.student-shell .student-slot-card .slot-meta-row {
  font-size: 9px;
  line-height: 1.34;
  margin-top: 4px;
  margin-bottom: 4px;
}

.student-shell .student-slot-card .slot-pill,
.student-shell .student-slot-card .slot-hall-code {
  font-size: 9px;
  font-weight: 900;
  line-height: 1.22;
}

.student-shell .student-slot-card .slot-hall-head {
  grid-template-columns: minmax(0, 1fr);
}

.student-shell .student-slot-card .slot-hall-code {
  cursor: default;
  pointer-events: none;
}

.student-shell .student-slot-card .slot-note {
  font-size: 9px;
  line-height: 1.34;
  margin-top: 5px;
}
