/* ── Quick Actions: Approval Card Presets ── */

.approval-presets-row {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.approval-presets-row.visible {
  display: flex;
}

.btn-preset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  flex: 1;
  justify-content: center;
  min-width: 0;
  max-width: 50%;
  transition: opacity 0.15s, background 0.15s;
}

.btn-preset:active {
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.04);
}

.btn-preset svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-preset span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Compact pane variant */
.pane-approval-card .approval-presets-row {
  gap: 3px;
  margin-bottom: 3px;
}

.pane-approval-card .btn-preset {
  min-height: 28px;
  padding: 2px 6px;
  font-size: 11px;
}

/* Disable preset buttons when confirming */
.approval-card.confirming .btn-preset {
  pointer-events: none;
  opacity: 0.4;
}

/* ── Quick Actions: Settings View ── */

.qa-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.qa-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #30363d);
  flex-shrink: 0;
  gap: 8px;
}

.qa-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #e6edf3);
  flex: 1;
}

.qa-back-btn,
.qa-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim, #8b949e);
  cursor: pointer;
  padding: 0;
}

.qa-back-btn:active,
.qa-add-btn:active {
  background: rgba(255, 255, 255, 0.08);
}

.qa-add-btn {
  color: #58a6ff;
}

.qa-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 80px;
}

/* Section headers */
.qa-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  margin-top: 16px;
}

.qa-section-header:first-child {
  margin-top: 0;
}

.qa-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim, #8b949e);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qa-section-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  background: rgba(88, 166, 255, 0.1);
  color: #58a6ff;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.qa-section-add-btn:active {
  background: rgba(88, 166, 255, 0.2);
}

/* Preset / Rule cards */
.qa-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  margin-bottom: 8px;
}

.qa-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid;
}

.qa-card-icon svg {
  width: 16px;
  height: 16px;
}

.qa-card-body {
  flex: 1;
  min-width: 0;
}

.qa-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #e6edf3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qa-card-meta {
  font-size: 11px;
  color: var(--text-dim, #8b949e);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qa-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.qa-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim, #8b949e);
  cursor: pointer;
  padding: 0;
}

.qa-card-btn:active {
  background: rgba(255, 255, 255, 0.08);
}

.qa-card-btn--delete:active {
  color: #f85149;
}

/* Action badge (approve/reject) */
.qa-action-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
}

.qa-action-badge--approve {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.12);
}

.qa-action-badge--reject {
  color: #f85149;
  background: rgba(248, 81, 73, 0.12);
}

/* Tool chips (auto-rule) */
.qa-tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.qa-tool-chip {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(88, 166, 255, 0.1);
  color: #58a6ff;
  font-weight: 500;
}

/* Toggle switch */
.qa-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.qa-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.qa-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.2s;
}

.qa-toggle input:checked + .qa-toggle-track {
  background: #3fb950;
}

.qa-toggle-track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.qa-toggle input:checked + .qa-toggle-track::after {
  transform: translateX(18px);
}

/* Global pause banner */
.qa-pause-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(210, 153, 34, 0.3);
  background: rgba(210, 153, 34, 0.06);
  margin-bottom: 12px;
}

.qa-pause-label {
  font-size: 12px;
  font-weight: 500;
  color: #d29922;
}

/* Match count stat */
.qa-match-count {
  font-size: 10px;
  color: var(--text-dim, #8b949e);
  opacity: 0.7;
}

/* ── Forms ── */

.qa-form {
  padding: 0;
}

.qa-form-group {
  margin-bottom: 16px;
}

.qa-form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim, #8b949e);
  margin-bottom: 6px;
}

.qa-form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #30363d);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text, #e6edf3);
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.qa-form-input:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.15);
}

.qa-form-input::placeholder {
  color: var(--text-dim, #8b949e);
  opacity: 0.5;
}

.qa-form-hint {
  font-size: 11px;
  color: var(--text-dim, #8b949e);
  margin-top: 4px;
  opacity: 0.7;
}

/* Icon picker */
.qa-icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qa-icon-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border, #30363d);
  background: transparent;
  color: var(--text-dim, #8b949e);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
}

.qa-icon-option:active,
.qa-icon-option.selected {
  border-color: #58a6ff;
  color: #58a6ff;
  background: rgba(88, 166, 255, 0.08);
}

.qa-icon-option svg {
  width: 16px;
  height: 16px;
}

/* Color picker */
.qa-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qa-color-option {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, transform 0.1s;
}

.qa-color-option:active {
  transform: scale(0.9);
}

.qa-color-option.selected {
  border-color: #fff;
}

/* Radio buttons */
.qa-radio-row {
  display: flex;
  gap: 12px;
}

.qa-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text, #e6edf3);
  cursor: pointer;
}

.qa-radio-label input[type="radio"] {
  accent-color: #58a6ff;
}

/* Checkbox grid (tools) */
.qa-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qa-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text, #e6edf3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border, #30363d);
  background: transparent;
  transition: border-color 0.15s;
}

.qa-checkbox-label:has(input:checked) {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.06);
}

.qa-checkbox-label input[type="checkbox"] {
  accent-color: #58a6ff;
  width: 14px;
  height: 14px;
}

.qa-checkbox-label.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Form buttons */
.qa-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.qa-btn-save {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #58a6ff;
  color: #0d1117;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.qa-btn-save:active {
  opacity: 0.8;
}

.qa-btn-save:disabled {
  opacity: 0.5;
  cursor: default;
}

.qa-btn-cancel {
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid var(--border, #30363d);
  background: transparent;
  color: var(--text-dim, #8b949e);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.qa-btn-cancel:active {
  background: rgba(255, 255, 255, 0.06);
}

/* Tool filter multi-select */
.qa-tool-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qa-tool-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #30363d);
  background: transparent;
  color: var(--text-dim, #8b949e);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.qa-tool-filter-chip.selected {
  border-color: #58a6ff;
  color: #58a6ff;
  background: rgba(88, 166, 255, 0.08);
}

.qa-tool-filter-chip:active {
  opacity: 0.7;
}

/* Empty state */
.qa-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-dim, #8b949e);
}

.qa-empty-text {
  font-size: 13px;
  margin-bottom: 12px;
}

/* Feedback preview in card */
.qa-card-feedback {
  font-size: 11px;
  color: var(--text-dim, #8b949e);
  font-style: italic;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
