: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;
  --bg: var(--bg-app);
  --border: var(--border-light);
  --text-muted: #94A3B8;
}

* {
  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;
}

.date-merge-modal {
  width: min(560px, 100%);
}

.date-merge-status {
  padding: 11px 13px;
  border-left: 4px solid #38BDF8;
  border-radius: 9px;
  color: #E0F2FE;
  background: rgba(56, 189, 248, 0.14);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
}

.date-merge-status.ok {
  border-left-color: #34D399;
  color: #D1FAE5;
  background: rgba(16, 185, 129, 0.16);
}

.date-merge-status.error {
  border-left-color: #FB7185;
  color: #FFE4E6;
  background: rgba(225, 29, 72, 0.18);
}

.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;
}

.password-input-wrap {
  position: relative;
  display: block;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #E2E8F0;
  background: rgba(15, 23, 42, 0.42);
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-visible {
  color: #FFFFFF;
  background: rgba(30, 58, 138, 0.72);
}

.password-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.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;
  position: relative;
  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);
}

.timetable-zoom-overlay {
  position: absolute;
  right: 24px;
  top: 24px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.66);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.38);
  backdrop-filter: blur(10px);
}

.timetable-zoom-overlay .tool-circle {
  width: 44px;
  height: 44px;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.28);
}

.timetable-zoom-overlay .tool-circle:hover,
.timetable-zoom-overlay .tool-circle:focus-visible {
  background: #1D4ED8;
  transform: translateY(-1px);
}

.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 {
  position: relative;
  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-change-label {
  display: inline-block;
  min-width: max-content;
  color: inherit;
  background: transparent;
}

.date-change-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.date-change-display,
.date-change-display * {
  box-shadow: none;
}

.date-change-display:hover .date-value,
.date-change-display:focus-visible .date-value {
  outline: 3px solid rgba(249, 115, 22, 0.75);
  outline-offset: 3px;
}

.date-undo-button {
  min-height: 34px;
  padding: 5px 13px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: #FFFFFF;
  background: #E11D48;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.22);
}

.date-undo-button:hover {
  transform: translateY(-1px);
  background: #BE123C;
}

.date-change-input {
  min-height: 44px;
  width: 230px;
  padding: 4px 12px;
  border: 3px solid #F97316;
  border-radius: 8px;
  color: #fff;
  background: #1E293B;
  font: inherit;
  text-align: center;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
}

.date-calendar-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 45;
  width: 318px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 14px;
  color: #F8FAFC;
  background: #0F172A;
  box-shadow: 0 22px 48px rgba(2, 6, 23, 0.42);
  transform: translateX(-50%);
}

.date-calendar-head {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.date-calendar-head strong {
  color: #F8FAFC;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.date-calendar-nav {
  min-height: 32px;
  border: 1px solid #334155;
  border-radius: 10px;
  color: #F8FAFC;
  background: #1E293B;
  font-size: 18px;
  font-weight: 900;
}

.date-calendar-weekdays,
.date-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-calendar-weekdays {
  margin-bottom: 5px;
}

.date-calendar-weekdays span {
  color: #94A3B8;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.date-calendar-empty,
.date-calendar-day {
  min-height: 34px;
}

.date-calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #E2E8F0;
  background: #111827;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.date-calendar-day:hover {
  border-color: #F97316;
  background: #1E293B;
}

.date-calendar-day.is-current {
  border-color: #F97316;
  box-shadow: inset 0 0 0 1px #F97316;
}

.date-calendar-day.is-today .calendar-day-number {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.calendar-exam-dot {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #EF4444;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}

.date-calendar-legend {
  position: relative;
  margin-top: 9px;
  padding-left: 17px;
  color: #CBD5E1;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.date-calendar-legend .calendar-exam-dot {
  left: 3px;
  bottom: 3px;
  transform: none;
}

.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-count-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.role-count-button {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #FFFFFF;
  background: #2563EB;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.22);
}

.role-count-button:first-child {
  background: #64748B;
}

.role-count-button:hover {
  transform: translateY(-1px);
}

.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: 36px;
  padding: 5px 30px 5px 9px;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-staff-select option,
.inline-staff-select option {
  font-size: 14px;
  line-height: 1.45;
}

.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: 36px;
  padding: 5px 30px 5px 9px;
  font-size: 14px;
  line-height: 1.25;
  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,
.visible-date-range-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);
}

.visible-date-range-panel {
  border-color: rgba(16, 185, 129, 0.36);
  background: rgba(15, 23, 42, 0.58);
}

.semester-visibility-panel strong,
.visible-date-range-panel strong {
  display: block;
  color: #F8FAFC;
  font-size: 18px;
  font-weight: 900;
}

.semester-visibility-panel small,
.visible-date-range-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;
}

.visible-date-range-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 240px));
  gap: 14px;
  align-items: end;
}

.visible-date-range-controls label {
  display: grid;
  gap: 7px;
  color: #F8FAFC;
  font-size: 13px;
  font-weight: 900;
}

.visible-date-range-controls input {
  width: 100%;
  min-height: 38px;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  color: #F8FAFC;
  background: #0F172A;
  font: inherit;
  font-weight: 900;
}

@media (max-width: 900px) {
  .semester-visibility-panel,
  .visible-date-range-panel {
    grid-template-columns: 1fr;
  }

  .visible-date-range-controls {
    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 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.62);
  font-size: 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.slot-hall-code-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-hall-count-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 22px;
  min-height: 18px;
  padding: 1px 5px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.92);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.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-columns, 1) * 132px) + 18px));
  width: 100%;
}

.slot-halls {
  flex-wrap: wrap;
  overflow: visible;
  overflow-x: visible;
  overflow-y: visible;
  scrollbar-width: none;
}

.slot-halls::-webkit-scrollbar {
  display: none;
}

.slot-hall {
  flex: 0 0 126px;
  min-width: 126px;
}


/* 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);
  align-items: center;
}

.slot-hall-head:has(.enroll-btn) {
  grid-template-columns: minmax(0, 1fr) 22px;
}

.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;
  gap: 3px;
  padding-right: 2px;
}

.slot-hall-code-text {
  flex: 1 1 auto;
}

.slot-hall-count-badge {
  margin-left: auto;
}

.slot-hall-code.bg-status-pending {
  background-color: #641111;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.34);
}

.slot-hall-code.bg-status-filled {
  background-color: #1B4332;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.32);
}

.slot-hall-code.bg-status-pending:hover,
.slot-hall-code.bg-status-pending:focus-visible {
  background-color: #7F1D1D;
}

.slot-hall-code.bg-status-filled:hover,
.slot-hall-code.bg-status-filled:focus-visible {
  background-color: #14532D;
}

.slot-hall-code.bg-status-pending .slot-hall-count-badge {
  background-color: rgba(69, 10, 10, 0.96);
}

.slot-hall-code.bg-status-filled .slot-hall-count-badge {
  background-color: rgba(5, 46, 22, 0.96);
}


/* 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;
  min-height: 36px;
  font-size: 14px;
  line-height: 1.25;
}

.inline-remove-staff {
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  align-self: center;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #FFFFFF !important;
  background: #E11D48 !important;
  box-shadow: 0 6px 14px rgba(225, 29, 72, 0.28);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.inline-remove-staff:hover,
.inline-remove-staff:focus-visible {
  background: #BE123C !important;
  transform: translateY(-1px);
}

.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;
}

/* Shared theme controls */
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #1F2937;
  --bg-app: #F4F7FB;
  --bg: #F4F7FB;
  --border-light: #D7E0EC;
  --border: #CBD5E1;
  --card-bg: #FFFFFF;
  --text-muted: #64748B;
  --dark: #E2E8F0;
  --gray: #64748B;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

