.contract-detail-card {
  background: #fff;
}

.contract-detail-table th,
.contract-detail-table td {
  vertical-align: middle;
}

.contract-detail-table th.contract-th {
  background: #f8f9fa;
  font-weight: 600;
}

.contract-detail-table td {
  background: #fff;
}

.contract-detail-table tr:last-child td,
.contract-detail-table tr:last-child th {
  border-bottom: 0;
}

.contract-pre {
  white-space: pre-wrap;
}

.contract-detail-table th.contract-th-time {
  white-space: nowrap;
  font-size: 0.92em;
  letter-spacing: -0.2px;
}

.fc .fc-daygrid-day-number,
.fc .fc-daygrid-day-top,
.fc .fc-daygrid-day-frame {
  cursor: pointer;
}


.week-cell-head-fixed {
  min-height: 260px;
  max-height: 260px;
  display: flex;
  flex-direction: column;
}

.week-cell-head-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 4px;
  padding-right: 4px;
}

.collect-project-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 320px);
  min-height: 360px;
  overflow: auto;
  position: relative;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  cursor: grab;
  touch-action: pan-x pan-y;
}

.collect-project-table-wrap.is-dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.collect-project-table {
  width: auto;
  min-width: 2830px;
  max-width: none;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 0.88rem;
}

.collect-project-table thead th {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: #f1f5f9;
  background-clip: padding-box;
  box-shadow: 0 1px 0 #dee2e6;
  white-space: nowrap;
  overflow: visible;
  vertical-align: middle;
}

.collect-project-table thead th:not(:last-child) {
  border-right: 1px solid #d6dbe1;
}

.collect-project-table tbody td {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  vertical-align: middle;
}

.collect-project-table th,
.collect-project-table td {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.collect-project-table td.text-end,
.collect-project-table th.text-end {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.collect-project-table thead th.text-end {
  font-size: inherit;
  letter-spacing: normal;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
  text-overflow: clip;
}

.collect-project-table .collect-money-cell {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-size: 0.76rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}

.collect-ellipsis {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.collect-link-ellipsis {
  display: inline-block;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  vertical-align: bottom;
}

.collect-project-name-cell,
.collect-project-name-link,
.collect-client-cell {
  font-size: 0.76rem;
  letter-spacing: -0.02em;
}

.collect-col-sub { min-width: 130px; }
.collect-col-code { min-width: 150px; }
.collect-col-name { min-width: 380px; }
.collect-col-client { min-width: 260px; }
.collect-col-status { min-width: 90px; }
.collect-col-pm { min-width: 130px; }
.collect-col-note-date { min-width: 120px; }
.collect-col-note-text { min-width: 500px; }
.collect-col-total-amount,
.collect-col-collected-amount,
.collect-col-remaining-amount { min-width: 150px; }
.collect-col-expected-current,
.collect-col-expected-next { min-width: 180px; }
.collect-col-action { min-width: 90px; }

.collect-latest-note-cell {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.collect-project-name-link {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}

.collect-sticky-left {
  position: -webkit-sticky;
  position: sticky;
  z-index: 20;
  background-color: #fff;
  background-clip: padding-box;
}

.collect-project-table thead .collect-sticky-left {
  z-index: 50;
  background-color: #f1f5f9;
}

.collect-sticky-last {
  box-shadow: 4px 0 6px rgba(0, 0, 0, 0.08);
}

.collect-project-table tbody tr:hover .collect-sticky-left {
  background-color: #f5f5f5;
}

.collect-mobile-scroll-hint {
  margin-bottom: 0.4rem;
  color: #64748b;
  font-size: 0.78rem;
}

.expense-project-autocomplete {
  position: relative;
}

.expense-project-suggestions {
  top: calc(100% + 2px);
  left: 0;
  z-index: 1080;
  max-height: 300px;
  overflow-y: auto;
}

.expense-project-suggestion {
  cursor: pointer;
}

@media (max-width: 991.98px) {
  .collect-project-table {
    font-size: 0.82rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .collect-project-table .collect-col-sub,
  .collect-project-table th[data-col-key="sub-category"],
  .collect-project-table td[data-col-key="sub-category"] {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
  }

  .collect-project-table .collect-col-code,
  .collect-project-table th[data-col-key="contract-code"],
  .collect-project-table td[data-col-key="contract-code"] {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
  }

  .collect-project-table .collect-col-name,
  .collect-project-table th[data-col-key="project-name"],
  .collect-project-table td[data-col-key="project-name"] {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
  }
}

@media (max-width: 767.98px) {
  .collect-project-table {
    min-width: 2450px;
  }

  .collect-project-table-wrap {
    max-height: calc(100vh - 260px);
    max-height: calc(100dvh - 220px);
    min-height: 320px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }

  .collect-project-table col[data-col-key="sub-category"],
  .collect-project-table col[data-col-key="contract-code"],
  .collect-project-table th[data-col-key="sub-category"],
  .collect-project-table th[data-col-key="contract-code"],
  .collect-project-table td[data-col-key="sub-category"],
  .collect-project-table td[data-col-key="contract-code"] {
    display: none !important;
  }

  .collect-project-table .collect-col-name,
  .collect-project-table th[data-col-key="project-name"],
  .collect-project-table td[data-col-key="project-name"] {
    width: clamp(145px, 45vw, 190px);
    min-width: clamp(145px, 45vw, 190px);
    max-width: clamp(145px, 45vw, 190px);
  }

  .collect-project-table th[data-col-key="project-name"],
  .collect-project-table td[data-col-key="project-name"] {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-overflow: clip;
  }

  .collect-project-table td[data-col-key="project-name"] .collect-project-name-link {
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-overflow: clip;
    text-align: left;
  }

  .collect-project-name-link .badge {
    margin-top: 2px;
    white-space: nowrap;
  }

  .collect-sticky-last {
    border-right: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow: 5px 0 8px rgba(15, 23, 42, 0.20);
  }
}

@media (pointer: coarse) {
  .collect-project-table-wrap,
  .collect-project-table-wrap.is-dragging {
    cursor: auto;
  }
}
