/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.1s, border-color 0.1s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--slate-300); }
.btn-secondary:hover { background: var(--slate-50); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #B91C1C; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--slate-100); }
.btn-sm { padding: 4px 10px; font-size: var(--font-size-sm); }
.btn-lg { padding: 12px 18px; font-size: var(--font-size-md); }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ============ INPUTS ============ */
.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color 0.1s, box-shadow 0.1s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--shadow-focus); }
.input::placeholder { color: var(--text-muted); }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-size: var(--font-size-sm); font-weight: 500; color: var(--text-secondary); }
.input-error { color: var(--danger); font-size: var(--font-size-sm); }
.input.has-error { border-color: var(--danger); }

/* ============ BADGES ============ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
}
.badge-success { background: var(--green-100); color: #166534; }
.badge-warning { background: var(--yellow-100); color: #92400E; }
.badge-danger { background: var(--red-100); color: #991B1B; }
.badge-info { background: var(--blue-100); color: #1E40AF; }

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}
.card-title { font-size: var(--font-size-md); font-weight: 600; color: var(--text-primary); }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.stat-card.stat-success { border-top-color: var(--success); }
.stat-card.stat-warning { border-top-color: var(--warning); }
.stat-card.stat-danger { border-top-color: var(--danger); }
.stat-card.stat-info { border-top-color: var(--info); }
.stat-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.stat-delta {
  font-size: var(--font-size-xs);
  font-weight: 500;
  margin-top: 4px;
}
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }
.stat-delta.neutral { color: var(--text-muted); }

/* ============ TABLES ============ */
.table {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: var(--font-size-sm);
}
.table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--slate-50);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--text-primary);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--slate-50); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--slate-900);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: var(--font-size-base);
  z-index: 9999;
  animation: toast-in 0.2s ease-out;
}
.toast.toast-success { background: var(--green-600); }
.toast.toast-danger { background: var(--red-600); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
