/* Large-data CRM interaction layer */

.scale-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 4px 4px;
  color: var(--muted, #66756f);
}

.scale-pagination button {
  min-width: 92px;
  min-height: 44px;
  border: 1px solid rgba(22, 86, 67, 0.18);
  border-radius: 12px;
  background: #fff;
  color: #155a45;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.scale-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.scale-pagination span {
  min-width: 168px;
  text-align: center;
  font-size: 14px;
}

.scale-loading-row td {
  padding: 42px 20px !important;
  text-align: center;
  color: #66756f;
}

.scale-address {
  display: grid;
  gap: 5px;
  min-width: 190px;
  max-width: 340px;
}

.scale-address strong {
  color: #183f33;
  font-size: 13px;
}

.scale-address span {
  color: #71817b;
  font-size: 12px;
  line-height: 1.45;
}

.scale-station-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #edf7f2;
  color: #17664d;
  font-size: 12px;
  font-weight: 800;
}

.scale-import-progress {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(24, 116, 84, 0.18);
  border-radius: 16px;
  background: #f5fbf8;
}

.scale-import-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.scale-import-progress > i {
  display: block;
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dcebe4;
}

.scale-import-progress > i > b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #136146, #4bb28a);
  transition: width 180ms ease;
}

.scale-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.scale-summary-card {
  min-height: 132px;
  padding: 20px;
  border: 1px solid rgba(20, 78, 61, 0.11);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(21, 61, 48, 0.06);
}

.scale-summary-card span,
.scale-summary-card small {
  display: block;
  color: #71817b;
}

.scale-summary-card strong {
  display: block;
  margin: 10px 0 4px;
  color: #143e31;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
}

.scale-team-card {
  cursor: default;
}

.scale-sync-indicator {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 190;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(20, 78, 61, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #4f655d;
  font-size: 12px;
  box-shadow: 0 8px 28px rgba(13, 48, 37, 0.12);
  backdrop-filter: blur(14px);
}

.scale-sync-indicator::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2fa777;
  content: "";
}

.scale-sync-indicator.offline::before {
  background: #d78636;
}

.scale-customer-picker {
  position: relative;
}

.scale-search-status {
  min-height: 22px;
  margin-top: 6px;
  color: #71817b;
  font-size: 12px;
}

@media (max-width: 980px) {
  .scale-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .scale-pagination {
    position: sticky;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 15;
    justify-content: space-between;
    margin: 0 -4px;
    padding: 10px;
    border: 1px solid rgba(20, 78, 61, 0.12);
    border-radius: 16px;
    background: rgba(248, 251, 249, 0.96);
    box-shadow: 0 10px 26px rgba(17, 59, 46, 0.1);
    backdrop-filter: blur(14px);
  }

  .scale-pagination button {
    flex: 1;
    min-width: 0;
  }

  .scale-pagination span {
    min-width: 112px;
    font-size: 12px;
  }

  .scale-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .scale-summary-card {
    min-height: 112px;
    padding: 16px;
    border-radius: 17px;
  }

  .scale-summary-card strong {
    font-size: 28px;
  }

  .scale-sync-indicator {
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  #leadsView .table-scroll,
  #customersView .table-scroll,
  #ordersView .table-scroll,
  #inquiriesView .table-scroll,
  #pendingView .table-scroll,
  #poolView .table-scroll {
    overflow-x: auto;
    overscroll-behavior: contain;
  }

  #leadsView table,
  #customersView table,
  #ordersView table,
  #inquiriesView table,
  #pendingView table,
  #poolView table {
    min-width: 920px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scale-import-progress > i > b {
    transition: none;
  }
}
