html {
  font-size: 16px;
}

.admin-export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.download-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.export-dashboard-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr) auto;
  gap: 18px;
  align-items: center;
}

.export-dashboard-card p {
  min-height: 0;
}

.export-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.export-dashboard-metrics div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e0e9ef;
  border-radius: 8px;
  background: #f8f1e7;
}

.export-dashboard-metrics > div > span,
.export-page-stat > span {
  display: block;
  color: #64748b;
  font-size: .82rem;
  font-weight: 700;
}

.export-dashboard-metrics > div > strong,
.export-page-stat > strong {
  display: block;
  color: var(--bronze-dark);
  font-size: 1.2rem;
  line-height: 1.2;
}

.export-dashboard-metrics small {
  display: block;
  color: #64748b;
  overflow-wrap: anywhere;
}

.export-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: start;
}

.export-page-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.export-page-stat {
  padding: 16px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 55, 90, 0.06);
}

.export-check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.export-check-list li {
  padding: 12px 14px;
  border: 1px solid var(--gold);
  border-left: 4px solid var(--bronze);
  border-radius: 8px;
  background: #fff7f7;
}

.export-check-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--bronze-dark);
}

.export-scope-options {
  display: grid;
  gap: 10px;
}

.export-form-actions {
  display: grid;
  gap: 10px;
}

@media (max-width: 992px) {
  .export-dashboard-card,
  .export-page-grid {
    grid-template-columns: 1fr;
  }

  .export-dashboard-actions .btn {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .admin-export-button {
    width: 100%;
  }

  .export-dashboard-metrics {
    grid-template-columns: 1fr;
  }
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(125, 211, 252, .22), transparent 34rem),
    linear-gradient(180deg, #f8f1e7 0%, #f5ebdd 52%, #f8f1e7 100%);
  color: #1f2937;
}

a {
  color: var(--bronze);
}

.app-main:has(.admin-overview),
.app-main:has(.admin-teachers-page) {
  box-sizing: border-box;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.admin-overview,
.admin-teachers-page {
  display: grid;
  gap: 18px;
  color: #172033;
  min-width: 0;
}

.admin-overview > *,
.admin-teachers-page > * {
  min-width: 0;
}

.admin-hero,
.admin-section-card {
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(15, 40, 70, .08);
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
}

.admin-hero.compact {
  padding-block: 20px;
}

.admin-eyebrow {
  margin: 0 0 6px;
  color: var(--bronze);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.admin-hero h1 {
  margin: 0;
  color: #211713;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0;
}

.admin-hero p,
.admin-section-heading p,
.quick-action-card p,
.attention-card p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: .96rem;
}

.admin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-hero-actions .btn,
.quick-action-card .btn {
  border-radius: 12px;
  font-weight: 800;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat-card {
  display: grid;
  min-height: 104px;
  padding: 15px;
  border: 1px solid #e3edf4;
  border-radius: 16px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(15, 40, 70, .07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 126, 164, .35);
  box-shadow: 0 18px 36px rgba(15, 40, 70, .11);
}

.admin-stat-icon,
.quick-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f1e5d4;
  color: var(--bronze);
}

.admin-stat-icon svg,
.quick-action-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-stat-value {
  margin-top: 10px;
  color: #211713;
  font-size: 1.75rem;
  font-weight: 850;
  line-height: 1;
}

.admin-stat-title {
  margin-top: 4px;
  color: #64748b;
  font-size: .95rem;
  font-weight: 750;
}

.admin-section-card {
  padding: 18px;
}

.admin-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-section-heading h2 {
  margin: 0;
  color: #211713;
  font-size: 1.35rem;
  font-weight: 800;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.admin-status-pill.is-ok {
  background: var(--cream);
  color: #166534;
}

.admin-status-pill.is-warning {
  background: #fef3c7;
  color: #92400e;
}

.admin-status-pill.is-muted {
  background: #e5e7eb;
  color: #4b5563;
}

body.schedule-build-running {
  overflow: hidden;
}

.schedule-build-overlay {
  position: fixed;
  inset: 0;
  z-index: 2050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .68);
  backdrop-filter: blur(8px);
}

.schedule-build-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .75fr);
  gap: 16px;
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.schedule-build-main,
.schedule-build-game {
  min-width: 0;
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(2, 8, 23, .24);
}

.schedule-build-main {
  display: grid;
  grid-template-columns: minmax(250px, .8fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 24px;
}

.schedule-robot-scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid #dbeaf2;
  border-radius: 14px;
  background: #f8f1e7;
}

.schedule-robot-scene::before {
  position: absolute;
  inset: auto 24px 34px;
  height: 2px;
  background: repeating-linear-gradient(90deg, #cbd5e1 0 22px, transparent 22px 34px);
  content: "";
}

.schedule-robot {
  position: relative;
  width: 154px;
  height: 220px;
  animation: scheduleRobotBob 2.8s ease-in-out infinite;
}

.schedule-robot-antenna {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 28px;
  border-radius: 999px;
  background: var(--bronze-dark);
  transform: translateX(-50%);
}

.schedule-robot-antenna::before {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, .14);
  content: "";
  transform: translateX(-50%);
  animation: scheduleRobotPulse 1.4s ease-in-out infinite;
}

.schedule-robot-head {
  position: absolute;
  top: 25px;
  left: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 110px;
  height: 84px;
  border: 4px solid #3b2a20;
  border-radius: 18px;
  background: var(--gold);
  box-shadow: inset 0 -10px 0 rgba(23, 71, 99, .15);
}

.schedule-robot-eye {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #211713;
  box-shadow: 0 0 0 7px rgba(255, 255, 255, .68);
  animation: scheduleRobotBlink 4.5s ease-in-out infinite;
}

.schedule-robot-neck {
  position: absolute;
  top: 108px;
  left: 63px;
  width: 28px;
  height: 18px;
  border-radius: 5px;
  background: #3b2a20;
}

.schedule-robot-body {
  position: absolute;
  top: 124px;
  left: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 136px;
  height: 78px;
  border: 4px solid #3b2a20;
  border-radius: 20px;
  background: #f8fafc;
  box-shadow: inset 0 -12px 0 rgba(148, 163, 184, .18);
}

.schedule-robot-body::before,
.schedule-robot-body::after {
  position: absolute;
  top: 18px;
  width: 26px;
  height: 8px;
  border-radius: 999px;
  background: #3b2a20;
  content: "";
}

.schedule-robot-body::before {
  left: -26px;
  transform: rotate(18deg);
}

.schedule-robot-body::after {
  right: -26px;
  transform: rotate(-18deg);
}

.schedule-robot-body span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f59e0b;
}

.schedule-robot-body span:nth-child(2) {
  background: #22c55e;
  animation: scheduleRobotPulse 1.1s ease-in-out infinite;
}

.schedule-robot-body span:nth-child(3) {
  background: var(--bronze);
}

.schedule-robot-shadow {
  position: absolute;
  right: 21px;
  bottom: 2px;
  left: 21px;
  height: 14px;
  border-radius: 50%;
  background: rgba(15, 23, 42, .16);
  animation: scheduleRobotShadow 2.8s ease-in-out infinite;
}

.schedule-paper {
  position: absolute;
  width: 64px;
  height: 84px;
  border: 1px solid #b6cfdd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 40, 70, .12);
}

.schedule-paper::before {
  position: absolute;
  inset: 16px 12px auto;
  height: 32px;
  background: repeating-linear-gradient(180deg, #9ec4d7 0 3px, transparent 3px 10px);
  content: "";
}

.schedule-paper.paper-a {
  top: 42px;
  left: 28px;
  transform: rotate(-12deg);
  animation: schedulePaperFloatA 4.4s ease-in-out infinite;
}

.schedule-paper.paper-b {
  right: 28px;
  bottom: 60px;
  transform: rotate(10deg);
  animation: schedulePaperFloatB 4.9s ease-in-out infinite;
}

.schedule-paper.paper-c {
  right: 54px;
  top: 28px;
  width: 54px;
  height: 70px;
  transform: rotate(18deg);
  animation: schedulePaperFloatA 5.3s ease-in-out infinite;
}

.schedule-build-copy {
  min-width: 0;
}

.schedule-build-copy h2 {
  margin: 0;
  color: #211713;
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: 0;
}

.schedule-build-copy p {
  margin: 8px 0 0;
  color: #475569;
  font-size: 1rem;
}

.schedule-build-meter {
  position: relative;
  height: 12px;
  margin: 20px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.schedule-build-meter span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 44%;
  border-radius: inherit;
  background: var(--bronze);
  animation: scheduleBuildMeter 2.15s ease-in-out infinite;
}

.schedule-build-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.schedule-build-stats span,
.schedule-game-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f5ebdd;
  color: #31546a;
  font-size: .86rem;
  font-weight: 800;
}

.schedule-build-stats strong,
.schedule-game-score strong {
  color: #211713;
}

.schedule-build-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.schedule-build-steps li {
  position: relative;
  min-height: 38px;
  padding: 9px 12px 9px 38px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #475569;
  font-size: .92rem;
  font-weight: 750;
  background: #f8f1e7;
}

.schedule-build-steps li::before {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 14px;
  height: 14px;
  border: 2px solid #9fb8ca;
  border-radius: 50%;
  content: "";
  transform: translateY(-50%);
}

.schedule-build-steps li.is-active {
  border-color: #8fc3d9;
  color: #0a4f75;
  background: #ecf8fb;
}

.schedule-build-steps li.is-active::before {
  border-color: #0a7aa6;
  background: #0a7aa6;
  box-shadow: 0 0 0 5px rgba(10, 122, 166, .14);
}

.schedule-build-steps li.is-done {
  border-color: #c7ead4;
  color: #166534;
  background: #f0fdf4;
}

.schedule-build-steps li.is-done::before {
  border-color: #22c55e;
  background: #22c55e;
  color: #fff;
  content: "✓";
  font-size: 10px;
  font-weight: 900;
  line-height: 10px;
  text-align: center;
}

.schedule-build-result {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  background: #fff7f7;
  color: var(--bronze-dark);
  font-weight: 750;
}

#schedule-build-close {
  margin-top: 12px;
  border-radius: 10px;
  font-weight: 800;
}

.schedule-build-game {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.schedule-game-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.schedule-game-head h3 {
  margin: 0;
  color: #211713;
  font-size: 1.16rem;
  font-weight: 850;
  letter-spacing: 0;
}

.schedule-game-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: .88rem;
  font-weight: 700;
}

.schedule-game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.schedule-game-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid #d7e5ed;
  border-radius: 8px;
  background: #f8f1e7;
  color: #334155;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease, color .12s ease;
}

.schedule-game-cell span {
  color: #94a3b8;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}

.schedule-game-cell strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.schedule-game-cell.is-movable {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.schedule-game-cell.is-movable:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(146, 64, 14, .16);
}

.schedule-game-cell.is-empty {
  border-style: dashed;
  background: #eef2f7;
  color: #64748b;
  cursor: default;
}

.schedule-game-cell.is-miss {
  border-color: var(--gold-light);
  background: #fff1f2;
  color: var(--bronze-dark);
  animation: schedulePuzzleMiss .22s ease-in-out;
}

.schedule-game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: .84rem;
  font-weight: 800;
}

.schedule-game-footer .btn {
  border-radius: 9px;
  font-weight: 800;
}

.schedule-build-overlay.is-error .schedule-build-meter span {
  width: 100%;
  background: var(--bronze);
  animation: none;
}

@keyframes scheduleRobotBob {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes scheduleRobotShadow {
  0%, 100% {
    transform: scaleX(1);
    opacity: .15;
  }

  50% {
    transform: scaleX(.82);
    opacity: .1;
  }
}

@keyframes scheduleRobotPulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: .45;
  }
}

@keyframes scheduleRobotBlink {
  0%, 46%, 54%, 100% {
    transform: scaleY(1);
  }

  50% {
    transform: scaleY(.18);
  }
}

@keyframes schedulePaperFloatA {
  0%, 100% {
    transform: translateY(0) rotate(-12deg);
  }

  50% {
    transform: translateY(-13px) rotate(-7deg);
  }
}

@keyframes schedulePaperFloatB {
  0%, 100% {
    transform: translateY(0) rotate(10deg);
  }

  50% {
    transform: translateY(12px) rotate(4deg);
  }
}

@keyframes scheduleBuildMeter {
  0% {
    left: -48%;
  }

  50% {
    left: 34%;
  }

  100% {
    left: 104%;
  }
}

@keyframes schedulePuzzleMiss {
  0%, 100% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(-3px);
  }

  70% {
    transform: translateX(3px);
  }
}

@media (max-width: 992px) {
  .schedule-build-shell,
  .schedule-build-main {
    grid-template-columns: 1fr;
  }

  .schedule-robot-scene {
    min-height: 260px;
  }
}

@media (max-width: 768px) {
  .schedule-build-overlay {
    align-items: flex-start;
    padding: 12px;
  }

  .schedule-build-shell {
    gap: 12px;
    max-height: calc(100vh - 24px);
  }

  .schedule-build-main,
  .schedule-build-game {
    padding: 16px;
    border-radius: 14px;
  }

  .schedule-build-copy h2 {
    font-size: 1.55rem;
  }

  .schedule-robot-scene {
    min-height: 220px;
  }

  .schedule-robot {
    scale: .86;
  }

  .schedule-game-head,
  .schedule-game-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-game-grid {
    gap: 7px;
  }

  .schedule-game-cell span {
    font-size: .64rem;
  }

  .schedule-game-cell strong {
    font-size: 1.1rem;
  }
}

.admin-ok-message {
  padding: 18px;
  border-radius: 14px;
  background: #ecfdf5;
  color: #166534;
  font-weight: 800;
}

.attention-grid,
.quick-action-grid {
  display: grid;
  gap: 12px;
}

.attention-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-action-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.attention-card,
.quick-action-card {
  min-width: 0;
  border: 1px solid #e3edf4;
  border-radius: 16px;
  background: #f8f1e7;
}

.attention-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
}

.attention-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.attention-card h3,
.quick-action-card h3 {
  margin: 0;
  color: #211713;
  font-size: 1rem;
  font-weight: 800;
}

.attention-card-head strong {
  flex: 0 0 auto;
  color: var(--bronze);
  font-size: 1.5rem;
  line-height: 1;
}

.attention-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.attention-list li {
  min-width: 0;
}

