/* ============================================================
   ダッシュボード サイドバー ロゴ
   ============================================================ */

/* .brand — ロゴ全体 */
.sidebar-header .brand {
  display: flex;
  align-items: center;
  font-family: 'Barlow Condensed', 'Noto Sans JP', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: .04em;
  color: #1f2a3c;
  text-decoration: none;
}

.sidebar-header .brand img {
  margin-right: .5rem;
}

/* サブメニュー アクティブ項目 — 文字色・太字 */
#sidebar .sidebar-wrapper .menu .submenu .submenu-item.active>a {
  color: #435ebe !important;
  font-weight: 700 !important;
}

.submenu {
  padding: 0px;
}

/* ============================================================
   サイドバー ログアウト固定
   ============================================================ */

/* ============================================================
   アプリ WebView 埋め込み（?embed=1）
   ============================================================ */
html.embed-app #sidebar,
html.embed-app #app > #main > header,
html.embed-app footer#footer {
  display: none !important;
}

html.embed-app #main {
  margin-left: 0 !important;
  padding-top: 0 !important;
  min-height: 100vh;
}

html.embed-app .page-heading {
  padding-top: 0.75rem;
}

html.embed-app .page-title-bar .text-subtitle {
  display: none !important;
}

html.embed-app .wa-week-toolbar,
html.embed-app .wa-week-schedule {
  display: none !important;
}

/* ============================================================
   サイドバー レイアウト・スクロール（統合版）
   ロゴ(header)とログアウト(footer)を固定、
   メニュー部分のみホイールスクロール可能にする
   ============================================================ */
#sidebar {
  height: 100vh !important;
  position: fixed !important;
  z-index: 1040 !important;
}

/* wrapper全体は flex column で高さ固定 — overflow hidden のまま */
.sidebar-wrapper {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  overflow: hidden !important;
}

/* ヘッダー(ロゴ)は固定 — flex-shrink:0 */
.sidebar-wrapper .sidebar-header {
  flex-shrink: 0 !important;
}

/* メニューだけがスクロール */
.sidebar-wrapper .sidebar-menu {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* スクロールバーを細く */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .15) transparent;
}

.sidebar-wrapper .sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-wrapper .sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .15);
  border-radius: 2px;
}

/* フッター(ログアウト)は固定 */
.sidebar-wrapper .sidebar-footer {
  flex-shrink: 0 !important;
  border-top: 1px solid rgba(0, 0, 0, .08);
  padding: .5rem 0;
  background: inherit;
}

.auth-device-icon {
  width: 32px;
}

/* ============================================================
   共通ページレイアウト補助
   ============================================================ */

/* ページタイトル行 アクションボタン付き */
.page-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.page-title-bar h3 {
  margin-bottom: 0;
  font-weight: 700;
}

/* 検索バー */
.search-bar {
  max-width: 320px;
  margin-left: auto;
}

.requests-filter-controls {
  margin-left: auto;
  justify-content: flex-end;
  align-items: center;
}

.requests-filter-controls .search-bar {
  margin-left: 0;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.table-toolbar-left {
  display: flex;
  align-items: center;
}

.table-toolbar .dataTables_length {
  margin: 0;
}

.table-toolbar .dataTables_length label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  color: #6c757d;
}

.table-toolbar .dataTables_length select {
  min-width: 88px;
}

/* ============================================================
   DataTables 2 共通：ソート矢印を列タイトル左側に統一
   （ログイン履歴と同様。datatables.min.css の後に読み込むこと）
   ============================================================ */
div.dataTables_wrapper table.dataTable thead th.dt-orderable-asc,
div.dataTables_wrapper table.dataTable thead th.dt-orderable-desc,
div.dataTables_wrapper table.dataTable thead th.dt-ordering-asc,
div.dataTables_wrapper table.dataTable thead th.dt-ordering-desc,
div.dataTables_wrapper table.dataTable thead th.sorting,
div.dataTables_wrapper table.dataTable thead th.sorting_asc,
div.dataTables_wrapper table.dataTable thead th.sorting_desc {
  text-align: left !important;
  vertical-align: middle;
  position: relative;
  padding-left: 1.35rem !important;
  padding-right: 0.5rem !important;
}

div.dataTables_wrapper table.dataTable thead th .dt-column-header,
div.dataTables_wrapper table.dataTable thead th .dt-column-footer {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start !important;
  gap: 0.35rem;
  width: auto !important;
  max-width: 100%;
}

div.dataTables_wrapper table.dataTable thead th .dt-column-order {
  order: -1;
  flex: 0 0 auto;
  position: static !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  margin: 0 !important;
  float: none !important;
}

div.dataTables_wrapper table.dataTable thead th .dt-column-title {
  flex: 1 1 auto;
  text-align: left;
}

div.dataTables_wrapper table.dataTable thead th.sorting::before,
div.dataTables_wrapper table.dataTable thead th.sorting::after,
div.dataTables_wrapper table.dataTable thead th.sorting_asc::before,
div.dataTables_wrapper table.dataTable thead th.sorting_asc::after,
div.dataTables_wrapper table.dataTable thead th.sorting_desc::before,
div.dataTables_wrapper table.dataTable thead th.sorting_desc::after {
  position: absolute !important;
  left: 0.35rem !important;
  right: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  float: none !important;
}

div.dataTables_wrapper table.dataTable thead th .dataTables_sorter {
  position: static !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  margin: 0 0.35rem 0 0 !important;
}

div.dataTables_wrapper table.dataTable thead th.text-end.dt-orderable-asc,
div.dataTables_wrapper table.dataTable thead th.text-end.dt-orderable-desc,
div.dataTables_wrapper table.dataTable thead th.text-end.dt-ordering-asc,
div.dataTables_wrapper table.dataTable thead th.dt-ordering-desc.text-end,
div.dataTables_wrapper table.dataTable thead th.text-end.sorting,
div.dataTables_wrapper table.dataTable thead th.text-end.sorting_asc,
div.dataTables_wrapper table.dataTable thead th.text-end.sorting_desc {
  text-align: right !important;
}

div.dataTables_wrapper table.dataTable thead th.text-end .dt-column-header {
  justify-content: flex-end;
}

div.dataTables_wrapper table.dataTable thead th.text-end .dt-column-title {
  text-align: right;
}

/* DT2 自動型付与の右寄せを上書き（金額列など .text-end は除外） */
div.dataTables_wrapper table.dataTable thead th.dt-type-date:not(.text-end),
div.dataTables_wrapper table.dataTable tbody td.dt-type-date:not(.text-end),
div.dataTables_wrapper table.dataTable thead th.dt-type-numeric:not(.text-end),
div.dataTables_wrapper table.dataTable tbody td.dt-type-numeric:not(.text-end) {
  text-align: left !important;
}

div.dataTables_wrapper table.dataTable thead th.dt-type-date:not(.text-end) .dt-column-header,
div.dataTables_wrapper table.dataTable thead th.dt-type-numeric:not(.text-end) .dt-column-header {
  justify-content: flex-start !important;
}

/* ============================================================
   作業員割当 #wa-unassigned-table 列幅
   ============================================================ */
@media (min-width: 768px) {
  .wa-unassigned-table-wrap table#wa-unassigned-table {
    table-layout: fixed;
    width: 100%;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table thead th:nth-child(1),
  .wa-unassigned-table-wrap table#wa-unassigned-table colgroup col:nth-child(1) {
    width: 12% !important;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table thead th:nth-child(2),
  .wa-unassigned-table-wrap table#wa-unassigned-table colgroup col:nth-child(2) {
    width: 28% !important;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table thead th:nth-child(3),
  .wa-unassigned-table-wrap table#wa-unassigned-table colgroup col:nth-child(3) {
    width: 10% !important;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table thead th:nth-child(4),
  .wa-unassigned-table-wrap table#wa-unassigned-table colgroup col:nth-child(4) {
    width: 16% !important;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table thead th:nth-child(5),
  .wa-unassigned-table-wrap table#wa-unassigned-table colgroup col:nth-child(5) {
    width: 16% !important;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table thead th:nth-child(6),
  .wa-unassigned-table-wrap table#wa-unassigned-table colgroup col:nth-child(6) {
    width: 10% !important;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table tbody td {
    vertical-align: middle;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table tbody td:nth-child(2) {
    overflow: hidden;
    max-width: 100%;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table .request-list-td-value {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table .request-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .wa-unassigned-table-wrap table#wa-unassigned-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table colgroup col {
    width: auto !important;
  }

  .wa-unassigned-table-wrap table#wa-unassigned-table thead th,
  .wa-unassigned-table-wrap table#wa-unassigned-table tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  .wa-unassigned-table-wrap.table-responsive .table#wa-unassigned-table tbody td .request-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .wa-unassigned-table-wrap.table-responsive .table#wa-unassigned-table tbody td .request-list-td-value .text-truncate {
    max-width: 100% !important;
  }

  .wa-unassigned-table-wrap.table-responsive .table#wa-unassigned-table tbody td .request-list-td-value .type-badge {
    margin-left: auto;
  }
}

/* ステータスバッジ */
.badge-status {
  font-size: .75rem;
  font-weight: 600;
  padding: .3em .7em;
  border-radius: 20px;
}

.badge-pending {
  background: #fff3cd;
  color: #856404;
}

.badge-inprogress {
  background: #cff4fc;
  color: #055160;
}

.badge-done {
  background: #d2ffe8;
  color: #0a3622;
}

.badge-billed {
  background: #ebf3ff;
  color: #0c2a6b;
}

.badge-paid {
  background: #d2ffe8;
  color: #0a3622;
}

.badge-cancelled {
  background: #ffdede;
  color: #58151c;
}

.badge-active {
  background: #d2ffe8;
  color: #0a3622;
}

.badge-inactive {
  background: #e6eaee;
  color: #495057;
}

/* テーブル操作アイコンボタン */
.btn-icon-sm {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

/* サマリーカード */
.stat-card {
  border-radius: .7rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card .stat-icon.blue {
  background: #ebf3ff;
  color: #435ebe;
}

.stat-card .stat-icon.green {
  background: #d2ffe8;
  color: #198754;
}

.stat-card .stat-icon.orange {
  background: #fff3cd;
  color: #997404;
}

.stat-card .stat-icon.red {
  background: #ffdede;
  color: #dc3545;
}

.stat-card .stat-icon.purple {
  background: #f0ebff;
  color: #6f42c1;
}

.stat-card .stat-label {
  font-size: .8rem;
  color: #6c757d;
  margin-bottom: .15rem;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2a3c;
  line-height: 1.1;
}

.stat-card .stat-sub {
  font-size: .75rem;
  color: #6c757d;
  margin-top: .1rem;
}

/* ============================================================
   スケジュール / カレンダービュー (worker-assignment.html)
   ============================================================ */
.dispatch-calendar {
  overflow-x: auto;
}

.dispatch-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
  width: 100%;
}

.dispatch-table th {
  background: #f4f6fb;
  font-size: .78rem;
  font-weight: 700;
  color: #495057;
  text-align: center;
  padding: .6rem .4rem;
  border: 1px solid #e9ecef;
  white-space: nowrap;
}

.dispatch-table td {
  border: 1px solid #e9ecef;
  padding: .4rem;
  vertical-align: top;
  min-width: 120px;
  min-height: 70px;
  height: 70px;
  background: #fff;
}

.dispatch-table td.row-header {
  background: #f4f6fb;
  font-size: .82rem;
  font-weight: 700;
  color: #1f2a3c;
  white-space: nowrap;
  padding: .5rem .75rem;
  min-width: 100px;
}

.dispatch-chip {
  border-radius: 4px;
  padding: .25rem .4rem;
  font-size: .72rem;
  line-height: 1.3;
  margin-bottom: 2px;
  cursor: pointer;
  border-left: 3px solid transparent;
}

/* 依頼一覧 .badge-status と同色*/
.dispatch-chip-cancelled {
  background: #ffdede;
  color: #58151c;
  border-left-color: #dc3545;
}

.dispatch-chip-pending {
  background: #fff3cd;
  color: #856404;
  border-left-color: #997404;
}

.dispatch-chip-inprogress {
  background: #cff4fc;
  color: #055160;
  border-left-color: #0aa2c0;
}

.dispatch-chip-done {
  background: #d2ffe8;
  color: #0a3622;
  border-left-color: #198754;
}

.dispatch-chip-billed {
  background: #ebf3ff;
  color: #0c2a6b;
  border-left-color: #435ebe;
}

.dispatch-chip-inactive {
  background: #e6eaee;
  color: #495057;
  border-left-color: #6c757d;
}

/* ============================================================
   現場作業管理 ステータスカード (site-work-list.html)
   ============================================================ */
.fieldwork-card {
  border-radius: .6rem;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-left: 4px solid #dee2e6;
  transition: box-shadow .2s;
}

.fieldwork-card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, .1);
}

