/* Grid tables, filters, and pagination */

.table-wrap {
  margin: 5px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--grid-line);
  border-radius: 16px;
  background: var(--glass-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: var(--glass-surface);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 10px;
  font-size: 0.81rem;
  font-weight: 700;
  text-align: center;
  color: var(--grid-head-text);
  background: var(--grid-head);
  border-bottom: 1px solid var(--grid-row-line);
  white-space: nowrap;
}

tbody td {
  padding: 10px 3px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--grid-row-line);
  text-align: center;
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--grid-hover);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-empty-cell {
  padding: 38px 16px;
  text-align: center;
  color: var(--text-dim);
  font-weight: 700;
  vertical-align: middle;
}

.table-body.is-empty {
  height: 100%;
}

.table-body.is-empty > .table-empty-row {
  height: 100%;
}

.table-body.is-empty > .table-empty-row > .table-empty-cell {
  height: 100%;
}

.table-wrap.is-empty > table {
  min-height: 100%;
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--glass-surface);
  border: 1px solid var(--line);
  color: var(--glass-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.filter-chip.active {
  background: var(--glass-bg);
  border-color: var(--glass-line);
  color: var(--glass-link);
}

.result-grid-card .filter-strip + .table-wrap {
  margin-top: 12px;
}

.result-grid-card thead th {
  overflow: visible;
}

.result-grid-card tbody tr {
  height: var(--grid-row-height);
}

.result-grid-card tbody tr.is-clickable {
  cursor: pointer;
}

.result-grid-card tbody tr.is-selected {
  background: rgba(var(--glass-primary-rgb), 0.12);
}

.result-grid-card tbody tr.is-selected:hover {
  background: rgba(var(--glass-primary-rgb), 0.18);
}

.result-grid-card tbody td {
  height: var(--grid-row-height);
  padding: 3px 3px;
  vertical-align: middle;
}

.result-grid-card th.table-header-enhanced {
  padding: 4px 6px;
}

.table-header-shell {
  position: relative;
  display: block;
  width: 100%;
}

.table-header-shell.has-filter {
  padding-right: 24px;
}

.table-header-shell.no-filter {
  padding-right: 0;
}

.table-sort-button,
.table-filter-button,
.table-filter-close,
.table-filter-clear {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.table-sort-button {
  min-width: 0;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  color: var(--glass-muted);
  text-align: center;
}

.table-header-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-sort-icon {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  color: var(--glass-muted);
  font-size: 10px;
  line-height: 1;
}

.table-sort-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10px;
}

.table-sort-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 13px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--glass-bg);
  color: var(--glass-link);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.table-sort-order-hidden {
  display: none;
}

.result-grid-card th.sorted-asc .table-sort-button,
.result-grid-card th.sorted-desc .table-sort-button {
  color: var(--glass-ink);
}

.result-grid-card th.sorted-asc .table-sort-icon,
.result-grid-card th.sorted-desc .table-sort-icon {
  color: var(--glass-link);
}

.table-filter-button {
  position: absolute;
  top: 50%;
  right: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transform: translateY(-50%);
  color: var(--glass-muted);
}

.table-filter-button:hover,
.table-filter-close:hover,
.table-filter-clear:hover {
  background: var(--glass-bg);
}

.table-filter-glyph {
  width: 11px;
  height: 11px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M2 3.5A1.5 1.5 0 0 1 3.5 2h9A1.5 1.5 0 0 1 14 3.5c0 .4-.16.78-.44 1.06L10 8.12V13a.75.75 0 0 1-1.12.65l-2-1.14A.75.75 0 0 1 6.5 11.86V8.12L2.44 4.56A1.5 1.5 0 0 1 2 3.5Z'/%3E%3C/svg%3E")
    center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M2 3.5A1.5 1.5 0 0 1 3.5 2h9A1.5 1.5 0 0 1 14 3.5c0 .4-.16.78-.44 1.06L10 8.12V13a.75.75 0 0 1-1.12.65l-2-1.14A.75.75 0 0 1 6.5 11.86V8.12L2.44 4.56A1.5 1.5 0 0 1 2 3.5Z'/%3E%3C/svg%3E")
    center/contain no-repeat;
}

