/* ================================================================
   data-table-8.css — テーブル（選択行の一括削除）
================================================================ */

:root {
  --dt8-primary: #2B7FE8;
  --dt8-border: #E2E8F0;
  --dt8-text: #1A2332;
  --dt8-text-sub: #5A6A7A;
  --dt8-head-bg: #F4F7FF;
  --dt8-selected-bg: #EBF2FF;
  --dt8-red: #EF4444;
  --dt8-red-dark: #DC2626;
  --dt8-red-light: #FEE2E2;
}

/* demo-container を縦積みレイアウトに変更（テーブル＋モーダル＋トースト） */
.demo-container {
  flex-direction: column;
  align-items: stretch;
  padding: 24px;
}

.dt8-wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* ===== ツールバー ===== */
.dt8-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dt8-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--dt8-text-sub);
}

.dt8-toolbar-actions { display: flex; gap: 8px; }

.dt8-clear-btn {
  padding: 6px 14px;
  font-size: 13px;
  color: var(--dt8-primary);
  background: #fff;
  border: 1.5px solid #C7D9F5;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s, border-color 0.15s;
}
.dt8-clear-btn:hover:not(:disabled) { background: #F0F6FF; border-color: var(--dt8-primary); }
.dt8-clear-btn:disabled { color: #A9B4C2; border-color: #E2E8F0; background: #F7F9FC; cursor: not-allowed; }

/* 削除ボタン：危険操作の強調色（赤系） */
.dt8-delete-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--dt8-red);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s;
}
.dt8-delete-btn:hover:not(:disabled) { background: var(--dt8-red-dark); }
.dt8-delete-btn:disabled { background: #E2E8F0; color: #A9B4C2; cursor: not-allowed; }

/* ===== テーブル ===== */
.dt8-table-scroll { overflow-x: auto; }

.dt8-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--dt8-text);
  background: #fff;
}

.dt8-table th,
.dt8-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--dt8-border);
  white-space: nowrap;
}

.dt8-table thead th {
  background: var(--dt8-head-bg);
  font-weight: 600;
  color: var(--dt8-text-sub);
}

.dt8-check-col { width: 44px; text-align: center; }
.dt8-id-col { width: 56px; }

.dt8-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--dt8-primary);
}

/* ホバー → 選択の順で定義し、選択ハイライトを優先させる */
.dt8-table tbody tr:hover td {
  background: #F4F7FF;
  transition: background 0.1s;
}

.dt8-table tbody tr.is-selected td {
  background: var(--dt8-selected-bg);
}

/* ===== 状態バッジ ===== */
.dt8-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.dt8-status[data-status="未着手"] { background: #F3F4F6; color: #6B7280; }
.dt8-status[data-status="対応中"] { background: #DBEAFE; color: #1E40AF; }
.dt8-status[data-status="完了"]   { background: #D1FAE5; color: #065F46; }

/* ================================================================
   削除確認モーダル（overlay-confirm-1 を踏襲）
================================================================ */
.dt8-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
/* hidden 属性と連動して非表示にする（.dt8-overlay は display:flex を持つため必須） */
.dt8-overlay[hidden] { display: none; }

.dt8-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
  padding: 20px;
  animation: dt8-pop 0.15s ease-out;
}

@keyframes dt8-pop {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.dt8-dialog--danger { border-top: 4px solid var(--dt8-red); }

.dt8-dialog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dt8-red-dark);
  margin: 0 0 10px;
}

.dt8-dialog-msg { font-size: 14px; color: #374151; line-height: 1.65; margin: 0 0 20px; }

.dt8-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.dt8-dialog-cancel {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  background: #fff;
  border: 1.5px solid var(--dt8-border);
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s;
}
.dt8-dialog-cancel:hover { background: #F9FAFB; }

.dt8-dialog-confirm {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--dt8-red-dark);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s;
}
.dt8-dialog-confirm:hover { background: #B91C1C; }

/* ================================================================
   Undoトースト（overlay-toast-1 を踏襲・複数スタック対応）
================================================================ */
.dt8-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  /* 新しいトーストを下に追加しつつ画面上では上に積む */
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: 340px;
  width: calc(100vw - 40px);
}

.dt8-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #22C55E;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.dt8-toast--show { opacity: 1; transform: translateX(0); }
.dt8-toast--hide { opacity: 0; transform: translateX(20px); }

.dt8-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  background: #DCFCE7; color: #16A34A;
}

.dt8-body { flex: 1; min-width: 0; }

.dt8-title {
  font-size: 13px; font-weight: 700; color: #1A2332;
  margin: 0 0 4px; line-height: 1.4;
}

/* Undoトースト固有の追加パーツ（overlay-toast-1 にはない） */
.dt8-undo-btn {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--dt8-primary);
  text-decoration: underline;
  cursor: pointer;
  font-family: sans-serif;
}
.dt8-undo-btn:hover { color: #1E63C4; }

.dt8-close {
  width: 20px; height: 20px;
  background: none; border: none;
  font-size: 12px; color: #9AA5B4;
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  font-family: sans-serif;
}
.dt8-close:hover { color: #5A6A7A; background: #F1F5F9; }

.dt8-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  border-radius: 0 0 0 10px;
  background: #22C55E;
  animation: dt8-countdown 3s linear forwards;
}

@keyframes dt8-countdown {
  from { width: 100%; }
  to   { width: 0; }
}

/* ================================================================
   リセットボタン（spec rule: 必ずページ専用CSSに書く）
================================================================ */
.demo-controls { margin-top: 12px; }

.reset-btn {
  padding: 6px 16px;
  font-size: 13px;
  color: #5A6A7A;
  background: #fff;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s, border-color 0.15s;
}
.reset-btn:hover { background: #F4F6F9; border-color: #9AA5B4; }

/* ================================================================
   スマホ対応
================================================================ */
@media (max-width: 600px) {
  .dt8-table th,
  .dt8-table td { padding: 8px 12px; }
  .dt8-toast-container { right: 10px; bottom: 10px; }
}