.fieldwork-card.status-departure {
  border-color: #ffc107;
}

.fieldwork-card.status-inprogress {
  border-color: #435ebe;
}

.fieldwork-card.status-done {
  border-color: #198754;
}

.fieldwork-card .fc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}

.fieldwork-card .fc-title {
  font-weight: 700;
  font-size: .95rem;
}

.fieldwork-card .fc-meta {
  font-size: .8rem;
  color: #6c757d;
}

.fieldwork-card .fc-items {
  font-size: .82rem;
  color: #495057;
  border-top: 1px solid #f0f0f0;
  padding-top: .5rem;
  margin-top: .5rem;
}

/* ============================================================
   実施報告書プレビュー印刷用 (delivery-note-list.html)
   ============================================================ */
.delivery-preview {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  font-size: .88rem;
  min-height: 800px;
}

.delivery-preview {
  width: 100%;
  min-height: 800px;
  background-color: #fff;
}

.delivery-preview .dp-header-table {
  width: 100%;
}

.delivery-preview .dp-header-title {
  background-color: #0d6efd;
  color: #fff;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 0.2em;
  height: 20px;
}

.delivery-preview .dp-header-right {
  text-align: right;
  vertical-align: middle;
  font-size: 16px;
  font-weight: bold;
  color: #000000;
}

.delivery-preview .dp-content {
  padding: 20px;
}

.delivery-preview .dp-info-table {
  width: 100%;
  border-collapse: collapse;
  color: #000000;
}

.delivery-preview .dp-client-info {
  width: 50%;
  vertical-align: top;
  /*padding-bottom: 10px;*/
  color: #000000;
}

.delivery-preview .dp-issuer-info {
  vertical-align: top;
  /*padding-bottom: 10px;*/
  padding-left: 20px;
  color: #000000;
}

.delivery-preview .dp-stamp {
  position: absolute;
  top: -10px;
  right: 90px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delivery-preview .dp-stamp span {
  color: #dc3545;
  font-weight: bold;
  font-size: 10px;
  writing-mode: vertical-rl;
  letter-spacing: 2px;
}

.delivery-preview .dp-summary-table {
  width: 100%;
  border-collapse: collapse;
  border-bottom: 2px solid #8EA9DB;
}

.delivery-preview .dp-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 2px solid #8EA9DB;
}

.delivery-preview .dp-items-table th {
  border: 2px solid #8EA9DB;
  text-align: center;
  font-weight: bold;
  background-color: #f8f9fa;
}
.delivery-preview .dp-items-table tbody tr {
  font-size: 12px;
  line-height: 10px;
}

.delivery-preview .dp-items-table td {
  border: 2px solid #8EA9DB;
  padding: 4px 6px;
  writing-mode: horizontal-tb;
}

.delivery-preview .dp-notes-box {
  margin-top: 15px;
  border: 1px solid #ddd;
  padding: 10px;
}

.delivery-preview .dp-notes-box .min-h-\[80px\] {
  min-height: 80px;
}

.delivery-preview table.table-bordered {
  border: 1px solid #ddd;
  border-collapse: collapse;
}

.delivery-preview table.table-bordered th,
.delivery-preview table.table-bordered td {
  border: 1px solid #ddd;
  padding: 4px 6px;
  font-size: 0.85rem;
}

.delivery-preview table.table-bordered th {
  background-color: #f8f9fa;
  text-align: center;
  font-weight: bold;
}

@media print {

  #sidebar,
  header,
  .page-title-bar,
  .no-print {
    display: none !important;
  }

  #main {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .delivery-preview {
    border: none;
    padding: 0;
  }
}

/* ============================================================
   マスタ管理 タブ (masters.html)
   ============================================================ */
.master-tab-content {
  padding-top: 1.5rem;
}

/* ============================================================
   売上レポート グラフエリア
   ============================================================ */
.chart-area {
  background: #fff;
  border-radius: .7rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
  padding: 1.25rem 1.5rem;
}

.chart-placeholder {
  height: 260px;
  background: linear-gradient(135deg, #f4f6fb 25%, #ebf3ff 100%);
  border-radius: .4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: .9rem;
}

/* ============================================================
   入金消込 チェックボックス行ハイライト
   ============================================================ */
.table tbody tr.row-selected {
  background: #ebf3ff !important;
}

/* ============================================================
   入金確認・消込 #paymentTable / #paidTable
   768px 以上: 列は割合で縮み、取引先は省略＋ tooltip
   768px 未満: DataTables の固定 col 幅を解除しカード行＋省略へ
   ============================================================ */
@media (min-width: 768px) {
  .payment-matching-table-wrap table#paymentTable,
  .payment-matching-table-wrap table#paidTable {
    table-layout: fixed;
    width: 100%;
  }

  .payment-matching-table-wrap table#paymentTable thead th:nth-child(1),
  .payment-matching-table-wrap table#paymentTable colgroup col:nth-child(1) {
    width: 14% !important;
  }

  .payment-matching-table-wrap table#paymentTable thead th:nth-child(2),
  .payment-matching-table-wrap table#paymentTable colgroup col:nth-child(2) {
    width: 22% !important;
  }

  .payment-matching-table-wrap table#paymentTable thead th:nth-child(3),
  .payment-matching-table-wrap table#paymentTable colgroup col:nth-child(3) {
    width: 14% !important;
  }

  .payment-matching-table-wrap table#paymentTable thead th:nth-child(4),
  .payment-matching-table-wrap table#paymentTable colgroup col:nth-child(4) {
    width: 14% !important;
  }

  .payment-matching-table-wrap table#paymentTable thead th:nth-child(5),
  .payment-matching-table-wrap table#paymentTable colgroup col:nth-child(5) {
    width: 14% !important;
  }

  .payment-matching-table-wrap table#paymentTable thead th:nth-child(6),
  .payment-matching-table-wrap table#paymentTable colgroup col:nth-child(6) {
    width: 22% !important;
  }

  .payment-matching-table-wrap table#paidTable thead th:nth-child(1),
  .payment-matching-table-wrap table#paidTable colgroup col:nth-child(1) {
    width: 12% !important;
  }

  .payment-matching-table-wrap table#paidTable thead th:nth-child(2),
  .payment-matching-table-wrap table#paidTable colgroup col:nth-child(2) {
    width: 18% !important;
  }

  .payment-matching-table-wrap table#paidTable thead th:nth-child(3),
  .payment-matching-table-wrap table#paidTable colgroup col:nth-child(3) {
    width: 10% !important;
  }

  .payment-matching-table-wrap table#paidTable thead th:nth-child(4),
  .payment-matching-table-wrap table#paidTable colgroup col:nth-child(4) {
    width: 12% !important;
  }

  .payment-matching-table-wrap table#paidTable thead th:nth-child(5),
  .payment-matching-table-wrap table#paidTable colgroup col:nth-child(5) {
    width: 12% !important;
  }

  .payment-matching-table-wrap table#paidTable thead th:nth-child(6),
  .payment-matching-table-wrap table#paidTable colgroup col:nth-child(6) {
    width: 12% !important;
  }

  .payment-matching-table-wrap table#paidTable thead th:nth-child(7),
  .payment-matching-table-wrap table#paidTable colgroup col:nth-child(7) {
    width: 14% !important;
  }

  .payment-matching-table-wrap table#paidTable thead th:nth-child(8),
  .payment-matching-table-wrap table#paidTable colgroup col:nth-child(8) {
    width: 10% !important;
  }

  .payment-matching-table-wrap table#paymentTable tbody td,
  .payment-matching-table-wrap table#paidTable tbody td {
    vertical-align: middle;
  }

  .payment-matching-table-wrap table#paymentTable tbody td:nth-child(2),
  .payment-matching-table-wrap table#paidTable tbody td:nth-child(2) {
    overflow: hidden;
    max-width: 100%;
  }

  .payment-matching-table-wrap table#paymentTable .payment-matching-td-value,
  .payment-matching-table-wrap table#paidTable .payment-matching-td-value {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .payment-matching-table-wrap table#paymentTable .payment-matching-td-value .text-truncate,
  .payment-matching-table-wrap table#paidTable .payment-matching-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .payment-matching-table-wrap table#paymentTable,
  .payment-matching-table-wrap table#paidTable {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .payment-matching-table-wrap table#paymentTable colgroup col,
  .payment-matching-table-wrap table#paidTable colgroup col {
    width: auto !important;
  }

  .payment-matching-table-wrap table#paymentTable thead th,
  .payment-matching-table-wrap table#paymentTable tbody td,
  .payment-matching-table-wrap table#paidTable thead th,
  .payment-matching-table-wrap table#paidTable tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  /* カード行 flex：td を親幅に合わせる（auto だと長い取引先名で横に伸びる） */
  .payment-matching-table-wrap.table-responsive .table#paymentTable tbody td,
  .payment-matching-table-wrap.table-responsive .table#paidTable tbody td {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
  }

  /* flex 子の width:0 で残り幅を取り、長文でも省略可能にする */
  .payment-matching-table-wrap.table-responsive .table#paymentTable tbody td .payment-matching-td-value,
  .payment-matching-table-wrap.table-responsive .table#paidTable tbody td .payment-matching-td-value {
    flex: 1 1 0%;
    min-width: 0;
    width: 0;
    overflow: hidden;
    text-align: right;
  }

  .payment-matching-table-wrap.table-responsive .table#paymentTable tbody td .payment-matching-td-value .text-truncate,
  .payment-matching-table-wrap.table-responsive .table#paidTable tbody td .payment-matching-td-value .text-truncate {
    display: block;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .payment-matching-table-wrap.table-responsive .table#paymentTable tbody td:last-child {
    justify-content: flex-end;
    gap: 0.25rem;
  }

  .payment-matching-table-wrap.table-responsive .table#paymentTable tbody td:last-child::before {
    margin-right: auto;
  }
}

/* ============================================================
   モーダル内フォーム補助
   ============================================================ */
.modal-form-section {
  background: #f8f9fa;
  border-radius: .5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.modal-form-section .section-title {
  font-size: .78rem;
  font-weight: 700;
  color: #435ebe;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .75rem;
}

/* ============================================================
   ダッシュボード KPI カード
   ============================================================ */
.dash-kpi {
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
}

.dash-kpi:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
  transform: translateY(-2px);
}

.dash-kpi-alert {
  border: 1.5px solid #f3616d33;
}

.dash-kpi-warn {
  border: 1.5px solid #eaca4a44;
}

