/* 表部品 DataTable（static/table.js）の見た目。配色・余白は app.css の変数と部品（.panel .table .btn .input .select）を使う */

.dt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dt-bar-left,
.dt-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.dt-count {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.dt-gear {
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
}
.dt-gear svg {
  width: 16px;
  height: 16px;
}

/* 列の表示切替（歯車ボタンの下に出す） */
.dt-colwrap {
  position: relative;
  height: 0;
}
.dt-colmenu {
  position: absolute;
  right: 0;
  top: -6px;
  z-index: 30;
  width: min(280px, 100%);
  max-height: 360px;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
}
.dt-colmenu[hidden] {
  display: none;
}
.dt-colmenu-title {
  margin-bottom: 8px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-2);
}
.dt-colmenu-list {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}
.dt-colitem {
  align-items: center;
  min-height: 32px;
}

/* 表 */
.dt-panel {
  overflow: hidden;
}
.dt-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dt-wrap.is-loading .dt-table tbody {
  opacity: 0.55;
  transition: opacity 0.12s ease;
}
.dt-wrap:focus-visible {
  outline: none;
  box-shadow: inset var(--focus);
}
.dt-table {
  min-width: 720px;
}
.dt-table th,
.dt-table td {
  padding: 10px 14px;
}
.dt-th {
  position: relative;
}
.dt-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px -6px;
  padding: 4px 6px;
  appearance: none;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
}
.dt-sort:hover {
  color: var(--ink);
  background: var(--ai-50);
}
.dt-sort:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.dt-sort.is-asc,
.dt-sort.is-desc {
  color: var(--ai);
}
.dt-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-4);
  opacity: 0.55;
}
.dt-sort.is-asc .dt-arrow {
  border-top: 0;
  border-bottom: 5px solid var(--ai);
  opacity: 1;
}
.dt-sort.is-desc .dt-arrow {
  border-top: 5px solid var(--ai);
  opacity: 1;
}

/* 絞り込み行 */
.dt-filters .dt-fth {
  padding: 6px 10px;
  background: var(--surface);
  font-weight: 400;
}
.dt-filter {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 13px;
}
select.dt-filter {
  min-width: 84px;
  padding-left: 8px;
  padding-right: 22px;
  background-position: right 7px center;
}

/* セル */
.dt-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt-cell.is-wrap {
  white-space: normal;
  overflow-wrap: anywhere;
}
.dt-cell a {
  color: inherit;
}
.dt-cell.is-editable {
  cursor: text;
  min-width: 110px;
}
.dt-cell.is-editable:hover {
  background: var(--ai-50);
}
.dt-cell.is-editable:focus-visible {
  outline: none;
  box-shadow: inset var(--focus);
}
.dt-placeholder {
  color: var(--ink-4);
  font-size: 12px;
  opacity: 0;
}
.dt-cell.is-editable:hover .dt-placeholder,
.dt-cell.is-editable:focus-visible .dt-placeholder {
  opacity: 1;
}
.dt-cell.is-editing {
  padding: 4px 6px;
  overflow: visible;
  background: var(--surface);
}
.dt-cell.is-saving {
  opacity: 0.6;
}
.dt-input {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 14px;
}
.dt-textarea {
  min-height: 56px;
  min-width: 220px;
}
select.dt-input {
  padding-right: 28px;
  background-position: right 8px center;
}
.dt-empty {
  padding: 36px 20px;
  text-align: center;
  white-space: normal;
}
.dt-empty .empty-title {
  font-size: var(--fs-md);
}
.dt-empty .empty-text {
  margin: 6px 0 12px;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}

/* 下の帯（件数・ページ送り） */
.dt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.dt-foot[hidden] {
  display: none;
}
.dt-foot-left,
.dt-foot-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dt-per {
  width: auto;
  min-height: 34px;
  padding: 5px 30px 5px 10px;
  font-size: 13px;
}
.dt-pageinfo {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* 一覧ページの上の道具（検索・作戦の選択） */
.dt-toolbar {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
}
.dt-toolbar .input {
  min-height: 36px;
  padding-top: 5px;
  padding-bottom: 5px;
  min-width: 240px;
}

/* 状態のタブ（一覧ページで共通に使う） */
.dt-tabs {
  margin-top: 0;
}
.dt-tabs button .subnav-count {
  margin-left: 6px;
}
.dt-toolbar-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dt-toolbar-field .select {
  width: auto;
  min-width: 200px;
  min-height: 36px;
  padding-top: 5px;
  padding-bottom: 5px;
}
.dt-toolbar-label {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .dt-bar-right {
    width: 100%;
    justify-content: space-between;
  }
  .dt-colmenu {
    right: 0;
    left: 0;
    width: auto;
  }
}