.attention-list a {
  display: block;
  color: #211713;
  font-weight: 800;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-list a:hover,
.admin-secondary-link:hover,
.attention-all-link:hover {
  color: var(--bronze);
}

.attention-list span {
  display: -webkit-box;
  margin-top: 2px;
  color: #64748b;
  font-size: .86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.attention-all-link,
.admin-secondary-link {
  margin-top: auto;
  color: var(--bronze);
  font-weight: 800;
  text-decoration: none;
}

.quick-action-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 6px 10px;
  min-height: 0;
  padding: 12px;
  transition: transform .18s ease, border-color .18s ease;
}

.quick-action-card .quick-action-icon {
  grid-row: 1 / 3;
}

.quick-action-card h3,
.quick-action-card p {
  min-width: 0;
}

.quick-action-card p {
  display: -webkit-box;
  margin-top: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.quick-action-card .btn {
  grid-column: 1 / -1;
  min-height: 36px;
  padding: 7px 10px;
  font-size: .88rem;
  line-height: 1.15;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 126, 164, .35);
}

.admin-compact-table-wrap,
.teacher-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.admin-compact-table,
.teacher-table {
  min-width: 760px;
  margin-bottom: 0;
}

.teacher-table {
  min-width: 1180px;
  table-layout: fixed;
}

.teacher-table th:nth-child(1),
.teacher-table td:nth-child(1) {
  width: 24%;
}

.teacher-table th:nth-child(2),
.teacher-table td:nth-child(2) {
  width: 22%;
}

.teacher-table th:nth-child(3),
.teacher-table td:nth-child(3) {
  width: 14%;
}

.teacher-table th:nth-child(4),
.teacher-table td:nth-child(4) {
  width: 18%;
}

.teacher-table th:nth-child(5),
.teacher-table td:nth-child(5) {
  width: 22%;
}

.admin-compact-table th,
.teacher-table th {
  color: #475569;
  font-size: .86rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-compact-table td,
.teacher-table td {
  vertical-align: middle;
}

.admin-compact-table td {
  max-width: 360px;
  color: #334155;
  font-size: .88rem;
  overflow-wrap: anywhere;
}

.admin-compact-table th,
.admin-compact-table td {
  padding: .5rem .55rem;
}

.kug-practices-section {
  display: grid;
  gap: 12px;
}

.schedule-build-overlay.is-stopped .schedule-robot,
.schedule-build-overlay.is-stopped .schedule-robot *,
.schedule-build-overlay.is-stopped .schedule-paper,
.schedule-build-overlay.is-stopped .schedule-build-meter span {
  animation-play-state: paused !important;
}

.schedule-build-steps li.is-active {
  border-color: var(--gold);
  color: #6b421f;
  background: #fff8e7;
  box-shadow: 0 0 0 3px rgba(212, 168, 67, .2);
}

.schedule-build-steps li.is-active::before {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(212, 168, 67, .18);
  animation: scheduleRobotPulse 1.1s ease-in-out infinite;
}

.schedule-build-summary { margin-top: 8px; white-space: pre-line; }
.schedule-build-details { margin-top: 10px; color: #f8f1e7; }
.schedule-build-details pre { max-height: 140px; margin-top: 8px; overflow: auto; white-space: pre-wrap; color: inherit; }

.kug-dashboard-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.kug-dashboard-card .admin-section-heading { flex: 1; margin: 0; }
.kug-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: #6b5a4d; font-size: .9rem; font-weight: 750; }
.kug-breadcrumb a { color: var(--bronze); }
.kug-page-actions { max-width: 520px; align-items: flex-end; }
.kug-page-actions form { margin: 0; }
.kug-page-actions small { color: #6b5a4d; line-height: 1.4; }
.kug-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kug-counter { cursor: default; }
.kug-counter.is-saturday { border-color: #9d7837; background: #fffaf0; }
.kug-page-filter { display: grid; grid-template-columns: 1.25fr 1fr 1fr .85fr auto auto; align-items: end; gap: 12px; }
.kug-page-filter .form-label { color: #5d4a3c; font-size: .82rem; font-weight: 800; }
.kug-practices-page .kug-day-grid { flex-wrap: nowrap; }

@media (max-width: 1100px) {
  .kug-page-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kug-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .kug-dashboard-card { align-items: stretch; flex-direction: column; }
  .kug-page-filter, .kug-stat-grid { grid-template-columns: 1fr; }
  .kug-page-filter .btn { width: 100%; }
}

.kug-practices-heading {
  margin-bottom: 0;
}

.kug-practice-filter {
  display: grid;
  grid-template-columns: auto minmax(190px, 280px) auto auto;
  gap: 8px;
  align-items: center;
}

.kug-practice-filter .form-label {
  margin: 0;
  color: #475569;
  font-size: .88rem;
  font-weight: 800;
}

.kug-practice-filter .form-select {
  min-height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: .9rem;
}

.kug-practice-filter .btn {
  min-height: 34px;
  border-radius: 10px;
  font-weight: 800;
}

.kug-practice-table {
  min-width: 1060px;
}

.kug-practice-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.kug-practice-auto-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.kug-practice-auto-actions form {
  margin: 0;
}

.kug-practice-table th:nth-child(1),
.kug-practice-table td:nth-child(1) {
  width: 13%;
}

.kug-practice-table th:nth-child(2),
.kug-practice-table td:nth-child(2) {
  width: 26%;
}

.kug-practice-table th:nth-child(3),
.kug-practice-table td:nth-child(3) {
  width: 16%;
}

.kug-practice-table th:nth-child(4),
.kug-practice-table td:nth-child(4) {
  width: 26%;
}

.kug-practice-table th:nth-child(5),
.kug-practice-table td:nth-child(5) {
  width: 10%;
}

.kug-practice-table th:nth-child(6),
.kug-practice-table td:nth-child(6) {
  width: 9%;
}

.kug-practice-name {
  display: -webkit-box;
  color: #211713;
  font-weight: 750;
  line-height: 1.3;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.kug-practice-raw {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.25;
}

.kug-practice-days-form {
  display: grid;
  gap: 6px;
  margin: 0;
}

.kug-day-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.kug-day-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  margin: 0;
  border: 1px solid #c9dce8;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.kug-day-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kug-day-chip:has(input:checked) {
  border-color: var(--bronze);
  background: #e6f3f9;
  color: #0a4f75;
}

.kug-practice-days-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kug-practice-days-actions small {
  color: #64748b;
  font-weight: 750;
  white-space: nowrap;
}

.kug-practice-days-actions .btn {
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 850;
}

.kug-attention-pill {
  margin-top: 4px;
}

.kug-practice-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: #64748b;
  font-size: .9rem;
  font-weight: 800;
}

.teacher-filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(220px, 1fr) minmax(160px, .7fr) minmax(160px, .7fr) auto;
  gap: 14px;
  align-items: end;
}

.teacher-filter-actions {
  display: flex;
  gap: 8px;
}

.teacher-list-card {
  padding-bottom: 18px;
}

.teacher-table tr {
  height: 68px;
}

.teacher-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.teacher-name-cell,
.teacher-account-cell,
.teacher-department-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.teacher-name-cell strong,
.teacher-account-cell strong,
.teacher-department-cell > span {
  color: #211713;
  font-weight: 800;
  line-height: 1.25;
}

.teacher-name-cell span,
.teacher-account-cell span,
.teacher-muted {
  color: #64748b;
  font-size: .9rem;
}

.teacher-department-cell {
  max-width: 290px;
}

.teacher-department-cell > span {
  display: -webkit-box;
  overflow-wrap: anywhere;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.teacher-department-cell details {
  color: var(--bronze);
  font-size: .88rem;
  font-weight: 800;
}

.teacher-department-cell ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #475569;
  font-weight: 500;
}

.teacher-status-stack,
.teacher-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.teacher-row-actions {
  justify-content: flex-end;
}

.teacher-row-actions .btn {
  white-space: nowrap;
}

.teacher-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.teacher-pagination span {
  color: #475569;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .admin-stat-grid,
  .attention-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .teacher-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .admin-overview {
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  }

  .admin-hero,
  .admin-stat-grid,
  .kug-practices-section,
  .attention-section {
    grid-column: 1 / -1;
  }

  .quick-section,
  .imports-section {
    align-self: start;
  }

  .quick-section .quick-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-hero,
  .admin-section-heading {
    display: grid;
  }

  .admin-hero-actions,
  .teacher-row-actions,
  .teacher-pagination {
    justify-content: stretch;
  }

  .admin-hero-actions .btn,
  .teacher-row-actions .btn,
  .teacher-filter-actions .btn {
    width: 100%;
  }

  .kug-practice-filter {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-stat-grid,
  .attention-grid,
  .quick-action-grid,
  .teacher-filter-grid {
    grid-template-columns: 1fr;
  }

  .teacher-filter-actions {
    display: grid;
  }

  .teacher-status-stack,
  .teacher-row-actions {
    flex-wrap: wrap;
  }

  .teacher-table-wrap {
    overflow: visible;
  }

  .teacher-table {
    display: block;
    min-width: 0;
  }

  .teacher-table thead {
    display: none;
  }

  .teacher-table tbody {
    display: grid;
    gap: 10px;
  }

  .teacher-table tr {
    display: grid;
    height: auto;
    padding: 12px;
    border: 1px solid #e3edf4;
    border-radius: 14px;
    background: #fff;
  }

  .teacher-table td {
    display: grid;
    grid-template-columns: minmax(92px, .42fr) minmax(0, 1fr);
    gap: 10px;
    width: auto !important;
    padding: 7px 0;
    border: 0;
  }

  .teacher-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: .82rem;
    font-weight: 800;
  }

  .teacher-table td[data-label="Действия"]::before {
    content: "";
  }

  .teacher-table td[data-label="Действия"] {
    grid-template-columns: 1fr;
  }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1020;
}

.app-navbar {
  min-height: 72px;
  border-bottom: 1px solid rgba(15, 55, 90, .1);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 30px rgba(15, 55, 90, .07);
  backdrop-filter: blur(14px);
}

.app-nav-container {
  gap: 16px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #2b1c14;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0;
}

.app-brand:hover {
  color: var(--bronze-dark);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  box-shadow: 0 10px 22px rgba(8, 126, 164, .18);
}

.feature-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.app-nav-links {
  gap: 6px;
  align-items: center;
}

.app-navbar .nav-link {
  border-radius: 999px;
  color: #334155;
  font-weight: 700;
  padding: 8px 14px;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.app-navbar .nav-link:hover {
  color: var(--bronze-dark);
  background: #f1e5d4;
}

.app-navbar .nav-login-button {
  color: #fff;
  background: var(--bronze-dark);
  box-shadow: 0 10px 22px rgba(10, 74, 112, .18);
}

.app-navbar .nav-login-button:hover {
  color: #fff;
  background: var(--bronze);
  transform: translateY(-1px);
}

.navbar-toggler {
  border: 1px solid #d7e5ee;
  border-radius: 12px;
  padding: 8px 10px;
}

.app-main {
  max-width: 1440px;
  padding: 28px 24px 48px;
}

.app-footer {
  padding: 18px 24px;
  background: #fff;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-heading h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.app-card,
.readiness-panel,
.summary-strip,
.app-table {
  background: #fff;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 55, 90, 0.06);
}

.app-card {
  padding: 22px;
}

.wide-card {
  margin-bottom: 22px;
}

.app-card h2,
.section-block h2,
.readiness-panel h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
}

.app-card p {
  min-height: 48px;
  color: #526273;
}

.metric-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.metric {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--bronze-dark);
  line-height: 1;
}

.metric-label {
  color: #64748b;
  font-size: .9rem;
}

.readiness-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: center;
  margin-top: 24px;
  padding: 24px;
}

.readiness-actions {
  display: grid;
  gap: 12px;
}

.readiness-problems {
  margin: 0;
  padding-left: 1.1rem;
  color: #4a3020;
  font-size: .92rem;
}

.readiness-warnings {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--bronze-dark);
  font-size: .92rem;
}

.schedule-diagnostic-alert {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.readiness-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.schedule-start-summary {
  display: grid;
  gap: 12px;
}

.schedule-start-field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.schedule-start-summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #e5edf4;
}

.schedule-start-summary div:last-child {
  border-bottom: 0;
}

.schedule-start-summary strong {
  color: var(--bronze-dark);
  font-size: 1.2rem;
}

.schedule-draft-table td {
  min-width: 120px;
}

.week-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.week-badge-odd {
  color: var(--bronze-dark);
  background: #f5ebdd;
  border: 1px solid var(--gold-light);
}

.week-badge-even {
  color: #7c2d12;
  background: #ffedd5;
  border: 1px solid #fdba74;
}

.week-badge-every {
  color: #14532d;
  background: var(--cream);
  border: 1px solid #86efac;
}

.week-badge-unknown {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.semester-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.schedule-log-row {
  display: grid;
  grid-template-columns: 160px 110px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e5edf4;
}

.schedule-log-row:last-child {
  border-bottom: 0;
}

.schedule-log-row p {
  margin: 0;
}

.schedule-log-warning strong {
  color: #8a4b00;
}

.schedule-log-error strong {
  color: var(--bronze-dark);
}

.schedule-violations {
  border-left: 4px solid var(--bronze);
  background: var(--cream);
  margin-bottom: 1rem;
}

.schedule-violations h2 {
  color: var(--bronze-dark);
  font-size: 1.05rem;
  margin-bottom: .75rem;
}

.schedule-violations ul {
  margin: 0;
  padding-left: 1.25rem;
}

.manual-placement-alert {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  margin-bottom: 18px;
  border: 1px solid #f59e0b;
  border-left: 5px solid #d97706;
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
}

.manual-placement-alert strong {
  font-size: 1rem;
}

.unplaced-diagnostics-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-bottom: 22px;
  border: 1px solid #f59e0b;
  border-left: 6px solid #d97706;
  border-radius: 8px;
  background: #fff8e6;
  box-shadow: 0 14px 32px rgba(146, 64, 14, .10);
}

.unplaced-diagnostics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.unplaced-diagnostics-head h2 {
  margin: 0;
  color: #78350f;
  font-size: 1.35rem;
  font-weight: 800;
}

.unplaced-reason-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.unplaced-reason-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid #f3d38a;
  border-radius: 8px;
  background: #fff;
  color: #78350f;
  text-decoration: none;
}

.unplaced-reason-card:hover,
.unplaced-reason-card.is-active {
  border-color: #d97706;
  background: #fffbeb;
  color: #78350f;
}

.unplaced-reason-card strong {
  min-width: 42px;
  color: #b45309;
  font-size: 1.7rem;
  line-height: 1;
}

.unplaced-reason-card span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: .92rem;
  font-weight: 700;
}

.unplaced-filter-form {
  padding-top: 2px;
}

.unplaced-diagnostic-results {
  display: grid;
  gap: 10px;
}

.unplaced-diagnostic-empty {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px dashed #f3d38a;
  border-radius: 8px;
  background: #fff;
  color: #78350f;
}

.unplaced-diagnostic-card {
  border: 1px solid #f3d38a;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 10px 22px rgba(146, 64, 14, .07);
  overflow: hidden;
}

.unplaced-diagnostic-card[open] {
  border-color: #d97706;
}

.unplaced-diagnostic-card summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, .95fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.unplaced-diagnostic-card summary::-webkit-details-marker {
  display: none;
}

.unplaced-diagnostic-card summary::after {
  content: "Открыть подробности";
  justify-self: end;
  align-self: center;
  grid-column: 2;
  padding: 5px 9px;
  border: 1px solid #f3d38a;
  border-radius: 8px;
  color: #92400e;
  background: #fffbeb;
  font-size: .78rem;
  font-weight: 850;
}

.unplaced-diagnostic-card[open] summary::after {
  content: "Свернуть";
}