/* ダッシュボード一覧表：ラッパー内は表本体のみ（列ソート用） */
.page-heading .table-responsive:has(#fieldworkTable) .dataTables_wrapper .dt-layout-row:not(.dt-layout-table),
.page-heading .table-responsive:has(#dashUnassignedTable) .dataTables_wrapper .dt-layout-row:not(.dt-layout-table),
.page-heading .table-responsive:has(#dashPaymentAlertTable) .dataTables_wrapper .dt-layout-row:not(.dt-layout-table) {
  display: none !important;
}

/* ============================================================
   ダッシュボード（未割当 / 入金期日 / 依頼一覧）
   ============================================================ */
@media (min-width: 768px) {
  .page-heading .row.g-4.mb-4>[class*="col-"] {
    min-width: 0;
  }

  .page-heading .dash-panel-table-wrap .dt-container,
  .page-heading .dash-panel-table-wrap .dt-layout-cell,
  .page-heading .dashboard-request-list-table-wrap .dt-container,
  .page-heading .dashboard-request-list-table-wrap .dt-layout-cell {
    min-width: 0;
    max-width: 100%;
  }

  .dash-panel-table-wrap table#dashUnassignedTable,
  .dash-panel-table-wrap table#dashPaymentAlertTable {
    table-layout: fixed;
    width: 100% !important;
    max-width: 100%;
  }

  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable {
    width: 100% !important;
    max-width: 100%;
  }

  /* 未割当：依頼番号 / 取引先 / 開始予定日時 / 終了予定日時 */
  .dash-panel-table-wrap table#dashUnassignedTable thead th:nth-child(1),
  .dash-panel-table-wrap table#dashUnassignedTable colgroup col:nth-child(1) {
    width: 22% !important;
  }

  .dash-panel-table-wrap table#dashUnassignedTable thead th:nth-child(2),
  .dash-panel-table-wrap table#dashUnassignedTable colgroup col:nth-child(2) {
    width: 24% !important;
  }

  .dash-panel-table-wrap table#dashUnassignedTable thead th:nth-child(3),
  .dash-panel-table-wrap table#dashUnassignedTable colgroup col:nth-child(3) {
    width: 27% !important;
  }

  .dash-panel-table-wrap table#dashUnassignedTable thead th:nth-child(4),
  .dash-panel-table-wrap table#dashUnassignedTable colgroup col:nth-child(4) {
    width: 27% !important;
  }

  /* 入金期日：請求書番号 / 取引先 / 支払期限 / 金額 */
  .dash-panel-table-wrap table#dashPaymentAlertTable thead th:nth-child(1),
  .dash-panel-table-wrap table#dashPaymentAlertTable colgroup col:nth-child(1) {
    width: 24% !important;
  }

  .dash-panel-table-wrap table#dashPaymentAlertTable thead th:nth-child(2),
  .dash-panel-table-wrap table#dashPaymentAlertTable colgroup col:nth-child(2) {
    width: 36% !important;
  }

  .dash-panel-table-wrap table#dashPaymentAlertTable thead th:nth-child(3),
  .dash-panel-table-wrap table#dashPaymentAlertTable colgroup col:nth-child(3) {
    width: 22% !important;
  }

  .dash-panel-table-wrap table#dashPaymentAlertTable thead th:nth-child(4),
  .dash-panel-table-wrap table#dashPaymentAlertTable colgroup col:nth-child(4) {
    width: 18% !important;
  }

  .dash-panel-table-wrap table#dashUnassignedTable tbody td,
  .dash-panel-table-wrap table#dashPaymentAlertTable tbody td {
    vertical-align: middle;
  }

  .dash-panel-table-wrap table#dashUnassignedTable tbody td:nth-child(2),
  .dash-panel-table-wrap table#dashUnassignedTable tbody td:nth-child(3),
  .dash-panel-table-wrap table#dashUnassignedTable tbody td:nth-child(4),
  .dash-panel-table-wrap table#dashPaymentAlertTable tbody td:nth-child(2) {
    overflow: hidden;
    max-width: 100%;
  }

  .dash-panel-table-wrap table#dashUnassignedTable .request-list-td-value,
  .dash-panel-table-wrap table#dashPaymentAlertTable .request-list-td-value {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .dash-panel-table-wrap table#dashUnassignedTable .request-list-td-value .text-truncate,
  .dash-panel-table-wrap table#dashPaymentAlertTable .request-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .page-heading .dash-panel-table-wrap table#dashUnassignedTable,
  .page-heading .dash-panel-table-wrap table#dashPaymentAlertTable,
  .page-heading .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .page-heading .dash-panel-table-wrap table#dashUnassignedTable colgroup col,
  .page-heading .dash-panel-table-wrap table#dashPaymentAlertTable colgroup col,
  .page-heading .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable colgroup col {
    width: auto !important;
  }

  /* カード行 flex：td を親幅に合わせる（auto だと長い取引先名で横に伸びる） */
  .page-heading .dash-panel-table-wrap.table-responsive .table#dashUnassignedTable tbody td,
  .page-heading .dash-panel-table-wrap.table-responsive .table#dashPaymentAlertTable tbody td,
  .page-heading .dashboard-request-list-table-wrap.request-list-table-wrap.table-responsive .table#fieldworkTable tbody td {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
  }

  /* flex 子の width:0 で残り幅を取り、長文でも省略可能にする*/
  .page-heading .dash-panel-table-wrap.table-responsive .table tbody td .request-list-td-value,
  .page-heading .dashboard-request-list-table-wrap.request-list-table-wrap.table-responsive .table#fieldworkTable tbody td .request-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    width: 0;
    overflow: hidden;
    text-align: right;
  }

  .page-heading .dash-panel-table-wrap.table-responsive .table tbody td .request-list-td-value .text-truncate,
  .page-heading .dashboard-request-list-table-wrap.request-list-table-wrap.table-responsive .table#fieldworkTable tbody td .request-list-td-value .text-truncate,
  .page-heading .dashboard-request-list-table-wrap.request-list-table-wrap.table-responsive .table#fieldworkTable tbody td .request-list-td-value>a.text-truncate {
    display: block;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-heading .dashboard-request-list-table-wrap.request-list-table-wrap.table-responsive .table#fieldworkTable tbody td .request-list-td-value .type-badge {
    max-width: 100%;
    white-space: normal;
    justify-content: flex-end;
  }
}

/* ============================================================
   取引先ツリー (customer-list.html)
   ============================================================ */
.client-tree {
  padding: .25rem 0;
}

/* 取引先行 */
.ct-client-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .75rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s;
}

.ct-client-row:hover {
  background: #f4f6fb;
}

.ct-client-row.active-row {
  background: #ebf3ff;
  border-left-color: #435ebe;
}

/* 部署行 */
.ct-dept-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .75rem .45rem 1.8rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s;
}

.ct-dept-row:hover {
  background: #f4f6fb;
}

.ct-dept-row.active-row {
  background: #fff8e6;
  border-left-color: #eaca4a;
}

/* 現場行 */
.ct-site-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .75rem .4rem 3.2rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s;
  font-size: .88rem;
}

.ct-site-row:hover {
  background: #f4f6fb;
}

.ct-site-row.active-row {
  background: #d2ffe8;
  border-left-color: #198754;
}

/* 部署なし直属の現場は少し左から */
.ct-site-row.ct-direct {
  padding-left: 1.8rem;
}

.ct-toggle {
  width: 18px;
  flex-shrink: 0;
  color: #6c757d;
  font-size: .75rem;
  cursor: pointer;
}

.ct-toggle.ct-leaf {
  color: #ced4da;
  cursor: default;
}

.ct-icon {
  flex-shrink: 0;
  font-size: .95rem;
}

.ct-label {
  flex: 1;
  font-weight: 600;
  font-size: .88rem;
  color: #1f2a3c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ct-dept-row .ct-label,
.ct-site-row .ct-label {
  font-weight: 500;
}

.ct-actions {
  display: none;
  gap: .2rem;
  flex-shrink: 0;
}

.ct-client-row:hover .ct-actions,
.ct-dept-row:hover .ct-actions,
.ct-site-row:hover .ct-actions,
.ct-client-row.active-row .ct-actions {
  display: flex;
}

.ct-spacer {
  width: 18px;
  flex-shrink: 0;
}

/* 子要素コンテナ */
.ct-children {
  border-left: 1.5px dashed #dee2e6;
  margin-left: 1.5rem;
}

/* ============================================================
   取引先管理 カード型レイアウト (customer-list.html)
   ============================================================ */

/* データモデル凡例バー */
.dm-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: .5rem;
  padding: .75rem 1rem;
  font-size: .82rem;
}

.dm-box {
  padding: .3em .8em;
  border-radius: .3rem;
  font-weight: 700;
  font-size: .78rem;
  white-space: nowrap;
}

.dm-client {
  background: #ebf3ff;
  color: #435ebe;
  border: 1px solid #c5d0f0;
}

.dm-dept {
  background: #fff8e6;
  color: #997404;
  border: 1px solid #ffe69c;
}

.dm-site {
  background: #d2ffe8;
  color: #0a3622;
  border: 1px solid #a3cfbb;
}

.dm-bank {
  background: #f0ebff;
  color: #6f42c1;
  border: 1px solid #c5b3f5;
}

.dm-arrow {
  color: #6c757d;
  font-weight: 700;
  font-size: .8rem;
}

.dm-sep {
  color: #6c757d;
  font-size: .8rem;
}

/* 取引先カード */
.client-card {
  border-left: 4px solid #435ebe;
  transition: box-shadow .2s;
}

.client-card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
}

/* 取引先アバター */
.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: .5rem;
  background: #435ebe;
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: .05em;
}

/* 振込口座バッジ */
.bank-badge {
  display: inline-flex;
  align-items: center;
  background: #f0ebff;
  color: #6f42c1;
  border: 1px solid #c5b3f5;
  border-radius: 20px;
  padding: .2em .75em;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.bank-badge.sm {
  font-size: .72rem;
  padding: .15em .6em;
}

/* 部署エリア */
.dept-area {
  background: #f8f9fa;
  border-radius: .5rem;
  padding: .75rem 1rem;
  border: 1px solid #e9ecef;
}

/* 部署ブロック */
.dept-block {
  background: #fff;
  border-radius: .4rem;
  border: 1px solid #e9ecef;
  border-left: 3px solid #eaca4a;
  margin-bottom: .75rem;
  overflow: hidden;
}

.dept-block.dept-direct {
  border-left-color: #c5d0f0;
}

.dept-block:last-of-type {
  margin-bottom: 0;
}

/* 部署ヘッダー行 */
.dept-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .6rem .9rem;
  background: #fffdf0;
  border-bottom: 1px solid #f5f5f5;
}

.dept-direct .dept-header {
  background: #f8f9fa;
}

/* 現場チップ一覧 */
.site-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .6rem .9rem;
}

.site-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #f4f6fb;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: .25em .8em;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}

.site-chip:hover {
  background: #ebf3ff;
  border-color: #c5d0f0;
  box-shadow: 0 1px 4px rgba(67, 94, 190, .15);
}

/* 請求オプション */
.billing-option {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: .4rem;
  padding: .6rem .85rem;
  font-size: .85rem;
}

.billing-option.active {
  background: #ebf3ff;
  border-color: #c5d0f0;
}

/* ============================================================
   依頼登録 BtoB/BtoC 切替 (request-create.html)
   ============================================================ */
.requester-toggle {
  display: flex;
  gap: .75rem;
}

.rtog-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: .85rem 1rem;
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: .5rem;
  cursor: pointer;
  transition: all .2s;
  color: #6c757d;
  font-family: inherit;
  line-height: 1;
}

.rtog-btn i {
  font-size: 1.4rem;
  display: block;
  line-height: 1;
}

.rtog-btn span {
  font-weight: 700;
  font-size: .88rem;
  display: block;
  line-height: 1.2;
}

.rtog-btn small {
  font-size: .71rem;
  color: #adb5bd;
  display: block;
  line-height: 1;
}

.rtog-btn:hover {
  border-color: #435ebe;
  background: #f0f4ff;
  color: #435ebe;
}

.rtog-btn.active {
  border-color: #435ebe;
  background: #ebf3ff;
  color: #435ebe;
}

.rtog-btn.active small {
  color: #6c8ae4;
}

/* 取引先選択後のサマリーボックス */
.client-summary-box {
  background: #f4f6fb;
  border: 1px solid #c5d0f0;
  border-radius: .4rem;
  padding: .65rem .9rem;
  font-size: .83rem;
}

/* ============================================================
   振込口座台帳 種別バッジ (bank-account-list.html)
   ============================================================ */
.bank-type-badge {
  display: inline-flex;
  align-items: center;
  padding: .2em .65em;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

.bank-type-badge.type-client {
  background: #ebf3ff;
  color: #435ebe;
}

.bank-type-badge.type-dept {
  background: #fff8e6;
  color: #997404;
}

.bank-type-badge.type-personal {
  background: #d2ffe8;
  color: #0a3622;
}

/* ============================================================
   現場作業 進捗ステップ (site-work-list.html)
   ============================================================ */
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  flex-shrink: 0;
}

.progress-step i {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  border: 2px solid #dee2e6;
  background: #f8f9fa;
  color: #adb5bd;
}

