/* Button (Sendplane design system).
 * An ink primary (one per view), a white secondary for Cancel, Back and row
 * actions, a red danger for the final step of a destructive action, a compact
 * size for rows, and two borderless forms. The imported dashboard's .btn
 * classes share each recipe so its pages and scripts keep working. */

.button, .btn {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  color: var(--ink);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-control);
  transition: transform 140ms var(--ease-out), background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.button svg, .btn svg { width: 15px; height: 15px; }

.button-primary, .btn-primary, .btn-gradient { color: var(--fg-inverse); background: var(--interactive-primary); }
.button-secondary, .btn-secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-danger, .btn-danger { color: var(--fg-inverse); background: var(--danger-fg); }
.button-compact, .btn-sm { min-height: var(--control-height-compact); padding: 0 10px; font-size: 11px; }
.btn-lg { min-height: 42px; padding: 0 18px; font-size: 14px; }

/* Borderless: the imported dashboard's ghost button takes the soft hover fill. */
.btn-ghost { color: var(--muted); background: transparent; box-shadow: none; }

.button:disabled, .btn:disabled, .button[aria-disabled="true"] { cursor: not-allowed; opacity: .58; }
.button[aria-busy="true"], .btn[aria-busy="true"] { cursor: wait; }

/* A 30px glyph button and a full-width quiet button. */
.icon-button, .btn-icon {
  width: 30px;
  height: 30px;
  min-height: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: transform 140ms var(--ease-out), background-color 140ms ease, color 140ms ease;
}
.btn-icon.btn-sm { width: 28px; height: 28px; }
.quiet-button {
  width: 100%;
  padding: 7px;
  border: 0;
  border-radius: var(--radius-chip);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}

.button:active:not(:disabled), .btn:active:not(:disabled), .icon-button:active, .quiet-button:active { transform: scale(.97); }

@media (hover: hover) and (pointer: fine) {
  .button-primary:hover:not(:disabled), .btn-primary:hover:not(:disabled), .btn-gradient:hover:not(:disabled) { background: var(--interactive-primary-hover); }
  .button-secondary:hover:not(:disabled), .btn-secondary:hover:not(:disabled) { border-color: var(--border-default); background: var(--soft); }
  .button-danger:hover:not(:disabled), .btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger-fg) 85%, var(--surface-canvas)); }
  .btn-ghost:hover:not(:disabled), .quiet-button:hover, .icon-button:hover, .btn-icon:hover { color: var(--ink); background: var(--soft); }
}

@media (prefers-reduced-motion: reduce) {
  .button:active, .btn:active, .icon-button:active, .quiet-button:active { transform: none; }
}