html,
body,
.login-view,
.login-card,
.topbar,
.brand-panel,
.timetable-head,
.work-area,
.schedule-wrap,
.board-scroll,
.scheduler-card,
.dashboard-card,
.data-panel,
.table-wrap,
.system-modal,
.modal-backdrop,
.attendance-shell,
.header-box,
.slot-block,
.staff-item,
.theme-toggle {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 104px;
  height: 44px;
  gap: 10px;
  padding: 0 12px 0 16px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 999px;
  color: #F8FAFC;
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.22), inset 0 1px rgba(255, 255, 255, 0.08);
}

.theme-toggle::before {
  content: "Theme";
  color: currentColor;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(30, 41, 59, 0.9);
}

.theme-toggle-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.theme-toggle-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-panel .theme-toggle {
  justify-self: end;
}

.topbar .brand-panel {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.topbar {
  position: relative;
}

.topbar .theme-toggle {
  position: absolute;
  top: 16px;
  right: 22px;
  z-index: 6;
}

.topbar .user-box {
  margin-right: 134px;
}

.topbar .brand-panel .theme-toggle {
  justify-self: auto;
}

.login-view {
  position: relative;
}

.login-theme-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 5;
}

html[data-theme="light"] body {
  color: #1F2937;
  background: #F4F7FB;
}