.progress-step small {
  font-size: .68rem;
  color: #adb5bd;
  white-space: nowrap;
}

.progress-step.done i {
  background: #435ebe;
  border-color: #435ebe;
  color: #fff;
}

.progress-step.done small {
  color: #435ebe;
  font-weight: 700;
}

.progress-line {
  flex: 1;
  height: 2px;
  background: #dee2e6;
  margin-top: -1rem;
}

.progress-line.done {
  background: #435ebe;
}

/* 時間帯バッジ */
.time-slot-badge {
  display: inline-block;
  padding: .15em .6em;
  background: #ebf3ff;
  color: #435ebe;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}



/* ============================================================
   依頼登録 スケジュールカレンダー (request-create.html)
   ============================================================ */
.sched-section {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: .5rem;
  padding: .9rem 1rem;
}

.sched-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: .8rem;
}

.sched-table th,
.sched-table td {
  border: 1px solid #dee2e6;
  text-align: center;
  padding: 0;
}

.sched-th-slot {
  background: #f4f6fb;
  width: 72px;
  font-size: .75rem;
  font-weight: 700;
  color: #6c757d;
  padding: .4rem .3rem;
}

.sched-th-day {
  background: #f4f6fb;
  font-size: .72rem;
  font-weight: 700;
  color: #495057;
  padding: .3rem .2rem;
  min-width: 70px;
}

.sched-th-day span {
  font-size: .68rem;
  font-weight: 400;
  color: #6c757d;
  display: block;
}

.sched-today {
  background: #ebf3ff !important;
  color: #435ebe !important;
}

.sched-today span {
  color: #435ebe !important;
}

.sched-selected {
  background: #d2ffe8 !important;
}

.sched-label {
  background: #f4f6fb;
  font-size: .75rem;
  font-weight: 700;
  color: #6c757d;
  padding: .4rem .4rem;
  white-space: nowrap;
}

.sched-cell {
  padding: .35rem .2rem;
  cursor: pointer;
  transition: background .12s;
  vertical-align: middle;
}

.sched-cell:hover {
  background: #f0f4ff !important;
}

.sched-cell-selected {
  background: #d2ffe8 !important;
  outline: 2px solid #198754;
}

.sched-cell.sched-free {
  background: #fff;
}

.sched-cell.sched-partial {
  background: #fffdf0;
}

.sched-cell.sched-full {
  background: #fff5f5;
  cursor: not-allowed;
}

.sched-cell.sched-unassigned-highlight {
  background: #ffdede !important;
}

.sched-workers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1px;
  margin-top: 2px;
}

.sched-workers span {
  font-size: .6rem;
  color: #6c757d;
  background: #f0f0f0;
  border-radius: 2px;
  padding: 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

/* 凡例ドット */
.sched-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 2px;
  vertical-align: middle;
}

.sched-dot.sched-free {
  background: #198754;
}

.sched-dot.sched-partial {
  background: #ffc107;
}

.sched-dot.sched-full {
  background: #dc3545;
}

/* ============================================================
   請求書サイクルバッジ
   ============================================================ */
.cycle-badge {
  display: inline-block;
  padding: .2em .65em;
  background: #f0ebff;
  color: #6f42c1;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================================
   スケジュールカレンダー (request-create.html)
   ============================================================ */
.sched-cal {
  user-select: none;
}

.sched-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
}

.sched-table th {
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  color: #6c757d;
  padding: .25rem;
}

.sched-cell {
  border-radius: .4rem;
  padding: .4rem .35rem;
  text-align: center;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  min-width: 48px;
  vertical-align: top;
  border: 2px solid transparent;
}

.sched-cell:hover:not(.cal-past) {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  transform: translateY(-1px);
}

.sched-day-num {
  font-weight: 700;
  font-size: .85rem;
  line-height: 1.2;
}

.sched-day-label {
  font-size: .62rem;
  margin-top: .15rem;
  white-space: nowrap;
  overflow: hidden;
}

.sched-popup-hint {
  font-size: .62rem;
  margin-top: .1rem;
  opacity: .7;
}

/* ステータス色 */
.cal-free {
  background: #d2ffe8;
  border-color: #a3cfbb;
  color: #0a3622;
}

.cal-free .sched-day-label {
  color: #198754;
}

.cal-partial {
  background: #fff8e6;
  border-color: #ffe69c;
  color: #664d03;
}

.cal-partial .sched-day-label {
  color: #997404;
}

.cal-full {
  background: #ffdede;
  border-color: #f5c6cb;
  color: #58151c;
}

.cal-full .sched-day-label {
  color: #dc3545;
}

.cal-closed {
  background: #f1f3f5;
  border-color: #dee2e6;
  color: #adb5bd;
  cursor: default;
}

.cal-past {
  opacity: .45;
  cursor: default;
}

/* 凡例ドット */
.cal-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: .3rem;
  vertical-align: middle;
}

.cal-dot-free {
  background: #198754;
}

.cal-dot-partial {
  background: #997404;
}

.cal-dot-full {
  background: #dc3545;
}

.cal-dot-closed {
  background: #adb5bd;
}

/* ポップアップ */
.sched-popup-box {
  position: absolute;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
  padding: .75rem 1rem;
  min-width: 240px;
  max-width: 320px;
  z-index: 999;
}

.sched-popup-header {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .6rem;
  font-size: .88rem;
}

.sched-job-chip {
  display: inline-block;
  background: #ebf3ff;
  color: #435ebe;
  border-radius: 4px;
  padding: .1em .5em;
  font-size: .72rem;
  margin: .1rem .1rem .1rem 0;
  white-space: nowrap;
}



/* ============================================================
   アイテム追加フォーム (item-create.html)
   ============================================================ */
.item-img-upload {
  border: 2px dashed #dee2e6;
  border-radius: .5rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-img-upload:hover,
.item-img-upload.drag-over {
  border-color: #435ebe;
  background: #f0f4ff;
}

.price-preview-box {
  background: #f4f6fb;
  border: 1px solid #e2e6f0;
  border-radius: .5rem;
  padding: .75rem 1rem;
}

/* ============================================================
   カレンダー 作業者詳細ポップアップ（partial / full）
   ============================================================ */
.sched-detail-popup {
  position: fixed;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .6rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  min-width: 280px;
  max-width: 360px;
  z-index: 9000;
  pointer-events: auto;
  overflow: hidden;
}

/* ヘッダ */
.sdp-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .6rem .85rem .5rem;
  background: #f4f6fb;
  border-bottom: 1px solid #e9ecef;
}

.sdp-date {
  font-weight: 800;
  font-size: .88rem;
  color: #1f2a3c;
}

.sdp-slot {
  font-size: .75rem;
  color: #6c757d;
}

.sdp-worktype {
  font-size: .7rem;
  font-weight: 700;
  padding: .15em .6em;
  border-radius: 10px;
  background: #eef4ff;
  color: #2f4ea4;
  border: 1px solid #cfdcf8;
}

.sdp-badge {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 700;
  padding: .15em .6em;
  border-radius: 10px;
}

.sdp-partial {
  background: #fff8e6;
  color: #997404;
  border: 1px solid #ffe69c;
}

.sdp-full {
  background: #ffdede;
  color: #dc3545;
  border: 1px solid #f5c6cb;
}

.sdp-unassigned {
  background: #ff0000;
  color: #ffffff;
  border: 1px solid #cc0000;
}

.sdp-divider {
  height: 0;
}

/* 作業者カード一覧 */
.sdp-body {
  padding: .5rem .6rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.sdp-worker-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-left: 3px solid #435ebe;
  border-radius: .35rem;
  padding: .4rem .65rem;
}

.sdp-worker-card-unassigned {
  border-left-color: #dc3545;
}

.sdp-worker-name {
  font-weight: 700;
  font-size: .82rem;
  color: #1f2a3c;
  margin-bottom: .15rem;
}

.sdp-worker-name i[class^="bi-"] {
  color: #435ebe;
}

.sdp-worker-time {
  font-size: .75rem;
  color: #495057;
  margin-bottom: .1rem;
}

.sdp-worker-time i[class^="bi-"] {
  color: #6c757d;
}

.sdp-worker-assignee {
  display: flex;
  align-items: flex-start;
  gap: .25rem;
  font-size: .75rem;
  color: #495057;
  margin-bottom: .1rem;
}

.sdp-worker-assignee-list {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}

.sdp-worker-assignee-line {
  display: block;
  line-height: 1.35;
}

.sdp-worker-assignee i[class^="bi-"] {
  color: #6c757d;
}

.sdp-worker-place {
  font-size: .73rem;
  color: #6c757d;
}

.sdp-worker-place i[class^="bi-"] {
  color: #198754;
}

/* フッタ（空き案内） */
.sdp-footer {
  padding: .4rem .85rem;
  background: #f0f9f4;
  border-top: 1px solid #d2ffe8;
  font-size: .72rem;
  color: #198754;
}

/* ============================================================
   登録情報ページ (profile.html)
   ============================================================ */
.profile-field {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: .6rem;
}

.profile-field label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  color: #6c757d;
  margin-bottom: .2rem;
  text-transform: none;
  letter-spacing: 0;
}

.pf-value {
  font-size: .92rem;
  font-weight: 600;
  color: #1f2a3c;
}

.pf-kana {
  font-size: .75rem;
  color: #6c757d;
  margin-top: .1rem;
}

.pf-note {
  font-size: .72rem;
  color: #adb5bd;
  margin-top: .1rem;
}

.pf-mono {
  font-family: 'Courier New', monospace;
  font-size: .88rem;
}

.plan-badge {
  text-align: center;
}

.plan-name {
  display: inline-block;
  background: linear-gradient(135deg, #435ebe, #6c8ae4);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  padding: .4rem 1.5rem;
  border-radius: 20px;
  letter-spacing: .05em;
}

/* ============================================================
   税設定バッジ
   ============================================================ */
.tax-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .15em .55em;
  border-radius: 4px;
  white-space: nowrap;
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  text-align: center;
}

.tax-in10 {
  background: #ebf3ff;
  color: #435ebe;
  border: 1px solid #c5d0f0;
}

.tax-ex10 {
  background: #fff8e6;
  color: #997404;
  border: 1px solid #ffe69c;
}

.tax-in8 {
  background: #f0ebff;
  color: #6f42c1;
  border: 1px solid #c5b3f5;
}

.tax-ex8 {
  background: #d2ffe8;
  color: #0a3622;
  border: 1px solid #a3cfbb;
}

.tax-free {
  background: #e6eaee;
  color: #495057;
  border: 1px solid #ced4da;
}

.tax-badge-compact {
  font-size: .68rem;
  padding: .12em .4em;
}

/* 取引先詳細：個別価格一覧の税列・操作列（PC 表組み時） */
@media (min-width: 768px) {
  #item-prices-table .customer-detail-tax-col {
    width: 1%;
    white-space: nowrap;
  }

  #item-prices-table .customer-detail-action-col {
    width: 1%;
    white-space: nowrap;
  }
}

/* 取引先詳細：部署一覧 #departments-table 固定幅と省略表示 */
@media (min-width: 768px) {
  .dash-panel-table-wrap table#departments-table {
    table-layout: fixed;
    width: 100%;
  }

  .dash-panel-table-wrap table#departments-table thead th:nth-child(1),
  .dash-panel-table-wrap table#departments-table tbody td:nth-child(1) {
    width: 27% !important;
  }

  .dash-panel-table-wrap table#departments-table thead th:nth-child(2),
  .dash-panel-table-wrap table#departments-table tbody td:nth-child(2) {
    width: 27% !important;
  }

  .dash-panel-table-wrap table#departments-table thead th:nth-child(3),
  .dash-panel-table-wrap table#departments-table tbody td:nth-child(3) {
    width: 27% !important;
  }

  .dash-panel-table-wrap table#departments-table thead th:nth-child(4),
  .dash-panel-table-wrap table#departments-table tbody td:nth-child(4) {
    width: 19% !important;
  }

  .dash-panel-table-wrap table#departments-table tbody td {
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dash-panel-table-wrap table#departments-table .request-list-td-value {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
}

/* ============================================================
   経費精算一覧
   768px 以上: 列は割合で縮み
   768px 未満: カード行
   ============================================================ */
