/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.1s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-ai {
  background: rgba(124, 92, 255, 0.14);
  color: var(--brand-light);
  border: 1px solid rgba(124, 92, 255, 0.35);
}

.btn-ai:hover:not(:disabled) {
  background: rgba(124, 92, 255, 0.22);
}

.btn-full {
  width: 100%;
}

.btn-lg {
  padding: 13px 26px;
  font-size: 14.5px;
}

.btn-sm {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-sm:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.btn-sm.danger:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.35);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.icon-btn:hover {
  background: var(--surface-hover);
}

.icon-btn.danger-icon:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.35);
}

/* ---------------- Card ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.card-title-row h3 {
  font-size: 15px;
  margin-bottom: 2px;
}

.card-title-row p {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---------------- Forms ---------------- */

.form-group {
  margin-bottom: var(--space-4);
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group label span {
  color: var(--red);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
}

.select-input,
.date-input {
  width: 100%;
}

/* ---------------- Toggle switch ---------------- */

.toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-light);
  border-radius: 999px;
  transition: 0.2s;
  cursor: pointer;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--brand-gradient);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ---------------- Modal ---------------- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  justify-content: center;
  z-index: 100;
  padding: var(--space-6) var(--space-4);
  overflow-y: auto;
}

.modal-overlay.show {
  display: flex;
  align-items: flex-start;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 65%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-6);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 16px;
  margin-bottom: 3px;
}

.modal-header p {
  font-size: 12.5px;
  color: var(--text-muted);
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--red);
}

.modal-body {
  padding: var(--space-5);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ---------------- Confirm dialog ---------------- */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--space-4);
}

.confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  max-width: 360px;
  width: 100%;
}

.confirm-box p {
  font-size: 14px;
  margin-bottom: var(--space-4);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ---------------- Toast ---------------- */

.toast-host {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 300;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-left-color: var(--green);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-info {
  border-left-color: var(--blue);
}

/* ---------------- Empty states ---------------- */

.empty-state {
  text-align: center;
  padding: var(--space-6);
  color: var(--text-muted);
}

.empty-state.compact {
  padding: var(--space-5);
}

.empty-icon {
  font-size: 30px;
  margin-bottom: var(--space-2);
}

.empty-state-small,
.empty-small {
  text-align: center;
  padding: var(--space-4);
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------------- Tags / badges ---------------- */

.tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.tag-whatsapp {
  color: #22c55e;
}

.tag-facebook {
  color: #3b82f6;
}

.tag-instagram {
  color: #ec4899;
}