.unplaced-diagnostic-main,
.unplaced-diagnostic-reason {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.unplaced-diagnostic-main strong {
  color: #211713;
  font-size: 1rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.unplaced-diagnostic-main span,
.unplaced-diagnostic-main small,
.unplaced-diagnostic-reason small {
  color: #64748b;
  overflow-wrap: anywhere;
}

.unplaced-diagnostic-reason b {
  color: #78350f;
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.unplaced-diagnostic-reason small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.unplaced-diagnostic-detail {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.unplaced-diagnostic-counters {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  min-width: 0;
}

.unplaced-diagnostic-counters div {
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid #e9d7a3;
  border-radius: 8px;
  background: #fffaf0;
}

.unplaced-diagnostic-counters strong {
  color: #b45309;
  font-size: 1.25rem;
  line-height: 1;
}

.unplaced-diagnostic-counters span {
  color: #64748b;
  font-size: .78rem;
  font-weight: 800;
}

.unplaced-diagnostic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.unplaced-diagnostic-meta span {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: .82rem;
  font-weight: 750;
}

.unplaced-diagnostic-notes {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #f3d38a;
  border-radius: 8px;
  background: #fffbeb;
}

.unplaced-diagnostic-notes strong {
  color: #78350f;
}

.diagnostic-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 1.05rem;
}

.diagnostic-counters {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 4px 8px;
  min-width: 260px;
  color: #475569;
  font-size: .82rem;
}

.unplaced-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.unplaced-actions a {
  font-weight: 700;
}

.progress {
  height: 10px;
}

.progress-bar,
.btn-primary {
  background-color: var(--bronze);
  border-color: var(--bronze);
}

.btn-outline-primary {
  color: var(--bronze);
  border-color: var(--bronze);
}

.btn-outline-primary:hover {
  background-color: var(--bronze);
  border-color: var(--bronze);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  overflow: hidden;
}

.summary-strip div {
  padding: 18px;
  background: #f8f1e7;
}

.summary-strip strong {
  display: block;
  font-size: 1.7rem;
  color: var(--bronze-dark);
}

.summary-strip span {
  color: #64748b;
}

.section-block {
  margin-top: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.app-table {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  background: #f5ebdd;
  border-bottom-color: #d6e6f0;
  color: #334155;
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.reference-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.reference-page-heading h1 {
  margin: 0;
  color: #172033;
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: 0;
}

.reference-eyebrow {
  margin: 0 0 4px;
  color: #2f6fed;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.reference-workspace {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.reference-sidebar,
.reference-filter-card,
.reference-groups-card,
.reference-generic-shell {
  border: 1px solid var(--cream-muted);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 40, 70, .07);
}

.reference-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
  padding: 16px;
}

.reference-nav-section h2 {
  margin: 0 0 8px;
  color: #64748b;
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.reference-nav-section nav {
  display: grid;
  gap: 4px;
}

.reference-nav-section a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 10px;
  color: #334155;
  text-decoration: none;
  font-weight: 750;
  transition: background-color .16s ease, color .16s ease;
}

.reference-nav-section a:hover {
  color: var(--bronze-dark);
  background: #f1e5d4;
}

.reference-nav-section a.active {
  color: var(--bronze-dark);
  background: #dff4fa;
}

.reference-nav-section a strong {
  min-width: 28px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: .82rem;
  text-align: center;
}

.reference-nav-section a.active strong {
  color: var(--bronze-dark);
  background: #fff;
}

.reference-mobile-nav {
  display: none;
}

.reference-content {
  min-width: 0;
}

.reference-groups-shell,
.reference-generic-shell {
  display: grid;
  gap: 16px;
}

.reference-generic-shell {
  padding: 18px;
}

.reference-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.reference-section-title h2 {
  margin: 0;
  color: #211713;
  font-size: 1.85rem;
  font-weight: 850;
  letter-spacing: 0;
}

.reference-section-title p,
.reference-list-summary span {
  margin: 4px 0 0;
  color: #64748b;
  font-size: .96rem;
}

.reference-section-title .btn {
  flex: 0 0 auto;
  border-radius: 12px;
  font-weight: 800;
}

.reference-filter-card {
  padding: 16px;
}

.reference-group-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(145px, .8fr) minmax(150px, .85fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
}

.reference-workload-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(170px, 240px) auto;
  gap: 10px;
  align-items: end;
}

.reference-group-filters .form-label,
.reference-workload-filters .form-label,
.reference-generic-search .form-label {
  margin-bottom: 4px;
  color: #526273;
  font-size: .86rem;
  font-weight: 750;
}

.reference-filter-actions {
  display: flex;
  gap: 8px;
}

.reference-filter-actions .btn,
.reference-generic-search .btn {
  min-width: 92px;
  border-radius: 10px;
  font-weight: 800;
}

.reference-generic-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.reference-groups-card {
  padding: 16px;
}

.reference-list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reference-list-summary strong {
  color: #211713;
  font-size: 1rem;
}

.reference-groups-table-wrap {
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.reference-groups-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: #172033;
  font-size: .92rem;
}

.reference-groups-table th {
  padding: 9px 8px;
  border-bottom: 1px solid #b6c7d7;
  background: #f5ebdd;
  color: #334155;
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.reference-groups-table th:first-child {
  border-top-left-radius: 10px;
}

.reference-groups-table th:last-child {
  border-top-right-radius: 10px;
}

.reference-groups-table td {
  min-width: 0;
  padding: 8px;
  border-bottom: 1px solid #e4ebf1;
  vertical-align: middle;
}

.reference-groups-table tr:hover td {
  background: #f8fcff;
}

.reference-groups-table tr.has-document-gap td {
  background: #fffdf7;
}

.reference-groups-table th:nth-child(1),
.reference-groups-table td:nth-child(1) {
  width: 21%;
}

.reference-groups-table th:nth-child(2),
.reference-groups-table td:nth-child(2) {
  width: 11%;
}

.reference-groups-table th:nth-child(3),
.reference-groups-table td:nth-child(3) {
  width: 9%;
}

.reference-groups-table th:nth-child(4),
.reference-groups-table td:nth-child(4) {
  width: 8%;
}

.reference-groups-table th:nth-child(5),
.reference-groups-table td:nth-child(5) {
  width: 14%;
}

.reference-groups-table th:nth-child(6),
.reference-groups-table td:nth-child(6) {
  width: 20%;
}

.reference-groups-table th:nth-child(7),
.reference-groups-table td:nth-child(7) {
  width: 11%;
}

.reference-groups-table th:nth-child(8),
.reference-groups-table td:nth-child(8) {
  width: 6%;
  text-align: center;
}

.reference-workloads-table th:nth-child(1),
.reference-workloads-table td:nth-child(1) {
  width: 25%;
}

.reference-workloads-table th:nth-child(2),
.reference-workloads-table td:nth-child(2) {
  width: 10%;
}

.reference-workloads-table th:nth-child(3),
.reference-workloads-table td:nth-child(3) {
  width: 11%;
}

.reference-workloads-table th:nth-child(4),
.reference-workloads-table td:nth-child(4) {
  width: 22%;
}

.reference-workloads-table th:nth-child(5),
.reference-workloads-table td:nth-child(5) {
  width: 11%;
}

.reference-workloads-table th:nth-child(6),
.reference-workloads-table td:nth-child(6),
.reference-workloads-table th:nth-child(7),
.reference-workloads-table td:nth-child(7),
.reference-workloads-table th:nth-child(8),
.reference-workloads-table td:nth-child(8),
.reference-workloads-table th:nth-child(9),
.reference-workloads-table td:nth-child(9) {
  width: 5.25%;
  text-align: center;
}

.group-main-cell strong {
  display: block;
  color: #211713;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.group-main-cell span,
.group-department-cell span {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: #64748b;
  font-size: .84rem;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.group-documents-cell {
  display: grid;
  gap: 4px;
}

.group-doc-line {
  min-width: 0;
}

.group-doc-line summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}

.group-doc-line summary::-webkit-details-marker {
  display: none;
}

.group-doc-line summary span {
  color: #334155;
  font-weight: 750;
  white-space: nowrap;
}

.group-doc-line summary strong {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: .75rem;
  line-height: 1.25;
}

.group-doc-line.is-loaded summary strong {
  color: #166534;
  background: var(--cream);
}

.group-doc-line.is-missing summary strong {
  color: var(--bronze-dark);
  background: var(--cream);
}

.group-doc-details {
  display: grid;
  gap: 3px;
  margin-top: 5px;
  color: #64748b;
  font-size: .82rem;
}

.group-doc-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-doc-details a {
  color: var(--bronze);
  font-weight: 800;
  text-decoration: none;
}

.group-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.group-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
}

.group-status-pill.is-active {
  color: #166534;
  background: var(--cream);
}

.group-status-pill.is-review {
  color: #92400e;
  background: #fef3c7;
}

.group-status-pill.is-inactive {
  color: #475569;
  background: #e5e7eb;
}

.group-status-pill.is-excluded {
  color: #334155;
  background: #e2e8f0;
}

.group-status-pill.is-missing {
  color: var(--bronze-dark);
  background: var(--cream);
}

.workload-file-cell span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-document-file {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.reference-document-file span {
  display: block;
  max-width: 360px;
  overflow: hidden;
  color: #0f172a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-document-file a {
  color: #2f6f95;
  font-size: .84rem;
  font-weight: 800;
  text-decoration: none;
}

.reference-document-file a:hover,
.reference-document-file a:focus {
  color: var(--bronze-dark);
  text-decoration: underline;
}

.kug-calendar-heading {
  align-items: flex-start;
}

.kug-calendar-heading p:not(.reference-eyebrow) {
  margin: 6px 0 0;
  color: #64748b;
}

.kug-calendar-page {
  display: grid;
  gap: 16px;
}

.kug-calendar-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 260px) auto;
  gap: 12px;
  align-items: end;
}

.kug-calendar-controls .form-label {
  margin-bottom: 4px;
  color: #526273;
  font-size: .86rem;
  font-weight: 750;
}

.kug-calendar-summary-card,
.kug-calendar-empty,
.kug-calendar-table-card {
  border: 1px solid var(--cream-muted);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 40, 70, .07);
}

.kug-calendar-summary-card {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(0, 1.6fr);
  gap: 16px;
  padding: 16px;
}

.kug-calendar-group h2 {
  margin: 0;
  color: #211713;
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: 0;
}

.kug-calendar-group p,
.kug-calendar-group span,
.kug-calendar-group small {
  display: block;
  margin: 3px 0 0;
  color: #64748b;
}

.kug-calendar-group p {
  color: #334155;
  font-weight: 750;
}

.kug-calendar-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
}

.kug-calendar-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid #dbe7ef;
  border-radius: 999px;
  background: #f8f1e7;
  color: #475569;
  font-size: .88rem;
  font-weight: 750;
}

.kug-calendar-metrics strong {
  color: #211713;
  font-size: 1rem;
}

.kug-calendar-metrics span.requires-attention {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.kug-calendar-empty {
  padding: 20px;
  color: #64748b;
  font-weight: 750;
}

.kug-calendar-table-card {
  padding: 12px;
}

.kug-calendar-table {
  margin: 0;
  color: #172033;
  font-size: .92rem;
}

.kug-calendar-table th {
  border-bottom: 1px solid #b6c7d7;
  background: #f5ebdd;
  color: #334155;
  font-size: .82rem;
  font-weight: 850;
}

.kug-calendar-table td {
  border-bottom: 1px solid #e5edf3;
  vertical-align: middle;
}

.kug-calendar-table td span {
  display: block;
  color: #64748b;
  font-size: .84rem;
}

.kug-calendar-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 850;
  white-space: nowrap;
}

.kug-calendar-status.is-study,
.kug-calendar-day.is-study {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #166534;
}

.kug-calendar-status.is-partial {
  border-color: #bae6fd;
  background: var(--cream);
  color: var(--bronze-dark);
}

.kug-calendar-status.is-practice,
.kug-calendar-day.is-practice {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.kug-calendar-status.is-facultative,
.kug-calendar-day.is-facultative {
  border-color: #f5d0fe;
  background: var(--cream);
  color: #86198f;
}

.kug-calendar-status.is-session,
.kug-calendar-day.is-session {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.kug-calendar-status.is-vacation,
.kug-calendar-day.is-vacation {
  border-color: #bfdbfe;
  background: var(--cream);
  color: #1d4ed8;
}

.kug-calendar-status.is-other,
.kug-calendar-day.is-other,
.kug-calendar-day.is-outside {
  border-color: #d1d5db;
  background: #f8fafc;
  color: #475569;
}

.kug-calendar-status.requires-attention,
.kug-calendar-day.requires-attention {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

.kug-calendar-days {
  display: grid;
  grid-template-columns: repeat(6, minmax(58px, 1fr));
  gap: 6px;
  min-width: 390px;
}

.kug-calendar-day {
  display: grid;
  min-height: 56px;
  padding: 6px;
  border: 1px solid var(--cream-muted);
  border-radius: 10px;
  line-height: 1.1;
}

.kug-calendar-day strong {
  color: inherit;
  font-size: .82rem;
}

.kug-calendar-day small,
.kug-calendar-day em {
  color: inherit;
  font-size: .72rem;
  font-style: normal;
  opacity: .84;
}

@media (max-width: 1024px) {
  .kug-calendar-controls,
  .kug-calendar-summary-card {
    grid-template-columns: 1fr;
  }

  .kug-calendar-heading {
    display: grid;
  }
}

.group-actions-cell {
  position: relative;
}

.group-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #c9dce8;
  border-radius: 10px;
  background: #fff;
  color: #211713;
  font-size: 1.25rem;
  font-weight: 850;
  line-height: 1;
}

.group-menu-button:hover,
.group-menu-button:focus {
  border-color: var(--bronze);
  color: var(--bronze);
  background: #f1e5d4;
}

.group-actions-cell .dropdown-menu {
  min-width: 220px;
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(15, 40, 70, .16);
}

.reference-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.reference-pagination span {
  color: #475569;
  font-weight: 850;
}

@media (max-width: 1180px) {
  .reference-workspace {
    grid-template-columns: 1fr;
  }

  .reference-sidebar {
    display: none;
  }

  .reference-mobile-nav {
    display: block;
    padding: 14px;
    border: 1px solid var(--cream-muted);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 40, 70, .07);
  }
}

@media (max-width: 900px) {
  .reference-group-filters,
  .reference-workload-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-filter-actions,
  .reference-filter-actions .btn {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .reference-page-heading,
  .reference-section-title,
  .reference-list-summary {
    display: grid;
  }

  .reference-section-title .btn,
  .reference-filter-actions .btn,
  .reference-generic-search .btn {
    width: 100%;
  }

  .reference-group-filters,
  .reference-workload-filters,
  .reference-generic-search {
    grid-template-columns: 1fr;
  }

  .reference-groups-card {
    padding: 14px;
  }

  .reference-groups-table-wrap {
    overflow: visible;
  }

  .reference-groups-table {
    display: block;
    table-layout: auto;
  }

  .reference-groups-table thead {
    display: none;
  }

  .reference-groups-table tbody {
    display: grid;
    gap: 12px;
  }

  .reference-groups-table tr {
    display: grid;
    padding: 14px;
    border: 1px solid var(--cream-muted);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 40, 70, .06);
  }

  .reference-groups-table tr.has-document-gap {
    border-color: #f3d08a;
    background: #fffdf7;
  }

  .reference-groups-table tr:hover td,
  .reference-groups-table tr.has-document-gap td {
    background: transparent;
  }

  .reference-groups-table td {
    display: grid;
    grid-template-columns: minmax(112px, .45fr) minmax(0, 1fr);
    gap: 10px;
    width: auto !important;
    padding: 8px 0;
    border-bottom: 1px solid #edf2f6;
  }

  .reference-groups-table td:last-child {
    border-bottom: 0;
  }

  .reference-groups-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: .82rem;
    font-weight: 850;
  }

  .reference-groups-table .group-main-cell {
    grid-template-columns: 1fr;
    gap: 2px;
    padding-top: 0;
  }

  .reference-groups-table .group-main-cell::before {
    content: "";
    display: none;
  }

  .group-main-cell strong {
    font-size: 1.06rem;
  }

  .group-documents-cell,
  .group-status-stack {
    align-content: start;
  }

  .group-actions-cell {
    grid-template-columns: 1fr !important;
    justify-items: stretch;
  }

  .group-actions-cell::before {
    content: "";
    display: none;
  }

  .group-menu-button {
    justify-self: end;
  }

  .reference-pagination {
    justify-content: stretch;
  }

  .reference-pagination .btn {
    flex: 1 1 0;
  }
}

.preview-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(3, minmax(150px, 190px)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.groups-toolbar {
  grid-template-columns: minmax(260px, 1.2fr) minmax(110px, .5fr) minmax(230px, 1fr) minmax(130px, .65fr) minmax(230px, 1fr) minmax(170px, .8fr) auto;
}

.calendar-toolbar {
  grid-template-columns: minmax(280px, 1fr) minmax(120px, 160px) minmax(140px, 180px) minmax(210px, 260px) auto;
}

.workload-toolbar {
  grid-template-columns: minmax(300px, 1fr) minmax(110px, 150px) minmax(130px, 170px) minmax(160px, 200px) auto;
}

.preview-toolbar .form-label {
  margin-bottom: 4px;
  color: #526273;
  font-size: .86rem;
  font-weight: 600;
}

.preview-reset {
  display: flex;
  align-items: end;
}

.selected-group-card {
  margin-bottom: 18px;
}

.selected-group-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.logout-form {
  display: inline;
}

.logout-form .nav-link {
  border: 0;
  text-decoration: none;
}

.landing-page {
  display: grid;
  gap: 26px;
  padding-top: 10px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(560px, 1.18fr);
  gap: clamp(28px, 4.5vw, 72px);
  align-items: center;
  min-height: auto;
  padding: clamp(18px, 3.2vw, 44px) 0 10px;
}

.landing-hero-text {
  max-width: 780px;
}

.landing-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--bronze-dark);
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: 0;
}

.landing-kicker span {
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: #d9a441;
}

.landing-hero h1 {
  margin: 0 0 14px;
  color: #211713;
  font-size: clamp(2.45rem, 4.2vw, 4.45rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
}

.auth-panel h1 {
  margin: 0 0 14px;
  color: #2b1c14;
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
}

.landing-hero p {
  max-width: 720px;
  color: #475569;
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  line-height: 1.55;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.landing-actions .btn,
.auth-form .btn,
.form-actions .btn {
  border-radius: 14px;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}

.landing-actions .btn:hover,
.auth-form .btn:hover,
.form-actions .btn:hover {
  transform: translateY(-1px);
}

.landing-actions .btn-primary {
  background: var(--bronze-dark);
  border-color: var(--bronze-dark);
  box-shadow: 0 14px 26px rgba(10, 74, 112, .18);
}

.landing-actions .btn-primary:hover {
  background: var(--bronze);
  border-color: var(--bronze);
  box-shadow: 0 18px 34px rgba(8, 126, 164, .22);
}

.landing-visual {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(470px, 36vw, 580px);
}

.landing-visual::before {
  content: "";
  position: absolute;
  inset: 12% 4% 8% 12%;
  border-radius: 32px;
  background: radial-gradient(circle at 68% 20%, rgba(217, 164, 65, .18), transparent 28%),
    radial-gradient(circle at 22% 72%, rgba(125, 211, 252, .24), transparent 34%);
  filter: blur(12px);
  pointer-events: none;
}

.landing-illustration {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
  filter: drop-shadow(0 24px 46px rgba(8, 47, 73, .13));
}

.landing-schedule-preview {
  position: absolute;
  z-index: 2;
  left: clamp(8px, 2vw, 26px);
  bottom: clamp(8px, 1.4vw, 22px);
  width: min(430px, 64%);
  display: grid;
  gap: 14px;
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid rgba(8, 47, 73, .1);
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 22px 52px rgba(8, 47, 73, .16);
  backdrop-filter: blur(10px);
}

.schedule-preview-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2edf4;
}

.schedule-preview-label {
  color: #64748b;
  font-size: .84rem;
  font-weight: 800;
}

.schedule-preview-header h2 {
  margin: 4px 0 0;
  color: #211713;
  font-size: 1.38rem;
  font-weight: 800;
}

.schedule-preview-header time {
  padding: 7px 12px;
  border-radius: 999px;
  color: #7a4d00;
  background: #fff3d4;
  border: 1px solid #f0cc75;
  font-weight: 800;
  white-space: nowrap;
}

.schedule-preview-list {
  display: grid;
  gap: 10px;
}

.schedule-preview-lesson {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbe8f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f7fbfe);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.schedule-preview-lesson:hover,
.landing-feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(8, 126, 164, .32);
  box-shadow: 0 20px 42px rgba(8, 47, 73, .12);
}

.lesson-time {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 14px;
  color: #2b1c14;
  background: #f1e5d4;
}

.lesson-time strong {
  font-size: .95rem;
}

.lesson-time span {
  color: #526273;
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
}

.lesson-info {
  min-width: 0;
}

.lesson-info h3 {
  margin: 8px 0 4px;
  color: #2b1c14;
  font-size: .98rem;
  font-weight: 800;
}

.lesson-info p {
  margin: 0;
  min-height: 0;
  color: #64748b;
  font-size: .95rem;
}

.lesson-type {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.15;
}

.lesson-type-lecture {
  color: var(--bronze-dark);
  background: #f5ebdd;
  border: 1px solid var(--gold-light);
}

