/* 班级座位页 · 与班牌终端 seat-map 视觉一致 */
.class-seats-page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 180px);
  margin: -16px -20px -20px;
  padding: 0;
  background: linear-gradient(180deg, #e8f4fc 0%, #f5f7fa 40%);
  border-radius: 4px;
  overflow: hidden;
}

.seats-module-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(48, 65, 86, 0.92);
  color: #fff;
  flex-shrink: 0;
}

.seats-module-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.seats-module-header__sub {
  font-size: 12px;
  opacity: 0.85;
  min-width: 100px;
  text-align: right;
}

.seats-module-header .form-page__back {
  margin: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.seats-module-body {
  flex: 1;
  min-height: 0;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
}

.module-body--seat {
  flex: 1;
  min-height: 480px;
}

.seat-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.seat-workspace .seat-map {
  flex: 1;
  min-width: 0;
}

.seat-roster-panel {
  width: 168px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  padding: 12px 10px;
  box-shadow: 0 2px 10px rgba(52, 136, 255, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.seat-roster-panel__title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #37474f;
}

.seat-roster-panel__count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: #fff3e0;
  color: #e65100;
  font-size: 12px;
  text-align: center;
}

.seat-roster-panel__meta {
  margin: 0 0 8px;
  font-size: 10px;
  line-height: 1.45;
  color: #90a4ae;
}

.seat-roster-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}

.seat-roster-panel__list li {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}

.seat-roster-panel__item {
  display: block;
  width: 100%;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #455a64;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f5f7fa;
}

.seat-roster-panel__item:hover {
  background: #e3f2fd;
}

.seat-roster-panel__item.is-selected {
  background: #1565c0;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.35);
}

.class-seats-page .seat-cell--selected .seat-cell__desk {
  box-shadow: 0 0 0 2px #1565c0;
  outline: 2px solid rgba(21, 101, 192, 0.45);
}

.class-seats-page .seat-map__toolbar--pick {
  background: linear-gradient(90deg, rgba(255, 152, 0, 0.1), rgba(21, 101, 192, 0.08));
}

.class-seats-page .seat-cell--pick:not(.seat-cell--empty) .seat-cell__bar {
  display: block;
}

.seat-roster-panel__empty {
  font-size: 11px;
  color: #90a4ae;
  padding: 8px 4px;
}

.seat-layout-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: #f0f4f8;
  flex-shrink: 0;
}

.seat-layout-bar__label {
  font-size: 11px;
  font-weight: 700;
  color: #546e7a;
}

.seat-layout-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.class-seats-page .seat-map__btn--sm {
  padding: 4px 10px;
  font-size: 10px;
}

.class-seats-page .seat-map {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(52, 136, 255, 0.08);
}

