/* Confirmed CBT_Management_Interactive.html design, scoped to CBT only. */
main:has(.cbt-page) {
  grid-template-rows: 54px auto minmax(0, 1fr);
  --bg: #f3f5f3;
  --line: #dfe6e0;
  --ink: #25392e;
  --muted: #78867c;
  --teal: #247a67;
  background: var(--bg);
  color: var(--ink);
  font:
    13px "Microsoft YaHei",
    Arial,
    sans-serif;
}
main:has(.cbt-page) > header {
  height: 54px;
  padding: 0 22px;
  font-size: 16px;
}
main:has(.cbt-page) > #toolbar {
  padding: 10px 22px;
  min-height: 0;
}
main:has(.cbt-page) > #content {
  padding: 14px 20px 12px;
}
.cbt-page {
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 11px;
}
.cbt-tabs,
.cbt-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
:is(.cbt-page, .cbt-tabs, .cbt-form, .cbt-detail) button {
  border: 1px solid #dfe6e0;
  background: white;
  border-radius: 7px;
  padding: 8px 12px;
  color: #25392e;
  font: inherit;
  cursor: pointer;
}
:is(.cbt-page, .cbt-tabs, .cbt-form, .cbt-detail) button:hover {
  filter: brightness(0.96);
}
:is(.cbt-page, .cbt-form) button:disabled {
  opacity: 0.5;
  cursor: default;
}
.cbt-tabs button.active {
  background: #e8f3ee;
  border-color: #a8c6b5;
  color: #165e4d;
}
:is(.cbt-page, .cbt-form) button.primary {
  background: #247a67;
  border-color: #247a67;
  color: white;
}
.cbt-filters input {
  width: 240px;
  min-width: 190px;
}
.cbt-filters select {
  width: auto;
  min-width: 130px;
}
:is(.cbt-page, .cbt-form) :is(input, select, textarea) {
  border: 1px solid #dfe6e0;
  background: white;
  border-radius: 7px;
  padding: 8px 10px;
  color: #25392e;
  font: inherit;
  height: auto;
}
.cbt-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}
.cbt-tile {
  border: 1px solid #dfe6e0;
  background: white;
  border-radius: 9px;
  padding: 10px 12px;
}
.cbt-tile small,
.cbt-hint {
  color: #78867c;
}
.cbt-tile small {
  display: block;
}
.cbt-tile b {
  display: block;
  font-size: 20px;
  margin-top: 3px;
}
.cbt-table-slot {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.business-table {
  min-width: 0;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border: 1px solid #dfe6e0;
  border-radius: 10px;
  background: white;
  overflow: clip;
}
.cbt-table-heading {
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #dfe6e0;
}
.cbt-table-heading strong {
  font-size: 14px;
}
.cbt-table-heading .cbt-hint {
  font-size: 12px;
}
.business-table-top {
  overflow-x: scroll;
  overflow-y: hidden;
  height: 18px;
  min-width: 0;
  background: #e9eeea;
  scrollbar-color: #6c9a82 #e4ece5;
}
.business-table-top::-webkit-scrollbar {
  height: 15px;
}
.business-table-top::-webkit-scrollbar-thumb {
  background: #6c9a82;
  border-radius: 8px;
  border: 2px solid #e4ece5;
}
.business-table-top > div {
  height: 1px;
}
.business-table-body {
  min-height: 0;
  min-width: 0;
  overflow: auto;
  scrollbar-color: #90ab98 #edf1ee;
  overscroll-behavior: contain;
}
.business-table-body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
.business-table-body::-webkit-scrollbar-thumb {
  background: #90ab98;
  border: 2px solid #edf1ee;
  border-radius: 7px;
}
:is(.business-table, .cbt-detail) table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  white-space: nowrap;
  font-size: 12px;
  table-layout: auto;
}
:is(.business-table, .cbt-detail) :is(td, th) {
  padding: 12px 11px;
  text-align: left;
  border-bottom: 1px solid #e9eeea;
  white-space: nowrap;
}
:is(.business-table, .cbt-detail) th {
  position: sticky;
  top: 0;
  background: #eef5f0;
  z-index: 2;
  font-weight: 600;
  color: #456352;
}
:is(.business-table, .cbt-detail) tbody tr:hover {
  background: #f8fbf8;
}
.business-table .business-table-actions {
  max-width: none;
  overflow: visible;
}
.business-table-actions button {
  margin-right: 5px;
}
.business-table input[type="checkbox"] {
  width: auto;
}
.cbt-table-footer {
  border-top: 1px solid #dfe6e0;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #78867c;
  font-size: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
#cbtPages,
.cbt-scroll-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cbt-progress {
  min-width: 155px;
  width: 170px;
}
.cbt-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 5px;
}
.cbt-track {
  height: 8px;
  background: #e5eae6;
  border-radius: 10px;
  overflow: hidden;
}
.cbt-fill {
  height: 100%;
  background: #278777;
  border-radius: 10px;
}
.cbt-fill.return {
  background: #83a99a;
}
.cbt-tag {
  border-radius: 5px;
  padding: 4px 7px;
  background: #edf0ee;
  font-size: 11px;
}
.cbt-tag.way,
.cbt-tag.warn {
  background: #fff0d8;
  color: #9a6d21;
}
.cbt-tag.done {
  background: #e4f2e8;
  color: #2b7d4b;
}
.cbt-page button.cbt-link {
  border: 0;
  background: none;
  color: #1d755f;
  font-weight: bold;
  padding: 0;
}
.cbt-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.cbt-form label {
  margin: 0;
  min-width: 0;
  font-size: 12px;
  font-weight: 400;
  color: #78867c;
  gap: 5px;
}
.cbt-form :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.cbt-form input[type="checkbox"] {
  width: auto;
}
.cbt-form textarea {
  min-height: 80px;
}
.cbt-form .full {
  grid-column: 1/-1;
}
.cbt-form .form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.cbt-form .error {
  width: 100%;
  white-space: pre-line;
}
.modal:has(:is(.cbt-form, .cbt-detail, .cbt-history)) {
  width: min(920px, 100%);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: clip;
  border-radius: 13px;
  color: #25392e;
  font:
    13px "Microsoft YaHei",
    Arial,
    sans-serif;
}
.modal:has(:is(.cbt-form, .cbt-detail, .cbt-history)) .modal-head {
  padding: 16px 20px;
  flex: none;
  border-color: #dfe6e0;
  align-items: center;
}
.modal:has(:is(.cbt-form, .cbt-detail, .cbt-history)) .modal-head h2 {
  font-size: 16px;
}
.modal:has(:is(.cbt-form, .cbt-detail, .cbt-history)) .eyebrow {
  display: none;
}
.modal:has(:is(.cbt-form, .cbt-detail, .cbt-history)) #modalBody {
  padding: 18px 20px;
  overflow: auto;
  min-height: 0;
}
.cbt-detail-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.cbt-detail-metrics > div {
  background: #f3f5f3;
  padding: 10px;
  border-radius: 7px;
}
.cbt-detail-metrics b {
  display: block;
  font-size: 20px;
}
.cbt-progress-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 16px 0;
}
.cbt-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 15px;
}
.cbt-notice {
  background: #f4f8f4;
  border-radius: 7px;
  padding: 10px;
  color: #5b7061;
  font-size: 12px;
}
.cbt-inline-scroll {
  overflow: auto;
  max-height: 280px;
}
.cbt-history {
  max-height: 55vh;
  overflow: auto;
}
.cbt-history pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 850px) {
  .cbt-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  main:has(.cbt-page) > #content {
    padding: 10px;
  }
  main:has(.cbt-page) > header {
    padding: 0 12px;
  }
  main:has(.cbt-page) > #toolbar {
    padding: 9px 12px;
  }
  .cbt-progress {
    min-width: 120px;
    width: 120px;
  }
  .cbt-form {
    grid-template-columns: 1fr;
  }
  .cbt-table-heading {
    align-items: flex-start;
  }
  .cbt-table-heading .cbt-hint {
    max-width: 50%;
  }
}