.lesson-type-practice {
  color: #7a4d00;
  background: #fff3d4;
  border: 1px solid #f0cc75;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.landing-feature-card {
  display: grid;
  gap: 12px;
  min-height: 220px;
  padding: 24px;
  border: 1px solid rgba(8, 47, 73, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 16px 36px rgba(15, 55, 90, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  color: var(--bronze-dark);
  background: #f5ebdd;
}

.feature-icon-blue {
  color: var(--bronze-dark);
  background: #dff4fb;
}

.feature-icon-gold {
  color: #8a5a0a;
  background: #fff3d4;
}

.landing-feature-card h2 {
  margin: 0;
  color: #2b1c14;
  font-size: 1.24rem;
  font-weight: 800;
}

.landing-feature-card p {
  margin: 0;
  min-height: 0;
  color: #526273;
  font-size: 1rem;
  line-height: 1.55;
}

@media (max-width: 992px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-hero-text {
    max-width: 740px;
  }

  .landing-visual {
    display: grid;
    width: min(100%, 680px);
    min-height: auto;
  }

  .landing-schedule-preview {
    position: relative;
    left: auto;
    bottom: auto;
    width: min(calc(100% - 28px), 440px);
    margin: -86px auto 0;
    justify-self: center;
  }
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 210px);
  place-items: center;
  padding: 28px 0 52px;
}

.auth-panel {
  width: min(100%, 460px);
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 55, 90, .1);
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.teacher-schedule,
.remark-thread-list {
  display: grid;
  gap: 18px;
}

.teacher-day-card h3 {
  margin-bottom: 14px;
  color: #2b1c14;
  font-size: 1.2rem;
  font-weight: 800;
}

.lesson-list {
  display: grid;
  gap: 12px;
}

.lesson-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e0e9ef;
  border-radius: 8px;
  background: #f8f1e7;
}

.lesson-main {
  display: grid;
  gap: 4px;
}

.lesson-main small {
  color: #64748b;
}

.lesson-actions,
.table-actions,
.remark-admin-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.lesson-remark-form {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid #e0e9ef;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pending {
  color: #7c2d12;
  background: #ffedd5;
  border: 1px solid #fdba74;
}

.status-review {
  color: var(--bronze-dark);
  background: #f5ebdd;
  border: 1px solid var(--gold-light);
}

.status-confirmed {
  color: #14532d;
  background: var(--cream);
  border: 1px solid #86efac;
}

.status-error {
  color: var(--bronze-dark);
  background: var(--cream);
  border: 1px solid var(--gold-light);
}

.status-canceled {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.remark-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.remark-card-header h2 {
  margin: 8px 0 4px;
}

.admin-remark-new {
  border-left: 5px solid #f59e0b;
  background: #fffdf6;
}

.remark-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.remark-meta-grid div {
  padding: 10px 12px;
  border: 1px solid #e0e9ef;
  border-radius: 8px;
  background: #f8f1e7;
}

.remark-meta-grid span {
  display: block;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.remark-response {
  padding: 12px 14px;
  margin: 12px 0;
  border-left: 4px solid var(--bronze);
  background: #eef8fb;
}

.remark-response p {
  margin: 4px 0 0;
}

.remark-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.remark-action-grid form {
  display: grid;
  gap: 8px;
}

.remark-history-details {
  margin-top: 14px;
}

.remark-history {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.remark-history div {
  padding: 10px 12px;
  border-left: 3px solid #cbd5e1;
  background: #f8fafc;
}

.remark-history strong {
  display: block;
}

.remark-history p {
  margin: 4px 0 0;
}

.portal-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.form-shell {
  max-width: 1080px;
}

@media (max-width: 768px) {
  .app-main {
    padding: 20px 14px 36px;
  }

  .app-navbar {
    min-height: 66px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .app-nav-links {
    align-items: stretch;
    gap: 8px;
    padding-top: 14px;
  }

  .app-navbar .nav-link,
  .logout-form .nav-link {
    display: block;
    width: 100%;
    text-align: left;
  }

  .page-heading,
  .remark-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 22px;
    padding-top: 18px;
  }

  .landing-kicker {
    align-items: flex-start;
    font-size: .84rem;
  }

  .landing-hero h1 {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }

  .landing-actions .btn {
    width: 100%;
  }

  .landing-visual {
    position: relative;
    display: block;
    width: 100%;
    min-height: 560px;
  }

  .landing-illustration {
    width: 100%;
    height: 560px;
    border-radius: 20px;
    object-fit: cover;
    object-position: 55% center;
  }

  .landing-schedule-preview {
    position: absolute;
    left: 14px;
    bottom: 14px;
    width: min(calc(100% - 28px), 330px);
    margin: 0;
    padding: 12px;
    gap: 8px;
  }

  .schedule-preview-header {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding-bottom: 7px;
  }

  .schedule-preview-label {
    font-size: .72rem;
  }

  .schedule-preview-header h2 {
    margin-top: 2px;
    font-size: 1.05rem;
  }

  .schedule-preview-header time {
    width: auto;
    padding: 5px 8px;
    font-size: .78rem;
  }

  .schedule-preview-list {
    gap: 7px;
  }

  .schedule-preview-lesson {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
  }

  .lesson-time {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 7px 8px;
    border-radius: 11px;
  }

  .lesson-time strong {
    font-size: .8rem;
  }

  .lesson-time span {
    font-size: .7rem;
  }

  .lesson-info h3 {
    margin: 5px 0 2px;
    font-size: .82rem;
    line-height: 1.2;
  }

  .lesson-info p {
    font-size: .78rem;
  }

  .lesson-type {
    min-height: 20px;
    padding: 3px 7px;
    font-size: .63rem;
    white-space: normal;
  }

  .landing-feature-grid {
    grid-template-columns: 1fr;
  }

  .lesson-item {
    grid-template-columns: 1fr;
  }

  .lesson-actions,
  .table-actions,
  .remark-admin-actions,
  .form-actions {
    justify-content: flex-start;
  }

  .password-field {
    grid-template-columns: 1fr;
  }
}

.selected-group-header h2 {
  margin: 0;
}

.selected-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.selected-group-grid span {
  display: block;
  margin-bottom: 3px;
  color: #64748b;
  font-size: .84rem;
  font-weight: 700;
}

.selected-group-grid strong {
  display: block;
  color: #1e293b;
  line-height: 1.25;
}

.change-group-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e4edf4;
}

.change-group-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 10px;
}

.confirm-check {
  display: inline-flex;
  align-items: center;
  max-width: 360px;
  gap: 8px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #f4cd89;
  border-radius: 8px;
  background: #fff9ed;
  color: #704300;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.2;
}

.confirm-check input {
  flex: 0 0 auto;
}

.preview-reset .btn {
  white-space: nowrap;
}

.preview-filter-row .btn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.preview-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 10px;
}

.preview-range {
  color: #334155;
  font-weight: 700;
}

.preview-page-size {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #526273;
  font-size: .9rem;
}

.preview-page-size .form-select {
  width: auto;
  min-width: 92px;
}

.group-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 55, 90, 0.06);
}

.group-summary-strip div {
  padding: 14px 16px;
  background: #f8f1e7;
}

.group-summary-strip strong {
  display: block;
  color: var(--bronze-dark);
  font-size: 1.35rem;
}

.group-summary-strip span {
  color: #64748b;
  font-size: .9rem;
}

.curriculum-preview-table {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 10px;
  scrollbar-color: var(--bronze) #dbe7f0;
  scrollbar-width: thin;
}

.curriculum-preview-table::-webkit-scrollbar {
  height: 14px;
}

.curriculum-preview-table::-webkit-scrollbar-track {
  background: #dbe7f0;
  border-radius: 999px;
}

.curriculum-preview-table::-webkit-scrollbar-thumb {
  background: var(--bronze);
  border: 3px solid #dbe7f0;
  border-radius: 999px;
}

.groups-preview-table {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 10px;
  scrollbar-color: var(--bronze) #dbe7f0;
  scrollbar-width: thin;
}

.groups-preview-table::-webkit-scrollbar {
  height: 14px;
}

.groups-preview-table::-webkit-scrollbar-track {
  background: #dbe7f0;
  border-radius: 999px;
}

.groups-preview-table::-webkit-scrollbar-thumb {
  background: var(--bronze);
  border: 3px solid #dbe7f0;
  border-radius: 999px;
}

.calendar-preview-table {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 12px;
  scrollbar-color: var(--bronze) #dbe7f0;
  scrollbar-width: thin;
}

.calendar-preview-table::-webkit-scrollbar {
  height: 14px;
}

.calendar-preview-table::-webkit-scrollbar-track {
  background: #dbe7f0;
  border-radius: 999px;
}

.calendar-preview-table::-webkit-scrollbar-thumb {
  background: var(--bronze);
  border: 3px solid #dbe7f0;
  border-radius: 999px;
}

.workload-preview-table {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 12px;
  scrollbar-color: var(--bronze) #dbe7f0;
  scrollbar-width: thin;
}

.workload-preview-table::-webkit-scrollbar {
  height: 14px;
}

.workload-preview-table::-webkit-scrollbar-track {
  background: #dbe7f0;
  border-radius: 999px;
}

.workload-preview-table::-webkit-scrollbar-thumb {
  background: var(--bronze);
  border: 3px solid #dbe7f0;
  border-radius: 999px;
}

.curriculum-table {
  min-width: 1980px;
  table-layout: fixed;
}

.groups-table {
  min-width: 2060px;
  table-layout: fixed;
}

.calendar-table {
  min-width: 1620px;
  table-layout: fixed;
}

.workload-table {
  min-width: 2460px;
  table-layout: fixed;
}

.curriculum-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.groups-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.calendar-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.workload-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.curriculum-preview-table td,
.curriculum-preview-table th {
  font-size: .84rem;
}

.groups-preview-table td,
.groups-preview-table th {
  font-size: .86rem;
}

.calendar-preview-table td,
.calendar-preview-table th {
  font-size: .86rem;
}

.workload-preview-table td,
.workload-preview-table th {
  font-size: .84rem;
}

.curriculum-table th,
.curriculum-table td,
.groups-table th,
.groups-table td,
.calendar-table th,
.calendar-table td,
.workload-table th,
.workload-table td {
  vertical-align: top;
}

.curriculum-table .sticky-col,
.groups-table .sticky-col,
.calendar-table .sticky-col,
.workload-table .sticky-col {
  position: sticky;
  background: #fff;
  box-shadow: 1px 0 0 #d6e6f0;
  z-index: 3;
}

.curriculum-table thead .sticky-col,
.groups-table thead .sticky-col,
.calendar-table thead .sticky-col,
.workload-table thead .sticky-col {
  background: #f5ebdd;
  z-index: 6;
}

.curriculum-table .sticky-col-1 {
  left: 0;
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.curriculum-table .sticky-col-2 {
  left: 96px;
  width: 230px;
  min-width: 230px;
  max-width: 230px;
}

.curriculum-table .sticky-col-3 {
  left: 326px;
  width: 420px;
  min-width: 420px;
  max-width: 420px;
}

.groups-table .sticky-col-1 {
  left: 0;
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.groups-table .sticky-col-2 {
  left: 96px;
  width: 250px;
  min-width: 250px;
  max-width: 250px;
}

.calendar-table .sticky-col-1 {
  left: 0;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.calendar-table .sticky-col-2 {
  left: 100px;
  width: 82px;
  min-width: 82px;
  max-width: 82px;
}

.calendar-table .sticky-col-3 {
  left: 182px;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
}

.workload-table .sticky-col-1 {
  left: 0;
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.workload-table .sticky-col-2 {
  left: 110px;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
}

.workload-table .sticky-col-3 {
  left: 260px;
  width: 430px;
  min-width: 430px;
  max-width: 430px;
}

.calendar-meta-card {
  margin-bottom: 18px;
}

.calendar-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.calendar-meta-grid span,
.calendar-subtitle {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: .84rem;
  font-weight: 700;
}

.calendar-meta-grid strong {
  display: block;
  color: #1e293b;
  line-height: 1.25;
}

.calendar-groups {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e4edf4;
}

.calendar-group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-group-list span {
  display: inline-flex;
  padding: 5px 9px;
  border: 1px solid #cfe0ea;
  border-radius: 999px;
  background: #f7fbfe;
  color: #334155;
  font-size: .86rem;
  font-weight: 700;
}

.calendar-check-messages {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: #146c43;
  font-weight: 700;
}

.calendar-warning-block {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #f4cd89;
  border-radius: 8px;
  background: #fff9ed;
}

.calendar-warning-block h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #7a4a00;
}

.calendar-warning-table {
  overflow-x: auto;
}

.workload-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 55, 90, 0.06);
}

.workload-summary-grid div {
  padding: 14px 16px;
  background: #f8f1e7;
}

.workload-summary-grid strong {
  display: block;
  color: var(--bronze-dark);
  font-size: 1.35rem;
}

.workload-summary-grid span {
  color: #64748b;
  font-size: .9rem;
}

.workload-info-list {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: #146c43;
  font-weight: 700;
}

.workload-warning-block {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #f4cd89;
  border-radius: 8px;
  background: #fff9ed;
}

.workload-warning-block h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #7a4a00;
}

.workload-unknown-table {
  overflow-x: auto;
}

.raw-designation-cell {
  min-width: 160px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-weight: 700;
  color: #1f2937;
}

.calendar-source-symbol {
  display: inline-flex;
  margin-left: 6px;
  color: #64748b;
  font-weight: 700;
}

.calendar-chip {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
}

.calendar-chip-theory {
  background: #e8f3fb;
  border-color: #b9d8ec;
  color: var(--bronze-dark);
}

.calendar-chip-study-practice,
.calendar-chip-production-practice {
  background: #e8f6ee;
  border-color: #b7dec9;
  color: #146c43;
}

.calendar-chip-research {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.calendar-chip-session {
  background: #fff4df;
  border-color: #f4cd89;
  color: #8a4b00;
}

.calendar-chip-final {
  background: var(--cream);
  border-color: var(--gold);
  color: var(--bronze-dark);
}

.calendar-chip-holiday,
.calendar-chip-nonworking {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.calendar-chip-unknown {
  background: var(--cream);
  border-color: var(--gold-light);
  color: var(--bronze-dark);
}

.curriculum-table .col-section,
.curriculum-table .discipline-cell,
.curriculum-table .assessment-cell,
.curriculum-table .warning-cell,
.groups-table .group-program-cell,
.groups-table .group-department-cell,
.groups-table .warning-cell,
.workload-table .workload-discipline-col,
.workload-table .workload-source-cell,
.workload-table .workload-teacher-cell,
.workload-table .workload-code-cell,
.workload-table .warning-cell,
.workload-table .workload-check-cell,
.workload-table .workload-schedule-calculation-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.curriculum-table .col-section {
  color: #475569;
}

.curriculum-table .discipline-cell {
  font-weight: 600;
}

.groups-table .group-code-cell {
  color: #063f5c;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}

.groups-table .group-program-cell {
  width: 320px;
}

.groups-table .warning-cell {
  width: 420px;
}

.groups-table .creation-cell {
  width: 220px;
  color: #0f766e;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}

.workload-table .workload-discipline-col {
  font-weight: 650;
}

.workload-table .workload-source-cell {
  width: 300px;
}

.workload-table .workload-source-cell strong,
.workload-table .workload-source-cell span,
.workload-table .workload-source-cell small {
  display: block;
}

.workload-table .workload-source-cell small {
  margin-top: 4px;
  color: #64748b;
}

.workload-table .workload-code-cell {
  width: 260px;
}

.workload-table .workload-teacher-cell {
  width: 220px;
}

.workload-table .workload-check-cell {
  width: 130px;
  color: #475569;
  font-weight: 700;
}

.workload-table .workload-schedule-calculation-cell {
  width: 380px;
}

.preview-pagination-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.preview-pagination-wrap .pagination {
  flex-wrap: wrap;
  gap: 4px;
}

.tab-row a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #c9dce8;
  border-radius: 8px;
  background: #fff;
  color: #0f4661;
  text-decoration: none;
}

.tab-row a.active {
  background: var(--bronze);
  border-color: var(--bronze);
  color: #fff;
}

.tab-row span {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 70, 97, .1);
  text-align: center;
}

.tab-row a.active span {
  background: rgba(255, 255, 255, .22);
}

.issue-filter-row a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.issue-table td {
  vertical-align: top;
}

.issue-message-cell {
  min-width: 300px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.issue-message-cell small {
  display: block;
  margin-top: 4px;
  color: #64748b;
}

.issue-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.issue-status-error .issue-status-badge,
.issue-status-badge.issue-status-error {
  background: var(--cream);
  border: 1px solid var(--gold);
  color: var(--bronze-dark);
}

.issue-status-warning .issue-status-badge,
.issue-status-badge.issue-status-warning {
  background: #fff4df;
  border: 1px solid #f4cd89;
  color: #8a4b00;
}

.issue-status-success .issue-status-badge,
.issue-status-badge.issue-status-success {
  background: #e8f6ee;
  border: 1px solid #b7dec9;
  color: #146c43;
}

.issue-status-info .issue-status-badge,
.issue-status-badge.issue-status-info,
.issue-status-resolved .issue-status-badge,
.issue-status-badge.issue-status-resolved {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.issue-action-row td {
  padding: 0;
  background: #f8f1e7;
}

.issue-action-panel {
  display: grid;
  grid-template-columns: minmax(190px, .35fr) minmax(260px, 1fr);
  gap: 14px;
  padding: 16px;
  border-top: 1px solid #d9e5ee;
}

.issue-action-panel span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: .84rem;
  font-weight: 700;
}

.issue-action-panel strong {
  display: block;
  color: #1f2937;
  overflow-wrap: anywhere;
}

.issue-action-buttons {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.issue-action-buttons-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.issue-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.issue-multi-select {
  min-height: 240px;
}

.check-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.check-result-success {
  padding: 14px 16px;
  border: 1px solid #b7dec9;
  border-radius: 8px;
  background: #f2fbf6;
}

.check-result-success span {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f6ee;
  color: #146c43;
  font-size: .78rem;
  font-weight: 800;
}

.check-result-success strong {
  display: block;
  margin-bottom: 5px;
  color: #14532d;
}

.check-result-success p {
  margin: 0;
  color: #334155;
}

.action-bar,
.form-actions,
.reference-heading-actions,
.actions-cell {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.reference-danger-action {
  box-shadow: 0 0 0 1px rgba(185, 28, 28, .12);
}

.import-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* Import page redesign */
.app-main > .alert {
  max-width: 1100px;
  margin: 0 auto 16px;
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(15, 55, 90, .08);
}

.app-flash-message {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: min(1100px, 100%);
  min-height: 48px;
  padding-right: 48px;
}

.flash-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-weight: 800;
}

.alert-success .flash-icon {
  background: var(--bronze);
  color: #fff;
}

.alert-warning .flash-icon {
  background: #b7791f;
  color: #fff;
}

.edit-validation-summary {
  grid-column: 1 / -1;
}

.alert-danger .flash-icon {
  background: var(--bronze-dark);
  color: #fff;
}

.import-page-heading {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 18px;
}

.import-page-heading h1 {
  color: #211713;
}

.import-workspace {
  max-width: 1100px;
  margin: 0 auto 28px;
}

.import-upload-card {
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 18px 42px rgba(15, 55, 90, .1);
}

.import-stage-indicator {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.import-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dbe6ef;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
}

.import-stage span,
.import-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-weight: 800;
  line-height: 1;
}

.import-stage span {
  background: #e2e8f0;
  color: #475569;
}

.import-stage strong {
  overflow: hidden;
  font-size: .92rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-stage-current {
  border-color: #9bc8ea;
  background: #f5ebdd;
  color: var(--bronze-dark);
}

.import-stage-current span {
  background: var(--bronze);
  color: #fff;
}

.import-stage-done {
  border-color: #b7dec9;
  background: #eef8f2;
  color: #146c43;
}

.import-stage-done span {
  background: var(--bronze);
  color: #fff;
}

.import-upload-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.import-form-step {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dbe6ef;
  border-radius: 16px;
  background: #fff;
}

.import-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  min-width: 0;
}

.import-step-heading > div {
  min-width: 0;
}

.import-step-number {
  background: #e8f3fb;
  color: var(--bronze-dark);
}

.import-step-heading h2 {
  margin: 0 0 4px;
  color: #211713;
  font-size: 1.06rem;
  font-weight: 800;
}

.import-step-heading p {
  margin: 0;
  color: #64748b;
}

.import-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.import-field,
.import-group-picker {
  min-width: 0;
}

.import-field .form-select,
.import-field .form-control,
.import-group-picker .form-select,
.import-group-picker .form-control {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border-color: #cbd8e3;
  border-radius: 12px;
}

.import-progress-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  min-width: 0;
}

.import-document-progress {
  padding: 12px;
  border: 1px solid #dbe6ef;
  border-radius: 14px;
  background: #f8fbfe;
}

.import-progress-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #334155;
  font-size: .92rem;
}

.import-progress-caption span {
  color: #64748b;
  white-space: nowrap;
}

.import-progress-bar {
  height: 8px;
  background: #e2e8f0;
}

.import-secondary-action {
  min-height: 40px;
  white-space: nowrap;
}

.import-inline-message {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
}

.import-inline-success {
  border: 1px solid #b7dec9;
  background: #e8f6ee;
  color: #146c43;
}

.import-inline-warning {
  border: 1px solid #f4cd89;
  background: #fff4df;
  color: #9a5b00;
}

.import-group-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.missing-documents-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbe6ef;
  border-radius: 12px;
  background: #f8fbfe;
}