.class-seats-page .seat-map__grid-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.class-seats-page .seat-map__grid {
  flex: 1;
  height: 100%;
  display: grid;
  grid-template-columns: 32px repeat(var(--seat-cols, 8), minmax(0, 1fr));
  grid-template-rows: auto repeat(var(--seat-rows, 7), minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  min-height: 0;
}

.class-seats-page .seat-map__col-head,
.class-seats-page .seat-map__row-head {
  font-size: 10px;
  font-weight: 700;
  color: #78909c;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.class-seats-page .seat-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.class-seats-page .seat-cell__bar {
  height: 4px;
  border-radius: 2px;
  background: transparent;
}

.class-seats-page .seat-cell__bar--present { background: #2ecc71; }
.class-seats-page .seat-cell__bar--absent { background: #e74c3c; }
.class-seats-page .seat-cell__bar--late { background: #3498db; }
.class-seats-page .seat-cell__bar--leave { background: #95a5a6; }

.class-seats-page .seat-cell__desk {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ecf0f1;
  color: #2d3436;
  font-size: clamp(9px, 1.2vw, 13px);
  font-weight: 700;
  text-align: center;
  padding: 4px 2px;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 0;
}

.class-seats-page .seat-cell:not(.seat-cell--pick):not(.seat-cell--empty) .seat-cell__bar {
  display: none;
}

.class-seats-page .seat-cell--present .seat-cell__desk {
  background: linear-gradient(180deg, #6ee7a0 0%, #2ecc71 100%);
  color: #0d3d26;
  box-shadow: inset 0 0 0 1px rgba(39, 174, 96, 0.35);
}

.class-seats-page .seat-cell--late .seat-cell__desk {
  background: linear-gradient(180deg, #74b9ff 0%, #3498db 100%);
  color: #0a2e4d;
}

.class-seats-page .seat-cell--absent .seat-cell__desk {
  background: linear-gradient(180deg, #ff7675 0%, #e74c3c 100%);
  color: #4a0f0f;
}

.class-seats-page .seat-cell--leave .seat-cell__desk {
  background: linear-gradient(180deg, #bdc3c7 0%, #95a5a6 100%);
  color: #2d3436;
}

.class-seats-page .seat-cell--empty .seat-cell__desk {
  background: rgba(236, 240, 241, 0.8);
  color: #b2bec3;
}

.class-seats-page .seat-map__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  flex-shrink: 0;
}

.class-seats-page .seat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 10px;
  color: #455a64;
}

.class-seats-page .seat-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.class-seats-page .seat-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.class-seats-page .seat-legend__dot--absent { background: #e74c3c; }
.class-seats-page .seat-legend__dot--late { background: #3498db; }
.class-seats-page .seat-legend__dot--present { background: #2ecc71; }
.class-seats-page .seat-legend__dot--leave { background: #95a5a6; }

.class-seats-page .seat-map__actions {
  display: flex;
  gap: 8px;
}

.class-seats-page .seat-map__btn {
  border: none;
  background: #e8f2ff;
  color: #1565c0;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

.class-seats-page .seat-map__btn--primary {
  background: linear-gradient(90deg, #d4ff4d 0%, #b8f52a 22%, #7aed9a 52%, #5eead4 88%, #4dd4e8 100%);
  color: #000;
  box-shadow: 0 4px 12px rgba(94, 234, 212, 0.35);
}

.class-seats-page .seat-map__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  margin: -2px -2px 6px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(29, 78, 216, 0.12), rgba(94, 234, 212, 0.18));
  flex-shrink: 0;
}

.class-seats-page .seat-map__toolbar-text {
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
}

.class-seats-page .seat-map__toolbar-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: #546e7a;
}

.class-seats-page button.seat-cell {
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  background: transparent;
  width: 100%;
  height: 100%;
}

.class-seats-page .seat-cell--edit .seat-cell__desk {
  background: rgba(232, 242, 255, 0.95);
  color: #2d3436;
}

.class-seats-page .seat-cell--selected .seat-cell__desk {
  box-shadow: inset 0 0 0 2px #1d4ed8, 0 0 0 2px rgba(29, 78, 216, 0.25);
}

.class-seats-page .seat-dialog {
  position: absolute;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.class-seats-page .seat-dialog[hidden] {
  display: none !important;
}

.class-seats-page .seat-dialog__panel {
  width: min(100%, 420px);
  max-height: calc(100% - 20px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.class-seats-page .seat-dialog__panel h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.class-seats-page .seat-dialog__hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: #78909c;
}

.class-seats-page .seat-arrange__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.class-seats-page .seat-arrange__option {
  border: 1px solid #dfe6e9;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}

.class-seats-page .seat-arrange__option.is-active {
  border-color: #2563eb;
  background: #e8f2ff;
  color: #1d4ed8;
}

.class-seats-page .seat-arrange__check {
  display: flex;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 8px;
}

.class-seats-page .seat-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.class-seats-page .seat-dialog__btn {
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(90deg, #d4ff4d, #5eead4);
  color: #000;
}

.class-seats-page .seat-dialog__btn--ghost {
  background: #f1f5f9;
  color: #546e7a;
}

.class-seats-page .seat-nonatt-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 220px;
  overflow: auto;
}

.class-seats-page .seat-nonatt-list__item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f5;
  font-size: 13px;
}

.class-seats-page .seat-toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 8px 16px;
  background: rgba(48, 65, 86, 0.92);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
}

.class-seats-page .seat-toast[hidden] {
  display: none !important;
}

.page-panel:has(.class-seats-page) {
  padding: 0;
  background: transparent;
  box-shadow: none;
}