.result-grid-card th.filter-active .table-filter-button {
  background: var(--glass-bg);
  color: var(--glass-link);
}

.table-filter-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  width: min(320px, calc(100vw - 24px));
  max-height: min(540px, calc(100vh - 24px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background: var(--glass-surface);
  box-shadow: var(--glass-dialog-shadow);
  z-index: 1500;
}

.table-filter-menu-overlay {
  z-index: 1500;
}

.table-filter-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.table-filter-menu-header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--glass-ink);
  font-size: 14px;
}

.table-filter-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: var(--glass-muted);
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.table-filter-search {
  display: grid;
  gap: 6px;
}

.table-filter-search span {
  color: var(--glass-muted);
  font-size: 11px;
  font-weight: 700;
}

.table-filter-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--glass-line);
  border-radius: 11px;
  background: var(--glass-surface);
  color: var(--glass-ink);
  font: inherit;
  font-size: 13px;
}

.table-filter-search input:focus {
  outline: none;
  border-color: var(--glass-line);
  box-shadow: 0 0 0 3px rgba(var(--glass-primary-rgb), 0.12);
}

.table-filter-option-list {
  display: grid;
  gap: 4px;
  max-height: 248px;
  padding-right: 4px;
  overflow: auto;
}

.table-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--glass-ink);
  font-size: 13px;
  cursor: pointer;
}

.table-filter-option:hover {
  background: var(--glass-surface);
}

.table-filter-option-all {
  padding: 0 0 10px;
  border-bottom: 1px solid var(--glass-line);
  border-radius: 0;
  font-weight: 700;
}

.table-filter-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--glass-primary);
  flex: 0 0 auto;
}

.table-filter-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-filter-empty {
  padding: 18px 10px;
  text-align: center;
  color: var(--glass-muted);
  font-size: 12px;
}

.table-filter-menu-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  background: var(--glass-surface);
  color: var(--accent-strong);
  border: 1px solid var(--glass-line);
}

.row-action-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-grid-card .table-wrap {
  scrollbar-gutter: stable;
}

.applicant-admin-grid-card {
  --applicant-history-status-width: 94px;
  --applicant-history-action-width: 58px;
}

.applicant-admin-grid-card.is-empty-grid {
  min-height: clamp(420px, calc(100vh - 240px), 760px);
}

.table-header-static {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 8px;
}

