/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--r-lg);
  transition: all var(--trans-base);
  white-space: nowrap;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--yellow);
  color: var(--dark);
}
.btn-primary:hover {
  background: #e5b53c;
  box-shadow: 0 4px 14px var(--yellow-shadow);
  transform: translateY(-1px);
}
.btn-outline {
  border-color: var(--border);
  color: var(--dark);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--yellow);
  background: var(--yellow-10);
}
.btn-dark {
  background: var(--dark);
  color: var(--white);
}
.btn-dark:hover { background: var(--dark-alt); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #C53030; }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #2F855A; }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--dark); background: var(--light); }
.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); }
.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: var(--fs-base); }
.btn-icon { padding: var(--sp-2); border-radius: var(--r-md); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 0.6s linear infinite; }

/* ── Cards ────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  transition: all var(--trans-base);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card-flat { border: none; box-shadow: var(--shadow-sm); }
.card-flat:hover { box-shadow: var(--shadow-xl); }
.card-dark { background: var(--dark-alt); border-color: rgba(255,255,255,0.1); color: var(--white); }

/* ── Forms ────────────────────────────────── */
.form-group { margin-bottom: var(--sp-4); }
.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--dark);
  margin-bottom: var(--sp-1);
}
.form-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  transition: border-color var(--trans-fast);
  background: var(--white);
}
.form-input:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow-20);
}
.form-input::placeholder { color: #A0AEC0; }
.form-input.error { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: var(--fs-xs); margin-top: var(--sp-1); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7B8D' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 2.5rem; }
textarea.form-input { resize: vertical; min-height: 5rem; }
.form-check { display: flex; align-items: center; gap: var(--sp-2); }
.form-check input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--yellow); }
.form-hint { color: var(--muted); font-size: var(--fs-xs); margin-top: var(--sp-1); }

/* ── Badges ───────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--r-full);
  line-height: 1.4;
}
.badge-yellow { background: var(--yellow-10); color: #B7791F; }
.badge-blue { background: var(--blue-10); color: #2B6CB0; }
.badge-green { background: var(--green-10); color: #276749; }
.badge-danger { background: rgba(229,62,62,0.1); color: var(--danger); }
.badge-gray { background: var(--light); color: var(--muted); }
.badge-warning { background: var(--yellow-10); color: #B7791F; }
.badge-success { background: var(--green-10); color: #276749; }
.badge-info { background: rgba(66,153,225,0.12); color: #2B6CB0; }
.badge-red { background: rgba(229,62,62,0.1); color: var(--danger); }

/* ── Modal ────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--trans-base);
}
.modal-backdrop.active { opacity: 1; visibility: visible; }
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--white);
  border-radius: var(--r-2xl);
  padding: var(--sp-8);
  width: 90%;
  max-width: 28rem;
  max-height: 90vh;
  overflow-y: auto;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--trans-base);
}
.modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-6); }
.modal-title { font-size: var(--fs-xl); font-weight: 700; }
.modal-close { width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; border-radius: var(--r-full); color: var(--muted); transition: all var(--trans-fast); }
.modal-close:hover { background: var(--light); color: var(--dark); }

/* ── Toast ────────────────────────────────── */
.toast-container {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.toast {
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--r-lg);
  background: var(--dark);
  color: var(--white);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 24rem;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--info); }

/* ── Table ────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--light); }
.data-table .actions { display: flex; gap: var(--sp-2); }

/* ── Tabs ─────────────────────────────────── */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 2px solid var(--border); margin-bottom: var(--sp-6); overflow-x: auto; }
.tab {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--trans-fast);
}
.tab:hover { color: var(--dark); }
.tab.active { color: var(--yellow); border-bottom-color: var(--yellow); font-weight: 600; }

/* ── Pagination ───────────────────────────── */
.pagination { display: flex; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-8); }
.page-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all var(--trans-fast);
}
.page-btn:hover { border-color: var(--yellow); background: var(--yellow-10); }
.page-btn.active { background: var(--yellow); color: var(--dark); border-color: var(--yellow); }

/* ── Avatar ───────────────────────────────── */
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-full);
  object-fit: cover;
  background: linear-gradient(135deg, var(--blue), var(--yellow));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: var(--fs-sm);
}
.avatar-lg { width: 4rem; height: 4rem; font-size: var(--fs-xl); }
.avatar-xl { width: 6rem; height: 6rem; font-size: var(--fs-2xl); }

/* ── Status dots ──────────────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--danger); }
.status-dot.pending { background: var(--yellow); }

/* ── Empty state ──────────────────────────── */
.empty-state { text-align: center; padding: var(--sp-12) var(--sp-4); }
.empty-state i { font-size: 3rem; color: var(--muted); margin-bottom: var(--sp-4); }
.empty-state h3 { color: var(--dark); margin-bottom: var(--sp-2); }
.empty-state p { color: var(--muted); max-width: 20rem; margin: 0 auto; }

/* ── Loading Skeleton ─────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--light) 25%, #e8ecf1 50%, var(--light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-md);
}
.skeleton-text { height: 1rem; margin-bottom: var(--sp-2); }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: var(--sp-3); }
.skeleton-avatar { width: 3rem; height: 3rem; border-radius: var(--r-full); }
.skeleton-card { height: 12rem; }