.missing-documents-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #211713;
}

.missing-documents-heading span {
  color: #64748b;
  white-space: nowrap;
}

.missing-documents-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.missing-document-row {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dbe6ef;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  text-align: left;
}

.missing-document-row:hover,
.missing-document-row:focus-visible,
.missing-document-row.is-selected {
  border-color: #8fb9dd;
  background: #f5ebdd;
}

.missing-document-main,
.missing-document-main strong,
.missing-document-main span,
.missing-document-main small {
  display: block;
  overflow-wrap: anywhere;
}

.missing-document-main strong {
  color: #211713;
}

.missing-document-main span {
  margin-top: 2px;
}

.missing-document-main small {
  margin-top: 2px;
  color: #64748b;
}

.missing-documents-empty {
  padding: 10px 12px;
  color: #64748b;
}

.import-selected-group {
  padding: 14px;
  border: 1px solid #cfe1ee;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbfe 0%, #fff 100%);
}

.import-card-label {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.import-selected-group strong {
  display: block;
  color: #211713;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.import-selected-group dl {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.import-selected-group dt {
  margin-bottom: 2px;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.import-selected-group dd {
  margin: 0;
  color: #1f2937;
  overflow-wrap: anywhere;
}

.import-file-zone {
  display: block;
  width: 100%;
  min-height: 190px;
  padding: 18px;
  border: 2px dashed #a8c7df;
  border-radius: 16px;
  background: #f8fbfe;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.import-file-zone.is-dragover {
  border-color: var(--bronze);
  background: #f5ebdd;
  transform: translateY(-1px);
}

.import-file-zone.is-disabled {
  opacity: .68;
}

.import-file-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  color: #475569;
}

.import-file-empty strong {
  color: #211713;
  font-size: 1.05rem;
}

.import-file-empty small {
  color: #64748b;
}

.import-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #e8f6ee;
  color: var(--bronze);
}

.import-file-icon svg,
.upload-submit-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.import-file-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe6ef;
  border-radius: 14px;
  background: #fff;
}

.import-file-details {
  min-width: 0;
}

.import-file-details strong,
.import-file-details span,
.import-file-details small {
  display: block;
}

.import-file-details strong {
  max-width: 100%;
  overflow: hidden;
  color: #211713;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-file-details span {
  color: #64748b;
}

.import-file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.import-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.import-submit-row .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  min-width: 280px;
  border-radius: 12px;
  white-space: nowrap;
}

.upload-submit-icon {
  display: inline-flex;
}

.is-loading .upload-submit-icon {
  animation: importSpin 1s linear infinite;
}

@keyframes importSpin {
  to {
    transform: rotate(360deg);
  }
}

.loaded-documents-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #dbe6ef;
  border-radius: 16px;
  background: #f8fbfe;
}

.loaded-documents-heading strong {
  color: #211713;
}

.loaded-documents-heading p {
  margin: 2px 0 12px;
  color: #64748b;
}

.loaded-documents-list {
  display: grid;
  gap: 10px;
}

.loaded-document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbe6ef;
  border-radius: 14px;
  background: #fff;
}

.loaded-document-main {
  min-width: 0;
}

.loaded-document-main strong,
.loaded-document-main span,
.loaded-document-main small {
  display: block;
  overflow-wrap: anywhere;
}

.loaded-document-main strong {
  color: #211713;
}

.loaded-document-main span,
.loaded-document-main small {
  color: #64748b;
}

.loaded-document-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .import-upload-card {
    padding: 20px;
  }

  .import-stage-indicator {
    gap: 8px;
  }

  .import-stage {
    align-items: flex-start;
    padding: 9px;
  }

  .import-stage strong {
    white-space: normal;
  }

  .import-two-column,
  .import-group-layout,
  .import-progress-grid {
    grid-template-columns: 1fr;
  }

  .import-secondary-action {
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .import-workspace,
  .import-page-heading,
  .app-main > .alert {
    max-width: none;
  }

  .import-upload-card {
    padding: 16px;
    border-radius: 14px;
  }

  .import-stage-indicator {
    grid-template-columns: 1fr;
  }

  .import-stage {
    min-height: 44px;
  }

  .import-form-step {
    padding: 14px;
  }

  .import-step-heading {
    gap: 10px;
  }

  .import-file-card,
  .loaded-document-row {
    grid-template-columns: 1fr;
  }

  .import-file-actions,
  .loaded-document-actions {
    justify-content: stretch;
  }

  .import-file-actions .btn,
  .loaded-document-actions .btn {
    flex: 1 1 120px;
  }

  .import-submit-row {
    display: block;
  }

  .import-submit-row .btn {
    width: 100%;
    min-width: 0;
  }

  .import-progress-caption {
    display: grid;
    gap: 4px;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.status-pending {
  background: #e8f3fb;
  color: var(--bronze-dark);
  border: 1px solid #b9d8ec;
}

.status-confirmed {
  background: #e8f6ee;
  color: #146c43;
  border: 1px solid #b7dec9;
}

.status-canceled {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.status-error {
  background: var(--cream);
  color: var(--bronze-dark);
  border: 1px solid var(--gold);
}

.status-review {
  background: #fff4df;
  color: #9a5b00;
  border: 1px solid #f4cd89;
}

.btn-delete-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--bronze-dark);
  border: 1px solid #e6aaa5;
  background: #fff;
  font-weight: 700;
}

.btn-delete-soft:hover,
.btn-delete-soft:focus {
  color: #fff;
  border-color: var(--bronze-dark);
  background: var(--bronze-dark);
}

.trash-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Compact import workspace */
.import-page-heading,
.import-workspace,
.import-history-card {
  width: min(1280px, calc(100% - 32px));
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.import-page-heading {
  margin-bottom: 14px;
}

.import-page-heading h1 {
  margin-bottom: 4px;
}

.import-upload-card.import-composer-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.import-composer-card .import-stage-indicator {
  margin-bottom: 12px;
}

.import-composer-card .import-stage {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
}

.import-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, .8fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.import-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid #d8e2eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 55, 90, .07);
}

.import-file-panel {
  position: sticky;
  top: 14px;
}

.import-panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.import-panel-heading h2 {
  margin: 0 0 2px;
  color: #211713;
  font-size: 1.06rem;
  font-weight: 800;
}

.import-panel-heading p {
  margin: 0;
  color: #64748b;
}

.import-compact-fields {
  margin-bottom: 14px;
}

.import-compact-fields .form-select,
.import-search-shell .form-control,
.import-history-filters .form-select {
  min-height: 42px;
  border-radius: 8px;
}

.import-progress-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.import-progress-card .import-document-progress {
  padding: 10px;
  border-radius: 8px;
}

.import-progress-card .import-progress-caption {
  font-size: .9rem;
}

.import-progress-filter {
  white-space: nowrap;
}

.import-group-picker {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.import-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.import-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #475569;
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
}

.import-toggle input {
  width: 16px;
  height: 16px;
}

.import-search-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.import-picker-note {
  color: #64748b;
  font-size: .86rem;
}

.import-group-results {
  display: grid;
  gap: 7px;
  max-height: 340px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #d8e2eb;
  border-radius: 8px;
  background: #f8fbfe;
}

.import-group-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #d8e2eb;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-align: left;
}

.import-group-result:hover,
.import-group-result:focus-visible,
.import-group-result.is-selected {
  border-color: var(--gold-light);
  background: #f5ebdd;
}

.import-group-result-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.import-group-result-main strong,
.import-group-result-main span,
.import-group-result-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-group-result-main strong {
  color: #211713;
}

.import-group-result-main span,
.import-group-result-main small {
  color: #64748b;
}

.import-result-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.import-result-status.is-missing {
  border: 1px solid #b7dec9;
  background: #e8f6ee;
  color: #146c43;
}

.import-result-status.is-loaded {
  border: 1px solid #f4cd89;
  background: #fff4df;
  color: #8a4b00;
}

.import-group-empty {
  padding: 10px;
  color: #64748b;
}

.import-selected-compact,
.import-existing-doc,
.import-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d8e2eb;
  border-radius: 8px;
  background: #fff;
}

.import-existing-doc {
  border-color: #f4cd89;
  background: #fffaf0;
}

.import-selected-main,
.import-existing-doc > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.import-selected-main span,
.import-card-label {
  color: #64748b;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.import-selected-main strong,
.import-existing-doc strong {
  overflow: hidden;
  color: #211713;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-selected-main small,
.import-existing-doc small {
  overflow: hidden;
  color: #64748b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-existing-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.import-file-panel .import-file-zone {
  min-height: 170px;
  padding: 14px;
  border-radius: 8px;
}

.import-file-panel .import-file-card {
  grid-template-columns: auto minmax(0, 1fr);
  border-radius: 8px;
}

.import-file-panel .import-file-actions {
  grid-column: 2;
  justify-content: flex-start;
}

.import-file-panel .import-file-icon {
  border-radius: 8px;
}

.import-requirements {
  min-height: 24px;
  margin-top: 8px;
  color: #64748b;
  font-size: .9rem;
  font-weight: 700;
}

.import-requirements.is-ok {
  color: #146c43;
}

.import-requirements.is-error,
#selected-file-status.is-error {
  color: var(--bronze-dark);
}

.import-submit-button {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border-radius: 8px;
}

.import-summary-card {
  display: block;
  margin-top: 12px;
}

.import-summary-card dl {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
}

.import-summary-card div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
}

.import-summary-card dt {
  color: #64748b;
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.import-summary-card dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #172033;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-history-card {
  margin-bottom: 28px;
  padding: 14px;
  border: 1px solid #d8e2eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 55, 90, .07);
}

.import-history-header,
.import-history-header-actions,
.import-history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.import-history-header h2 {
  margin: 0 0 2px;
  color: #211713;
  font-size: 1.08rem;
  font-weight: 800;
}

.import-history-header p {
  margin: 0;
  color: #64748b;
}

.import-history-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5edf4;
}

.import-history-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.import-history-row {
  display: grid;
  grid-template-columns: 92px 150px 140px minmax(160px, 1fr) 170px 58px auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e1e9f0;
  border-radius: 8px;
  background: #fff;
}

.import-history-row.is-warning {
  border-color: #f4cd89;
  background: #fffaf0;
}

.import-history-row.is-error {
  border-color: var(--gold);
  background: #fff7f6;
}

.import-history-date,
.import-history-type,
.import-history-group,
.import-history-status {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.import-history-date strong,
.import-history-type strong,
.import-history-group strong {
  overflow: hidden;
  color: #172033;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-history-date span,
.import-history-type span,
.import-history-group span,
.import-history-status small {
  overflow: hidden;
  color: #64748b;
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-history-file {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-history-found {
  color: #475569;
  font-weight: 800;
  text-align: right;
}

.import-history-row .import-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

.import-history-empty {
  padding: 14px;
  color: #64748b;
}

.import-history-pagination {
  justify-content: center;
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .import-main-grid {
    grid-template-columns: 1fr;
  }

  .import-file-panel {
    position: static;
  }

  .import-history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-history-row {
    grid-template-columns: 90px 1fr 1fr;
  }

  .import-history-file,
  .import-history-status,
  .import-history-found,
  .import-history-row .import-actions {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .import-page-heading,
  .import-workspace,
  .import-history-card {
    width: min(100% - 18px, 1280px);
  }

  .import-composer-card .import-stage-indicator,
  .import-two-column,
  .import-progress-card,
  .import-history-filters,
  .import-history-row {
    grid-template-columns: 1fr;
  }

  .import-picker-head,
  .import-search-shell,
  .import-selected-compact,
  .import-existing-doc,
  .import-history-header,
  .import-history-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .import-toggle {
    white-space: normal;
  }

  .import-group-result {
    grid-template-columns: 1fr;
  }

  .import-group-result-main strong,
  .import-group-result-main span,
  .import-group-result-main small,
  .import-selected-main strong,
  .import-selected-main small,
  .import-existing-doc strong,
  .import-existing-doc small {
    white-space: normal;
  }

  .import-existing-actions,
  .import-history-row .import-actions {
    justify-content: stretch;
  }

  .import-existing-actions .btn,
  .import-history-row .import-actions .btn,
  .import-file-actions .btn {
    flex: 1 1 120px;
  }

  .import-history-file,
  .import-history-status,
  .import-history-found,
  .import-history-row .import-actions {
    grid-column: auto;
  }

  .import-history-found {
    text-align: left;
  }

  .import-summary-card div {
    grid-template-columns: 1fr;
  }
}

/* Import page visual refinement */
.app-main {
  background: var(--cream);
}

.import-page-heading,
.import-workspace,
.import-history-card {
  width: min(1320px, calc(100% - 40px));
  max-width: 1320px;
}

.import-page-heading {
  margin-top: 6px;
  margin-bottom: 16px;
}

.import-page-heading h1 {
  color: #120d0c;
  font-size: clamp(2rem, 3vw, 2.65rem);
  line-height: 1.08;
}

.import-upload-card.import-composer-card {
  padding: 24px;
  border: 1px solid #dbe6ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(7, 28, 52, .11);
}

.import-composer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5edf4;
}

.import-eyebrow {
  display: inline-flex;
  margin-bottom: 5px;
  color: #2f6f9f;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.import-composer-header h2 {
  margin: 0 0 4px;
  color: #120d0c;
  font-size: 1.35rem;
  font-weight: 850;
}

.import-composer-header p {
  max-width: 720px;
  margin: 0;
  color: #64748b;
}

.import-header-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #b9d8ec;
  border-radius: 999px;
  color: var(--bronze-dark);
  background: #f5ebdd;
  font-weight: 800;
}

.import-composer-card .import-stage-indicator {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.import-composer-card .import-stage-indicator::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: #d8e5ef;
}

.import-composer-card .import-stage {
  position: relative;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.import-composer-card .import-stage span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e9eff5;
  color: #64748b;
  box-shadow: 0 0 0 6px #fff;
}

.import-composer-card .import-stage strong {
  color: #64748b;
  font-size: .95rem;
}

.import-composer-card .import-stage-current {
  background: #f5ebdd;
}

.import-composer-card .import-stage-current span {
  background: var(--bronze-dark);
  color: #fff;
}

.import-composer-card .import-stage-current strong {
  color: #120d0c;
}

.import-main-grid {
  grid-template-columns: minmax(0, 1.28fr) minmax(390px, .9fr);
  gap: 24px;
  align-items: stretch;
}

.import-composer-card .import-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.import-panel-heading {
  margin-bottom: 16px;
}

.import-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8f3fb;
  color: var(--bronze-dark);
}

.import-panel-heading h2 {
  color: #120d0c;
  font-size: 1.12rem;
}

.import-panel-heading p {
  color: #7a8797;
}

.import-compact-fields {
  gap: 16px;
  margin-bottom: 12px;
}

.import-field .form-label,
.import-picker-head .form-label,
.import-history-filters .form-label {
  margin-bottom: 6px;
  color: #334155;
  font-size: .88rem;
  font-weight: 750;
}

.import-compact-fields .form-select,
.import-search-shell .form-control,
.import-history-filters .form-select {
  min-height: 48px;
  border-color: #cfdae5;
  border-radius: 12px;
  color: #172033;
  background-color: #fff;
}

.import-auto-hint {
  margin: 2px 0 18px;
  padding: 12px 14px;
  border: 1px solid #dbe8f3;
  border-radius: 14px;
  color: #49677f;
  background: #f6fbff;
  font-weight: 650;
}

.import-group-heading {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid #e5edf4;
}

.import-progress-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 14px;
}

.import-progress-card .import-document-progress {
  border-color: var(--cream-muted);
  border-radius: 14px;
  background: #f8fbfe;
}

.import-progress-filter,
.import-search-shell .btn,
.import-existing-actions .btn,
.import-selected-compact .btn {
  border-radius: 10px;
}

.import-group-results {
  max-height: 312px;
  border: 0;
  border-radius: 14px;
  background: var(--cream);
}

.import-group-result {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(7, 28, 52, .04);
}

.import-selected-compact,
.import-existing-doc {
  border-radius: 14px;
}

.import-file-panel {
  position: static;
  justify-content: flex-start;
}

.import-file-panel .import-file-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 266px;
  padding: 22px;
  border-color: #8fbfda;
  border-radius: 18px;
  background: linear-gradient(180deg, #eef9ff 0%, #f6fbff 100%);
}

.import-file-empty {
  gap: 10px;
}

.import-file-empty strong {
  color: #120d0c;
  font-size: 1.16rem;
}

.import-file-empty span {
  color: #64748b;
}

.import-file-empty .btn {
  min-height: 40px;
  border-radius: 10px;
  font-weight: 750;
}

.import-file-empty small {
  color: #8190a2;
}

.import-file-panel .import-file-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #e7f6ee;
}

