/* Sanctions & Watchlist Screening Tool Scoped Styles */
.swst-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-color, #1f2937);
}

.swst-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Statistics Bar */
.swst-summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.swst-stat-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.swst-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color, #2563eb);
}

.swst-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tabs */
.swst-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color, #e5e7eb);
  overflow-x: auto;
}

.swst-tab {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.swst-tab:hover {
  color: var(--text-color, #111827);
}

.swst-tab.active {
  color: var(--primary-color, #2563eb);
  border-bottom-color: var(--primary-color, #2563eb);
}

/* Toolbar */
.swst-toolbar {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.5rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.swst-search-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.swst-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color, #374151);
}

.swst-search-row {
  display: flex;
  gap: 0.5rem;
}

.swst-input, .swst-select, .swst-textarea {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  background: var(--input-bg, #ffffff);
  color: inherit;
  outline: none;
}

.swst-input:focus, .swst-select:focus, .swst-textarea:focus {
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.swst-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  align-items: end;
}

.swst-control-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.swst-slider-item {
  justify-content: flex-end;
}

.swst-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.swst-slider-val {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary-color, #2563eb);
}

.swst-range {
  width: 100%;
  accent-color: var(--primary-color, #2563eb);
  cursor: pointer;
}

/* Buttons */
.swst-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.swst-btn-primary {
  background: var(--primary-color, #2563eb);
  color: #ffffff;
}

.swst-btn-primary:hover {
  opacity: 0.9;
}

.swst-btn-secondary {
  background: var(--button-sec-bg, #f3f4f6);
  color: var(--text-color, #374151);
  border-color: var(--border-color, #d1d5db);
}

.swst-btn-secondary:hover {
  background: var(--button-sec-hover, #e5e7eb);
}

.swst-btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

/* Results header */
.swst-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.swst-results-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.swst-results-actions {
  display: flex;
  gap: 0.5rem;
}

/* Grid & Cards */
.swst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.swst-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.5rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.swst-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.swst-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.swst-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.swst-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
}

.swst-badge-auth {
  background: #e0e7ff;
  color: #3730a3;
}

.swst-badge-type {
  background: #f3f4f6;
  color: #374151;
}

.swst-badge-critical {
  background: #fee2e2;
  color: #991b1b;
}

.swst-badge-high {
  background: #ffedd5;
  color: #9a3412;
}

.swst-badge-medium {
  background: #fef9c3;
  color: #854d0e;
}

.swst-badge-match {
  background: #dbeafe;
  color: #1e40af;
}

.swst-ref-id {
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-muted, #9ca3af);
}

.swst-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.swst-card-aliases {
  font-size: 0.8125rem;
  color: var(--text-muted, #4b5563);
  margin: 0;
}

.swst-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #4b5563);
  padding: 0.5rem 0;
  border-top: 1px dashed var(--border-color, #e5e7eb);
  border-bottom: 1px dashed var(--border-color, #e5e7eb);
}

.swst-card-remarks {
  font-size: 0.8125rem;
  color: var(--text-muted, #4b5563);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swst-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

/* Batch Panel */
.swst-batch-box, .swst-audit-box {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.swst-panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.swst-panel-desc {
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
  margin: 0;
  line-height: 1.5;
}

.swst-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.swst-batch-results {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.swst-batch-summary {
  display: flex;
  gap: 1.5rem;
  background: var(--stat-bg, #f9fafb);
  border: 1px solid var(--border-color, #e5e7eb);
  padding: 1rem;
  border-radius: 0.375rem;
}

.swst-batch-metric {
  display: flex;
  flex-direction: column;
}

.swst-batch-num {
  font-size: 1.5rem;
  font-weight: 800;
}

.swst-metric-flagged .swst-batch-num {
  color: #dc2626;
}

.swst-metric-cleared .swst-batch-num {
  color: #16a34a;
}

.swst-batch-txt {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
}

/* Table */
.swst-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.swst-table th, .swst-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.swst-table th {
  background: var(--table-header-bg, #f9fafb);
  font-weight: 600;
  color: var(--text-color, #374151);
}

.swst-table-empty {
  text-align: center;
  color: var(--text-muted, #9ca3af);
  padding: 2rem 1rem;
}

.swst-verdict-match {
  color: #b91c1c;
  font-weight: 700;
}

.swst-verdict-clear {
  color: #15803d;
  font-weight: 600;
}

/* Audit box */
.swst-audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.swst-audit-actions {
  display: flex;
  gap: 0.5rem;
}

.swst-audit-log-container {
  overflow-x: auto;
}

/* Legal Banner */
.swst-legal-banner {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  color: #92400e;
  border-radius: 0 0.375rem 0.375rem 0;
  line-height: 1.5;
}

/* Modal */
.swst-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.swst-modal-overlay[hidden] {
  display: none;
}

.swst-modal-box {
  background: var(--card-bg, #ffffff);
  border-radius: 0.5rem;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 1.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.swst-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
}

.swst-modal-close:hover {
  color: var(--text-color, #111827);
}

.swst-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
  font-size: 0.875rem;
}

.swst-crypto-list {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  word-break: break-all;
  margin-top: 0.5rem;
}

/* Toast */
.swst-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #111827;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 10000;
}

.swst-toast[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .swst-summary-bar {
    grid-template-columns: 1fr 1fr;
  }
  .swst-controls-grid {
    grid-template-columns: 1fr;
  }
  .swst-detail-meta {
    grid-template-columns: 1fr;
  }
}

.swst-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.swst-modal-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.swst-btn-view-detail {
  cursor: pointer;
}