.table-inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.table-inline-actions-compact {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.table-inline-actions-dual {
  display: inline-grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.table-inline-actions-reserved::before,
.table-inline-actions-reserved::after {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  visibility: hidden;
  pointer-events: none;
  grid-row: 1;
  box-sizing: border-box;
  content: "";
}

.table-inline-actions-reserved::before {
  grid-column: 1;
  content: "저장";
}

.table-inline-actions-reserved::after {
  grid-column: 2;
  content: "취소";
}

.table-inline-button-span-2 {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
}

.table-inline-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(var(--glass-line-rgb), 0.92);
  border-radius: 10px;
  background: var(--glass-surface);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  transition: border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.table-inline-icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 10px;
}

.table-inline-icon-button .button-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.table-inline-button:hover,
.table-inline-button:focus-visible {
  border-color: rgba(var(--glass-primary-rgb), 0.62);
  box-shadow: 0 0 0 3px rgba(var(--glass-primary-rgb), 0.12);
}

.table-inline-button.primary {
  color: #ffffff;
  border-color: rgba(var(--glass-primary-rgb), 0.94);
  background: var(--glass-button);
}

.table-inline-button.danger {
  color: var(--glass-error);
  border-color: var(--glass-error-line);
  background: var(--glass-error-bg);
}

.table-inline-input,
.table-inline-select {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(var(--glass-line-rgb), 0.95);
  border-radius: 10px;
  background: var(--glass-surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}

.table-inline-input:focus,
.table-inline-select:focus {
  outline: none;
  border-color: rgba(var(--glass-primary-rgb), 0.72);
  box-shadow: 0 0 0 3px rgba(var(--glass-primary-rgb), 0.12);
}

.result-grid-card th:first-child,
.result-grid-card td:first-child {
  width: 64px;
  min-width: 64px;
  text-align: center;
}

.result-grid-card th.row-number-col,
.result-grid-card td.row-number-col {
  width: 64px;
  min-width: 64px;
  text-align: center;
}

.result-grid-card th.select-col,
.result-grid-card td.select-col {
  width: 64px;
  min-width: 64px;
  text-align: center;
}

.result-grid-card .select-col input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.result-grid-card th.table-action-column,
.result-grid-card td.table-action-column {
  width: 1%;
  min-width: 0;
  padding-left: 5px;
  padding-right: 5px;
  text-align: center;
}

.result-grid-card th.table-action-column .table-header-static {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.applicant-admin-grid-card th.table-column-detailAction .table-header-static,
.applicant-admin-grid-card th.table-column-deleteAction .table-header-static,
.applicant-admin-grid-card th.table-column-promoteAction .table-header-static {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.applicant-admin-grid-card th.table-column-statusLabel,
.applicant-admin-grid-card td.table-column-statusLabel {
  width: var(--applicant-history-status-width);
  min-width: var(--applicant-history-status-width);
  max-width: var(--applicant-history-status-width);
}

.applicant-admin-grid-card th.table-column-detailAction,
.applicant-admin-grid-card td.table-column-detailAction,
.applicant-admin-grid-card th.table-column-deleteAction,
.applicant-admin-grid-card td.table-column-deleteAction {
  width: var(--applicant-history-action-width);
  min-width: var(--applicant-history-action-width);
  max-width: var(--applicant-history-action-width);
}

.applicant-admin-grid-card td.table-column-statusLabel,
.applicant-admin-grid-card td.table-column-detailAction,
.applicant-admin-grid-card td.table-column-deleteAction {
  padding-left: 4px;
  padding-right: 4px;
}

.applicant-admin-grid-card .table-column-statusLabel .applicant-status-chip {
  min-width: 72px;
  padding: 6px 8px;
}

.applicant-admin-grid-card .table-column-detailAction .table-inline-icon-button,
.applicant-admin-grid-card .table-column-deleteAction .table-inline-icon-button {
  margin: 0 auto;
}

.result-grid-card.has-print-column th:last-child,
.result-grid-card.has-print-column td:last-child {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  text-align: center;
}

.result-grid-card table {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
}

.table-cell-text {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: inherit;
}

.table-cell-text strong {
  font: inherit;
  font-weight: 700;
}

.table-cell-tooltip {
  position: fixed;
  z-index: 1200;
  max-width: min(480px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(var(--glass-line-rgb), 0.34);
  border-radius: 12px;
  background: rgba(var(--glass-shadow-rgb), 0.94);
  color: var(--glass-surface);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
  box-shadow: var(--glass-dialog-shadow);
  pointer-events: none;
}

.account-management-table {
  --account-inline-field-height: 34px;
  --account-edit-action-width: 96px;
  --account-reset-action-width: 70px;
  --account-delete-action-width: 58px;
}

.examinee-data-table th.table-column-date,
.examinee-data-table td.table-column-date {
  width: 96px;
}

.examinee-data-table th.table-column-time,
.examinee-data-table td.table-column-time {
  width: 82px;
}

.examinee-data-table th.table-column-track,
.examinee-data-table td.table-column-track {
  width: 116px;
}

.examinee-data-table th.table-column-admission,
.examinee-data-table td.table-column-admission {
  width: 112px;
}

.examinee-data-table th.table-column-series,
.examinee-data-table td.table-column-series {
  width: 80px;
}

.examinee-data-table th.table-column-unit,
.examinee-data-table td.table-column-unit {
  width: 116px;
}

.examinee-data-table th.table-column-major,
.examinee-data-table td.table-column-major {
  width: 92px;
}

.examinee-data-table th.table-column-building,
.examinee-data-table td.table-column-building {
  width: 116px;
}

.examinee-data-table th.table-column-room,
.examinee-data-table td.table-column-room {
  width: 88px;
}

.examinee-data-table th.table-column-group,
.examinee-data-table td.table-column-group {
  width: 68px;
}

.examinee-data-table th.table-column-examineeNo,
.examinee-data-table td.table-column-examineeNo {
  width: 122px;
}

.examinee-data-table th.table-column-name,
.examinee-data-table td.table-column-name {
  width: 86px;
}

.examinee-data-table th.table-column-birth,
.examinee-data-table td.table-column-birth {
  width: 112px;
}

.examinee-data-table th.table-column-hasPhoto,
.examinee-data-table td.table-column-hasPhoto {
  width: 68px;
}

.print-history-table th.table-column-printedAt,
.print-history-table td.table-column-printedAt {
  width: 136px;
}

.examinee-registration-table table {
  min-width: 1360px;
}

.admit-card-lookup-table table {
  min-width: 1490px;
}

.print-history-table table {
  min-width: 1450px;
}

.account-management-table table {
  min-width: 1120px;
}

.account-management-table th.table-column-id,
.account-management-table td.table-column-id {
  width: 130px;
}

.account-management-table th.table-column-name,
.account-management-table td.table-column-name {
  width: 160px;
}

.account-management-table th.table-column-role,
.account-management-table td.table-column-role {
  width: 120px;
}

.account-management-table th.table-column-recentAccess,
.account-management-table td.table-column-recentAccess {
  width: 210px;
}

.account-management-table th.table-column-editAction,
.account-management-table td.table-column-editAction {
  width: var(--account-edit-action-width);
  min-width: var(--account-edit-action-width);
  max-width: var(--account-edit-action-width);
}

.account-management-table th.table-column-resetAction,
.account-management-table td.table-column-resetAction {
  width: var(--account-reset-action-width);
  min-width: var(--account-reset-action-width);
  max-width: var(--account-reset-action-width);
}

.account-management-table th.table-column-deleteAction,
.account-management-table td.table-column-deleteAction {
  width: var(--account-delete-action-width);
  min-width: var(--account-delete-action-width);
  max-width: var(--account-delete-action-width);
}

.account-management-table td.table-column-editAction,
.account-management-table td.table-column-resetAction,
.account-management-table td.table-column-deleteAction {
  padding-left: 4px;
  padding-right: 4px;
}

.account-management-table .table-column-editAction .table-inline-actions-dual {
  gap: 3px;
}

.account-management-table .table-column-editAction .table-inline-actions-reserved::before,
.account-management-table .table-column-editAction .table-inline-actions-reserved::after,
.account-management-table .table-column-editAction .table-inline-button,
.account-management-table .table-column-resetAction .table-inline-button,
.account-management-table .table-column-deleteAction .table-inline-button {
  padding: 0 8px;
}

.account-management-table .table-column-editAction .table-inline-button-span-2 {
  width: auto;
  justify-self: center;
}

.account-management-table .table-column-editAction .table-inline-icon-button,
.account-management-table .table-column-resetAction .table-inline-icon-button,
.account-management-table .table-column-deleteAction .table-inline-icon-button {
  margin: 0 auto;
}

.account-management-table .table-inline-input,
.account-management-table .table-inline-select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.account-management-table .table-inline-field-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: var(--account-inline-field-height);
}

.account-management-table .table-inline-field-shell > .table-inline-input,
.account-management-table .table-inline-field-shell > .table-inline-select {
  position: absolute;
  inset: 0;
}

.account-management-table td.table-column-id,
.account-management-table td.table-column-name,
.account-management-table td.table-column-role,
.account-management-table td.table-column-recentAccess {
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-management-table td.table-column-name strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 9px 14px;
}

.table-page-size {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.table-page-size > span {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.table-page-size-select {
  position: relative;
  min-width: 90px;
}

.page-size-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  min-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: var(--glass-surface);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.page-size-caret {
  color: var(--glass-muted);
  font-size: 0.65rem;
}

.page-size-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: max(100%, 90px);
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: var(--glass-surface);
  box-shadow: var(--glass-dialog-shadow);
  z-index: 5;
}

.page-size-option {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--glass-surface);
  color: var(--glass-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.page-size-option.active,
.page-size-option:hover {
  background: var(--glass-surface);
  color: var(--glass-ink);
}

.table-pagination-actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.table-pagination-summary {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  text-align: right;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
}

.table-pagination-ellipsis {
  padding: 0 2px;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
}

.page-btn {
  min-width: 36px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: var(--glass-surface);
  color: var(--glass-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

