.dashboard-view .card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.search-intro {
  display: grid;
  gap: 24px;
}

.search-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.search-summary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
}

.search-summary-item {
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 28px -24px rgba(15, 23, 42, 0.18);
}

.search-summary-item span {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.search-summary-item strong {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.search-filters {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  align-items: end;
}

.search-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.search-filter-group input,
.search-filter-group select {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.search-filter-group input:focus,
.search-filter-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

@media (max-width: 520px) {
  .search-summary-grid,
  .search-filters {
    grid-template-columns: 1fr;
  }
}

.search-date-range {
  display: flex;
  gap: 8px;
}

.search-date-range > * {
  flex: 1;
  min-width: 0;
}

.search-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.search-reset {
  border: none;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.search-reset:hover,
.search-reset:focus-visible {
  background: rgba(37, 99, 235, 0.2);
  outline: none;
}

.search-reset:active {
  transform: translateY(1px);
}

.search-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.search-card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: clamp(16px, 3vw, 24px);
  box-shadow: 0 14px 38px -24px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-chart {
  width: 100%;
  min-height: 320px;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.search-results-count {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.search-table-wrapper {
  overflow-x: auto;
}

.search-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: min(640px, 100%);
}

.search-table thead {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.search-table th,
.search-table td {
  padding: 6px 2px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.search-table th:first-child,
.search-table td:first-child {
  text-align: left;
}

.search-table .numeric {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.search-table .highlight {
  color: var(--accent-strong);
  font-weight: 600;
}

.table-title {
  font-weight: 600;
}

.table-subtitle {
  color: var(--text-muted);
  font-size: 12px;
}

.search-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

.search-table tbody tr.is-active {
  background: rgba(37, 99, 235, 0.12);
}

.optimization-detail-table .search-table th:first-child,
.optimization-detail-table .search-table td:first-child {
  text-align: left;
  white-space: normal;
  min-width: 40px;
  width: min(150px, 30vw);
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.badge.winner {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-strong);
}

@media (max-width: 768px) {
  .dashboard-nav {
    width: 100%;
    justify-content: space-between;
    border-radius: 16px;
  }

  .search-filters {
    grid-template-columns: 1fr;
  }

  .search-reset {
    width: 100%;
  }

  .search-layout {
    grid-template-columns: 1fr;
  }

  .search-card {
    padding: 16px;
  }
}
