/* Выборка — design/work/data.html */

.selection-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 1.35rem 1.5rem;
}

.selection-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.selection-filters-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #3a5a38;
}

.selection-filters-title svg {
  flex-shrink: 0;
  color: #3a5a38;
}

.selection-collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #fff;
  color: #6b7280;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.selection-collapse-btn:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.selection-collapse-btn svg {
  transition: transform 0.2s ease;
}

.selection-filters-card.is-collapsed .selection-collapse-btn svg {
  transform: rotate(180deg);
}

#selection-form {
  display: block;
}

.selection-filters-panel {
  display: grid;
  gap: 1.1rem;
}

.selection-filters-panel.is-collapsed {
  display: none;
}

.selection-filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  align-items: end;
}

.selection-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
}

.selection-field select,
.selection-field input {
  width: 100%;
  padding: 0.6rem 2rem 0.6rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: #1f2937;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.selection-field input[type="date"],
.selection-field input[type="number"] {
  padding-right: 0.75rem;
  background-image: none;
}

.selection-field select:focus,
.selection-field input:focus {
  outline: none;
  border-color: #3a5a38;
  box-shadow: 0 0 0 3px rgba(58, 90, 56, 0.1);
}

.selection-filters-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.15rem;
}

.selection-actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.selection-page .btn-primary {
  background: #3a5a38;
  color: #fff;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.selection-page .btn-primary:hover {
  background: #2e4a2d;
}

.selection-page .btn-secondary {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.selection-page .btn-secondary:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.selection-status-area {
  flex: 1 1 220px;
  min-width: min(100%, 260px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.selection-page .ui-msg {
  min-height: 0;
  font-weight: 500;
  font-size: 0.8125rem;
}

.selection-page .ui-msg:empty {
  display: none;
}

.selection-page .ui-msg.ok {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: #f0f7ef;
  color: #3a5a38;
}

.selection-page .ui-msg.ok::before {
  content: "✓";
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #4caf50;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.selection-page .ui-msg.error {
  color: #b42318;
  padding: 0.35rem 0;
}

.selection-geo-context {
  display: none;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: #f0f7ef;
  color: #3a5a38;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.selection-geo-context.is-visible {
  display: flex;
}

.selection-geo-context::before {
  content: "✓";
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #4caf50;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selection-geo-body strong {
  display: block;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.selection-geo-detail {
  font-size: 0.6875rem;
  opacity: 0.85;
}

/* Результаты */
.selection-results-card {
  padding-bottom: 1rem;
}

.selection-results-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0.85rem;
}

.selection-results-tabs .tab-btn {
  position: relative;
  margin: 0;
  padding: 0 0 0.7rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.selection-results-tabs .tab-btn:hover {
  color: #3a5a38;
}

.selection-results-tabs .tab-btn.active {
  color: #3a5a38;
  background: transparent;
}

.selection-results-tabs .tab-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #3a5a38;
}

.selection-results-meta {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.65rem;
}

.selection-table-wrap {
  overflow-x: auto;
}

.selection-page table.selection-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
  font-size: 0.8125rem;
}

.selection-page table.selection-table th {
  text-align: left;
  padding: 0.7rem 1rem;
  color: #3a5a38;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
  cursor: pointer;
  user-select: none;
}

.selection-page table.selection-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
  vertical-align: middle;
}

.selection-page table.selection-table tbody tr:hover td {
  background: #f9fafb;
}

.selection-page table.selection-table tbody tr:nth-child(2n) {
  background: transparent;
}

.selection-page table.selection-table tbody tr:nth-child(2n):hover td {
  background: #f9fafb;
}

.selection-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.selection-page-info {
  font-size: 0.8125rem;
  color: #6b7280;
}

.selection-pager-controls {
  display: flex;
  gap: 0.5rem;
}

.selection-page .selection-pager-controls .btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
}

.selection-page .selection-pager-controls .btn:hover:not(:disabled) {
  background: #f3f4f6;
  color: #1f2937;
}

.selection-page .selection-pager-controls .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tab-panel-hidden {
  display: none;
}

.selection-panel-heading {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #3a5a38;
}

.selection-panel-lead {
  margin: 0 0 0.85rem;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.45;
}

.selection-chart-wrap {
  position: relative;
  margin-top: 0.5rem;
}

.selection-page .chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(31, 41, 55, 0.95);
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  transform: translate(-50%, -120%);
  white-space: nowrap;
  opacity: 0;
}

.selection-export-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.selection-export-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
  padding: 0.85rem;
  display: grid;
  gap: 0.5rem;
}

.selection-export-card p {
  margin: 0;
  color: #6b7280;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.selection-export-card .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #9ca3af;
  padding: 1.25rem;
}

.status-row td {
  padding: 0;
  border: none;
}

@media (max-width: 1100px) {
  .selection-filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .selection-filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .selection-filters-grid {
    grid-template-columns: 1fr;
  }

  .selection-filters-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .selection-actions-left {
    width: 100%;
  }

  .selection-actions-left .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
