/* 年末調整の確認作業を、絞り込み → 選択 → 処理の順に追えるワークキューとして構成する。 */
.grid-page {
  --grid-border: #d8dee8;
  --grid-border-strong: #b8c2d1;
  --grid-muted: #64748b;
  --grid-surface-subtle: #f7f9fc;
  --grid-accent-soft: #eff6ff;
  font-size: 13px;
  line-height: 1.5;
  color: #1f2937;
}

.grid-filter-panel {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid var(--grid-border);
  border-radius: 10px;
  background: #fff;
}

.grid-filter-heading,
.grid-results-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.grid-filter-heading {
  margin-bottom: 14px;
}

.grid-filter-heading h2,
.grid-results-header h2 {
  margin: 0;
  color: #182235;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.grid-filter-heading p,
.grid-results-header p {
  margin: 2px 0 0;
  color: var(--grid-muted);
  font-size: 12px;
}

.grid-filter-count {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  color: #1d4ed8;
  background: var(--grid-accent-soft);
  font-size: 11px;
  font-weight: 700;
}

.grid-filters {
  min-width: 0;
}

.grid-filter-field {
  min-width: 0;
}

.grid-filter-field label {
  display: block;
  margin-bottom: 5px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.grid-filter-field small {
  display: block;
  margin-top: 4px;
  color: var(--grid-muted);
  font-size: 10px;
}

.grid-filter-field select,
.grid-filter-field input[type="text"],
.grid-display-options select {
  height: 36px;
  border: 1px solid var(--grid-border-strong);
  border-radius: 6px;
  color: #1e293b;
  background-color: #fff;
  font-size: 13px;
}

.grid-filter-field select,
.grid-display-options select {
  padding: 0 32px 0 10px;
}

.grid-filter-field input[type="text"] {
  padding: 0 10px;
}

.grid-filter-field select:focus,
.grid-filter-field input[type="text"]:focus,
.grid-display-options select:focus {
  border-color: #2563eb;
  outline: 2px solid rgb(37 99 235 / 18%);
  outline-offset: 1px;
}

.grid-filter-field select:disabled {
  color: #64748b;
  background-color: #f1f5f9;
  cursor: not-allowed;
}

.grid-filter-details {
  min-width: 0;
  padding-top: 2px;
  border-top: 1px solid #edf0f4;
}

.grid-filter-details summary {
  width: fit-content;
  margin: 8px 0 0;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.grid-filter-details[open] summary {
  margin-bottom: 12px;
}

.grid-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.grid-filter-reset {
  color: #475569;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.grid-results {
  overflow: hidden;
  border: 1px solid var(--grid-border);
  border-radius: 10px;
  background: #fff;
}

.grid-results-header {
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--grid-border);
}

.grid-results-header strong {
  color: #182235;
  font-variant-numeric: tabular-nums;
}

.grid-display-options {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.grid-display-options label {
  flex: none;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.grid-display-options select {
  width: 150px;
  min-width: 0;
}

.bulk-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--grid-border);
  background: var(--grid-surface-subtle);
}

.bulk-selection-status {
  display: flex;
  min-width: 190px;
  flex-direction: column;
  margin-right: 4px;
}

.bulk-selection-status span {
  color: #1e293b;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bulk-selection-status small {
  color: var(--grid-muted);
  font-size: 10px;
}

.bulk-toolbar .btn:disabled {
  border-color: #d7dde6;
  color: #94a3b8;
  background: #eef1f5;
  box-shadow: none;
  opacity: 1;
}

.grid-table-wrapper {
  max-width: 100%;
  overflow-x: auto;
}

.grid-table {
  font-size: 12px;
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}

.grid-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 38px;
  padding: 0 12px;
  font-size: 11px;
  letter-spacing: 0.03em;
  font-weight: 700;
  color: #526075;
  white-space: nowrap;
  background-color: #f5f7fa;
  border-bottom: 1px solid var(--grid-border);
}

.grid-table tbody tr {
  outline: none;
}

.grid-table tbody tr:not(.clear-band-header):not(.grid-empty-row):hover {
  background-color: #f8fbff;
}

.grid-table tbody tr.grid-row-active {
  background-color: #eff6ff;
}

.grid-table tbody tr:focus {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

.grid-table td {
  height: 46px;
  padding: 7px 12px;
  border-bottom: 1px solid #e8ecf1;
  color: #334155;
  vertical-align: middle;
}

.grid-table td[data-column-id="full_name"] {
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
}

.grid-table td[data-column-id="detail"] a {
  font-weight: 700;
  text-decoration: none;
}

.grid-table tbody tr:last-child td {
  border-bottom: 0;
}

.grid-empty-row td {
  height: 150px;
  text-align: center;
}

.grid-empty-row strong,
.grid-empty-row span {
  display: block;
}

.grid-empty-row strong {
  color: #334155;
  font-size: 14px;
}

.grid-empty-row span {
  margin-top: 4px;
  color: var(--grid-muted);
}

/* D13: 編集可列の極淡背景 (Phase B で適用) */
.grid-table td[data-editable="true"] {
  background-color: #fafbfc;
}

.grid-meta {
  font-size: 11px;
}

/* tabular-nums は数値列のみ */
.grid-table td.numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 767px) {
  .grid-filter-panel {
    padding: 14px 12px;
  }

  .grid-filter-heading,
  .grid-results-header {
    align-items: stretch;
    flex-direction: column;
  }

  .grid-filter-count {
    align-self: flex-start;
  }

  .grid-filter-actions {
    justify-content: space-between;
  }

  .grid-filter-actions .btn {
    min-width: 112px;
  }

  .grid-display-options {
    width: 100%;
  }

  .grid-display-options select {
    min-width: 0;
    flex: 1;
    width: auto;
  }

  .bulk-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .bulk-selection-status {
    width: 100%;
  }
}