@media (min-width: 768px) {
  .expense-list-table-wrap table#expense-table {
    table-layout: fixed;
    width: 100%;
  }

  .expense-list-table-wrap table#expense-table thead th:nth-child(1) {
    width: 9% !important;
  }

  .expense-list-table-wrap table#expense-table thead th:nth-child(2) {
    width: 11% !important;
  }

  .expense-list-table-wrap table#expense-table thead th:nth-child(3) {
    width: 13% !important;
  }

  .expense-list-table-wrap table#expense-table thead th:nth-child(4) {
    width: 10% !important;
  }

  .expense-list-table-wrap table#expense-table thead th:nth-child(5) {
    width: 16% !important;
  }

  .expense-list-table-wrap table#expense-table thead th:nth-child(6) {
    width: 8% !important;
  }

  .expense-list-table-wrap table#expense-table thead th:nth-child(7) {
    width: 7% !important;
  }

  .expense-list-table-wrap table#expense-table thead th:nth-child(8) {
    width: 11% !important;
  }

  .expense-list-table-wrap table#expense-table thead th:nth-child(9) {
    width: 15% !important;
  }

  .expense-list-table-wrap table#expense-table colgroup col:nth-child(1) {
    width: 9% !important;
  }

  .expense-list-table-wrap table#expense-table colgroup col:nth-child(2) {
    width: 11% !important;
  }

  .expense-list-table-wrap table#expense-table colgroup col:nth-child(3) {
    width: 13% !important;
  }

  .expense-list-table-wrap table#expense-table colgroup col:nth-child(4) {
    width: 10% !important;
  }

  .expense-list-table-wrap table#expense-table colgroup col:nth-child(5) {
    width: 16% !important;
  }

  .expense-list-table-wrap table#expense-table colgroup col:nth-child(6) {
    width: 8% !important;
  }

  .expense-list-table-wrap table#expense-table colgroup col:nth-child(7) {
    width: 7% !important;
  }

  .expense-list-table-wrap table#expense-table colgroup col:nth-child(8) {
    width: 11% !important;
  }

  .expense-list-table-wrap table#expense-table colgroup col:nth-child(9) {
    width: 15% !important;
  }

  .expense-list-table-wrap table#expense-table tbody td {
    vertical-align: middle;
  }

  .expense-list-table-wrap table#expense-table .request-list-td-value {
    min-width: 0;
    overflow: hidden;
  }

  .expense-list-table-wrap table#expense-table .request-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .expense-list-table-wrap table#expense-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .expense-list-table-wrap table#expense-table colgroup col {
    width: auto !important;
  }

  .expense-list-table-wrap table#expense-table thead th,
  .expense-list-table-wrap table#expense-table tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  /* カード行 flex：td 長い関連作業・内容で横に伸びる */
  .expense-list-table-wrap.table-responsive .table#expense-table tbody td {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
  }

  /* flex 長文でも省略可能にする */
  .expense-list-table-wrap.table-responsive .table#expense-table tbody td .request-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    width: 0;
    overflow: hidden;
    text-align: right;
  }

  .expense-list-table-wrap.table-responsive .table#expense-table tbody td .request-list-td-value .text-truncate {
    display: block;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .expense-list-table-wrap.table-responsive .table#expense-table tbody td .request-list-td-value .badge-status {
    max-width: 100%;
    white-space: normal;
    justify-content: flex-end;
  }
}

/* 取引先詳細：アイテム個別価格 #item-prices-table アイテム列の省略表示 */
@media (min-width: 768px) {
  .customer-detail-item-prices-table-wrap table#item-prices-table {
    table-layout: fixed;
    width: 100%;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table thead th:nth-child(1),
  .customer-detail-item-prices-table-wrap table#item-prices-table colgroup col:nth-child(1) {
    width: 20% !important;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table thead th:nth-child(2),
  .customer-detail-item-prices-table-wrap table#item-prices-table colgroup col:nth-child(2),
  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td:nth-child(2) {
    width: 14% !important;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table thead th:nth-child(3),
  .customer-detail-item-prices-table-wrap table#item-prices-table colgroup col:nth-child(3),
  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td:nth-child(3) {
    width: 14% !important;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table thead th:nth-child(4),
  .customer-detail-item-prices-table-wrap table#item-prices-table colgroup col:nth-child(4),
  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td:nth-child(4) {
    width: 14% !important;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table thead th:nth-child(5),
  .customer-detail-item-prices-table-wrap table#item-prices-table colgroup col:nth-child(5),
  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td:nth-child(5) {
    width: 14% !important;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table thead th:nth-child(6),
  .customer-detail-item-prices-table-wrap table#item-prices-table colgroup col:nth-child(6),
  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td:nth-child(6) {
    width: 14% !important;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table thead th:nth-child(7),
  .customer-detail-item-prices-table-wrap table#item-prices-table colgroup col:nth-child(7),
  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td:nth-child(7) {
    width: 10% !important;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td {
    vertical-align: middle;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td:nth-child(1) {
    overflow: hidden;
    max-width: 100%;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td:nth-child(2),
  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td:nth-child(4),
  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td:nth-child(6) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table .request-list-td-value {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table .request-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .customer-detail-item-prices-table-wrap table#item-prices-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table colgroup col {
    width: auto !important;
  }

  .customer-detail-item-prices-table-wrap table#item-prices-table thead th,
  .customer-detail-item-prices-table-wrap table#item-prices-table tbody td {
    width: auto !important;
    min-width: 0 !important;
  }
}

/* ============================================================
   Outlook風 月間カレンダー (request-create.html)
   ============================================================ */
.sched-section {
  background: #fff;
  border: 1px solid #d0d7de;
}

.sched-section .sched-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
}

.sched-section .sched-table th,
.sched-section .sched-table td {
  border: 1px solid #d0d7de;
  padding: 0;
  vertical-align: top;
}

.sched-section .sched-th-day {
  height: 32px;
  font-size: .82rem;
  font-weight: 600;
  text-align: left;
  padding: .35rem .5rem;
  color: #1f2328;
  background: #f6f8fa;
}

.sched-section .sched-th-day.is-sun {
  color: #b42318;
}

.sched-section .sched-th-day.is-sat {
  color: #155eef;
}

.sched-month-cell {
  height: 132px;
  background: #fff;
  cursor: pointer;
}

.sched-month-cell:hover {
  background: #f7fbff;
}

.sched-month-cell.sched-outside {
  background: #f9fafb;
  color: #98a2b3;
}

.sched-month-cell.sched-cell-selected {
  box-shadow: inset 0 0 0 2px #1570ef;
}

.sched-month-cell.sched-today .sched-month-day {
  background: #1570ef;
  color: #fff;
}

.sched-month-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin: .35rem 0 0 .35rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: #1f2328;
}

.sched-month-events {
  padding: .2rem .25rem .3rem;
}

.sched-event-chip {
  display: block;
  margin: 0 0 2px;
  padding: 2px 6px;
  font-size: .75rem;
  line-height: 1.3;
  color: #0b3b64;
  background: #cfe8ff;
  border-left: 3px solid #1570ef;
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sched-event-chip:hover {
  background: #b2ddff;
}

.sched-event-chip-unassigned {
  color: #7a271a;
  background: #fee4e2;
  border-left-color: #d92d20;
}

.sched-event-chip-unassigned:hover {
  background: #fecdca;
}

.sched-event-time {
  font-weight: 700;
}

.sched-event-more {
  font-size: .7rem;
  color: #667085;
  padding: 1px 6px;
}

/* 区分バッジ */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25em .65em;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* 現地作業：青 */
.type-badge-onsite {
  background: #dbeafe;
  color: #1d4ed8;
}

/* 集荷：オレンジ */
.type-badge-pickup {
  background: #ffedd5;
  color: #c2410c;
}

/* 納品：紫 */
.type-badge-deliver {
  background: #ede9fe;
  color: #6d28d9;
}

body .form-select {
  color: #212529 !important;
}

body .form-control {
  color: #212529 !important;
}

body textarea.form-control {
  color: #212529 !important;
}

/* ============================================================
   依頼一覧 #fieldworkTable（request-list）
   768px 以上: 列は割合で縮み、.request-list-td-value 内で省略
   768px 未満: DataTables の固定 col 幅を解除しカード行＋省略へ
   ============================================================ */
@media (min-width: 768px) {
  .request-list-table-wrap table#fieldworkTable {
    table-layout: fixed;
    width: 100%;
  }

  .request-list-table-wrap table#fieldworkTable thead th:nth-child(1) {
    width: 9% !important;
  }

  .request-list-table-wrap table#fieldworkTable thead th:nth-child(2) {
    width: 15% !important;
  }

  .request-list-table-wrap table#fieldworkTable thead th:nth-child(3) {
    width: 11% !important;
  }

  .request-list-table-wrap table#fieldworkTable thead th:nth-child(4) {
    width: 12% !important;
  }

  .request-list-table-wrap table#fieldworkTable thead th:nth-child(5) {
    width: 19% !important;
  }

  .request-list-table-wrap table#fieldworkTable thead th:nth-child(6) {
    width: 12% !important;
  }

  .request-list-table-wrap table#fieldworkTable thead th:nth-child(7) {
    width: 12% !important;
  }

  .request-list-table-wrap table#fieldworkTable thead th:nth-child(8) {
    width: 10% !important;
  }

  /* DataTables が付与する colgroup / col の幅を上書き（th だけでは列幅が効かない場合がある） */
  .request-list-table-wrap table#fieldworkTable colgroup col:nth-child(1) {
    width: 9% !important;
  }

  .request-list-table-wrap table#fieldworkTable colgroup col:nth-child(2) {
    width: 15% !important;
  }

  .request-list-table-wrap table#fieldworkTable colgroup col:nth-child(3) {
    width: 11% !important;
  }

  .request-list-table-wrap table#fieldworkTable colgroup col:nth-child(4) {
    width: 12% !important;
  }

  .request-list-table-wrap table#fieldworkTable colgroup col:nth-child(5) {
    width: 19% !important;
  }

  .request-list-table-wrap table#fieldworkTable colgroup col:nth-child(6) {
    width: 12% !important;
  }

  .request-list-table-wrap table#fieldworkTable colgroup col:nth-child(7) {
    width: 12% !important;
  }

  .request-list-table-wrap table#fieldworkTable colgroup col:nth-child(8) {
    width: 10% !important;
  }

  .request-list-table-wrap table#fieldworkTable colgroup col:nth-child(9) {
    width: 0 !important;
    min-width: 0 !important;
  }

  .request-list-table-wrap table#fieldworkTable tbody td {
    vertical-align: middle;
  }

  .request-list-table-wrap table#fieldworkTable .request-list-td-value {
    min-width: 0;
    overflow: hidden;
  }

  .request-list-table-wrap table#fieldworkTable .request-list-td-value .text-truncate {
    max-width: 100% !important;
  }

  .request-list-table-wrap table#fieldworkTable .request-list-td-value>a.text-truncate {
    display: block;
    min-width: 0;
  }
}

@media (max-width: 767.98px) {
  .request-list-table-wrap table#fieldworkTable {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .request-list-table-wrap table#fieldworkTable colgroup col {
    width: auto !important;
  }

  .request-list-table-wrap table#fieldworkTable thead th,
  .request-list-table-wrap table#fieldworkTable tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  .request-list-table-wrap.table-responsive .table#fieldworkTable tbody td .request-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .request-list-table-wrap.table-responsive .table#fieldworkTable tbody td .request-list-td-value .text-truncate {
    max-width: 100% !important;
  }

  .request-list-table-wrap.table-responsive .table#fieldworkTable tbody td .request-list-td-value .type-badge {
    max-width: 100%;
    white-space: normal;
    justify-content: flex-end;
  }
}

/* ============================================================
   ダッシュボード依頼一覧 #fieldworkTable（列幅のみ。全文日時）
   ============================================================ */