.import-file-panel .import-file-card {
  width: 100%;
  padding: 16px;
  border: 1px solid #cfe0ec;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(7, 28, 52, .06);
}

.import-file-details strong {
  font-size: 1.02rem;
}

.import-requirements {
  margin-top: 12px;
  font-size: .92rem;
}

.import-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 330px);
  min-height: 52px;
  margin-top: 10px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--bronze-dark) 0%, var(--bronze) 100%);
  box-shadow: 0 14px 26px rgba(13, 110, 253, .22);
  font-weight: 850;
}

.import-submit-button:hover,
.import-submit-button:focus {
  color: #fff;
  background: linear-gradient(135deg, #3b2a20 0%, var(--bronze-dark) 100%);
}

.import-submit-button:disabled {
  border: 1px solid #c9d6e3;
  color: #7c8a9b;
  background: #e8eef7;
  box-shadow: none;
}

.import-summary-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5edf4;
  color: #64748b;
  font-size: .95rem;
  font-weight: 750;
}

.import-summary-strip span:first-child {
  color: #120d0c;
}

.import-history-card {
  margin-top: 28px;
  margin-bottom: 32px;
  padding: 22px;
  border-color: #dbe6ef;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(7, 28, 52, .09);
}

.import-history-header h2 {
  color: #120d0c;
  font-size: 1.28rem;
}

.import-history-header p {
  color: #7a8797;
  font-weight: 700;
}

.import-history-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.import-history-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #d8e4ef;
  border-radius: 999px;
  background: #f4f8fc;
}

.import-history-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #64748b;
  font-weight: 800;
  text-decoration: none;
}

.import-history-switch a.is-active {
  color: #120d0c;
  background: #fff;
  box-shadow: 0 4px 10px rgba(7, 28, 52, .08);
}

.import-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid #d7e2eb;
  border-radius: 10px;
  color: var(--bronze-dark);
  background: #fff;
  font-weight: 800;
}

.import-icon-button:hover,
.import-icon-button:focus {
  color: #120d0c;
  border-color: #9fc4df;
  background: #f5ebdd;
}

.import-icon-button.is-collapsed svg {
  transform: rotate(180deg);
}

.action-icon,
.trash-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.import-history-filters {
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: #f5f9fc;
}

.import-history-filters .btn {
  min-height: 48px;
  border-radius: 12px;
}

.import-history-table {
  margin-top: 16px;
}

.import-history-table-head,
.import-history-row {
  display: grid;
  grid-template-columns: 116px minmax(145px, .72fr) minmax(145px, .74fr) minmax(210px, 1.2fr) minmax(220px, auto) 72px 112px;
  gap: 12px;
  align-items: center;
}

.import-history-table-head {
  padding: 0 12px 8px;
  color: #8190a2;
  font-size: .76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.import-history-row {
  position: relative;
  min-height: 58px;
  padding: 12px;
  border: 1px solid #e2ebf2;
  border-radius: 14px;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.import-history-row:hover {
  border-color: #bfd4e6;
  box-shadow: 0 10px 24px rgba(7, 28, 52, .07);
  transform: translateY(-1px);
}

.import-history-row.is-warning {
  border-color: #ead7af;
  background: #fffaf1;
}

.import-history-row.is-warning::before,
.import-history-row.is-error::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
}

.import-history-row.is-warning::before {
  background: #d99023;
}

.import-history-row.is-error::before {
  background: var(--bronze-dark);
}

.import-history-row.is-error {
  border-color: var(--gold-light);
  background: #fff8f7;
}

.import-history-status {
  align-items: start;
  min-width: 0;
}

.import-history-status .status-badge {
  max-width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
}

.import-history-found {
  min-width: 0;
  text-align: center;
}

.import-history-row .import-actions {
  justify-content: flex-end;
}

.import-history-row .import-actions .btn span {
  display: inline;
}

.import-open-action {
  color: var(--bronze-dark);
}

.btn-delete-soft.import-icon-button {
  color: var(--bronze-dark);
  border-color: var(--gold-light);
  background: #fff;
}

.btn-delete-soft.import-icon-button:hover,
.btn-delete-soft.import-icon-button:focus {
  color: #fff;
  border-color: var(--bronze-dark);
  background: var(--bronze-dark);
}

.import-history-pagination {
  gap: 12px;
  margin-top: 18px;
}

.import-history-pagination .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 38px;
  border-radius: 12px;
}

.import-history-pagination .disabled {
  pointer-events: none;
  opacity: .45;
}

.import-history-pagination span {
  color: #475569;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .import-history-table-head,
  .import-history-row {
    grid-template-columns: 96px minmax(118px, .72fr) minmax(126px, .72fr) minmax(150px, 1fr) minmax(190px, auto) 56px 88px;
    gap: 9px;
  }

  .import-history-row .import-actions .btn span {
    display: none;
  }
}

@media (max-width: 1100px) {
  .import-main-grid {
    grid-template-columns: 1fr;
  }

  .import-file-panel .import-file-zone {
    min-height: 220px;
  }
}

@media (max-width: 900px) {
  .import-history-table-head {
    display: none;
  }

  .import-history-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .import-history-row > div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .import-history-row > div::before {
    content: attr(data-label);
    color: #8190a2;
    font-size: .75rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  .import-history-row .import-actions {
    display: flex;
    justify-content: flex-start;
  }

  .import-history-row .import-actions::before {
    display: none;
  }

  .import-history-row .import-actions .btn span {
    display: inline;
  }
}

@media (max-width: 640px) {
  .import-page-heading,
  .import-workspace,
  .import-history-card {
    width: min(100% - 18px, 1320px);
  }

  .import-upload-card.import-composer-card,
  .import-history-card {
    padding: 16px;
    border-radius: 16px;
  }

  .import-composer-header,
  .import-history-header {
    align-items: stretch;
    flex-direction: column;
  }

  .import-header-badge {
    align-self: flex-start;
  }

  .import-composer-card .import-stage-indicator {
    gap: 6px;
  }

  .import-composer-card .import-stage {
    justify-content: flex-start;
  }

  .import-composer-card .import-stage strong {
    white-space: normal;
  }

  .import-composer-card .import-stage-indicator::before {
    display: none;
  }

  .import-file-panel .import-file-zone {
    min-height: 205px;
  }

  .import-submit-button {
    width: 100%;
  }

  .import-history-switch,
  .import-history-switch a {
    width: 100%;
  }

  .import-history-switch a {
    justify-content: center;
  }

  .import-history-row > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.cleanup-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cleanup-card h2 {
  margin-bottom: 6px;
}

.cleanup-open-button {
  flex: 0 0 auto;
  min-width: 238px;
}

.cleanup-check {
  margin: 12px 0;
}

.cleanup-count {
  margin: 12px 0 8px;
  color: #334155;
}

.cleanup-list {
  max-height: 320px;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  list-style: none;
}

.cleanup-list li {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef3f7;
}

.cleanup-list li:last-child {
  border-bottom: 0;
}

.cleanup-list span {
  color: #1f2937;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.cleanup-list small {
  color: #64748b;
}

.cleanup-empty {
  margin: 12px 0 0;
}

.preview-action-bar {
  margin: 20px 0 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 55, 90, 0.06);
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.edit-grid .form-actions {
  grid-column: 1 / -1;
}

.classroom-preview-table {
  overflow-x: auto;
}

.classroom-table {
  min-width: 1180px;
}

.classroom-name-cell {
  min-width: 130px;
  font-weight: 700;
}

.classroom-note-cell,
.classroom-table .warning-cell {
  min-width: 220px;
  white-space: normal;
}

.classroom-edit-row td {
  background: #f8f1e7;
}

.classroom-edit-form {
  padding: 8px 0;
}

.classroom-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.classroom-edit-grid label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
}

.classroom-edit-actions {
  margin-top: 12px;
}

/* Classroom occupancy */
.classroom-occupancy-page {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.teacher-occupancy-page {
  gap: 14px;
}

.classroom-occupancy-heading {
  align-items: flex-start;
  margin-bottom: 0;
}

.teacher-occupancy-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(540px, 1.35fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 55, 90, .08);
}

.teacher-occupancy-title h1 {
  margin-bottom: 4px;
}

.teacher-primary-form {
  display: grid;
  grid-template-columns: minmax(180px, .85fr) minmax(240px, 1.15fr) auto auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.teacher-primary-search,
.teacher-primary-select {
  grid-column: auto;
}

.teacher-week-toggle,
.teacher-step-buttons,
.teacher-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.teacher-week-toggle .btn,
.teacher-step-button,
.teacher-filter-toggle,
.teacher-primary-submit {
  min-height: 40px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 850;
}

.teacher-week-toggle .btn {
  white-space: nowrap;
}

.teacher-toolbar-actions {
  justify-content: flex-end;
}

.teacher-step-button.disabled {
  color: #94a3b8;
  border-color: #d9e5ee;
  background: #f8f1e7;
  opacity: 1;
}

.teacher-advanced-panel {
  min-width: 0;
}

.teacher-week-section {
  display: grid;
  gap: 14px;
}

.teacher-profile-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(440px, 1.35fr);
  gap: 14px;
  align-items: stretch;
  padding-bottom: 2px;
}

.teacher-profile-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.teacher-profile-main h2 {
  margin: 0 0 4px;
  color: #211713;
  font-size: 1.35rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.teacher-profile-main span,
.teacher-profile-main small {
  display: block;
  color: #64748b;
  overflow-wrap: anywhere;
}

.teacher-profile-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(86px, 1fr));
  gap: 8px;
}

.teacher-profile-stats div {
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #f8f1e7;
}

.teacher-profile-stats strong {
  color: #211713;
  font-size: 1.35rem;
  line-height: 1;
}

.teacher-profile-stats span {
  color: #64748b;
  font-size: .78rem;
  font-weight: 850;
}

.classroom-occupancy-draft {
  max-width: 820px;
  margin: 6px 0 0;
  color: #64748b;
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.classroom-occupancy-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 55, 90, .06);
}

.occupancy-filter-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.occupancy-filter-field span {
  color: #475569;
  font-size: .82rem;
  font-weight: 800;
}

.occupancy-filter-field .form-select,
.occupancy-filter-field .form-control {
  min-height: 40px;
  border-color: #cad9e5;
  border-radius: 8px;
  font-size: .92rem;
}

.occupancy-filter-wide,
.occupancy-filter-search {
  grid-column: span 2;
}

.occupancy-mode-group,
.occupancy-status-group,
.occupancy-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.occupancy-mode-group .btn,
.occupancy-status-group .btn,
.occupancy-filter-actions .btn {
  min-height: 40px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 800;
}

.occupancy-calendar-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: -4px;
}

.classroom-occupancy-stats {
  margin-bottom: 0;
}

.classroom-occupancy-stats div {
  padding: 14px 16px;
}

.classroom-occupancy-stats strong {
  font-size: 1.45rem;
}

.occupancy-section {
  margin-top: 0;
}

.occupancy-section-title {
  align-items: flex-start;
  gap: 12px;
}

.occupancy-section-title h2 {
  margin-bottom: 3px;
}

.occupancy-section-title p {
  margin: 0;
  color: #64748b;
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.classroom-occupancy-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.classroom-occupancy-table {
  min-width: 1180px;
  table-layout: fixed;
}

.classroom-occupancy-table th,
.classroom-occupancy-table td {
  width: 132px;
  padding: 8px;
  vertical-align: top;
}

.classroom-occupancy-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 54px;
  background: #eaf4fa;
}

.classroom-occupancy-table thead th span,
.classroom-occupancy-table thead th small {
  display: block;
}

.classroom-occupancy-table thead th small {
  color: #64748b;
  font-weight: 700;
}

.classroom-occupancy-table .occupancy-sticky-col {
  position: sticky;
  left: 0;
  z-index: 5;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  background: #fff;
  box-shadow: 12px 0 18px rgba(15, 55, 90, .05);
}

.classroom-occupancy-table thead .occupancy-sticky-col {
  z-index: 7;
  background: #eaf4fa;
}

.occupancy-room-cell,
.occupancy-day-cell {
  color: #211713;
}

.occupancy-room-cell strong,
.occupancy-room-cell span,
.occupancy-room-cell small {
  display: block;
  overflow-wrap: anywhere;
}

.occupancy-room-cell strong,
.occupancy-day-cell {
  font-weight: 850;
}

.occupancy-room-cell span {
  margin-top: 4px;
  color: #475569;
  font-size: .86rem;
}

.occupancy-room-cell small {
  margin-top: 2px;
  color: #64748b;
}

.classroom-occupancy-table th.is-focus-slot,
.classroom-occupancy-table td.is-focus-slot,
.occupancy-mobile-pair.is-focus-slot {
  background: #fff8e8;
}

.occupancy-cell {
  display: grid;
  align-content: start;
  gap: 4px;
  width: 100%;
  min-height: 96px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  line-height: 1.25;
  overflow: hidden;
}

button.occupancy-cell {
  appearance: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

button.occupancy-cell[draggable="true"] {
  cursor: grab;
}

button.occupancy-cell[draggable="true"]:active {
  cursor: grabbing;
}

button.occupancy-cell:hover,
button.occupancy-cell:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 55, 90, .14);
}

button.occupancy-cell.is-dragging {
  opacity: .48;
  transform: scale(.98);
  box-shadow: none;
}

