/* Button primitives */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--text-size-base);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-size-sm);
}

/* Universal modal button styles — used by all dialogs */
.button-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  transition: background 0.2s;
  white-space: nowrap;
}
.button-no:hover { background: var(--bg-subtle); }

.button-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid var(--header-bg);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  transition: background 0.2s;
  white-space: nowrap;
}
.button-alt:hover { background: var(--primary-light); }

.button-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: var(--header-bg);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  transition: background 0.2s;
  white-space: nowrap;
}
.button-ok:hover { background: var(--header-bg-dark); }

/* Icon-only buttons */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--color-text-muted);
}
.btn-icon:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.btn-icon-danger:hover { background: #fde0dd; color: var(--error); }

/* Form inputs */
.input, .select, .textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-raised);
  color: var(--color-text);
  font-size: var(--text-size-base);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
label { display: block; font-size: var(--text-size-sm); color: var(--color-text-muted); margin-bottom: var(--space-1); }

/* Utility classes */
.text-muted { color: var(--color-text-muted); }
.error-state { padding: var(--space-8); text-align: center; color: var(--error); }
.empty-state { padding: var(--space-8); text-align: center; color: var(--color-text-muted); }
.hidden { display: none !important; }

/* Toast */
#toast-root {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--color-bg-raised);
  color: var(--color-text);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--color-primary);
  min-width: 240px;
  max-width: 360px;
  pointer-events: auto;
  animation: toast-in 0.25s ease-out;
}
.toast-error { border-left-color: var(--error); }
.toast-warning { border-left-color: var(--warning); }
.toast-success { border-left-color: var(--success); }
.toast-leave { animation: toast-out 0.3s ease-in forwards; }
@keyframes toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { to { transform: translateX(100%); opacity: 0; } }