@media (min-width: 768px) {

  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable thead th:nth-child(1),
  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable colgroup col:nth-child(1) {
    width: 9% !important;
  }

  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable thead th:nth-child(2),
  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable colgroup col:nth-child(2) {
    width: 13% !important;
  }

  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable thead th:nth-child(3),
  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable colgroup col:nth-child(3) {
    width: 10% !important;
  }

  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable thead th:nth-child(4),
  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable colgroup col:nth-child(4) {
    width: 14% !important;
  }

  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable thead th:nth-child(5),
  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable colgroup col:nth-child(5) {
    width: 14% !important;
  }

  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable thead th:nth-child(6),
  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable colgroup col:nth-child(6) {
    width: 12% !important;
  }

  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable thead th:nth-child(7),
  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable colgroup col:nth-child(7) {
    width: 12% !important;
  }

  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable thead th:nth-child(8),
  .dashboard-request-list-table-wrap.request-list-table-wrap table#fieldworkTable colgroup col:nth-child(8) {
    width: 10% !important;
  }
}

/* ============================================================
   売上一覧 #sales-table（sales-management）取引先省略・列幅
   ============================================================ */
@media (min-width: 768px) {
  .sales-list-table-wrap table#sales-table {
    table-layout: fixed;
    width: 100%;
  }

  .sales-list-table-wrap table#sales-table thead th:nth-child(1) {
    width: 11%;
  }

  .sales-list-table-wrap table#sales-table thead th:nth-child(2) {
    width: 16%;
  }

  .sales-list-table-wrap table#sales-table thead th:nth-child(3) {
    width: 11%;
  }

  .sales-list-table-wrap table#sales-table thead th:nth-child(4) {
    width: 10%;
  }

  .sales-list-table-wrap table#sales-table thead th:nth-child(5) {
    width: 13%;
  }

  .sales-list-table-wrap table#sales-table thead th:nth-child(6) {
    width: 5%;
  }

  .sales-list-table-wrap table#sales-table thead th:nth-child(7) {
    width: 8%;
  }
    .sales-list-table-wrap table#sales-table thead th:nth-child(8) {
    width: 8%;
  }
    .sales-list-table-wrap table#sales-table thead th:nth-child(9) {
    width: 8%;
  }
    .sales-list-table-wrap table#sales-table thead th:nth-child(10) {
    width: 10%;
  }

  .sales-list-table-wrap table#sales-table colgroup col:nth-child(1) {
    width: 11% !important;
  }

  .sales-list-table-wrap table#sales-table colgroup col:nth-child(2) {
    width: 16% !important;
  }

  .sales-list-table-wrap table#sales-table colgroup col:nth-child(3) {
    width: 11% !important;
  }

  .sales-list-table-wrap table#sales-table colgroup col:nth-child(4) {
    width: 10% !important;
  }

  .sales-list-table-wrap table#sales-table colgroup col:nth-child(5) {
    width: 13% !important;
  }

  .sales-list-table-wrap table#sales-table colgroup col:nth-child(6) {
    width: 5% !important;
  }

  .sales-list-table-wrap table#sales-table colgroup col:nth-child(7) {
    width: 8% !important;
  }
   .sales-list-table-wrap table#sales-table colgroup col:nth-child(8) {
    width: 8% !important;
  }
   .sales-list-table-wrap table#sales-table colgroup col:nth-child(9) {
    width: 8% !important;
  }
   .sales-list-table-wrap table#sales-table colgroup col:nth-child(10) {
    width: 10% !important;
  }

  .sales-list-table-wrap table#sales-table tbody td {
    vertical-align: middle;
  }

  .sales-list-table-wrap table#sales-table tbody td:nth-child(2) {
    overflow: hidden;
    max-width: 100%;
  }

  .sales-list-table-wrap table#sales-table .sales-list-td-value {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .sales-list-table-wrap table#sales-table .sales-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

/* ============================================================
   お知らせ一覧 #notification-result（root/notification-list）タイトル省略
   768px 以上: table-layout: fixed で列幅を固定し、タイトル列を省略表示にする
   ============================================================ */
@media (min-width: 768px) {
  .notification-list-table-wrap table#notification-result {
    table-layout: fixed;
    width: 100%;
  }

  .notification-list-table-wrap table#notification-result tbody td:nth-child(3) {
    overflow: hidden;
    max-width: 100%;
  }

  .notification-list-table-wrap table#notification-result .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .sales-list-table-wrap table#sales-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .sales-list-table-wrap table#sales-table colgroup col {
    width: auto !important;
  }

  .sales-list-table-wrap table#sales-table thead th,
  .sales-list-table-wrap table#sales-table tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  .sales-list-table-wrap.table-responsive .table#sales-table tbody td .sales-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .sales-list-table-wrap.table-responsive .table#sales-table tbody td .sales-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

/* ============================================================
   実績報告書一覧
   ============================================================ */
@media (min-width: 768px) {
  .delivery-note-list-table-wrap table#deliveryNoteTable {
    table-layout: fixed;
    width: 100%;
  }

  .delivery-note-list-table-wrap table#deliveryNoteTable thead th:nth-child(2),
  .delivery-note-list-table-wrap table#deliveryNoteTable colgroup col:nth-child(2) {
    width: 14% !important;
  }

  .delivery-note-list-table-wrap table#deliveryNoteTable tbody td {
    vertical-align: middle;
  }

  .delivery-note-list-table-wrap table#deliveryNoteTable tbody td:nth-child(2) {
    overflow: hidden;
    max-width: 100%;
  }

  .delivery-note-list-table-wrap table#deliveryNoteTable .sales-list-td-value {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .delivery-note-list-table-wrap table#deliveryNoteTable .sales-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .delivery-note-list-table-wrap table#deliveryNoteTable {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .delivery-note-list-table-wrap table#deliveryNoteTable colgroup col {
    width: auto !important;
  }

  .delivery-note-list-table-wrap table#deliveryNoteTable thead th,
  .delivery-note-list-table-wrap table#deliveryNoteTable tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  .delivery-note-list-table-wrap.table-responsive .table#deliveryNoteTable tbody td .sales-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .delivery-note-list-table-wrap.table-responsive .table#deliveryNoteTable tbody td .sales-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

/* ============================================================
   取引先別売上サマリ #summary-table（sales-summary-by-customer）
   ============================================================ */
@media (min-width: 768px) {
  .sales-summary-table-wrap table#summary-table {
    table-layout: fixed;
    width: 100%;
  }

  .sales-summary-table-wrap table#summary-table thead th:nth-child(1) {
    width: 22%;
  }

  .sales-summary-table-wrap table#summary-table thead th:nth-child(2) {
    width: 13%;
  }

  .sales-summary-table-wrap table#summary-table thead th:nth-child(3) {
    width: 13%;
  }

  .sales-summary-table-wrap table#summary-table thead th:nth-child(4) {
    width: 13%;
  }

  .sales-summary-table-wrap table#summary-table thead th:nth-child(5) {
    width: 13%;
  }

  .sales-summary-table-wrap table#summary-table thead th:nth-child(6) {
    width: 13%;
  }

  .sales-summary-table-wrap table#summary-table thead th:nth-child(7) {
    width: 13%;
  }

  .sales-summary-table-wrap table#summary-table colgroup col:nth-child(1) {
    width: 22% !important;
  }

  .sales-summary-table-wrap table#summary-table colgroup col:nth-child(2) {
    width: 13% !important;
  }

  .sales-summary-table-wrap table#summary-table colgroup col:nth-child(3) {
    width: 13% !important;
  }

  .sales-summary-table-wrap table#summary-table colgroup col:nth-child(4) {
    width: 13% !important;
  }

  .sales-summary-table-wrap table#summary-table colgroup col:nth-child(5) {
    width: 13% !important;
  }

  .sales-summary-table-wrap table#summary-table colgroup col:nth-child(6) {
    width: 13% !important;
  }

  .sales-summary-table-wrap table#summary-table colgroup col:nth-child(7) {
    width: 13% !important;
  }

  .sales-summary-table-wrap table#summary-table tbody td {
    vertical-align: middle;
  }

  .sales-summary-table-wrap table#summary-table tbody td:nth-child(1) {
    overflow: hidden;
    max-width: 100%;
  }

  .sales-summary-table-wrap table#summary-table .sales-summary-td-value {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .sales-summary-table-wrap table#summary-table .sales-summary-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .sales-summary-table-wrap table#summary-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .sales-summary-table-wrap table#summary-table colgroup col {
    width: auto !important;
  }

  .sales-summary-table-wrap table#summary-table thead th,
  .sales-summary-table-wrap table#summary-table tbody td,
  .sales-summary-table-wrap table#summary-table tfoot td {
    width: auto !important;
    min-width: 0 !important;
  }

  /* 取引先別売上サマリのみ：DataTables 2 scrollX（.dt-scroll-*）。同期用 body 内 tfoot は非表示、カードは .dt-scroll-foot の表のみ */
  .sales-summary-table-wrap .dt-scroll-body #summary-table tfoot {
    display: none !important;
  }

  .sales-summary-table-wrap .dt-scroll-foot table colgroup col {
    width: auto !important;
    min-width: 0 !important;
  }

  .sales-summary-table-wrap .dt-scroll-foot table tfoot tr {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e6f0;
    border-radius: .6rem;
    margin-top: 1rem;
    margin-bottom: 0;
    padding: .75rem 1rem;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  }

  .sales-summary-table-wrap .dt-scroll-foot table tfoot td {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: .35rem 0;
    border: none;
    font-size: .88rem;
    border-bottom: 1px solid #f0f0f0;
  }

  .sales-summary-table-wrap .dt-scroll-foot table tfoot td .dt-scroll-sizing {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
  }

  .sales-summary-table-wrap .dt-scroll-foot table tfoot td:last-child {
    border-bottom: none;
  }

  .sales-summary-table-wrap .dt-scroll-foot table tfoot td::before {
    content: attr(data-label);
    font-size: .75rem;
    font-weight: 700;
    color: #6c757d;
    flex-shrink: 0;
    margin-right: .75rem;
    white-space: nowrap;
  }

  .sales-summary-table-wrap .dt-scroll-foot table tfoot td:first-child {
    justify-content: center;
    font-weight: 700;
  }

  .sales-summary-table-wrap .dt-scroll-foot table tfoot td:first-child::before {
    display: none;
  }

  /* scrollX 無し時：単一 #summary-table のみ */
  .sales-summary-table-wrap.table-responsive .table#summary-table tfoot tr {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e6f0;
    border-radius: .6rem;
    margin-top: 1rem;
    margin-bottom: 0;
    padding: .75rem 1rem;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  }

  .sales-summary-table-wrap.table-responsive .table#summary-table tfoot td {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: .35rem 0;
    border: none;
    font-size: .88rem;
    border-bottom: 1px solid #f0f0f0;
  }

  .sales-summary-table-wrap.table-responsive .table#summary-table tfoot td .dt-scroll-sizing {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
  }

  .sales-summary-table-wrap.table-responsive .table#summary-table tfoot td:last-child {
    border-bottom: none;
  }

  .sales-summary-table-wrap.table-responsive .table#summary-table tfoot td::before {
    content: attr(data-label);
    font-size: .75rem;
    font-weight: 700;
    color: #6c757d;
    flex-shrink: 0;
    margin-right: .75rem;
    white-space: nowrap;
  }

  .sales-summary-table-wrap.table-responsive .table#summary-table tfoot td:first-child {
    justify-content: center;
    font-weight: 700;
  }

  .sales-summary-table-wrap.table-responsive .table#summary-table tfoot td:first-child::before {
    display: none;
  }

  .sales-summary-table-wrap.table-responsive .table#summary-table tbody td:nth-child(1) .sales-summary-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .sales-summary-table-wrap.table-responsive .table#summary-table tbody td:nth-child(1) .sales-summary-td-value .text-truncate {
    max-width: 100% !important;
  }
}

/* ============================================================
   取引先一覧 #customer-result（customer-list）
   ============================================================ */