.occupancy-cell span {
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.occupancy-cell strong,
.occupancy-cell em,
.occupancy-cell small {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.occupancy-cell strong {
  display: -webkit-box;
  color: inherit;
  font-size: .86rem;
  font-style: normal;
  font-weight: 850;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.occupancy-cell em,
.occupancy-cell small {
  display: -webkit-box;
  font-size: .76rem;
  font-style: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.occupancy-cell.is-free {
  border-color: #b7e9c5;
  background: #ecfdf3;
  color: #166534;
}

.occupancy-cell.is-occupied {
  border-color: var(--gold-light);
  background: #fff0ed;
  color: #8a2418;
}

.occupancy-cell.is-unavailable {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

.occupancy-cell.is-conflict {
  border-color: #4a3020;
  background: #4a3020;
  color: #fff;
}

.teacher-occupancy-page .classroom-occupancy-table {
  min-width: 1120px;
}

.teacher-occupancy-page .classroom-occupancy-table th,
.teacher-occupancy-page .classroom-occupancy-table td {
  width: 124px;
  padding: 7px;
}

.teacher-occupancy-page .classroom-occupancy-table .occupancy-sticky-col {
  width: 236px;
  min-width: 236px;
  max-width: 236px;
}

.teacher-occupancy-page .occupancy-cell {
  min-height: 78px;
  padding: 8px;
}

.teacher-occupancy-page .occupancy-cell.is-free {
  border-color: #d5f4df;
  background: #f5fff8;
  color: #15803d;
}

.teacher-lesson-card {
  gap: 3px;
}

.teacher-lesson-card .occupancy-card-group {
  color: inherit;
  font-weight: 800;
  opacity: .88;
}

.teacher-lesson-card .occupancy-card-address {
  opacity: .74;
}

.occupancy-cell.is-single-day {
  border-color: #f0cc75;
  background: #fff7df;
  color: #7a4d00;
}

.occupancy-cell.is-conflict.is-single-day,
.occupancy-cell.has-daily-overload {
  border-color: #4a3020;
  background: #4a3020;
  color: #fff;
}

[data-drop-cell].is-drop-allowed .occupancy-cell.is-free {
  border-color: #22c55e;
  background: var(--cream);
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, .4);
}

[data-drop-cell].is-drop-hover .occupancy-cell.is-free {
  border-color: #15803d;
  background: #bbf7d0;
  box-shadow: 0 12px 28px rgba(21, 128, 61, .18), inset 0 0 0 2px rgba(21, 128, 61, .5);
}

[data-drop-cell].is-drop-blocked .occupancy-cell {
  border-color: var(--gold-light);
  background: #fff7f7;
  color: var(--bronze-dark);
  opacity: .72;
}

.occupancy-drag-ghost {
  position: fixed;
  top: -1000px;
  left: -1000px;
  z-index: 9999;
  pointer-events: none;
  opacity: .9;
  box-shadow: 0 18px 40px rgba(15, 40, 70, .22);
}

.occupancy-dnd-message {
  position: fixed;
  top: 86px;
  right: 24px;
  z-index: 1080;
  max-width: min(420px, calc(100vw - 32px));
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #b7e9c5;
  border-radius: 8px;
  background: #ecfdf3;
  color: #14532d;
  font-size: .9rem;
  font-weight: 800;
  box-shadow: 0 16px 38px rgba(15, 40, 70, .18);
}

.occupancy-dnd-message.is-error {
  border-color: var(--gold-light);
  background: #fff7f7;
  color: var(--bronze-dark);
}

.teacher-unassigned-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: #475569;
  font-size: .9rem;
  font-weight: 800;
}

.teacher-unassigned-toggle input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.teacher-week-stats {
  margin: 0 0 14px;
}

.teacher-day-stats {
  margin: 0 0 14px;
}

.teacher-unavailable-day-cell {
  vertical-align: middle !important;
  background: #f8f1e7;
}

.teacher-unavailable-day-message {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  min-height: 62px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
}

.teacher-unavailable-day-message strong {
  color: #334155;
  font-size: .94rem;
  font-weight: 850;
}

.teacher-unavailable-day-message span {
  color: #64748b;
  font-size: .86rem;
  font-weight: 700;
}

.teacher-occupancy-table .occupancy-day-cell strong,
.teacher-occupancy-table .occupancy-day-cell span,
.teacher-occupancy-table .occupancy-day-cell small {
  display: block;
  overflow-wrap: anywhere;
}

.teacher-occupancy-table .occupancy-day-cell span {
  margin-top: 4px;
  color: #9a5b00;
  font-size: .82rem;
  font-weight: 850;
}

.teacher-occupancy-table .occupancy-day-cell small {
  margin-top: 2px;
  color: #64748b;
  font-size: .78rem;
}

.teacher-occupancy-table tr.is-single-lesson-day .occupancy-sticky-col,
.occupancy-room-card.is-single-lesson-day {
  background: #fff8e8;
}

.teacher-occupancy-table tr.has-daily-overload .occupancy-sticky-col {
  background: #fff0ed;
}

.occupancy-popover {
  width: min(520px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 40, 70, .26);
  color: #1f2937;
  overflow: auto;
}

.occupancy-popover::backdrop {
  background: rgba(7, 28, 52, .1);
}

.occupancy-popover article {
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.occupancy-popover article:last-child {
  border-bottom: 0;
}

.occupancy-popover h3 {
  margin: 0 0 12px;
  color: #211713;
  font-size: 1.05rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.occupancy-popover dl {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 7px 12px;
  margin: 0;
}

.occupancy-popover dt {
  color: #64748b;
  font-size: .84rem;
  font-weight: 800;
}

.occupancy-popover dd {
  margin: 0;
  color: #1f2937;
  overflow-wrap: anywhere;
}

.occupancy-move-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.occupancy-move-open {
  justify-self: start;
  border-radius: 8px;
  font-weight: 800;
}

.occupancy-move-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #f8f1e7;
}

.occupancy-move-options {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.occupancy-move-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  padding: 9px;
  border: 1px solid #c6f1d1;
  border-radius: 8px;
  background: #ecfdf3;
  color: #14532d;
  cursor: pointer;
}

.occupancy-move-option input {
  margin-top: 4px;
}

.occupancy-move-option span,
.occupancy-move-option strong,
.occupancy-move-option em,
.occupancy-move-option small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.occupancy-move-option strong,
.occupancy-move-option em,
.occupancy-move-option span > small {
  display: block;
}

.occupancy-move-option strong {
  color: inherit;
  font-size: .92rem;
  font-weight: 850;
}

.occupancy-move-option em,
.occupancy-move-option small {
  font-size: .78rem;
  font-style: normal;
}

.occupancy-move-option > small {
  grid-column: 2;
  color: #166534;
}

.occupancy-move-option.is-disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
}

.occupancy-move-option.is-disabled > small {
  color: #4a3020;
}

.occupancy-move-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.occupancy-move-status,
.occupancy-move-loading,
.occupancy-move-empty {
  margin: 0;
  color: #475569;
  font-size: .84rem;
  font-weight: 700;
}

.occupancy-move-status.is-error {
  color: #b91c1c;
}

.occupancy-mobile-list {
  display: grid;
  gap: 12px;
}

.occupancy-room-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 55, 90, .06);
}

.occupancy-room-card header {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.occupancy-room-card header strong {
  color: #211713;
  font-size: 1rem;
  font-weight: 850;
}

.occupancy-room-card header span,
.occupancy-room-card header small {
  color: #64748b;
  overflow-wrap: anywhere;
}

.occupancy-mobile-pairs {
  display: grid;
  grid-auto-columns: minmax(210px, 72vw);
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.occupancy-mobile-pair {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8f1e7;
  scroll-snap-align: start;
}

.occupancy-mobile-pair-label {
  color: #475569;
  font-size: .82rem;
  font-weight: 850;
}

.occupancy-empty h2 {
  margin-bottom: 6px;
}

/* Group occupancy */
.group-occupancy-page {
  gap: 12px;
}

.group-page-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.group-page-heading h1 {
  margin: 0;
  color: #211713;
  font-size: clamp(1.85rem, 1.35rem + 1vw, 2.45rem);
  font-weight: 900;
  line-height: 1.08;
}

.group-page-heading p {
  margin: 0;
  color: #64748b;
  font-size: .95rem;
  font-weight: 650;
}

.group-control-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 55, 90, .06);
}

.group-primary-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.group-control-row {
  display: grid;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.group-control-main {
  grid-template-columns: minmax(220px, 1.1fr) minmax(150px, .58fr) minmax(145px, .52fr) minmax(260px, 1fr);
}

.group-control-secondary {
  grid-template-columns: minmax(300px, auto) minmax(320px, 1fr) auto;
}

.group-control-fieldset {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.group-control-fieldset legend {
  float: none;
  width: auto;
  margin: 0;
  color: #475569;
  font-size: .82rem;
  font-weight: 800;
}

.group-mode-toggle,
.group-week-step-buttons,
.group-step-buttons {
  flex-wrap: nowrap;
}

.group-period-controls {
  display: grid;
  grid-template-columns: minmax(210px, 280px) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.group-calendar-week-field {
  min-width: 0;
}

.group-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  justify-content: flex-end;
  min-width: 0;
}

.group-builder-link {
  min-height: 40px;
}

.group-form-actions .btn {
  white-space: nowrap;
}

.group-week-section {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.group-summary-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 55, 90, .05);
}

.group-summary-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.group-summary-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  min-width: 0;
}

.group-summary-title h2 {
  margin: 0;
  color: #211713;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.group-summary-title span {
  color: #334155;
  font-size: .95rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.group-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
  color: #475569;
  font-size: .88rem;
  font-weight: 760;
}

.group-summary-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.group-summary-main small {
  color: #64748b;
  font-size: .82rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.group-current-week {
  flex: 0 0 auto;
  max-width: min(320px, 42vw);
  white-space: normal;
  text-align: center;
}

.group-stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #f8f1e7;
}

.group-stat-strip span {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: .83rem;
  font-weight: 760;
  white-space: nowrap;
}

.group-stat-strip strong {
  color: #211713;
  font-size: .98rem;
  font-weight: 900;
  line-height: 1;
}

.group-kug-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: stretch;
}

.group-kug-chip {
  display: grid;
  gap: 2px;
  min-width: min(240px, 100%);
  padding: 7px 9px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #7a4d00;
}

