.chip-options-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9dee7;
  background: #f8fafc;
  border-radius: 6px;
}

.chip-option-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}

.chip-option-picker {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d9dee7;
  background: #f8fafc;
  border-radius: 6px;
}

.chip-price-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.chip-price-input {
  width: 100%;
}

.chip-empty {
  margin: 8px 0 0;
  color: #667085;
}

.chip-table-list {
  display: grid;
  gap: 5px;
  min-width: 260px;
}

.chip-table-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.chip-set-modal {
  width: min(680px, calc(100vw - 32px));
}

.orders-scope-control {
  grid-template-columns: repeat(2, minmax(130px, 1fr));
}

.pagination-modern {
  margin-top: 16px;
  margin-bottom: 0;
}

.page-size-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #61706b;
  font-size: 13px;
}

.page-size-control select {
  min-height: 38px;
  padding: 6px 30px 6px 10px;
  border: 1px solid #d8dfdb;
  border-radius: 6px;
  background: #fff;
}

.page-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.page-button {
  width: 38px;
  height: 38px;
  border: 1px solid #d8dfdb;
  border-radius: 6px;
  background: #fff;
  color: #18201d;
}

.page-button:hover:not(:disabled),
.page-button.active {
  border-color: #145c45;
  background: #145c45;
  color: #fff;
}

.page-button:disabled {
  opacity: .4;
  cursor: default;
}

.page-gap {
  min-width: 22px;
  text-align: center;
  color: #61706b;
}

.pagination-summary {
  color: #61706b;
  font-size: 13px;
}

.orders-table-paid {
  min-width: 1880px;
}

.orders-table-warranty {
  min-width: 1680px;
}

.orders-table-paid th,
.orders-table-warranty th {
  white-space: normal;
  vertical-align: middle;
}

.orders-table-paid td,
.orders-table-warranty td {
  white-space: nowrap;
}

.orders-table-warranty .work-cell {
  min-width: 280px;
  max-width: 420px;
}

/* Keep the order dialog inside the viewport while its form scrolls independently. */
.modal-overlay {
  overflow: hidden;
  padding: 8px;
}

.modal-shell.modal-order {
  width: min(1480px, 100%);
  height: min(820px, calc(100dvh - 16px));
  min-height: 0;
  max-height: calc(100dvh - 16px);
  display: flex;
  overflow: hidden;
}

.modal-order .details-shell {
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-order .details-head,
.modal-order .inline-alert {
  flex: 0 0 auto;
}

.modal-order .order-form-layout {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
  padding-right: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.modal-order input[readonly] {
  background: #f1f4f2;
  color: #44524d;
  cursor: default;
}

.modal-order .input-invalid {
  border-color: #a1453f;
  box-shadow: 0 0 0 2px rgba(161, 69, 63, .12);
}

.modal-order .field-stack > .error-text {
  color: #a1453f;
  font-size: 12px;
  text-transform: none;
}

.modal-shell.modal-order .grid-span-half {
  grid-column: span 2;
}

@media (max-width: 700px) {
  .modal-shell.modal-order {
    height: calc(100dvh - 16px);
    padding: 14px;
  }

  .chip-option-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .chip-option-picker {
    grid-template-columns: 1fr;
  }

  .pagination-modern,
  .page-size-control {
    align-items: stretch;
  }

  .page-buttons {
    flex-wrap: wrap;
  }
}
.crm-loading-indicator {
  position: fixed;
  z-index: 3000;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #cfdad5;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(25, 45, 37, 0.16);
  color: #183d30;
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-50% - 12px));
  transition: opacity 140ms ease, transform 140ms ease;
}

.crm-loading-indicator.visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.crm-loading-spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 2px solid #c4d6cf;
  border-top-color: #116149;
  border-radius: 50%;
  animation: crm-loading-spin 700ms linear infinite;
}

@keyframes crm-loading-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .crm-loading-indicator {
    max-width: calc(100vw - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .crm-loading-indicator {
    transition: opacity 140ms ease;
  }

  .crm-loading-spinner {
    animation-duration: 1.4s;
  }
}
.reminder-toggle {
  min-height: 42px;
  align-self: end;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.reminder-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--green);
}