@media (min-width: 768px) {
  .customer-list-table-wrap table#customer-result {
    table-layout: fixed;
    width: 100%;
  }

  .customer-list-table-wrap table#customer-result thead th:nth-child(1) {
    width: 3% !important;
  }

  .customer-list-table-wrap table#customer-result thead th:nth-child(2) {
    width: 15% !important;
  }

  .customer-list-table-wrap table#customer-result thead th:nth-child(3) {
    width: 10% !important;
  }

  .customer-list-table-wrap table#customer-result thead th:nth-child(4) {
    width: 10% !important;
  }

  .customer-list-table-wrap table#customer-result thead th:nth-child(5) {
    width: 15% !important;
  }

  .customer-list-table-wrap table#customer-result thead th:nth-child(6) {
    width: 15% !important;
  }

  .customer-list-table-wrap table#customer-result thead th:nth-child(7) {
    width: 5% !important;
  }

  .customer-list-table-wrap table#customer-result thead th:nth-child(8) {
    width: 27% !important;
  }

  .customer-list-table-wrap table#customer-result tbody td {
    vertical-align: middle;
  }

  .customer-list-table-wrap table#customer-result .customer-list-td-value {
    min-width: 0;
    overflow: hidden;
  }

  .customer-list-table-wrap table#customer-result .customer-list-td-value .text-truncate {
    max-width: 100% !important;
  }

  .customer-list-table-wrap table#customer-result tbody td:nth-child(1) .customer-list-td-value,
  .customer-list-table-wrap table#customer-result tbody td:nth-child(8) .customer-list-td-value {
    text-align: center;
  }
}

@media (max-width: 767.98px) {
  .customer-list-table-wrap table#customer-result {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .customer-list-table-wrap table#customer-result colgroup col {
    width: auto !important;
  }

  .customer-list-table-wrap table#customer-result thead th,
  .customer-list-table-wrap table#customer-result tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  .customer-list-table-wrap.table-responsive .table#customer-result tbody td .customer-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .customer-list-table-wrap.table-responsive .table#customer-result tbody td .customer-list-td-value .text-truncate {
    max-width: 100% !important;
  }

  .customer-list-table-wrap.table-responsive .table#customer-result tbody td:nth-child(1) .customer-list-td-value,
  .customer-list-table-wrap.table-responsive .table#customer-result tbody td:nth-child(8) .customer-list-td-value {
    text-align: center;
  }
}

/* ============================================================
   部署一覧エリアのスタイル
   ============================================================ */
.department-list-wrapper {
  margin-left: 1rem;
  border-left: 3px solid #435ebe;
  padding-left: 1rem;
}

.department-list-header {
  margin-bottom: 0.5rem;
}

.department-list-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
}

.department-list-table-container {
  overflow-x: auto;
}

.department-list-table {
  width: 100% !important;
  border-collapse: collapse !important;
  background: #fff;
  border-top: 1px solid #dee2e6;
  border-left: 1px solid #dee2e6;
  border-right: 1px solid #dee2e6;
  table-layout: fixed !important;
}

.department-list-table colgroup col:nth-child(1) {
  width: 20% !important;
}

.department-list-table colgroup col:nth-child(2) {
  width: 12% !important;
}

.department-list-table colgroup col:nth-child(3) {
  width: 20% !important;
}

.department-list-table colgroup col:nth-child(4) {
  width: 28% !important;
}

.department-list-table colgroup col:nth-child(5) {
  width: 8% !important;
}

.department-list-table colgroup col:nth-child(6) {
  width: 12% !important;
}

.department-list-table thead th:nth-child(1) {
  width: 20% !important;
}

.department-list-table thead th:nth-child(2) {
  width: 12% !important;
}

.department-list-table thead th:nth-child(3) {
  width: 20% !important;
}

.department-list-table thead th:nth-child(4) {
  width: 28% !important;
}

.department-list-table thead th:nth-child(5) {
  width: 8% !important;
}

.department-list-table thead th:nth-child(6) {
  width: 12% !important;
}

.department-list-table thead {
  background: #fff;
}

.department-list-table thead th {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid #dee2e6;
  border-left: 1px solid #dee2e6;
}

.department-list-table thead th:last-child {
  text-align: center;
}

.department-list-table tbody td {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  vertical-align: middle;
  border-bottom: 1px solid #dee2e6;
  border-left: 1px solid #dee2e6;
}

.department-list-table tbody tr:hover {
  background-color: rgba(67, 94, 190, 0.03);
}

/* 取引先一覧の子行内テーブル — 親のスマホカード化の対象外 */
@media (max-width: 767.98px) {
  .department-list-wrapper {
    margin-left: 0.5rem;
    padding-left: 0.75rem;
  }

  .department-list-table thead {
    display: table-header-group !important;
  }

  .department-list-table tbody tr {
    display: table-row !important;
    border: 0 !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .department-list-table tbody td {
    display: table-cell !important;
    justify-content: normal !important;
    padding: 0.5rem !important;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6) !important;
    font-size: inherit !important;
  }

  .department-list-table tbody td:last-child {
    border-bottom: 1px solid var(--bs-border-color, #dee2e6) !important;
  }

  .department-list-table tbody td::before {
    content: none !important;
  }
}

/* ============================================================
   スマートフォン共通対応
   ============================================================ */
@media (max-width: 767.98px) {

  /* --- request-create.html: 空き状況カレンダーを非表示 --- */
  .sched-section {
    display: none !important;
  }

  /* --- worker-assignment.html: 未割当テーブル → カード形式 --- */

  .table-responsive .table thead {
    display: none;
  }

  .table-responsive .table tbody tr {
    display: block;
    border: 1px solid #e2e6f0;
    border-radius: .6rem;
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  }

  .table-responsive .table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .35rem 0;
    border: none;
    font-size: .88rem;
    border-bottom: 1px solid #f0f0f0;
  }

  .table-responsive .table tbody td:last-child {
    border-bottom: none;
  }

  .table-responsive .table tbody td::before {
    content: attr(data-label);
    font-size: .75rem;
    font-weight: 700;
    color: #6c757d;
    flex-shrink: 0;
    margin-right: .75rem;
    white-space: nowrap;
  }

  .table-responsive .table tbody td.td-action {
    justify-content: flex-end;
    padding-top: .6rem;
  }

  .table-responsive .table tbody td.td-action::before {
    margin-right: auto;
  }

  .table-responsive {
    overflow-x: visible;
  }

  /* 取引先詳細：アイテム個別価格カード行のアイテム名省略 */
  .customer-detail-item-prices-table-wrap.table-responsive .table#item-prices-table tbody td:nth-child(1) {
    overflow: hidden;
    min-width: 0;
  }

  .customer-detail-item-prices-table-wrap.table-responsive .table#item-prices-table tbody td:nth-child(1) .request-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-align: right;
  }

  .customer-detail-item-prices-table-wrap.table-responsive .table#item-prices-table tbody td:nth-child(1) .request-list-td-value .text-truncate {
    min-width: 0;
    max-width: 100% !important;
  }

  .customer-detail-item-prices-table-wrap.table-responsive .table#item-prices-table tbody td:last-child {
    justify-content: flex-end;
    gap: 0.25rem;
  }

  .customer-detail-item-prices-table-wrap.table-responsive .table#item-prices-table tbody td:last-child::before {
    margin-right: auto;
  }

  .table-responsive.no-card-transform .table thead {
    display: table-header-group;
  }

  .table-responsive.no-card-transform .table tbody tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    margin-bottom: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
  }

  .table-responsive.no-card-transform .table tbody td {
    display: table-cell;
    justify-content: normal;
    padding: .5rem;
    border-bottom: 0;
    font-size: inherit;
  }

  .table-responsive.no-card-transform .table tbody td::before {
    content: none;
  }

  /* --- フィルター行を縦積みに --- */
  .requests-filter-controls {
    flex-direction: column;
    align-items: stretch !important;
    width: 100%;
  }

  .requests-filter-controls .form-control,
  .requests-filter-controls .form-select {
    width: 100% !important;
  }

  /* --- ページネーション行を縦積みに --- */
  .pagination-footer {
    flex-direction: column;
    gap: .75rem;
    align-items: center !important;
  }

  /* --- receipt-list.html: フィルター行を縦積みに --- */
  .receipt-filter-controls {
    flex-direction: column;
    align-items: stretch !important;
    width: 100%;
  }

  .receipt-filter-controls .form-control,
  .receipt-filter-controls .form-select,
  .receipt-filter-controls .input-group {
    width: 100% !important;
    max-width: 100% !important;
  }

  .table-toolbar {
    align-items: stretch;
  }

  .table-toolbar-left,
  .table-toolbar-right {
    width: 100%;
  }

  .table-toolbar .dataTables_length label {
    width: 100%;
    justify-content: space-between;
  }

  .table-toolbar .dataTables_length select {
    width: auto;
  }
}

/* ============================================================
   Bootstrap Tooltip 共通（一覧セル全文・chrysoprase.js から利用）
   浅色・細枠・軽い影。customClass の有無に依存せず .tooltip 全体に適用し、
   DataTables 子行などから表示される body 直下の Tooltip も同一見た目にする。
   ============================================================ */
.tooltip {
  --bs-tooltip-bg: #f4f6fb;
  --bs-tooltip-color: #243047;
  --bs-tooltip-opacity: 1;
  opacity: 1 !important;
  filter: drop-shadow(0 4px 14px rgba(31, 42, 60, 0.1));
}

.tooltip .tooltip-inner {
  max-width: min(360px, 90vw);
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
  border-radius: 8px;
  border: 1px solid rgba(67, 94, 190, 0.14);
  background-color: #f4f6fb !important;
  color: #243047 !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  opacity: 1;
}

/* Popper 配置別：三角の塗り（cp-tooltip-light のみに依存しない） */
.tooltip[data-popper-placement^='top'] .tooltip-arrow::before,
.tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: #f4f6fb !important;
}

.tooltip[data-popper-placement^='bottom'] .tooltip-arrow::before,
.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: #f4f6fb !important;
}

.tooltip[data-popper-placement^='left'] .tooltip-arrow::before,
.tooltip.bs-tooltip-start .tooltip-arrow::before {
  border-left-color: #f4f6fb !important;
}

.tooltip[data-popper-placement^='right'] .tooltip-arrow::before,
.tooltip.bs-tooltip-end .tooltip-arrow::before {
  border-right-color: #f4f6fb !important;
}

/* customClass */
.tooltip.cp-tooltip-light {
  --bs-tooltip-bg: #f4f6fb;
  --bs-tooltip-color: #243047;
  --bs-tooltip-opacity: 1;
  opacity: 1 !important;
  filter: drop-shadow(0 4px 14px rgba(31, 42, 60, 0.1));
}

@media (min-width: 768px) {
    /* 破棄確認ダイアログ（showDiscardConfirm / customClass: swal-discard-confirm） */
    .swal-discard-confirm .swal2-content {
      padding: 0 0 0 3.6em;
      text-align: left;
    }
    /* 破棄確認ダイアログ（入金消込確認 / customClass: swal-discard-confirm-pay） */
    .swal-discard-confirm-pay .swal2-content {
      padding: 0 0 0 2em;
      text-align: left;
    }
    .swal-discard-confirm .swal2-html-container {
        padding: 0 0 0 3.6em;
        text-align: left;
    }
    .swal-discard-confirm-pay .swal2-html-container {
        padding: 0 0 0 2em;
        text-align: left;
    }
    /* 依頼詳細：予定日時未設定の割当不可 */
    .swal-detail-assign-schedule .swal2-content {
        padding: 0 1.5em 0 1.2em;
        text-align: left;
    }
    .swal-detail-assign-schedule .swal2-html-container {
        padding: 0 1.5em 0 1.2em;
        text-align: left;
    }
}
/* ============================================================
   アイテム一覧 #itemTable（item-list）
   768px 以上: 列は割合で縮み、省略
   768px 未満: DataTables の固定 col 幅を解除しカード行＋省略へ
   ============================================================ */
