.print-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 1.4rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s ease;
}

.print-btn:hover {
  background: #005ecf;
}

.section-admin-dashboard {
  background: linear-gradient(to bottom right, #f9fafb, #eef5f0);
  min-height: 100vh;
  padding: 0;
}

/* ===== 管理ヘッダー ===== */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.6rem 3rem;
  background: var(--primary-color-tint-2);
  color: #fff;
}

.admin-nav {
  display: flex;
  gap: 2rem;
}

.admin-user-wrapper {
  display: flex;
  flex-direction: row;
  gap: 2rem;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.6rem;
  opacity: 0.95;
}

.admin-btn,
.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  color: var(--primary-color);
  border: none;
  font-size: 1.4rem;
  padding: 0.8rem 1.4rem;
  border-radius: 0.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-btn:hover,
.logout-btn:hover {
  background: var(--primary-color-tint-4);
  transform: translateY(-2px);
  color: var(--color-white);
}

/* ===== テーブルエリア ===== */

.admin-session-section {
  padding: 3rem 0 6rem;
}

.container-large {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  border-radius: 1rem;
  padding: 2rem 3rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  color: #333;
  margin-bottom: 2.5rem;
}

.date-tabs {
  width: 80%;
  margin: 0 auto;

  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.date-tabs .date-tab {
  background: transparent;
  border: 1.5px solid #ccc;
  border-radius: 99rem;
  padding: 0.6rem 1.4rem;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.date-tab:hover {
  background-color: var(--primary-color-tint-4);
  color: #fff;
  border-color: var(--primary-color-tint-3);
  transform: translateY(-2px);
}

.date-tab.active {
  background-color: var(--primary-color-tint-3);
  color: #fff;
  border-color: var(--primary-color-tint-2);
}

.date-heading {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 3rem;
  scroll-margin-top: 8rem;
}

/* テーブル右上に印刷ボタンを配置 */
.table-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.6rem;
}

/* ===== テーブル ===== */
/* 横スクロール対応 */
.admin-table-wrapper {
  width: 80%;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table-head-wrapper {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem;
}

.admin-table-head-wrapper .date-tabs {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.admin-table-head-wrapper .date-tabs .date-tab {
  background-color: var(--white-color);
  border: 1.5px solid #ccc;
  border-radius: 99rem;
  color: #333;
  padding: 0.4rem 1rem;
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* タブホバー時 */
.admin-table-head-wrapper .date-tab:hover {
  background-color: #e9f3ff;
  border-color: #0078ff;
  color: #0078ff;
  transform: translateY(-1px);
}

/* 選択中タブ（アクティブ状態）*/
.admin-table-head-wrapper .date-tab.active {
  background-color: #0078ff;
  border-color: #0078ff;
  color: var(--white-color);
  /* box-shadow: 0 2px 4px rgba(0, 120, 255, 0.3); */
}

.admin-table-head-wrapper .table-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1rem;
}

.admin-table {
  width: 100%;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 1.5rem;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #eee;
  padding: 1.4rem 1.6rem;
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  background: #f8f9fa;
  color: #444;
  font-weight: 600;
  text-align: center;
}

.admin-table td {
  color: #333;
  font-weight: 500;
}

.admin-table td[rowspan] {
  vertical-align: middle;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.4);
}

/* .admin-table th:nth-child(1), 
.admin-table td:nth-child(1) {
  text-align: center;
} */

.admin-table tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.admin-table tbody tr:hover {
  background: #fafafa;
}

/* 空きあり（open） */
.admin-table tr.status-open {
  background-color: #f0fff4; /* 淡いグリーン */
  background-color: #e7f7eb; /* 少し濃いグリーン */
  border-left: 3px solid #5dbb63;
}

/* 混雑ぎみ（warning） */
.admin-table tr.status-warning {
  background-color: #fff8e1; /* 淡いイエロー */
  background-color: #fff1c7; /* 少し濃い黄色 */
  border-left: 3px solid #f5a623;
}

/* 満席（full） */
.admin-table tr.status-full {
  background-color: #ffecec; /* 淡いレッド */
  background-color: #ffd8d8; /* 淡いけど明確な赤み */
  border-left: 3px solid #e74c3c;
}

/* 受付終了（closed） */
.admin-table tr.status-closed {
  background-color: #ececec; /* 薄グレー */
  border-left: 3px solid #999;
  color: #888;
}

/* 予約件数・来場者数を強調 */
.admin-table td:nth-child(3),
.admin-table td:nth-child(4) {
  font-size: 1.8rem;
  font-weight: normal;
  color: #444;
  text-align: right;
  padding-right: 1.5rem;
}

/* “件数”と“名”のサフィックスを少し淡くして強弱をつける */
.admin-table td:nth-child(3)::after,
.admin-table td:nth-child(4)::after {
  color: #666;
  font-weight: 400;
}

.admin-table td:nth-child(5) {
  text-align: center;
  font-size: 1.3rem;
}

/* 満席に近い行の人数を赤に */
td.highlight {
  color: #b71c1c !important; /* より深い赤でコントラスト確保 */
  font-weight: 700;
  background: none !important; /* 行の背景色が干渉していたら無効化 */
  /* animation: pulse 1.8s infinite ease-in-out; */
}

@keyframes pulse {
  0%,
  100% {
    text-shadow: 0 0 0 rgba(183, 28, 28, 0);
  }
  50% {
    text-shadow: 0 0 4px rgba(183, 28, 28, 0.3);
  }
}

/* =========================================
   来場者一覧（visitors-table）
   ========================================= */

.visitors-table td.time-cell {
  text-align: center;
  vertical-align: middle;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.4);
}

.visitors-table td:nth-child(2),
.visitors-table td:nth-child(3) {
  font-size: 1.6rem;
  font-weight: 500;
  color: #333;
  text-align: left;
  padding-right: 0;
}

.visitors-table td.visitors-count-cell {
  text-align: center;
}

.visitors-table td:last-child {
  text-align: left;
  font-size: 1.4rem;
}

/* ヘッダーをより強調 */
.visitors-table th {
  background: #f3f5f8;
  color: #333;
  font-weight: 600;
}

/* 小計行（時間帯ごと）*/
.visitors-table .subtotal-row td {
  background: #fafafa;
  text-align: right;
  font-size: 1.6rem;
  color: #555;
  padding: 1rem 1.5rem;
  border-top: 1px solid #eee;
  border-bottom: 2px solid #ddd;
}

.visitors-table td.cell-note {
  max-width: 25rem;
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
  padding: 0.5rem;
}

/* 日付ごとの合計 */
.daily-total {
  width: 80%;
  margin: 0 auto;
  border-radius: 0 0 1rem 1rem;
  padding: 1rem 1.5rem;
  font-size: 1.8rem;
  text-align: right;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.daily-total strong {
  color: var(--primary-color);
}

/* ===== セレクト・ボタン ===== */
.status-select {
  font-size: 1.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  border: 1px solid #ccc;
  background-color: var(--white-color);
  cursor: pointer;
  transition: all 0.15s ease;
}

/* hoverとfocus時のアクセント */
.status-select:hover,
.status-select:focus {
  border-color: #5da1ff;
  box-shadow: 0 0 3px rgba(93, 161, 255, 0.5);
  outline: none;
}

.btn-small {
  background: var(--secondary-color-tint-1);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 0.4rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-small:hover {
  background: var(--secondary-color-tint-2);
}

.btn-save {
  background-color: var(--primary-color-tint-2);
  color: #fff;
  border: none;
  padding: 0.8rem 2.4rem;
  border-radius: 6px;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-save:hover {
  background-color: var(--primary-color-tint-3);
}

.table-buttons.bottom {
  width: 100%;
  margin-top: 1.6rem;
  display: flex;
  justify-content: flex-end;
}

/* スマホ時は幅を広げる */
@media (max-width: 768px) {
  .admin-table {
    min-width: 600px;
  }
}

/* 小画面対応：余白を自動で折り返す */
@media (max-width: 600px) {
  .admin-table-wrapper {
    width: 100%;
  }

  .admin-table-head-wrapper .date-tabs {
    justify-content: center;
    flex-wrap: wrap;
  }
  .admin-table-head-wrapper .date-tab {
    font-size: 1.5rem;
    padding: 0.35rem 0.9rem;
  }
}

@media print {
  /* 背景色・ボックス影を消す */
  body {
    background: var(--white-color) !important;
  }

  .container-large {
    box-shadow: none !important;
    background: var(--white-color) !important;
  }

  header,
  .admin-topbar,
  .date-tabs,
  .table-buttons,
  footer {
    display: none !important;
  }

  /* 印刷用フォントとサイズ */
  body,
  table {
    font-family: 'Noto Sans JP', sans-serif;
    color: #000;
    font-size: 12pt;
  }

  /* ページの余白設定（プリンターモード用） */
  @page {
    size: A4 landscape;
    margin: 15mm 10mm;
  }

  /* テーブルを印刷向けに見やすく */
  .admin-table {
    width: 100%;
    border-collapse: collapse;
  }

  .admin-table th,
  .admin-table td {
    border: 1px solid #ccc;
    padding: 6px 8px;
  }

  .admin-table th {
    background: #eee !important;
  }

  /* カラーラベルはグレー系に変換 */
  .status-open {
    background: #f9fff9 !important;
  }
  .status-warning {
    background: #fffdf3 !important;
  }
  .status-full {
    background: #fff5f5 !important;
  }
  .status-closed {
    background: #f5f5f5 !important;
    color: #777 !important;
  }

  /* ページ区切りを制御（各日付で改ページ） */
  .admin-session-section {
    page-break-after: always;
  }

  .admin-session-section:last-of-type {
    page-break-after: auto;
  }

  /* 印刷時は非表示 */
  @media print {
    .print-btn {
      display: none !important;
    }
  }
}
