/* ============================================================
   COMPONENTS v2 — Comune pentru toate tab-urile
   Buttons, badges, lists, forms, modals
   ============================================================ */

/* === Modal ===
   .modal-overlay/.modal (the real markup, see 00-shared.css) are the only
   modal in this app. This file used to also define a `.modal { position:
   fixed; inset:0; display:flex; ... }` rule for an unused `.modal >
   .modal-content` pattern nothing in the codebase ever adopted — loading
   after 00-shared.css, it won, and turned the real `.modal` panel into a
   fixed flex row, so `.modal-header` and `#modal-body` sat side by side
   instead of stacked (title left, content squeezed right on mobile). */
.modal-close {
  background: transparent;
  border: 0;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
}
.modal-close:hover {
  background: var(--card-hover);
  color: var(--text);
}
.modal-footer {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
}

/* === Forms === */
.form-field {
  margin-bottom: var(--sp-4);
}
.form-label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-body);
  font-family: inherit;
  transition: border-color var(--t-fast);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-help {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

/* === Toast / notifications === */
.toast {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-5);
  box-shadow: var(--sh-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  z-index: var(--z-toast);
  animation: toast-in var(--t-med) var(--ease-out);
  max-width: 400px;
}
@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.success { border-color: var(--ok); }
.toast.error { border-color: var(--err); }

/* === Tab content visibility (utility) === */
.tab-pane {
  display: none;
  animation: tab-in var(--t-med) var(--ease-out);
}
.tab-pane.active {
  display: block;
}
@keyframes tab-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Skeleton (loading) === */
.skeleton {
  background: linear-gradient(90deg, var(--card) 0%, var(--card-hover) 50%, var(--card) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Empty state === */
.empty-state {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  opacity: 0.4;
  margin-bottom: var(--sp-3);
}
.empty-state-title {
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

/* === Tags / chips === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--card-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-tiny);
  font-weight: 600;
  color: var(--text-muted);
}
.chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* === Avatar === */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--fs-small);
  overflow: hidden;
}
.avatar.lg { width: 48px; height: 48px; font-size: var(--fs-h3); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* === Action group === */
.action-group {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
}

/* === Inline divider === */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-4) 0;
}

/* === Section header === */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--sp-5) 0 var(--sp-3);
}
.section-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin: 0;
}
.section-actions {
  display: flex;
  gap: var(--sp-2);
}