@media (min-width: 768px) {
  .item-list-table-wrap table#itemTable {
    table-layout: fixed;
    width: 100%;
  }

  .item-list-table-wrap table#itemTable thead th:nth-child(1) {
    width: 12% !important;
  }

  .item-list-table-wrap table#itemTable thead th:nth-child(2) {
    width: 30% !important;
  }

  .item-list-table-wrap table#itemTable thead th:nth-child(3) {
    width: 13% !important;
  }

  .item-list-table-wrap table#itemTable thead th:nth-child(4) {
    width: 15% !important;
  }

  .item-list-table-wrap table#itemTable thead th:nth-child(5) {
    width: 13% !important;
  }

  .item-list-table-wrap table#itemTable thead th:nth-child(6) {
    width: 17% !important;
  }

  .item-list-table-wrap table#itemTable colgroup col:nth-child(1) {
    width: 12% !important;
  }

  .item-list-table-wrap table#itemTable colgroup col:nth-child(2) {
    width: 30% !important;
  }

  .item-list-table-wrap table#itemTable colgroup col:nth-child(3) {
    width: 13% !important;
  }

  .item-list-table-wrap table#itemTable colgroup col:nth-child(4) {
    width: 15% !important;
  }

  .item-list-table-wrap table#itemTable colgroup col:nth-child(5) {
    width: 13% !important;
  }

  .item-list-table-wrap table#itemTable colgroup col:nth-child(6) {
    width: 17% !important;
  }

  .item-list-table-wrap table#itemTable tbody td {
    vertical-align: middle;
  }

  .item-list-table-wrap table#itemTable .item-list-td-value {
    min-width: 0;
    overflow: hidden;
  }

  .item-list-table-wrap table#itemTable .item-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .item-list-table-wrap table#itemTable {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .item-list-table-wrap table#itemTable colgroup col {
    width: auto !important;
  }

  .item-list-table-wrap table#itemTable thead th,
  .item-list-table-wrap table#itemTable tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  .item-list-table-wrap.table-responsive .table#itemTable tbody td .item-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .item-list-table-wrap.table-responsive .table#itemTable tbody td .item-list-td-value .text-truncate {
    max-width: 100% !important;
  }

  /* 操作列のボタンを緊密に配置 */
  .item-list-table-wrap.table-responsive .table#itemTable tbody td:last-child {
    justify-content: flex-end;
    gap: 0.25rem;
  }

  .item-list-table-wrap.table-responsive .table#itemTable tbody td:last-child::before {
    margin-right: auto;
  }
}

/* ============================================================
   取引先別価格一覧 #priceTable（item-list）
   768px 以上: 列は割合で縮み、省略
   768px 未満: DataTables の固定 col 幅を解除しカード行＋省略へ
   ============================================================ */
@media (min-width: 768px) {
  .price-list-table-wrap table#priceTable {
    table-layout: fixed;
    width: 100%;
  }

  .price-list-table-wrap table#priceTable thead th:nth-child(1) {
    width: 15% !important;
  }

  .price-list-table-wrap table#priceTable thead th:nth-child(2) {
    width: 15% !important;
  }

  .price-list-table-wrap table#priceTable thead th:nth-child(3) {
    width: 10% !important;
  }

  .price-list-table-wrap table#priceTable thead th:nth-child(4) {
    width: 12% !important;
  }

  .price-list-table-wrap table#priceTable thead th:nth-child(5) {
    width: 10% !important;
  }

  .price-list-table-wrap table#priceTable thead th:nth-child(6) {
    width: 12% !important;
  }

  .price-list-table-wrap table#priceTable thead th:nth-child(7) {
    width: 10% !important;
  }

  .price-list-table-wrap table#priceTable thead th:nth-child(8) {
    width: 8% !important;
  }

  .price-list-table-wrap table#priceTable thead th:nth-child(9) {
    width: 8% !important;
  }

  .price-list-table-wrap table#priceTable colgroup col:nth-child(1) {
    width: 15% !important;
  }

  .price-list-table-wrap table#priceTable colgroup col:nth-child(2) {
    width: 15% !important;
  }

  .price-list-table-wrap table#priceTable colgroup col:nth-child(3) {
    width: 10% !important;
  }

  .price-list-table-wrap table#priceTable colgroup col:nth-child(4) {
    width: 12% !important;
  }

  .price-list-table-wrap table#priceTable colgroup col:nth-child(5) {
    width: 10% !important;
  }

  .price-list-table-wrap table#priceTable colgroup col:nth-child(6) {
    width: 12% !important;
  }

  .price-list-table-wrap table#priceTable colgroup col:nth-child(7) {
    width: 10% !important;
  }

  .price-list-table-wrap table#priceTable colgroup col:nth-child(8) {
    width: 8% !important;
  }

  .price-list-table-wrap table#priceTable colgroup col:nth-child(9) {
    width: 8% !important;
  }

  .price-list-table-wrap table#priceTable tbody td {
    vertical-align: middle;
  }

  .price-list-table-wrap table#priceTable .price-list-td-value {
    min-width: 0;
    overflow: hidden;
  }

  .price-list-table-wrap table#priceTable .price-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .price-list-table-wrap table#priceTable {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .price-list-table-wrap table#priceTable colgroup col {
    width: auto !important;
  }

  .price-list-table-wrap table#priceTable thead th,
  .price-list-table-wrap table#priceTable tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  .price-list-table-wrap.table-responsive .table#priceTable tbody td .price-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .price-list-table-wrap.table-responsive .table#priceTable tbody td .price-list-td-value .text-truncate {
    max-width: 100% !important;
  }

  /* 操作列のボタンを緊密に配置 */
  .price-list-table-wrap.table-responsive .table#priceTable tbody td:last-child {
    justify-content: flex-end;
    gap: 0.25rem;
  }

  .price-list-table-wrap.table-responsive .table#priceTable tbody td:last-child::before {
    margin-right: auto;
  }
}

/* ============================================================
   振込口座一覧 #bankAccountTable（bank-account-list）
   768px 以上: 列は割合で縮み、省略
   768px 未満: DataTables の固定 col 幅を解除しカード行＋省略へ
   ============================================================ */
@media (min-width: 768px) {
  .bank-account-list-table-wrap table#bankAccountTable {
    table-layout: fixed;
    width: 100%;
  }

  .bank-account-list-table-wrap table#bankAccountTable thead th:nth-child(1) {
    width: 10% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable thead th:nth-child(2) {
    width: 15% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable thead th:nth-child(3) {
    width: 22% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable thead th:nth-child(4) {
    width: 10% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable thead th:nth-child(5) {
    width: 13% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable thead th:nth-child(6) {
    width: 17% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable thead th:nth-child(7) {
    width: 13% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable colgroup col:nth-child(1) {
    width: 10% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable colgroup col:nth-child(2) {
    width: 15% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable colgroup col:nth-child(3) {
    width: 22% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable colgroup col:nth-child(4) {
    width: 10% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable colgroup col:nth-child(5) {
    width: 13% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable colgroup col:nth-child(6) {
    width: 17% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable colgroup col:nth-child(7) {
    width: 13% !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable tbody td {
    vertical-align: middle;
  }

  .bank-account-list-table-wrap table#bankAccountTable .bank-account-list-td-value {
    min-width: 0;
    overflow: hidden;
  }

  .bank-account-list-table-wrap table#bankAccountTable .bank-account-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .bank-account-list-table-wrap table#bankAccountTable {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable colgroup col {
    width: auto !important;
  }

  .bank-account-list-table-wrap table#bankAccountTable thead th,
  .bank-account-list-table-wrap table#bankAccountTable tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  .bank-account-list-table-wrap.table-responsive .table#bankAccountTable tbody td .bank-account-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .bank-account-list-table-wrap.table-responsive .table#bankAccountTable tbody td .bank-account-list-td-value .text-truncate {
    max-width: 100% !important;
  }

  /* 操作列のボタンを緊密に配置 */
  .bank-account-list-table-wrap.table-responsive .table#bankAccountTable tbody td:last-child {
    justify-content: flex-end;
    gap: 0.25rem;
  }

  .bank-account-list-table-wrap.table-responsive .table#bankAccountTable tbody td:last-child::before {
    margin-right: auto;
  }
}

/* ============================================================
   スタッフ管理 #staff-result（staff-management）
   768px 以上: 列は割合で縮み、省略
   768px 未満: DataTables の固定 col 幅を解除しカード行＋省略へ
   ============================================================ */
@media (min-width: 768px) {
  .staff-management-table-wrap table#staff-result {
    table-layout: fixed;
    width: 100%;
  }

  .staff-management-table-wrap table#staff-result thead th:nth-child(1) {
    width: 15% !important;
  }

  .staff-management-table-wrap table#staff-result thead th:nth-child(2) {
    width: 28% !important;
  }

  .staff-management-table-wrap table#staff-result thead th:nth-child(3) {
    width: 12% !important;
  }

  .staff-management-table-wrap table#staff-result thead th:nth-child(4) {
    width: 20% !important;
  }

  .staff-management-table-wrap table#staff-result thead th:nth-child(5) {
    width: 10% !important;
  }

  .staff-management-table-wrap table#staff-result thead th:nth-child(6) {
    width: 15% !important;
  }

  .staff-management-table-wrap table#staff-result colgroup col:nth-child(1) {
    width: 15% !important;
  }

  .staff-management-table-wrap table#staff-result colgroup col:nth-child(2) {
    width: 28% !important;
  }

  .staff-management-table-wrap table#staff-result colgroup col:nth-child(3) {
    width: 12% !important;
  }

  .staff-management-table-wrap table#staff-result colgroup col:nth-child(4) {
    width: 20% !important;
  }

  .staff-management-table-wrap table#staff-result colgroup col:nth-child(5) {
    width: 10% !important;
  }

  .staff-management-table-wrap table#staff-result colgroup col:nth-child(6) {
    width: 15% !important;
  }

  .staff-management-table-wrap table#staff-result tbody td {
    vertical-align: middle;
  }

  .staff-management-table-wrap table#staff-result .staff-management-td-value {
    min-width: 0;
    overflow: hidden;
  }

  .staff-management-table-wrap table#staff-result .staff-management-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .staff-management-table-wrap table#staff-result {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .staff-management-table-wrap table#staff-result colgroup col {
    width: auto !important;
  }

  .staff-management-table-wrap table#staff-result thead th,
  .staff-management-table-wrap table#staff-result tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  .staff-management-table-wrap.table-responsive .table#staff-result tbody td .staff-management-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .staff-management-table-wrap.table-responsive .table#staff-result tbody td .staff-management-td-value .text-truncate {
    max-width: 100% !important;
  }

  /* 操作列のボタンを緊密に配置 */
  .staff-management-table-wrap.table-responsive .table#staff-result tbody td:last-child {
    justify-content: flex-end;
    gap: 0.25rem;
  }

  .staff-management-table-wrap.table-responsive .table#staff-result tbody td:last-child::before {
    margin-right: auto;
  }
}

/* ============================================================
   任意請求一覧 #voluntaryInvoiceTable（invoice-list）
   768px 以上: 列は割合で縮み、省略
   768px 未満: DataTables の固定 col 幅を解除しカード行＋省略へ
   ============================================================ */
@media (min-width: 768px) {
  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable {
    table-layout: fixed;
    width: 100%;
  }

  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable thead th:nth-child(1),
  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable colgroup col:nth-child(1) {
    width: 35% !important;
  }

  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable thead th:nth-child(2),
  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable colgroup col:nth-child(2) {
    width: 22% !important;
  }

  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable thead th:nth-child(3),
  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable colgroup col:nth-child(3) {
    width: 23% !important;
  }

  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable thead th:nth-child(4),
  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable colgroup col:nth-child(4) {
    width: 20% !important;
  }

  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable tbody td {
    vertical-align: middle;
  }

  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable .voluntary-list-td-value {
    min-width: 0;
    overflow: hidden;
  }

  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable .voluntary-list-td-value .text-truncate {
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable colgroup col {
    width: auto !important;
  }

  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable thead th,
  .voluntary-invoice-table-wrap table#voluntaryInvoiceTable tbody td {
    width: auto !important;
    min-width: 0 !important;
  }

  .voluntary-invoice-table-wrap.table-responsive .table#voluntaryInvoiceTable tbody td .voluntary-list-td-value {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-align: right;
  }

  .voluntary-invoice-table-wrap.table-responsive .table#voluntaryInvoiceTable tbody td .voluntary-list-td-value .text-truncate {
    max-width: 100% !important;
  }

  .voluntary-invoice-table-wrap.table-responsive .table#voluntaryInvoiceTable tbody td:last-child {
    justify-content: flex-end;
    gap: 0.25rem;
  }

  .voluntary-invoice-table-wrap.table-responsive .table#voluntaryInvoiceTable tbody td:last-child::before {
    margin-right: auto;
  }
}