/* Minimal overrides — Tailwind handles most styling */
.tab-btn.active {
  border-color: #3b82f6;
  color: #ffffff;
  background-color: rgba(59, 130, 246, 0.1);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.kpi-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* KPI icon badge */
.kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* KPI list cards — breakdown items with progress bars */
.kpi-list-card .kpi-list-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.kpi-list-card .kpi-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kpi-list-card .kpi-list-label {
  font-size: 0.8125rem;
  color: #d1d5db;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 65%;
}
.kpi-list-card .kpi-list-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}
.kpi-list-card .kpi-bar-track {
  height: 3px;
  background: #374151;
  border-radius: 2px;
  overflow: hidden;
}
.kpi-list-card .kpi-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.quality-high { color: #10b981; }
.quality-mid { color: #f59e0b; }
.quality-low { color: #ef4444; }

.table-row:hover { background-color: rgba(59, 130, 246, 0.05); }

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #374151;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.drill-link {
  color: #60a5fa;
  cursor: pointer;
}
.drill-link:hover {
  text-decoration: underline;
}

/* ── Query mode toggle ── */
.query-mode-btn {
  cursor: pointer;
  border: none;
  background: transparent;
}
.query-mode-btn.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}
.query-panel.hidden { display: none; }

/* ── Report Builder form ── */
.rb-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.rb-select {
  appearance: none;
  background-color: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #e5e7eb;
  width: 100%;
  transition: border-color 0.15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.25em;
  padding-right: 2rem;
}
.rb-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.rb-text-input {
  background-color: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #e5e7eb;
  width: 100%;
  transition: border-color 0.15s ease;
}
.rb-text-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.rb-text-input::placeholder { color: #4b5563; }

.rb-checkbox-list {
  max-height: 10rem;
  overflow-y: auto;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 0.5rem;
}
.rb-checkbox-list::-webkit-scrollbar { width: 4px; }
.rb-checkbox-list::-webkit-scrollbar-track { background: transparent; }
.rb-checkbox-list::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 2px; }

.rb-checkbox-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: #d1d5db;
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.rb-checkbox-list label:hover {
  background: rgba(59, 130, 246, 0.06);
}
.rb-checkbox-list input[type="checkbox"] {
  accent-color: #3b82f6;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Chart type radio cards */
.rb-chart-option { cursor: pointer; }
.rb-chart-card {
  text-align: center;
  padding: 0.625rem 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #1f2937;
  color: #6b7280;
  transition: all 0.15s ease;
}
.rb-chart-card.active,
.rb-chart-option input:checked + .rb-chart-card {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  color: #93c5fd;
}
.rb-chart-card:hover {
  border-color: #4b5563;
}

/* Filter rows */
.rb-filter-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 0.375rem;
  align-items: center;
}
.rb-filter-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rb-filter-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ── AI Query ── */
.ai-chip {
  cursor: pointer;
  transition: all 0.15s ease;
}
.ai-sql-toggle {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.ai-sql-toggle:hover {
  background-color: rgba(59, 130, 246, 0.05);
}

/* ── Widget grid for My Dashboard ── */
#dashboard-widgets {
  min-height: 200px;
}
.widget-body {
  min-height: 60px;
}
