/* Reusable UI primitives: section heading, cards, field rows, inputs, buttons
   (.btn / .btn-sm variants), role pill, toast, modal. */

/* Section label above a card */
.section-heading { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 16px 0 10px; padding-left: 4px; }
.section-heading:first-child { margin-top: 0; }

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card-head .title { display: flex; align-items: center; gap: 10px; }
.card-head .title .icon { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-elevated); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-head .title .icon svg { width: 14px; height: 14px; stroke: var(--accent-bright); fill: none; stroke-width: 2; }
.card-head .title h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; margin: 0; }
.card-head .title .sub { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
.card-head .title .title-txt { display: flex; flex-direction: column; gap: 0; }
.card-head .trail { display: flex; align-items: center; gap: 8px; }

/* Form field rows */
.field-grid { display: grid; gap: 14px; }
.field {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 14px;
}
.field > label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-deeper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus { border-color: var(--accent); background: var(--bg-primary); }
.input::placeholder { color: var(--text-muted); }
.input.mono { font-family: var(--font-mono); font-size: 13px; }
.input:read-only { color: var(--text-secondary); cursor: default; }

.inline { display: flex; align-items: center; gap: 8px; }

/* Primary button (card-level) */
.btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn.accent { background: linear-gradient(135deg, var(--accent-dim), var(--accent)); border-color: transparent; color: white; }
.btn.accent:hover { opacity: 0.92; color: white; }
.btn.danger { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); color: #f87171; }
.btn.danger:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.btn.solid-danger { background: var(--danger); border-color: var(--danger); color: white; }
.btn.solid-danger:hover { background: #dc2626; color: white; }

/* Legacy btn-sm kept for backward-compat elsewhere (rename form + sites actions) */
.btn-sm { padding: 8px 14px; border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-secondary); }
.btn-sm:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn-sm.accent { background: linear-gradient(135deg, var(--accent-dim), var(--accent)); border-color: transparent; color: white; }
.btn-sm.accent:hover { opacity: 0.92; }
.btn-sm.danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: var(--danger); }
.btn-sm.danger:hover { background: rgba(239,68,68,0.2); }

/* Role pill on profile */
.role-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 100px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.role-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ─── Toast ─────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 14px; color: var(--text-primary); display: flex; align-items: center; gap: 10px; animation: toastIn 0.3s ease-out; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.success { border-color: rgba(34,197,94,0.3); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.visible { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; max-width: 400px; width: 100%; animation: fadeInUp 0.3s ease-out; }
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
.modal-actions button { padding: 10px 20px; border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; border: 1px solid var(--border); }
.modal-actions .btn-modal-cancel { background: var(--bg-elevated); color: var(--text-secondary); }
.modal-actions .btn-modal-confirm { background: var(--danger); border-color: var(--danger); color: white; }
.edit-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.edit-field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.edit-field input { width: 100%; padding: 10px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.2s; }
.edit-field input:focus { border-color: var(--accent); }
.edit-field .hint { font-size: 13px; color: var(--text-muted); margin-top: 4px; display: block; }