.group-kug-chip strong {
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.group-kug-chip span {
  color: #211713;
  font-size: .84rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.group-kug-chip small {
  color: #7a4d00;
  font-size: .78rem;
  font-weight: 700;
}

.group-kug-chip.requires-attention {
  border-color: var(--gold-light);
  background: #fff7f7;
  color: var(--bronze-dark);
}

.group-kug-chip.is-facultative {
  border-color: #f5d0fe;
  background: var(--cream);
  color: #86198f;
}

.group-kug-chip.is-empty {
  border-color: #d9e5ee;
  background: #f8f1e7;
  color: #475569;
}

.group-occupancy-table {
  min-width: 1360px;
}

.group-occupancy-table th,
.group-occupancy-table td {
  width: 136px;
  padding: 6px;
}

.group-occupancy-table .occupancy-sticky-col {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
}

.group-occupancy-table tr.is-kug-day .occupancy-sticky-col {
  background: #fffbeb;
}

.group-occupancy-table tr.has-group-conflict .occupancy-sticky-col,
.group-mobile-list .has-group-conflict {
  background: #fff0ed;
}

.group-slot-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.group-occupancy-page .occupancy-cell {
  min-height: 78px;
  padding: 7px;
}

.group-occupancy-page .occupancy-cell.is-free {
  border-color: #d5f4df;
  background: #f5fff8;
  color: #15803d;
}

.group-occupancy-page .occupancy-cell.is-kug {
  border-color: #fde68a;
  background: #fffbeb;
  color: #7a4d00;
}

.group-lesson-card {
  gap: 4px;
  color: #211713;
}

.group-lesson-card.is-occupied {
  border-color: #cfe0eb;
  background: #f8f1e7;
}

.group-lesson-card.is-conflict {
  border-color: #4a3020;
  background: #4a3020;
  color: #fff;
}

.group-card-badges {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px;
}

.group-lesson-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eaf4fa;
  color: #2f6f95;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.group-lesson-badge.is-lecture {
  background: #f5ebdd;
  color: var(--bronze-dark);
}

.group-lesson-badge.is-practice {
  background: var(--cream);
  color: #166534;
}

.group-lesson-badge.is-lab {
  background: #fef3c7;
  color: #92400e;
}

.group-lesson-badge.is-stream {
  background: #eef2ff;
  color: #3730a3;
}

.group-lesson-badge.is-subgroup {
  background: #f1f5f9;
  color: #334155;
}

.group-lesson-card.is-conflict .group-lesson-badge {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.group-subgroup-title {
  color: inherit;
  font-weight: 900;
  opacity: .86;
}

.group-conflict-line {
  color: inherit;
  font-weight: 850;
  opacity: .9;
}

.group-kug-card {
  gap: 3px;
}

.group-kug-card strong {
  color: inherit;
}

.group-popover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 1280px) {
  .teacher-occupancy-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .teacher-toolbar-actions {
    justify-content: flex-start;
  }

  .teacher-profile-strip {
    grid-template-columns: 1fr;
  }

  .group-control-main {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .group-control-secondary {
    grid-template-columns: 1fr;
  }

  .group-period-controls {
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  .group-form-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 1100px) {
  .occupancy-filter-wide,
  .occupancy-filter-search {
    grid-column: span 1;
  }

  .group-control-main,
  .group-period-controls {
    grid-template-columns: 1fr;
  }

  .group-mode-toggle,
  .group-week-step-buttons,
  .group-step-buttons {
    flex-wrap: wrap;
  }

  .group-summary-card {
    display: grid;
  }

  .group-current-week {
    justify-self: start;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .classroom-occupancy-heading {
    display: grid;
  }

  .teacher-primary-form {
    grid-template-columns: 1fr;
  }

  .group-control-card {
    padding: 12px;
  }

  .group-control-main,
  .group-control-secondary,
  .group-period-controls {
    grid-template-columns: 1fr;
  }

  .teacher-week-toggle,
  .teacher-step-buttons,
  .teacher-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .teacher-week-toggle .btn,
  .teacher-step-button,
  .teacher-filter-toggle,
  .teacher-primary-submit,
  .teacher-toolbar-actions .btn {
    width: 100%;
  }

  .group-mode-toggle,
  .group-week-step-buttons,
  .group-step-buttons,
  .group-form-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .group-form-actions .btn {
    width: 100%;
  }

  .teacher-profile-main {
    display: grid;
  }

  .teacher-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-summary-title {
    display: grid;
    gap: 4px;
  }

  .group-stat-strip span {
    width: 100%;
    justify-content: space-between;
  }

  .teacher-unavailable-day-message {
    display: grid;
  }

  .classroom-occupancy-heading .btn {
    width: 100%;
  }

  .classroom-occupancy-filters {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .occupancy-mode-group,
  .occupancy-status-group,
  .occupancy-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .occupancy-status-group {
    grid-template-columns: 1fr;
  }

  .occupancy-filter-actions .btn {
    width: 100%;
  }

  .occupancy-section-title {
    display: grid;
  }

  .occupancy-popover dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-main {
    padding: 20px 14px 36px;
  }

  .page-heading,
  .readiness-panel {
    display: block;
  }

  .page-heading .btn,
  .reference-heading-actions,
  .readiness-actions {
    margin-top: 16px;
  }

  .summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .preview-toolbar {
    grid-template-columns: 1fr;
  }

  .groups-toolbar {
    grid-template-columns: 1fr;
  }

  .calendar-toolbar {
    grid-template-columns: 1fr;
  }

  .workload-toolbar {
    grid-template-columns: 1fr;
  }

  .issue-action-panel {
    grid-template-columns: 1fr;
  }

  .classroom-edit-grid {
    grid-template-columns: 1fr;
  }

  .preview-table-header,
  .preview-page-size {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-page-size .form-select {
    width: 100%;
  }

  .preview-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-action-bar .btn,
  .preview-action-bar form {
    width: 100%;
  }

  .selected-group-header,
  .change-group-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .import-actions {
    width: 100%;
    justify-content: stretch;
  }

  .import-actions .btn {
    flex: 1 1 140px;
  }

  .cleanup-card {
    display: block;
  }

  .cleanup-open-button {
    width: 100%;
    min-width: 0;
    margin-top: 16px;
  }

  .unplaced-diagnostics-head,
  .unplaced-diagnostic-card summary {
    grid-template-columns: 1fr;
  }

  .unplaced-diagnostics-head {
    display: grid;
  }

  .unplaced-diagnostic-card summary::after {
    justify-self: start;
    grid-column: 1;
  }
}

/* University landing redesign */
body {
  background: #f4f7f9;
}

.app-header {
  background: #120d0c;
}

.app-navbar {
  min-height: 70px;
  border-bottom: 1px solid rgba(214, 159, 75, .24);
  background: linear-gradient(90deg, #120d0c 0%, #211713 58%, #120d0c 100%);
  box-shadow: 0 14px 34px rgba(3, 13, 27, .2);
  backdrop-filter: none;
}

.app-nav-container {
  max-width: 1520px;
  margin: 0 auto;
}

.app-brand,
.app-brand:visited {
  color: #fff;
}

.app-brand:hover,
.app-brand:focus {
  color: #f4c873;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .24);
}

.app-navbar .nav-link,
.app-navbar .nav-link:visited {
  color: rgba(255, 255, 255, .82);
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.app-navbar .nav-link:focus-visible,
.landing-actions .btn:focus-visible {
  outline: 3px solid rgba(244, 200, 115, .72);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(10, 39, 72, .42);
}

.app-navbar .nav-link.nav-login-button,
.app-navbar .nav-link.nav-login-button:visited {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid rgba(245, 206, 128, .38);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #2b1c14 0%, #211713 100%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .2);
}

.app-navbar .nav-link.nav-login-button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .18s ease;
}

.app-navbar .nav-link.nav-login-button:hover,
.app-navbar .nav-link.nav-login-button:focus,
.app-navbar .nav-link.nav-login-button:active {
  color: #fff;
  background: linear-gradient(135deg, #174f7d 0%, #0f3860 100%);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, .26);
}

.app-navbar .nav-link.nav-login-button:hover::after,
.app-navbar .nav-link.nav-login-button:focus::after {
  transform: translateX(2px) rotate(45deg);
}

@media (min-width: 1200px) {
  .app-nav-container {
    align-items: center;
    gap: 14px;
  }

  #mainNav {
    min-width: 0;
  }

  .app-nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
    row-gap: 4px;
  }

  .app-navbar .nav-link,
  .logout-form .nav-link {
    padding: .42rem .52rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }
}

.app-navbar .nav-link.active,
.app-navbar .nav-link.active:visited {
  color: #fff;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 -2px 0 #f4c873;
}

.app-user-dropdown {
  margin-left: 4px;
}

.app-user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
}

.app-user-menu {
  min-width: 190px;
  padding: 8px;
  border: 1px solid #d8e4ef;
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(7, 28, 52, .22);
}

.app-user-menu .dropdown-item {
  border-radius: 10px;
  color: #172033;
  font-weight: 700;
}

.app-user-menu .dropdown-item:hover,
.app-user-menu .dropdown-item:focus {
  color: #120d0c;
  background: #f5ebdd;
}

.app-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid transparent;
}

.app-nav-dropdown .dropdown-toggle {
  border: 0;
  background: transparent;
}

.app-nav-dropdown .dropdown-toggle::after {
  margin-left: 4px;
  color: rgba(244, 200, 115, .9);
}

.app-nav-menu {
  min-width: 244px;
  padding: 8px;
  border: 1px solid rgba(216, 228, 239, .9);
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 22px 46px rgba(3, 13, 27, .24);
}

.app-nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #172033;
  font-size: .9rem;
  font-weight: 800;
}

.app-nav-dropdown-item:hover,
.app-nav-dropdown-item:focus {
  color: #120d0c;
  background: #f5ebdd;
}

.app-nav-dropdown-item.active,
.app-nav-dropdown-item.active:hover,
.app-nav-dropdown-item.active:focus {
  color: #120d0c;
  background: linear-gradient(135deg, #fff7df 0%, #eaf6ff 100%);
  box-shadow: inset 3px 0 0 #f4c873;
}

.app-nav-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-user-menu .logout-form {
  display: block;
}

.app-user-menu .logout-form .dropdown-item {
  width: 100%;
  text-align: left;
}

@media (min-width: 1200px) {
  .app-nav-links {
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    width: auto;
    max-width: fit-content;
  }

  .app-navbar .nav-link,
  .logout-form .nav-link {
    padding: .42rem .7rem;
    font-size: .86rem;
    line-height: 1.1;
    white-space: nowrap;
  }

  .app-user-toggle {
    max-width: 152px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.navbar-toggler {
  border-color: rgba(244, 200, 115, .38);
  background: rgba(255, 255, 255, .06);
}

.app-main:has(.landing-page) {
  max-width: none;
  padding: 0 0 46px;
}

.landing-page {
  display: block;
  padding-top: 0;
  background: linear-gradient(180deg, #120d0c 0%, #120d0c 58%, #f4f7f9 58%, #f4f7f9 100%);
}

.university-hero {
  position: relative;
  isolation: isolate;
  display: block;
  grid-template-columns: none;
  box-sizing: border-box;
  min-height: 0;
  height: clamp(620px, calc(100vh - 70px), 760px);
  overflow: hidden;
  padding: clamp(46px, 7vw, 86px) clamp(20px, 5vw, 72px);
  color: #fff;
  background: #120d0c;
}

.landing-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  filter: saturate(1.08) brightness(1.07);
  object-fit: cover;
  object-position: 58% center;
}

.university-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(4, 17, 34, .92) 0%, rgba(6, 25, 48, .79) 37%, rgba(6, 25, 48, .48) 68%, rgba(4, 17, 34, .34) 100%),
    linear-gradient(180deg, rgba(5, 18, 35, .28) 0%, rgba(5, 18, 35, .12) 44%, rgba(5, 18, 35, .78) 100%);
}

.university-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg width='980' height='640' viewBox='0 0 980 640' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cpath d='M76 464c128-70 215 32 343-38 120-66 213-10 318-70 60-34 104-36 160-24' stroke='%2365c7e7' stroke-opacity='.18' stroke-width='2'/%3E%3Cpath d='M44 504c134-78 230 30 358-44 112-64 213-14 332-78 70-37 118-38 172-18' stroke='%23f3cb7a' stroke-opacity='.18' stroke-width='2'/%3E%3Cpath d='M670 164c38-62 95-76 166-40 34 17 62 23 92 14' stroke='%23f3cb7a' stroke-opacity='.22' stroke-width='2'/%3E%3Cpath d='M695 188c34-42 80-49 136-20 32 16 60 21 88 11' stroke='%23f3cb7a' stroke-opacity='.14' stroke-width='1.5'/%3E%3C/g%3E%3C/svg%3E");
  background-position: right center;
  background-repeat: no-repeat;
  opacity: .92;
  pointer-events: none;
}

.landing-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
  align-items: center;
  gap: clamp(34px, 7vw, 108px);
  width: min(100%, 1480px);
  min-height: 100%;
  margin: 0 auto;
}

.landing-hero-text {
  max-width: 680px;
}

.landing-kicker {
  color: #f3cb7a;
  font-size: clamp(.9rem, 1vw, 1rem);
  line-height: 1.45;
  text-transform: none;
}

.landing-kicker span:first-child {
  flex: 0 0 40px;
  height: 2px;
  background: linear-gradient(90deg, #f3cb7a, #b7782e);
}

.landing-kicker span:not(:first-child) {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
}

.landing-hero h1 {
  max-width: 680px;
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(3.6rem, 6.8vw, 7rem);
  font-weight: 800;
  line-height: .94;
  text-wrap: balance;
  text-shadow: 0 18px 42px rgba(0, 0, 0, .32);
}

.landing-hero p {
  max-width: 560px;
  color: rgba(255, 255, 255, .84);
  font-size: clamp(1.15rem, 1.5vw, 1.42rem);
  line-height: 1.55;
}

.landing-actions {
  margin-top: 34px;
}

.landing-actions .btn.hero-login-button,
.landing-actions .btn.hero-login-button:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 14px 24px;
  border: 1px solid rgba(255, 230, 177, .4);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #8f4e1b 0%, #ad6423 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .28), 0 8px 18px rgba(143, 78, 27, .28);
  font-size: 1.05rem;
  font-weight: 800;
}

.landing-actions .btn.hero-login-button::after {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .18s ease;
}

.landing-actions .btn.hero-login-button:hover,
.landing-actions .btn.hero-login-button:focus,
.landing-actions .btn.hero-login-button:active {
  color: #fff;
  background: linear-gradient(135deg, #a35c1f 0%, #ad6423 100%);
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(0, 0, 0, .34), 0 10px 24px rgba(163, 92, 31, .32);
}

.landing-actions .btn.hero-login-button:hover::after,
.landing-actions .btn.hero-login-button:focus::after {
  transform: translateX(3px) rotate(45deg);
}

.landing-schedule-preview {
  position: relative;
  left: auto;
  bottom: auto;
  width: min(100%, 390px);
  justify-self: end;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-top-color: rgba(243, 203, 122, .48);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(6, 24, 47, .7), rgba(6, 24, 47, .44));
  box-shadow: 0 26px 58px rgba(0, 0, 0, .32);
  backdrop-filter: blur(18px);
}

.schedule-preview-header {
  border-bottom-color: rgba(255, 255, 255, .14);
}

.schedule-preview-label {
  color: rgba(255, 255, 255, .68);
}

.schedule-preview-header h2 {
  color: #fff;
}

.schedule-preview-header time {
  color: #fff7df;
  background: rgba(193, 122, 46, .28);
  border-color: rgba(243, 203, 122, .48);
}

.schedule-preview-lesson {
  grid-template-columns: 78px minmax(0, 1fr);
  padding: 11px;
  border-color: rgba(255, 255, 255, .14);
  border-radius: 13px;
  background: rgba(255, 255, 255, .1);
}

.schedule-preview-lesson:hover {
  border-color: rgba(243, 203, 122, .34);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .18);
}

.lesson-time {
  color: #fff;
  background: rgba(101, 199, 231, .16);
}

.lesson-time span,
.lesson-info p {
  color: rgba(255, 255, 255, .72);
}

.lesson-info h3 {
  color: #fff;
}

.lesson-type-lecture {
  color: #dff6ff;
  background: rgba(101, 199, 231, .16);
  border-color: rgba(101, 199, 231, .45);
}

.lesson-type-practice {
  color: #fff2d1;
  background: rgba(193, 122, 46, .18);
  border-color: rgba(243, 203, 122, .44);
}

.landing-transition {
  height: 62px;
  margin-top: -1px;
  background:
    linear-gradient(180deg, #120d0c 0%, rgba(7, 28, 52, .72) 42%, rgba(244, 247, 249, 0) 100%),
    linear-gradient(135deg, transparent 0 46%, rgba(243, 203, 122, .34) 46% 47%, transparent 47% 100%);
}

.landing-feature-grid {
  width: min(100% - 40px, 1280px);
  margin: -18px auto 34px;
  gap: 16px;
}

.landing-feature-card {
  position: relative;
  min-height: 178px;
  padding: 22px;
  border: 1px solid #d9e3ea;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8f1e7);
  box-shadow: 0 16px 34px rgba(8, 28, 53, .08);
  overflow: hidden;
}

.landing-feature-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #c17a2e, #f3cb7a 52%, rgba(101, 199, 231, .72));
}

.landing-feature-card .feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: #211713;
}

.landing-feature-card .feature-icon-blue {
  background: var(--bronze-dark);
}

.landing-feature-card .feature-icon-gold {
  color: #211713;
  background: #f3cb7a;
}

.landing-feature-card h2 {
  color: #211713;
}

.landing-feature-card p {
  color: #536577;
}

.landing-feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(193, 122, 46, .36);
  box-shadow: 0 22px 48px rgba(8, 28, 53, .12);
}

@media (max-width: 992px) {
  .landing-hero-inner {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 30px;
  }

  .landing-schedule-preview {
    justify-self: start;
    width: min(100%, 430px);
  }

  .landing-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .app-navbar {
    min-height: 62px;
  }

  .app-brand {
    font-size: 1rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
  }

  .navbar-collapse {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(244, 200, 115, .2);
    border-radius: 14px;
    background: rgba(3, 16, 32, .92);
  }

  .app-nav-links {
    align-items: stretch;
    gap: 6px;
  }

  .app-nav-pill {
    justify-content: space-between;
    width: 100%;
  }

  .app-navbar .nav-link {
    padding: .72rem .82rem;
  }

  .app-nav-menu,
  .app-user-menu {
    width: 100%;
    margin: 4px 0 8px;
    border-color: rgba(244, 200, 115, .18);
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: none;
  }

  .app-user-dropdown {
    margin-left: 0;
  }

  .app-navbar .nav-link.nav-login-button {
    justify-content: center;
    width: 100%;
  }

  .university-hero {
    height: auto;
    min-height: auto;
    padding: 38px 18px 34px;
  }

  .landing-hero-bg {
    object-position: 58% center;
  }

  .university-hero::before {
    background:
      linear-gradient(180deg, rgba(4, 17, 34, .88) 0%, rgba(6, 25, 48, .64) 45%, rgba(4, 17, 34, .82) 100%),
      linear-gradient(90deg, rgba(4, 17, 34, .7), rgba(6, 25, 48, .26));
  }

  .university-hero::after {
    background-size: 760px auto;
    background-position: 58% 42%;
    opacity: .62;
  }

  .landing-hero h1 {
    max-width: 100%;
    font-size: clamp(2.7rem, 12vw, 3.25rem);
    line-height: .96;
  }

  .landing-hero p {
    font-size: 1.08rem;
  }

  .landing-actions {
    margin-top: 26px;
  }

  .landing-actions .btn.hero-login-button {
    width: 100%;
    min-height: 54px;
  }

  .landing-schedule-preview {
    width: 100%;
    padding: 14px;
  }

  .schedule-preview-header {
    align-items: center;
    flex-direction: row;
  }

  .schedule-preview-lesson {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .landing-transition {
    height: 42px;
  }

  .landing-feature-grid {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 520px);
    margin-top: -10px;
  }

  .landing-feature-card {
    min-height: 154px;
  }
}
.schedule-build-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: 1rem;
}

.schedule-cancel-button {
    color: #ead8c2;
    background: #241d1b;
    border: 1px solid #8f5548;
}

.schedule-cancel-button:hover,
.schedule-cancel-button:focus {
    color: #fff4e8;
    background: #342421;
    border-color: #ad6958;
}

.schedule-cancel-confirm {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(18, 13, 11, .78);
}

.schedule-cancel-confirm.d-none { display: none !important; }

.schedule-cancel-confirm-card {
    width: min(31rem, 100%);
    padding: 1.4rem;
    color: #eadfce;
    background: #211b18;
    border: 1px solid #8f6950;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .45);
}

.schedule-cancel-confirm-card h3 { color: #f1d7a8; font-size: 1.2rem; }
.teacher-general-remark-card {
  max-width: 920px;
  margin-inline: auto;
  padding: clamp(1rem, 2.5vw, 1.75rem);
}

.teacher-portal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .75rem; }
.teacher-workload-filter { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(140px, .55fr) minmax(170px, .8fr) auto; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.teacher-workload-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.teacher-workload-summary .app-card { display: grid; gap: .35rem; padding: 1rem 1.25rem; }
.teacher-workload-summary span { color: #64748b; }
.teacher-workload-summary strong { color: var(--bronze-dark); font-size: 1.8rem; }
.teacher-workload-types { display: flex; flex-wrap: wrap; gap: .6rem 1.25rem; margin: 1rem 0; }
.teacher-workload-table-wrap { overflow-x: auto; }
.teacher-workload-table { min-width: 880px; margin-bottom: 0; }
.workload-progress { white-space: nowrap; font-weight: 700; }
.teacher-workload-empty { color: #64748b; }

@media (max-width: 768px) {
  .teacher-portal-actions { justify-content: stretch; margin-top: 1rem; }
  .teacher-portal-actions .btn { flex: 1 1 100%; margin-top: 0; }
  .teacher-workload-filter, .teacher-workload-summary { grid-template-columns: 1fr; }
  .teacher-workload-filter .btn { width: 100%; }
}

.teacher-general-remark-form {
  display: grid;
  gap: 1rem;
}

.teacher-general-remark-textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 1rem;
  font-size: 1.05rem;
  line-height: 1.55;
}

.teacher-general-remark-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 600px) {
  .teacher-general-remark-textarea {
    min-height: 160px;
  }

  .teacher-general-remark-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-general-remark-actions .btn {
    width: 100%;
  }
}

.teacher-placement-picker { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .6fr) auto; gap: 1rem; align-items: end; margin-bottom: 1.5rem; }
.teacher-placement-wide { grid-column: 1 / -1; }
.teacher-kug-readonly h2 { font-size: 1.25rem; margin-bottom: .8rem; }
.teacher-kug-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.teacher-kug-grid .app-card { display: grid; gap: .35rem; padding: 1rem; }
.teacher-kug-grid span, .teacher-kug-grid small { color: #64748b; }
.teacher-placement-save { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: end; }
@media (max-width: 768px) {
  .teacher-placement-picker, .teacher-placement-save { grid-template-columns: minmax(0, 1fr); }
  .teacher-placement-picker .btn, .teacher-placement-save .btn { width: 100%; }
  .teacher-placement-picker select, .teacher-placement-save select { width: 100%; max-width: 100%; }
}

/* Classroom selection and week parity controls. */
.occupancy-calendar-picker {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
}
.occupancy-calendar-picker legend {
  float: none;
  font-size: .82rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.occupancy-calendar-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.occupancy-calendar-buttons .btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 52px;
  padding: 8px;
  font-size: .85rem;
}
.occupancy-calendar-buttons small { font-size: .75rem; }
.classroom-occupancy-filters .occupancy-week-picker {
  min-width: 0;
  margin: 0;
  grid-column: span 2;
}
.occupancy-week-picker legend {
  float: none;
  font-size: .82rem;
  font-weight: 800;
  margin-bottom: 5px;
}
.occupancy-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  margin-top: 20px;
  scroll-margin-top: 80px;
}
.occupancy-workspace-results { min-width: 0; }
.occupancy-empty-room { margin-bottom: 12px; padding: 14px 16px; }
.occupancy-empty-room > summary { cursor: pointer; overflow-wrap: anywhere; }
.occupancy-empty-room > summary span { display: block; margin-top: 4px; font-size: .85rem; }
.occupancy-empty-room[open] > summary { margin-bottom: 16px; }
.occupancy-workspace-results .classroom-occupancy-stats { margin-top: 0; }
.occupancy-workspace .occupancy-room-picker { min-width: 0; padding: 16px; }
.occupancy-workspace .classroom-occupancy-table { min-width: 940px; }
.occupancy-workspace .classroom-occupancy-table th,
.occupancy-workspace .classroom-occupancy-table td { width: 100px; }
.occupancy-workspace .classroom-occupancy-table .occupancy-sticky-col {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
}
@media (max-width: 991.98px) {
  .occupancy-workspace { grid-template-columns: minmax(0, 1fr); }
}
.occupancy-room-picker > p { margin: 4px 0 12px; font-size: .9rem; }
.occupancy-room-address { margin-top: 16px; }
.occupancy-room-address h3 { font-size: .95rem; margin-bottom: 8px; }
.occupancy-room-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.occupancy-room-buttons .btn { min-width: 54px; min-height: 44px; }
@media (max-width: 575.98px) {
  .classroom-occupancy-filters .occupancy-week-picker { grid-column: 1 / -1; }
}