html[data-theme="light"] .login-view {
  background: linear-gradient(135deg, #F8FAFC, #E0F2FE);
}

html[data-theme="light"] .login-card,
html[data-theme="light"] .system-modal,
html[data-theme="light"] .dashboard-card,
html[data-theme="light"] .data-panel,
html[data-theme="light"] .scheduler-card,
html[data-theme="light"] .slot-block,
html[data-theme="light"] .payment-rates {
  color: #1F2937;
  background: #FFFFFF !important;
  border-color: #D7E0EC;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.09);
}

html[data-theme="light"] .login-card *,
html[data-theme="light"] .system-modal *,
html[data-theme="light"] .dashboard-card *,
html[data-theme="light"] .data-panel *,
html[data-theme="light"] .scheduler-card *,
html[data-theme="light"] .slot-block *,
html[data-theme="light"] .payment-rates *,
html[data-theme="light"] .attendance-main * {
  color: #1F2937 !important;
}

html[data-theme="light"] .topbar,
html[data-theme="light"] .student-shell .topbar {
  color: #172033;
  background: #F8FAFC;
  border-bottom: 1px solid #D7E0EC;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .brand-panel,
html[data-theme="light"] .student-shell .brand-panel,
html[data-theme="light"] .header-box {
  color: #172033;
  background: #FFFFFF;
  border-bottom-color: #D7E0EC;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .brand-copy strong,
html[data-theme="light"] .student-shell .brand-copy strong,
html[data-theme="light"] .header-title-box h1,
html[data-theme="light"] .timetable-head h1,
html[data-theme="light"] .student-shell .timetable-head h1,
html[data-theme="light"] .login-view h1,
html[data-theme="light"] .login-card h1,
html[data-theme="light"] .system-modal h2,
html[data-theme="light"] .data-panel h2,
html[data-theme="light"] .slot-header h2 {
  color: #111827 !important;
}

html[data-theme="light"] .system-kicker,
html[data-theme="light"] .brand-copy span:last-child,
html[data-theme="light"] .slot-header p,
html[data-theme="light"] .staff-role,
html[data-theme="light"] #user-info {
  color: #64748B !important;
}

html[data-theme="light"] .role-title {
  color: #FFFFFF;
  background: #334155;
}

html[data-theme="light"] .timetable-head,
html[data-theme="light"] .student-shell .timetable-head {
  background: transparent;
}

html[data-theme="light"] .work-area,
html[data-theme="light"] .student-shell .work-area,
html[data-theme="light"] .attendance-main {
  background: #EAF0F7;
}

html[data-theme="light"] .schedule-wrap,
html[data-theme="light"] .student-shell .schedule-wrap,
html[data-theme="light"] .board-scroll {
  background: #FFFFFF;
  border-color: #CBD5E1;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .date-header,
html[data-theme="light"] .exam-date-block {
  background: #F8FAFC;
  border-color: #9BAFC7;
}

html[data-theme="light"] .scheduler-card,
html[data-theme="light"] .scheduler-card form {
  background: #FFFFFF;
}

html[data-theme="light"] .scheduler-card-heading,
html[data-theme="light"] .scheduler-sticky-header {
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color: #111827;
  background-color: #FFFFFF;
  border-color: #CBD5E1;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #64748B;
}

html[data-theme="light"] .search-controls input,
html[data-theme="light"] .staff-upf,
html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color: #172033;
  background: #FFFFFF;
  border: 1px solid #94A3B8;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .semester-filter,
html[data-theme="light"] .user-box,
html[data-theme="light"] .pill-action,
html[data-theme="light"] .search-button,
html[data-theme="light"] .primary-action,
html[data-theme="light"] .secondary-action,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .logout-btn,
html[data-theme="light"] .tool-circle,
html[data-theme="light"] .mini-download,
html[data-theme="light"] .mini-clock,
html[data-theme="light"] .csv-action,
html[data-theme="light"] .panel-submit,
html[data-theme="light"] .panel-toggle,
html[data-theme="light"] .collapse-toggle,
html[data-theme="light"] .table-save,
html[data-theme="light"] button:not(.dept-toggle):not(.theme-toggle):not(.scheduler-collapse-toggle):not(.password-toggle):not(.login-link-button) {
  color: #F8FAFC !important;
  background: #0F172A !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .semester-filter select {
  color: #F8FAFC !important;
  background: #1E293B !important;
  border-color: #334155 !important;
}

html[data-theme="light"] .theme-toggle {
  color: #F8FAFC !important;
  background: #0F172A !important;
  border-color: #334155 !important;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .theme-toggle .theme-toggle-icon {
  color: #F8FAFC !important;
  background: #1E293B !important;
  border: 1px solid #334155;
}

html[data-theme="light"] .theme-toggle:hover {
  background: #1E293B !important;
  border-color: #475569;
}

html[data-theme="light"] .dept-pill,
html[data-theme="light"] .dept-pill *,
html[data-theme="light"] .dept-column-head,
html[data-theme="light"] .dept-column-head *,
html[data-theme="light"] .exam-card,
html[data-theme="light"] .exam-card *,
html[data-theme="light"] .student-slot-card,
html[data-theme="light"] .student-slot-card *,
html[data-theme="light"] .slot-pill,
html[data-theme="light"] .slot-pill *,
html[data-theme="light"] .mini-download {
  color: #F8FAFC !important;
}

html[data-theme="light"] .slot-meta-row,
html[data-theme="light"] .slot-meta-row *,
html[data-theme="light"] .slot-supervisor,
html[data-theme="light"] .slot-supervisor *,
html[data-theme="light"] .slot-extra-modules,
html[data-theme="light"] .slot-extra-modules * {
  color: #F8FAFC !important;
}

html[data-theme="light"] .scheduler-card .primary-action,
html[data-theme="light"] .scheduler-card .secondary-action,
html[data-theme="light"] .scheduler-card .danger-action,
html[data-theme="light"] .scheduler-card .icon-button,
html[data-theme="light"] .scheduler-card .csv-button,
html[data-theme="light"] .scheduler-card .staff-add-button {
  color: #172033 !important;
  border-color: #94A3B8;
}

html[data-theme="light"] .staff-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

html[data-theme="light"] .staff-item:hover {
  background: #EEF4FB;
}

html[data-theme="light"] .data-table th,
html[data-theme="light"] table th {
  color: #111827;
  background: #E2E8F0;
}

html[data-theme="light"] .data-table td,
html[data-theme="light"] table td {
  color: #1F2937;
  border-color: #D7E0EC;
}

html[data-theme="light"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.32);
}

html[data-theme="light"] .toast {
  color: #FFFFFF;
  background: rgba(30, 41, 59, 0.96);
}

html[data-theme="light"] .student-shell {
  background: #F4F7FB;
}

html[data-theme="light"] .student-shell .student-slot-card,
html[data-theme="light"] .exam-card {
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.14);
}

/* Light-mode readability fixes for hard-coded dark-theme controls */
html[data-theme="light"] .date-bar,
html[data-theme="light"] .date-header {
  color: #111827 !important;
  background: #E2E8F0 !important;
  border-color: #94A3B8 !important;
}

html[data-theme="light"] .date-bar *,
html[data-theme="light"] .date-header * {
  color: #111827 !important;
}

html[data-theme="light"] .date-bar .date-value {
  color: #111827 !important;
  background: #FFFFFF !important;
  border: 1px solid #94A3B8;
}

html[data-theme="light"] .date-change-display,
html[data-theme="light"] .date-change-display * {
  color: #FFFFFF !important;
  box-shadow: none !important;
}

html[data-theme="light"] .date-change-display {
  gap: 8px;
  padding: 3px 8px;
  border: 2px solid #334155 !important;
  border-radius: 8px;
  background: #111827 !important;
}

html[data-theme="light"] .date-change-display .date-change-label {
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  color: #FFFFFF !important;
  background: transparent !important;
}

html[data-theme="light"] .date-change-display .date-value {
  color: #FFFFFF !important;
  background: #334155 !important;
  border: 0 !important;
  border-radius: 6px;
}

html[data-theme="light"] .date-undo-button,
html[data-theme="light"] .date-undo-button * {
  color: #FFFFFF !important;
  background: #E11D48 !important;
  border-color: #BE123C !important;
}

html[data-theme="light"] .date-change-input {
  color: #111827 !important;
  background: #FFFFFF !important;
  border-color: #F97316;
}

html[data-theme="light"] .date-calendar-popover,
html[data-theme="light"] .date-calendar-popover * {
  color: #111827 !important;
}

html[data-theme="light"] .date-calendar-popover {
  background: #FFFFFF !important;
  border-color: #94A3B8 !important;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.2);
}

html[data-theme="light"] .date-calendar-head strong {
  color: #111827 !important;
}

html[data-theme="light"] .date-calendar-nav {
  color: #FFFFFF !important;
  background: #111827 !important;
  border-color: #334155 !important;
}

html[data-theme="light"] .date-calendar-weekdays span,
html[data-theme="light"] .date-calendar-legend {
  color: #475569 !important;
}

html[data-theme="light"] .date-calendar-day {
  color: #FFFFFF !important;
  background: #111827 !important;
  border-color: #CBD5E1 !important;
}

html[data-theme="light"] .date-calendar-day .calendar-day-number {
  color: #FFFFFF !important;
}

html[data-theme="light"] .date-calendar-day:hover,
html[data-theme="light"] .date-calendar-day.is-current {
  border-color: #F97316 !important;
  background: #1E293B !important;
}

html[data-theme="light"] .calendar-exam-dot,
html[data-theme="light"] .date-calendar-legend .calendar-exam-dot {
  background: #DC2626 !important;
}

html[data-theme="light"] .date-merge-status {
  color: #075985 !important;
  background: #E0F2FE !important;
  border-left-color: #0284C7 !important;
}

html[data-theme="light"] .date-merge-status.ok {
  color: #065F46 !important;
  background: #D1FAE5 !important;
  border-left-color: #059669 !important;
}

html[data-theme="light"] .date-merge-status.error {
  color: #7F1D1D !important;
  background: #FEE2E2 !important;
  border-left-color: #DC2626 !important;
}

html[data-theme="light"] .topbar .user-box {
  color: #111827 !important;
  background: #FFFFFF !important;
  border: 1px solid #94A3B8;
}

html[data-theme="light"] .topbar .user-box *,
html[data-theme="light"] #user-name,
html[data-theme="light"] .user-info,
html[data-theme="light"] .user-info *,
html[data-theme="light"] .user-role-label {
  color: #111827 !important;
}

html[data-theme="light"] .user-avatar {
  color: #FFFFFF !important;
  background: #111827 !important;
  border-color: #CBD5E1;
}

html[data-theme="light"] .user-box-divider {
  background: #CBD5E1 !important;
}

html[data-theme="light"] .supervisor-slot-count {
  color: #111827 !important;
  background: #E2E8F0 !important;
  border: 1px solid #94A3B8;
}

html[data-theme="light"] .timetable-zoom-overlay {
  background: rgba(255, 255, 255, 0.82) !important;
  border-color: #94A3B8 !important;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .timetable-zoom-overlay .tool-circle,
html[data-theme="light"] .tool-circle {
  color: #111827 !important;
  background: #FFFFFF !important;
  border: 1px solid #94A3B8 !important;
}

html[data-theme="light"] .timetable-zoom-overlay .tool-circle:hover,
html[data-theme="light"] .timetable-zoom-overlay .tool-circle:focus-visible {
  color: #FFFFFF !important;
  background: #1D4ED8 !important;
  border-color: #1D4ED8 !important;
}

html[data-theme="light"] .scheduler-card {
  color: #111827 !important;
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1;
}

html[data-theme="light"] .scheduler-sticky-header {
  background: #F8FAFC !important;
  border-bottom-color: #CBD5E1;
}

html[data-theme="light"] .scheduler-card-heading,
html[data-theme="light"] .scheduler-card.is-collapsed,
html[data-theme="light"] .scheduler-card.is-collapsed .scheduler-card-heading {
  color: #111827 !important;
  background: #E2E8F0 !important;
  border-color: #94A3B8 !important;
}

html[data-theme="light"] .scheduler-card-heading h2,
html[data-theme="light"] .scheduler-card-heading *,
html[data-theme="light"] .scheduler-card.is-collapsed .scheduler-card-heading h2,
html[data-theme="light"] .scheduler-card.is-collapsed .scheduler-card-heading * {
  color: #111827 !important;
}

html[data-theme="light"] .scheduler-collapse-toggle,
html[data-theme="light"] .scheduler-card.is-collapsed .scheduler-collapse-toggle,
html[data-theme="light"] .scheduler-bottom-arrows {
  color: #111827 !important;
}

html[data-theme="light"] .scheduler-card label,
html[data-theme="light"] .scheduler-card label *,
html[data-theme="light"] .scheduler-card .allocation-summary,
html[data-theme="light"] .scheduler-card .allocation-summary * {
  color: #111827 !important;
}

html[data-theme="light"] .scheduler-card input,
html[data-theme="light"] .scheduler-card select,
html[data-theme="light"] .scheduler-card textarea {
  color: #111827 !important;
  background: #FFFFFF !important;
  border: 1px solid #94A3B8 !important;
}

html[data-theme="light"] .bottom-panels {
  background: #EAF0F7 !important;
}

html[data-theme="light"] .bottom-panels .data-panel {
  color: #FFFFFF !important;
  background: var(--red) !important;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .bottom-panels .module-panel {
  background: var(--blue) !important;
}

html[data-theme="light"] .bottom-panels .hall-panel {
  background: var(--red) !important;
}

html[data-theme="light"] .bottom-panels .panel-title {
  color: #FFFFFF !important;
  background: var(--navy) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .bottom-panels .module-panel .panel-title {
  background: #4f77f0 !important;
}

html[data-theme="light"] .bottom-panels .data-panel *,
html[data-theme="light"] .bottom-panels .panel-title *,
html[data-theme="light"] .bottom-panels .data-panel label,
html[data-theme="light"] .bottom-panels .data-panel label span {
  color: #FFFFFF !important;
}

html[data-theme="light"] .bottom-panels .data-panel input,
html[data-theme="light"] .bottom-panels .data-panel select {
  color: #111827 !important;
  background: #FFFFFF !important;
  border: 1px solid #94A3B8 !important;
}

html[data-theme="light"] .bottom-panels .panel-submit,
html[data-theme="light"] .bottom-panels .panel-toggle,
html[data-theme="light"] .bottom-panels .csv-action,
html[data-theme="light"] .bottom-panels .danger-action {
  color: #111827 !important;
  background: #FFFFFF !important;
  border: 1px solid #94A3B8 !important;
}

html[data-theme="light"] .bottom-panels .panel-submit:hover,
html[data-theme="light"] .bottom-panels .panel-toggle:hover,
html[data-theme="light"] .bottom-panels .csv-action:hover {
  background: #F1F5F9 !important;
}

html[data-theme="light"] .dashboard-card {
  color: #F8FAFC !important;
  background: #111827 !important;
  border: 1px solid #1E293B;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .dashboard-card *,
html[data-theme="light"] .section-heading h2 {
  color: #F8FAFC !important;
}

html[data-theme="light"] .dashboard-card input,
html[data-theme="light"] .dashboard-card select,
html[data-theme="light"] .dashboard-card textarea {
  color: #F8FAFC !important;
  background: #0F172A !important;
  border: 1px solid #334155 !important;
}

html[data-theme="light"] .dashboard-card th {
  color: #FFFFFF !important;
  background: #0F172A !important;
}

html[data-theme="light"] .dashboard-card td {
  color: #E2E8F0 !important;
  border-color: #1E293B !important;
}

html[data-theme="light"] .dashboard-card .csv-action,
html[data-theme="light"] .dashboard-card .danger-action,
html[data-theme="light"] .dashboard-card .collapse-toggle,
html[data-theme="light"] .dashboard-card .count-badge {
  color: #FFFFFF !important;
}

html[data-theme="light"] .dashboard-card .csv-action {
  color: #FFFFFF !important;
  background: #0D9488 !important;
  border-color: transparent !important;
}

html[data-theme="light"] .dashboard-card .csv-action.muted {
  color: #FFFFFF !important;
  background: #475569 !important;
}

html[data-theme="light"] .dashboard-card .danger-action {
  color: #FFFFFF !important;
  background: #BE123C !important;
  border-color: transparent !important;
}

html[data-theme="light"] .dashboard-card .collapse-toggle,
html[data-theme="light"] .dashboard-card .table-save {
  color: #FFFFFF !important;
  background: var(--navy) !important;
  border-color: transparent !important;
}

html[data-theme="light"] .dashboard-card .count-badge {
  color: #FFFFFF !important;
  background: var(--navy) !important;
}

html[data-theme="light"] .dashboard-card button:not(.csv-action):not(.danger-action):not(.collapse-toggle):not(.table-save) {
  color: #111827 !important;
}

html[data-theme="light"] .scheduler-card,
html[data-theme="light"] .scheduler-card form {
  color: #FFFFFF !important;
  background: #475569 !important;
  border-color: #334155 !important;
}

html[data-theme="light"] .scheduler-sticky-header {
  background: #475569 !important;
  border-bottom-color: rgba(226, 232, 240, 0.18) !important;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.26) !important;
}

html[data-theme="light"] .scheduler-card-heading,
html[data-theme="light"] .scheduler-card.is-collapsed,
html[data-theme="light"] .scheduler-card.is-collapsed .scheduler-card-heading {
  color: #FFFFFF !important;
  background: #64748B !important;
  border-color: #334155 !important;
}

html[data-theme="light"] .scheduler-card.editing-mode .scheduler-card-heading {
  background: #F97316 !important;
}

html[data-theme="light"] .scheduler-card-heading h2,
html[data-theme="light"] .scheduler-card-heading *,
html[data-theme="light"] .scheduler-card label,
html[data-theme="light"] .scheduler-card label *,
html[data-theme="light"] .scheduler-card .allocation-summary,
html[data-theme="light"] .scheduler-card .allocation-summary *,
html[data-theme="light"] .scheduler-collapse-toggle,
html[data-theme="light"] .scheduler-bottom-arrows {
  color: #FFFFFF !important;
}

html[data-theme="light"] .scheduler-card input,
html[data-theme="light"] .scheduler-card select,
html[data-theme="light"] .scheduler-card textarea {
  color: #FFFFFF !important;
  background: #025763 !important;
  border: 1px solid rgba(226, 232, 240, 0.18) !important;
}

html[data-theme="light"] .scheduler-card input:disabled,
html[data-theme="light"] .scheduler-card select:disabled,
html[data-theme="light"] .scheduler-card textarea:disabled {
  color: #111827 !important;
  background: #94A3B8 !important;
}

html[data-theme="light"] .topbar .user-box,
html[data-theme="light"] .user-box {
  color: #F8FAFC !important;
  background: #0F172A !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18) !important;
}

html[data-theme="light"] .topbar .user-box *,
html[data-theme="light"] .user-box *,
html[data-theme="light"] #user-name,
html[data-theme="light"] .user-info,
html[data-theme="light"] .user-info * {
  color: #F8FAFC !important;
}

html[data-theme="light"] .user-role-label {
  color: rgba(248, 250, 252, 0.72) !important;
}

html[data-theme="light"] .user-box-divider {
  background: rgba(248, 250, 252, 0.24) !important;
}

html[data-theme="light"] .user-avatar {
  color: #FFFFFF !important;
  background: #020617 !important;
  border-color: rgba(248, 250, 252, 0.42) !important;
}

html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .logout-btn,
html[data-theme="light"] .search-button,
html[data-theme="light"] .pill-action,
html[data-theme="light"] .primary-action,
html[data-theme="light"] .secondary-action,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .tool-circle,
html[data-theme="light"] .mini-download,
html[data-theme="light"] .mini-clock,
html[data-theme="light"] .csv-action,
html[data-theme="light"] .csv-action.muted,
html[data-theme="light"] .panel-submit,
html[data-theme="light"] .panel-toggle,
html[data-theme="light"] .collapse-toggle,
html[data-theme="light"] .table-save,
html[data-theme="light"] .scheduler-card .primary-action,
html[data-theme="light"] .scheduler-card .secondary-action,
html[data-theme="light"] .scheduler-card .icon-button,
html[data-theme="light"] .scheduler-card .csv-button,
html[data-theme="light"] .scheduler-card .staff-add-button,
html[data-theme="light"] .bottom-panels .panel-submit,
html[data-theme="light"] .bottom-panels .panel-toggle,
html[data-theme="light"] .bottom-panels .csv-action,
html[data-theme="light"] .dashboard-card .csv-action,
html[data-theme="light"] .dashboard-card .csv-action.muted,
html[data-theme="light"] .dashboard-card .collapse-toggle,
html[data-theme="light"] .dashboard-card .table-save {
  color: #F8FAFC !important;
  background: #0F172A !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16) !important;
}

html[data-theme="light"] .danger-action,
html[data-theme="light"] .scheduler-card .danger-action,
html[data-theme="light"] .bottom-panels .danger-action,
html[data-theme="light"] .dashboard-card .danger-action {
  color: #FFFFFF !important;
  background: #BE123C !important;
  border-color: #9F1239 !important;
  box-shadow: 0 10px 20px rgba(190, 18, 60, 0.22) !important;
}

html[data-theme="light"] .icon-button.danger,
html[data-theme="light"] .dashboard-card .icon-button.danger {
  position: relative;
  display: inline-grid !important;
  place-items: center !important;
  min-width: 42px !important;
  min-height: 34px !important;
  color: #FFFFFF !important;
  background: #0B1220 !important;
  border: 1px solid #111827 !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2) !important;
}

html[data-theme="light"] .dashboard-card .icon-button.danger {
  font-size: 0 !important;
}

html[data-theme="light"] .dashboard-card .icon-button.danger::before {
  content: "X";
  display: grid;
  place-items: center;
  color: #FFFFFF !important;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

html[data-theme="light"] .dashboard-card .remove-button {
  color: #FFFFFF !important;
  background: #0B1220 !important;
  border-color: #111827 !important;
}

html[data-theme="light"] .dept-check {
  border-color: #0F172A !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .dept-toggle.off .dept-check {
  background: #475569 !important;
}

html[data-theme="light"] .scheduler-collapse-toggle,
html[data-theme="light"] .scheduler-card.is-collapsed .scheduler-collapse-toggle,
html[data-theme="light"] .scheduler-bottom-arrows {
  color: #FFFFFF !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

html[data-theme="light"] .scheduler-card.is-collapsed .scheduler-collapse-toggle span,
html[data-theme="light"] .scheduler-card.is-collapsed .scheduler-bottom-arrows > span {
  border-top-color: currentColor !important;
  border-right-color: currentColor !important;
  animation: single-arrow-right 1.15s ease-in-out infinite !important;
}

html[data-theme="light"] .scheduler-collapse-toggle::before,
html[data-theme="light"] .scheduler-collapse-toggle::after,
html[data-theme="light"] .scheduler-card.is-collapsed .scheduler-collapse-toggle::before,
html[data-theme="light"] .scheduler-card.is-collapsed .scheduler-collapse-toggle::after {
  display: none !important;
}

/* Light mode polish: keep controls readable inside dark form surfaces. */
.scheduler-card select option,
.scheduler-card select optgroup,
.inline-hall-modal select option,
.inline-hall-modal select optgroup,
.role-staff-select option,
.inline-staff-select option,
.inline-slot-select option,
.inline-hall-card select option,
html[data-theme="light"] .scheduler-card select option,
html[data-theme="light"] .scheduler-card select optgroup,
html[data-theme="light"] .inline-hall-modal select option,
html[data-theme="light"] .inline-hall-modal select optgroup,
html[data-theme="light"] .role-staff-select option,
html[data-theme="light"] .inline-staff-select option,
html[data-theme="light"] .inline-slot-select option,
html[data-theme="light"] .inline-hall-card select option {
  color: #F8FAFC !important;
  background: #025763 !important;
}

.scheduler-card select option:checked,
.inline-hall-modal select option:checked,
.role-staff-select option:checked,
.inline-staff-select option:checked,
html[data-theme="light"] .scheduler-card select option:checked,
html[data-theme="light"] .inline-hall-modal select option:checked,
html[data-theme="light"] .role-staff-select option:checked,
html[data-theme="light"] .inline-staff-select option:checked {
  color: #FFFFFF !important;
  background: #1D4ED8 !important;
}

.login-card button.password-toggle.login-password-toggle,
html[data-theme="light"] .login-card button.password-toggle.login-password-toggle,
.login-view button.password-toggle.login-password-toggle,
html[data-theme="light"] .login-view button.password-toggle.login-password-toggle {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  color: #CBD5E1 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  -webkit-appearance: none;
  appearance: none;
}

.login-card button.password-toggle.login-password-toggle:hover,
.login-card button.password-toggle.login-password-toggle:focus-visible,
.login-card button.password-toggle.login-password-toggle.is-visible,
.login-view button.password-toggle.login-password-toggle:hover,
.login-view button.password-toggle.login-password-toggle:focus-visible,
.login-view button.password-toggle.login-password-toggle.is-visible {
  color: #FFFFFF !important;
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: translateY(-50%) scale(1.06);
}

.login-card button.password-toggle.login-password-toggle svg,
.login-view button.password-toggle.login-password-toggle svg {
  width: 22px !important;
  height: 22px !important;
  color: currentColor !important;
  stroke: currentColor !important;
}

html[data-theme="light"] .login-card button.password-toggle.login-password-toggle,
html[data-theme="light"] .login-view button.password-toggle.login-password-toggle {
  color: #0F172A !important;
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="light"] .login-card button.password-toggle.login-password-toggle:hover,
html[data-theme="light"] .login-card button.password-toggle.login-password-toggle:focus-visible,
html[data-theme="light"] .login-card button.password-toggle.login-password-toggle.is-visible,
html[data-theme="light"] .login-view button.password-toggle.login-password-toggle:hover,
html[data-theme="light"] .login-view button.password-toggle.login-password-toggle:focus-visible,
html[data-theme="light"] .login-view button.password-toggle.login-password-toggle.is-visible {
  color: #1D4ED8 !important;
  background: transparent !important;
  background-color: transparent !important;
}

.login-card button.login-link-button,
html[data-theme="light"] .login-card button.login-link-button,
.login-view button.login-link-button,
html[data-theme="light"] .login-view button.login-link-button {
  min-height: 0 !important;
  padding: 0 !important;
  color: #60A5FA !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-decoration: underline !important;
  transform: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.login-card button.login-link-button:hover,
.login-view button.login-link-button:hover {
  color: #93C5FD !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

html[data-theme="light"] .login-card button.login-link-button,
html[data-theme="light"] .login-view button.login-link-button {
  color: #1D4ED8 !important;
  background: transparent !important;
  background-color: transparent !important;
}

html[data-theme="light"] .login-card button.login-link-button:hover,
html[data-theme="light"] .login-view button.login-link-button:hover {
  color: #1E40AF !important;
  background: transparent !important;
  background-color: transparent !important;
}

/* Light mode: preserve dark edit-form surfaces and staff allocation status colors. */
html[data-theme="light"] .scheduler-card,
html[data-theme="light"] .scheduler-card form,
html[data-theme="light"] .scheduler-form-body,
html[data-theme="light"] .hall-card,
html[data-theme="light"] .inline-hall-card,
html[data-theme="light"] .existing-box,
html[data-theme="light"] .existing-list,
html[data-theme="light"] .self-addition-checkbox,
html[data-theme="light"] .extra-module-row,
html[data-theme="light"] .mds-target-box {
  color: #F8FAFC !important;
}

html[data-theme="light"] .scheduler-card label,
html[data-theme="light"] .scheduler-card label *,
html[data-theme="light"] .scheduler-card .form-line,
html[data-theme="light"] .scheduler-card .form-line *,
html[data-theme="light"] .scheduler-card .capacity-note,
html[data-theme="light"] .scheduler-card .existing-box,
html[data-theme="light"] .scheduler-card .existing-box *,
html[data-theme="light"] .scheduler-card .existing-list,
html[data-theme="light"] .scheduler-card .existing-list *,
html[data-theme="light"] .scheduler-card .existing-item,
html[data-theme="light"] .scheduler-card .existing-item *,
html[data-theme="light"] .scheduler-card .extra-modules-title,
html[data-theme="light"] .scheduler-card .extra-modules-title *,
html[data-theme="light"] .scheduler-card .extra-module-row,
html[data-theme="light"] .scheduler-card .extra-module-row *,
html[data-theme="light"] .scheduler-card .mds-target-box,
html[data-theme="light"] .scheduler-card .mds-target-box *,
html[data-theme="light"] .scheduler-card .self-addition-checkbox,
html[data-theme="light"] .scheduler-card .self-addition-checkbox *,
html[data-theme="light"] .scheduler-card .hall-title,
html[data-theme="light"] .scheduler-card .hall-title *,
html[data-theme="light"] .scheduler-card .hall-card,
html[data-theme="light"] .scheduler-card .hall-card *,
html[data-theme="light"] .inline-hall-modal,
html[data-theme="light"] .inline-hall-modal *,
html[data-theme="light"] .slot-card.inline-edit-card,
html[data-theme="light"] .slot-card.inline-edit-card * {
  color: #F8FAFC !important;
}

html[data-theme="light"] .slot-card .slot-hall-code.bg-status-pending,
html[data-theme="light"] .slot-card button.slot-hall-code.bg-status-pending,
html[data-theme="light"] .slot-card .inline-hall-button.bg-status-pending {
  color: #FFFFFF !important;
  background: #641111 !important;
  background-color: #641111 !important;
  border-color: rgba(248, 113, 113, 0.5) !important;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.34) !important;
}

html[data-theme="light"] .slot-card .slot-hall-code.bg-status-filled,
html[data-theme="light"] .slot-card button.slot-hall-code.bg-status-filled,
html[data-theme="light"] .slot-card .inline-hall-button.bg-status-filled {
  color: #FFFFFF !important;
  background: #1B4332 !important;
  background-color: #1B4332 !important;
  border-color: rgba(74, 222, 128, 0.5) !important;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.32) !important;
}

html[data-theme="light"] .slot-card .slot-hall-code.bg-status-pending:hover,
html[data-theme="light"] .slot-card button.slot-hall-code.bg-status-pending:hover,
html[data-theme="light"] .slot-card .slot-hall-code.bg-status-pending:focus-visible,
html[data-theme="light"] .slot-card button.slot-hall-code.bg-status-pending:focus-visible {
  background: #7F1D1D !important;
  background-color: #7F1D1D !important;
}

html[data-theme="light"] .slot-card .slot-hall-code.bg-status-filled:hover,
html[data-theme="light"] .slot-card button.slot-hall-code.bg-status-filled:hover,
html[data-theme="light"] .slot-card .slot-hall-code.bg-status-filled:focus-visible,
html[data-theme="light"] .slot-card button.slot-hall-code.bg-status-filled:focus-visible {
  background: #14532D !important;
  background-color: #14532D !important;
}

html[data-theme="light"] .slot-card .slot-hall-code.bg-status-pending .slot-hall-count-badge {
  color: #FFFFFF !important;
  background: rgba(69, 10, 10, 0.96) !important;
}

html[data-theme="light"] .slot-card .slot-hall-code.bg-status-filled .slot-hall-count-badge {
  color: #FFFFFF !important;
  background: rgba(5, 46, 22, 0.96) !important;
}

html[data-theme="light"] .slot-card.inline-edit-card .inline-student-input,
html[data-theme="light"] .slot-card.inline-edit-card input.inline-student-input {
  color: #0F172A !important;
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: none !important;
}

html[data-theme="light"] .slot-card.inline-edit-card .inline-slot-input,
html[data-theme="light"] .slot-card.inline-edit-card .inline-slot-select {
  color: #0F172A !important;
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
}

html[data-theme="light"] .scheduler-card .existing-box {
  background: rgba(15, 23, 42, 0.28) !important;
}

html[data-theme="light"] .scheduler-card .existing-item,
html[data-theme="light"] .scheduler-card .existing-item * {
  color: #F8FAFC !important;
  background: #0F172A !important;
}

html[data-theme="light"] .scheduler-card .existing-item {
  border-left-color: #F97316 !important;
}

html[data-theme="light"] .scheduler-card .needed-badge,
html[data-theme="light"] .inline-hall-modal .needed-badge {
  color: #0F172A !important;
  background: #E2E8F0 !important;
}

html[data-theme="light"] .scheduler-card .needed-badge *,
html[data-theme="light"] .inline-hall-modal .needed-badge * {
  color: inherit !important;
}

html[data-theme="light"] .scheduler-card .needed-badge strong,
html[data-theme="light"] .inline-hall-modal .needed-badge strong {
  color: #FFFFFF !important;
  background: #0F172A !important;
}

/* Light mode: keep selected popup hall/staff values visible on dark form panels. */
html[data-theme="light"] .inline-hall-modal .inline-modal-head h2,
html[data-theme="light"] .inline-hall-modal > h2 {
  color: #0F172A !important;
}

html[data-theme="light"] .inline-hall-modal > p,
html[data-theme="light"] .inline-hall-modal .modal-help,
html[data-theme="light"] .inline-hall-modal .form-help {
  color: #334155 !important;
}

html[data-theme="light"] .inline-hall-modal .inline-hall-card select,
html[data-theme="light"] .inline-hall-modal .inline-hall-card input,
html[data-theme="light"] .inline-hall-modal .hall-select,
html[data-theme="light"] .inline-hall-modal .inline-staff-select,
html[data-theme="light"] .inline-hall-modal .allocated-count {
  color: #F8FAFC !important;
  -webkit-text-fill-color: #F8FAFC !important;
  background: #00616A !important;
  background-color: #00616A !important;
  border-color: rgba(45, 212, 191, 0.55) !important;
  opacity: 1 !important;
}

html[data-theme="light"] .inline-hall-modal .inline-staff-select.missing-staff {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  background: #7F1D1D !important;
  background-color: #7F1D1D !important;
  border-color: #FB7185 !important;
}

html[data-theme="light"] .inline-hall-modal .inline-hall-card select:disabled,
html[data-theme="light"] .inline-hall-modal .inline-hall-card input:disabled {
  color: #CBD5E1 !important;
  -webkit-text-fill-color: #CBD5E1 !important;
  background: #253246 !important;
  background-color: #253246 !important;
  opacity: 1 !important;
}

/* Light mode: carry staff allocation status across the full hall block. */
html[data-theme="light"] .slot-card .slot-hall:has(.slot-hall-code.bg-status-pending),
html[data-theme="light"] .slot-card .slot-hall-head:has(.slot-hall-code.bg-status-pending) {
  background: #641111 !important;
  background-color: #641111 !important;
  border-color: rgba(248, 113, 113, 0.55) !important;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.34) !important;
}

html[data-theme="light"] .slot-card .slot-hall:has(.slot-hall-code.bg-status-filled),
html[data-theme="light"] .slot-card .slot-hall-head:has(.slot-hall-code.bg-status-filled) {
  background: #1B4332 !important;
  background-color: #1B4332 !important;
  border-color: rgba(74, 222, 128, 0.55) !important;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.32) !important;
}

html[data-theme="light"] .slot-card .slot-hall:has(.slot-hall-code.bg-status-pending) .slot-hall-code,
html[data-theme="light"] .slot-card .slot-hall-head:has(.slot-hall-code.bg-status-pending) .slot-hall-code,
html[data-theme="light"] .slot-card .slot-hall-head:has(.slot-hall-code.bg-status-pending) .inline-hall-count {
  color: #FFFFFF !important;
  background: #641111 !important;
  background-color: #641111 !important;
}

html[data-theme="light"] .slot-card .slot-hall:has(.slot-hall-code.bg-status-filled) .slot-hall-code,
html[data-theme="light"] .slot-card .slot-hall-head:has(.slot-hall-code.bg-status-filled) .slot-hall-code,
html[data-theme="light"] .slot-card .slot-hall-head:has(.slot-hall-code.bg-status-filled) .inline-hall-count {
  color: #FFFFFF !important;
  background: #1B4332 !important;
  background-color: #1B4332 !important;
}

html[data-theme="light"] .slot-card .slot-hall:has(.slot-hall-code.bg-status-pending) .slot-hall-count-badge,
html[data-theme="light"] .slot-card .slot-hall-head:has(.slot-hall-code.bg-status-pending) .inline-hall-count {
  color: #FFFFFF !important;
  background: rgba(69, 10, 10, 0.96) !important;
}

html[data-theme="light"] .slot-card .slot-hall:has(.slot-hall-code.bg-status-filled) .slot-hall-count-badge,
html[data-theme="light"] .slot-card .slot-hall-head:has(.slot-hall-code.bg-status-filled) .inline-hall-count {
  color: #FFFFFF !important;
  background: rgba(5, 46, 22, 0.96) !important;
}

@media (max-width: 720px) {
  .theme-toggle {
    min-width: 92px;
    height: 40px;
    padding: 0 10px 0 13px;
  }
}

/* Final alignment polish for active timetable pills and header account controls. */
.topbar .timetable-head .user-box {
  right: 28px;
  margin-right: 0 !important;
}

.date-change-display {
  align-items: center;
  line-height: 1;
}

.date-change-display .date-change-label,
.date-change-display .date-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  line-height: 1;
}

.slot-hall-code {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 7px !important;
  min-height: 30px;
  padding: 4px 5px 4px 8px !important;
  border-radius: 6px !important;
  line-height: 1 !important;
}

.slot-hall-code-text {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 20px;
  overflow: hidden;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-hall-count-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 22px;
  margin-left: auto !important;
  padding: 0 7px !important;
  border-radius: 6px !important;
  line-height: 1 !important;
  text-align: center;
}

/* Staff availability cues inside assignment dropdowns. */
.role-staff-select option.staff-availability-same-day,
.inline-staff-select option.staff-availability-same-day,
.scheduler-card select option.staff-availability-same-day,
.inline-hall-modal select option.staff-availability-same-day,
html[data-theme="light"] .role-staff-select option.staff-availability-same-day,
html[data-theme="light"] .inline-staff-select option.staff-availability-same-day,
html[data-theme="light"] .scheduler-card select option.staff-availability-same-day,
html[data-theme="light"] .inline-hall-modal select option.staff-availability-same-day {
  color: #FFFFFF !important;
  background: #7F1D1D !important;
  background-color: #7F1D1D !important;
}

.role-staff-select option.staff-availability-adjacent-day,
.inline-staff-select option.staff-availability-adjacent-day,
.scheduler-card select option.staff-availability-adjacent-day,
.inline-hall-modal select option.staff-availability-adjacent-day,
html[data-theme="light"] .role-staff-select option.staff-availability-adjacent-day,
html[data-theme="light"] .inline-staff-select option.staff-availability-adjacent-day,
html[data-theme="light"] .scheduler-card select option.staff-availability-adjacent-day,
html[data-theme="light"] .inline-hall-modal select option.staff-availability-adjacent-day {
  color: #111827 !important;
  background: #FACC15 !important;
  background-color: #FACC15 !important;
}

.role-staff-select option.staff-availability-available,
.inline-staff-select option.staff-availability-available,
.scheduler-card select option.staff-availability-available,
.inline-hall-modal select option.staff-availability-available,
html[data-theme="light"] .role-staff-select option.staff-availability-available,
html[data-theme="light"] .inline-staff-select option.staff-availability-available,
html[data-theme="light"] .scheduler-card select option.staff-availability-available,
html[data-theme="light"] .inline-hall-modal select option.staff-availability-available {
  color: #FFFFFF !important;
  background: #166534 !important;
  background-color: #166534 !important;
}

.role-staff-select option.staff-availability-same-day:checked,
.inline-staff-select option.staff-availability-same-day:checked,
html[data-theme="light"] .role-staff-select option.staff-availability-same-day:checked,
html[data-theme="light"] .inline-staff-select option.staff-availability-same-day:checked {
  color: #FFFFFF !important;
  background: #991B1B !important;
  background-color: #991B1B !important;
}

.role-staff-select option.staff-availability-adjacent-day:checked,
.inline-staff-select option.staff-availability-adjacent-day:checked,
html[data-theme="light"] .role-staff-select option.staff-availability-adjacent-day:checked,
html[data-theme="light"] .inline-staff-select option.staff-availability-adjacent-day:checked {
  color: #111827 !important;
  background: #FDE047 !important;
  background-color: #FDE047 !important;
}

.role-staff-select option.staff-availability-available:checked,
.inline-staff-select option.staff-availability-available:checked,
html[data-theme="light"] .role-staff-select option.staff-availability-available:checked,
html[data-theme="light"] .inline-staff-select option.staff-availability-available:checked {
  color: #FFFFFF !important;
  background: #15803D !important;
  background-color: #15803D !important;
}

/* Logged-in staff hall focus. Admin/student views do not receive this class. */
.slot-card .slot-hall:has(.slot-hall-code.my-assigned-hall),
.slot-card .slot-hall-head:has(.slot-hall-code.my-assigned-hall),
html[data-theme="light"] .slot-card .slot-hall:has(.slot-hall-code.my-assigned-hall),
html[data-theme="light"] .slot-card .slot-hall-head:has(.slot-hall-code.my-assigned-hall) {
  background: rgba(0, 129, 204, 0.24) !important;
  border-color: rgba(125, 211, 252, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.36) !important;
}

.slot-card .slot-hall-code.my-assigned-hall,
.slot-card button.slot-hall-code.my-assigned-hall,
html[data-theme="light"] .slot-card .slot-hall-code.my-assigned-hall,
html[data-theme="light"] .slot-card button.slot-hall-code.my-assigned-hall {
  color: #FFFFFF !important;
  background: #0081CC !important;
  background-color: #0081CC !important;
  border-color: rgba(186, 230, 253, 0.85) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    0 0 0 2px rgba(14, 165, 233, 0.26) !important;
}

.slot-card .slot-hall-code.my-assigned-hall .slot-hall-code-text,
.slot-card .slot-hall-code.my-assigned-hall .slot-hall-count-badge,
html[data-theme="light"] .slot-card .slot-hall-code.my-assigned-hall .slot-hall-code-text,
html[data-theme="light"] .slot-card .slot-hall-code.my-assigned-hall .slot-hall-count-badge {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}

.slot-card .slot-hall-code.my-assigned-hall .slot-hall-count-badge,
html[data-theme="light"] .slot-card .slot-hall-code.my-assigned-hall .slot-hall-count-badge {
  background: #005F99 !important;
  background-color: #005F99 !important;
}

/* Exam slot notes must expand the card instead of clipping or showing inner scrollbars. */
.slot-card .slot-note,
.student-shell .slot-card .slot-note,
.student-shell .student-slot-card .slot-note,
.attendance-shell .slot-card .slot-note,
html[data-theme="light"] .slot-card .slot-note,
html[data-theme="light"] .student-shell .slot-card .slot-note,
html[data-theme="light"] .student-shell .student-slot-card .slot-note,
html[data-theme="light"] .attendance-shell .slot-card .slot-note {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  text-overflow: clip !important;
  scrollbar-width: none !important;
}

.slot-card .slot-note::-webkit-scrollbar,
.student-shell .slot-card .slot-note::-webkit-scrollbar,
.student-shell .student-slot-card .slot-note::-webkit-scrollbar,
.attendance-shell .slot-card .slot-note::-webkit-scrollbar {
  display: none !important;
}

/* Student timetable hall badges: keep two halls per row for readability. */
.student-shell .student-slot-card .slot-halls {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.student-shell .student-slot-card .slot-halls:has(.slot-hall:only-child) {
  grid-template-columns: minmax(0, 1fr) !important;
}

.student-shell .student-slot-card .slot-hall {
  width: 100% !important;
  min-width: 0 !important;
  flex: 0 1 auto !important;
}

.student-shell .student-slot-card .slot-hall-head {
  width: 100% !important;
  min-width: 0 !important;
  display: block !important;
}

.student-shell .student-slot-card .student-hall-code {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(24px, auto) !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 2px 4px !important;
}

.student-shell .student-slot-card .student-hall-code .slot-hall-code-text {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.student-shell .student-slot-card .student-hall-code .slot-hall-count-badge {
  justify-self: end !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 24px !important;
  min-height: 18px !important;
  padding: 1px 5px !important;
  color: #FFFFFF !important;
  background: #0B1220 !important;
  border-radius: 6px !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-align: center !important;
}

/* Mobile and tablet layout: keep the timetable usable without compressing the board. */
@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }

  .app-shell {
    min-width: 0 !important;
  }

  .topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    min-height: 0 !important;
    padding: 12px 14px 16px !important;
  }

  .brand-panel {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 !important;
  }

  .brand-logos {
    gap: 6px !important;
  }

  .brand-logo {
    width: 34px !important;
    height: 34px !important;
    object-fit: contain !important;
  }

  .brand-copy strong {
    display: block !important;
    font-size: 13px !important;
    line-height: 1.18 !important;
    white-space: normal !important;
  }

  .theme-toggle {
    justify-self: end !important;
    min-height: 34px !important;
    padding: 6px 10px !important;
  }

  .theme-toggle-text {
    font-size: 11px !important;
  }

  .timetable-head {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 0 !important;
  }

  .topbar-title-row {
    display: block !important;
  }

  .timetable-head h1,
  .student-shell .timetable-head h1,
  .attendance-shell .timetable-head h1 {
    max-width: 100% !important;
    font-size: clamp(30px, 10vw, 48px) !important;
    line-height: 0.98 !important;
    letter-spacing: 0 !important;
    overflow-wrap: anywhere !important;
  }

  .topbar .user-box,
  .timetable-head .user-box,
  .topbar .timetable-head .user-box {
    position: static !important;
    right: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-content: space-between !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border-radius: 18px !important;
  }

  .table-actions,
  .student-shell .table-actions,
  .attendance-shell .table-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .search-controls,
  .filter-controls,
  .download-controls,
  .student-shell .search-controls,
  .student-shell .filter-controls,
  .student-shell .download-controls,
  .attendance-shell .search-controls,
  .attendance-shell .filter-controls,
  .attendance-shell .download-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .search-controls input,
  #timetable-search,
  #student-search,
  #attendance-search {
    flex: 1 1 180px !important;
    min-width: 0 !important;
    width: auto !important;
  }

  .semester-filter {
    flex: 1 1 100% !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 8px !important;
    max-width: none !important;
  }

  .semester-filter select {
    width: 100% !important;
    min-width: 0 !important;
  }

  .department-filter {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .dept-toggle {
    gap: 6px !important;
  }

  .dept-pill {
    min-width: 54px !important;
    padding: 8px 12px !important;
    border-radius: 14px !important;
    font-size: 20px !important;
    line-height: 1 !important;
  }

  .dept-check {
    width: 34px !important;
    height: 34px !important;
    border-width: 4px !important;
  }

  .dept-check::before {
    width: 14px !important;
    height: 8px !important;
    border-left-width: 5px !important;
    border-bottom-width: 5px !important;
  }

  .pill-action {
    flex: 1 1 150px !important;
    min-height: 42px !important;
    justify-content: center !important;
    padding: 8px 10px !important;
  }

  .work-area,
  .student-shell .work-area,
  .attendance-shell .work-area {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    padding: 14px 10px !important;
  }

  .work-area.scheduler-collapsed {
    grid-template-columns: 48px minmax(0, 1fr) !important;
  }

  .scheduler-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    max-height: calc(100svh - 120px) !important;
  }

  .scheduler-card.is-collapsed {
    width: 48px !important;
    min-width: 48px !important;
  }

  .scheduler-card-heading h2 {
    font-size: 18px !important;
  }

  .scheduler-form-body,
  .scheduler-scroll,
  .form-scroll {
    max-height: calc(100svh - 250px) !important;
    overflow-y: auto !important;
  }

  .form-line.two,
  .form-line.module-line,
  .form-line.compact,
  .hall-card-header,
  .staff-row,
  .hall-staff-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .schedule-wrap,
  .student-shell .schedule-wrap,
  .attendance-shell .schedule-wrap {
    width: 100% !important;
    min-width: 0 !important;
    border-width: 8px !important;
    overflow: hidden !important;
  }

  .board-scroll {
    min-height: 62vh !important;
    max-height: 72vh !important;
    overflow: auto !important;
  }

  .exam-lanes {
    min-width: max-content !important;
  }

  .date-group {
    min-width: min(92vw, 760px) !important;
  }

  .dept-grid,
  .day-grid {
    min-width: 680px !important;
  }

  .slot-card {
    font-size: 11px !important;
  }

  .slot-title,
  .slot-module-title {
    font-size: 12px !important;
  }

  .slot-halls {
    gap: 5px !important;
  }

  .timetable-zoom-overlay {
    top: 10px !important;
    right: 10px !important;
    bottom: auto !important;
    padding: 6px !important;
  }

  .timetable-zoom-overlay .tool-circle {
    width: 40px !important;
    height: 40px !important;
    font-size: 22px !important;
  }

  .bottom-panels,
  .bottom-panels.three-col {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 12px 10px !important;
  }

  .panel-fields,
  .module-panel .panel-fields,
  .hall-panel .panel-fields {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .list-wrap,
  .table-container,
  .data-table-wrap,
  .data-panel {
    overflow-x: auto !important;
  }

  .data-table,
  table.data-table {
    min-width: 780px !important;
  }

  .system-modal,
  .inline-hall-modal,
  .modal-card {
    width: min(96vw, 720px) !important;
    max-height: 88svh !important;
    overflow-y: auto !important;
    padding: 16px !important;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 10px 10px 14px !important;
  }

  .brand-panel {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .brand-logo {
    width: 30px !important;
    height: 30px !important;
  }

  .brand-copy strong {
    font-size: 12px !important;
  }

  .theme-toggle {
    grid-column: 1 / -1 !important;
    justify-self: start !important;
  }

  .timetable-head h1,
  .student-shell .timetable-head h1,
  .attendance-shell .timetable-head h1 {
    font-size: clamp(30px, 13vw, 48px) !important;
  }

  .topbar .user-box,
  .timetable-head .user-box,
  .topbar .timetable-head .user-box {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    gap: 8px !important;
  }

  .search-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .download-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .semester-filter {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .dept-pill {
    min-width: 50px !important;
    font-size: 18px !important;
  }

  .dept-check {
    width: 30px !important;
    height: 30px !important;
  }

  .work-area.scheduler-collapsed {
    grid-template-columns: 42px minmax(0, 1fr) !important;
  }

  .scheduler-card.is-collapsed {
    width: 42px !important;
    min-width: 42px !important;
  }

  .scheduler-card.is-collapsed .scheduler-card-heading h2 {
    font-size: 14px !important;
  }

  .schedule-wrap {
    border-width: 6px !important;
  }

  .board-scroll {
    min-height: 58vh !important;
    max-height: 68vh !important;
  }

  .date-group {
    min-width: 92vw !important;
  }

  .dept-grid,
  .day-grid {
    min-width: 620px !important;
  }

  .student-shell .student-slot-card .slot-halls {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
