.button {
  min-height: 48px;
  padding: 0 var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 700;
  transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast), box-shadow var(--motion-fast);
}

.button--primary {
  color: #fff;
  background: var(--color-brand-600);
  box-shadow: 0 8px 20px rgb(11 99 246 / 18%);
}

.button--primary:hover:not(:disabled) {
  background: var(--color-brand-700);
  box-shadow: 0 10px 24px rgb(11 99 246 / 24%);
}

.button--primary:active:not(:disabled) {
  transform: translateY(1px);
}

.button--full {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.button .spinner {
  display: none;
}

.button[aria-busy="true"] .button__label {
  visibility: hidden;
}

.button[aria-busy="true"] .spinner {
  position: absolute;
  display: block;
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--color-ink-600);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
}

.icon-button:hover:not(:disabled) {
  color: var(--color-ink-950);
  background: var(--color-muted);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-button {
  padding: 2px 0;
  color: var(--color-brand-700);
  background: none;
  border: 0;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover:not(:disabled) {
  color: var(--color-brand-600);
}

.text-button:disabled {
  color: var(--color-ink-500);
  cursor: not-allowed;
  text-decoration: none;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgb(255 255 255 / 42%);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .72s linear infinite;
}

.spinner--blue {
  color: var(--color-brand-600);
  border-color: var(--color-brand-100);
  border-top-color: var(--color-brand-600);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.alert {
  min-height: 48px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.alert svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert--error {
  color: #8f2020;
  background: var(--color-danger-soft);
  border-color: #f1c1c1;
}

.toast-region {
  position: fixed;
  z-index: 90;
  right: var(--space-5);
  bottom: var(--space-5);
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 14px 16px;
  color: #fff;
  background: var(--color-ink-950);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  animation: toast-in var(--motion-standard) var(--ease-standard);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* ===== Badge ===== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge--success {
  color: #14532d;
  background: #dcfce7;
}

.badge--neutral {
  color: #525252;
  background: #e4e4e7;
}

.badge--primary {
  color: #1e40af;
  background: #dbeafe;
}

.badge--info {
  color: #0e7490;
  background: #cffafe;
}

.badge--danger {
  color: #7f1d1d;
  background: #fee2e2;
}

/* ===== Text Muted ===== */

.text-muted {
  color: var(--color-text-tertiary);
  font-style: italic;
}

/* ===== Shared async and empty states ===== */

.dashboard-loading {
  min-height: 340px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-3);
  color: var(--color-ink-600);
}

.empty-state {
  position: relative;
  z-index: 1;
  min-height: 260px;
  padding: var(--space-8);
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-state__icon {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  color: var(--color-ink-500);
  background: var(--color-muted);
  border-radius: 50%;
}

.empty-state__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state strong {
  color: var(--color-ink-800);
  font-size: 15px;
}

.empty-state p {
  max-width: 430px;
  margin: 6px 0 0;
  color: var(--color-ink-500);
  font-size: var(--text-sm);
}

.empty-state--compact {
  min-height: 210px;
}

@media (max-width: 680px) {
  .empty-state { padding: var(--space-6) 18px; }
}

