/* Адаптив окремих сторінок */

.deals-toolbar {
  gap: 12px;
}

.filter-chips {
  overflow-x: auto;
  flex-wrap: nowrap;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.view-switcher {
  flex-shrink: 0;
}

.table-wrap {
  margin-inline: -4px;
  padding-inline: 4px;
}

@media (min-width: 1025px) {
  .filter-chips {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

@media (max-width: 1024px) {
  .deals-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .deals-toolbar__left {
    flex-direction: column;
    align-items: stretch;
  }

  .view-switcher {
    width: 100%;
    justify-content: stretch;
  }

  .view-switcher__btn {
    flex: 1;
    min-width: 0;
    padding-inline: 10px;
  }

  .data-table {
    min-width: 0;
    width: 100%;
  }

  .data-table:not(.data-table--cards):not(.report-table) {
    min-width: 0;
  }

  .data-table th,
  .data-table td {
    padding-inline: 12px;
  }
}

@media (max-width: 767px) {
  .deals-toolbar__left .search-bar,
  .leads-search {
    max-width: none;
    width: 100%;
  }

  .deals-toolbar__left .filter-chips {
    margin-inline: -2px;
  }

  .view-switcher__btn {
    font-size: 11px;
    padding: 8px 8px;
  }

  .view-switcher__btn .badge-tag {
    display: none;
  }

  .dual-pills {
    display: none;
  }

  .timeline {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .timeline::-webkit-scrollbar {
    display: none;
  }

  .timeline__step {
    min-width: 68px;
    flex-shrink: 0;
  }

  .timeline__label {
    font-size: 9px;
  }

  .finance-row {
    font-size: 13px;
  }

  .payment-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .leads-hero {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-md);
  }

  .leads-hero__stats {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .leads-stat {
    flex: 1;
    min-width: 0;
    padding: 8px 6px;
  }

  .leads-stat__value {
    font-size: 18px;
  }

  .leads-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .leads-toolbar__hint {
    white-space: normal;
  }

  .lead-filter-bar {
    padding: 10px 12px;
  }

  .lead-filter {
    padding: 7px 12px;
    min-height: 36px;
  }

  .lead-card__row {
    flex-direction: column;
    align-items: flex-start;
  }

  .lead-funnel {
    gap: 3px;
  }

  .carrier-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .carrier-card__meta {
    flex-direction: column;
    gap: 4px;
  }

  .report-summary .stat-card {
    min-height: 0;
  }

  .topbar__actions .btn--ghost span:not(.badge-tag) {
    white-space: nowrap;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .leads-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cockpit-stats {
    gap: 14px;
  }

  .stat-card {
    min-height: 0;
    padding: 16px;
  }

  .stat-card__head {
    margin-bottom: 12px;
  }

  .stat-card__value-row {
    margin-bottom: 10px;
  }
}

@media (max-width: 767px) {
  .toast-root {
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
    width: min(calc(100vw - 24px), 420px);
  }

  body.modal-open .toast-root {
    bottom: calc(var(--safe-bottom) + 12px);
  }
}

@media (min-width: 1025px) {
  .toast-root {
    bottom: calc(var(--safe-bottom) + 24px);
  }
}
