:root {
  color-scheme: light;
}

body {
  min-height: 100vh;
  background: #f6f7fb;
}

.container {
  max-width: 1440px;
}

.search-panel {
  border-radius: 8px;
}

.product-search,
.time-search {
  position: relative;
}

.product-suggestions,
.time-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.product-suggestion,
.time-suggestion {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #eef0f3;
  background: transparent;
  color: #111827;
  text-align: left;
}

.product-suggestion:hover,
.product-suggestion:focus,
.time-suggestion:hover,
.time-suggestion:focus {
  background: #f1f5ff;
}

.product-suggestion.is-selected {
  color: #667085;
  background: #f8fafc;
}

.product-suggestion.is-empty,
.time-suggestion.is-empty {
  color: #667085;
  cursor: default;
}

.time-suggestions {
  max-height: 220px;
}

.selected-products {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.selected-products:empty {
  display: none;
}

.selected-product {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid #cfe2ff;
  border-radius: 999px;
  background: #eef5ff;
  color: #084298;
  font-size: 13px;
}

.selected-product span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  min-width: 112px;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.is-loading::after {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.125em;
  animation: spin 0.75s linear infinite;
}

.results {
  display: grid;
  gap: 10px;
}

.results-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.results-filters {
  display: inline-flex;
  gap: 6px;
}

.filter-button {
  min-width: 0;
  padding: 5px 14px;
  border: 1px solid #cfd4dc;
  color: #475467;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}

.filter-button:hover,
.filter-button:focus {
  border-color: #0d6efd;
  color: #0d6efd;
}

.filter-button.is-active {
  border-color: #0d6efd;
  background: #0d6efd;
  color: #fff;
}

.is-hidden {
  display: none !important;
}

.provider-section {
  border-radius: 8px;
}

.group-divider {
  margin-top: 8px;
  padding: 6px 2px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.provider-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.provider-section .card-body {
  padding: 14px 18px;
}

.result-table {
  table-layout: fixed;
  width: 100%;
  border: 1px solid #e7e9f0;
  border-radius: 8px;
  overflow: hidden;
}

.result-table th {
  padding: 6px 10px;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.result-table td {
  padding: 7px 10px;
}

.result-table th:nth-child(1) {
  width: 34%;
}

.result-table th:nth-child(2) {
  width: 20%;
}

.result-table th:nth-child(3) {
  width: 24%;
}

.result-table th:nth-child(4) {
  width: 22%;
}

.result-table tbody tr + tr {
  border-top: 1px solid #eef0f4;
}

.result-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.result-title,
.result-product-name {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
}

.result-title {
  flex: 0 1 auto;
  min-width: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.result-title-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 6px;
  color: #0d6efd;
  background: #eaf2ff;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.result-title-link:hover,
.result-title-link:focus {
  color: #fff;
  background: #0d6efd;
}

.result-product-name {
  color: #667085;
  font-size: 13px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result-link {
  min-width: 0;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.result-link--is-edit {
  border: 1px solid #0d6efd;
  background: #eaf2ff;
  color: #0d6efd;
}

.result-link--is-edit:hover,
.result-link--is-edit:focus {
  background: #0d6efd;
  color: #fff;
}

.copy-link-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #cfe2ff;
  border-radius: 6px;
  color: #0d6efd;
  background: #f0f6ff;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.copy-link-button:hover,
.copy-link-button:focus {
  color: #fff;
  background: #0d6efd;
  border-color: #0d6efd;
}

.copy-link-button.is-copied {
  color: #198754;
  background: rgba(25, 135, 84, 0.12);
  border-color: #198754;
  cursor: default;
}

.copy-icon--done {
  display: none;
}

.copy-link-button.is-copied .copy-icon--default {
  display: none;
}

.copy-link-button.is-copied .copy-icon--done {
  display: block;
}

.schedule-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 8px;
}

.schedule-status {
  justify-self: start;
  max-width: 100%;
  padding: 5px 9px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

.schedule-status.text-bg-light {
  border: 1px solid #e2e5ec;
  color: #475467;
}

.schedule-controls .btn {
  min-width: 0;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.regular-schedule {
  justify-self: start;
  padding: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow: visible;
  color: #344054;
}

.rs-range {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eef0f4;
  color: #111827;
  font-weight: 700;
}

.provider-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: -2px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border: 1px solid #f5b97a;
  border-radius: 6px;
  background: #fff4e5;
  color: #9a3412;
  font-size: 12px;
  font-weight: 600;
}

.provider-note::before {
  content: "⚠";
  font-size: 13px;
  line-height: 1;
}

.rs-section + .rs-section {
  margin-top: 6px;
}

.rs-extra > summary {
  width: max-content;
  margin-top: 2px;
  color: #b54708;
  font-weight: 600;
  cursor: pointer;
}

.rs-extra > summary::-webkit-details-marker {
  display: none;
}

.rs-extra[open] > summary {
  margin-bottom: 2px;
}

.rs-title {
  color: #667085;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.rs-label {
  font-weight: 600;
  color: #475467;
}

.rs-exceptions {
  color: #b54708;
}

.rs-more,
.rs-empty {
  color: #667085;
}

.raw-json {
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

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

@media (max-width: 800px) {
  .result-table,
  .result-table tbody,
  .result-table tr,
  .result-table td {
    display: block;
    width: 100%;
  }

  .result-table {
    border: 0;
  }

  .result-table thead {
    display: none;
  }

  .result-table tbody tr {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid #e7e9f0;
    border-radius: 8px;
  }

  .result-table tbody tr + tr {
    border-top: 1px solid #e7e9f0;
  }

  .result-table td {
    padding: 4px 0;
  }

  .result-product-cell[data-label]::before,
  .result-status-cell[data-label]::before,
  .result-actions-cell[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .result-title {
    -webkit-line-clamp: unset;
    line-clamp: unset;
  }
}
