/* ═══════════════════════════════════════════════════════
   COMPONENTS — buttons, inputs, cards, modals
   ═══════════════════════════════════════════════════════ */

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--black);
}

.btn-primary:hover {
  background: var(--white);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}

.btn-outline:hover {
  background: var(--gold-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--gray3);
}

.btn-ghost:hover {
  color: var(--white);
  border-color: var(--gray3);
}

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

.btn-sm {
  padding: 8px 14px;
  font-size: 11px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-block {
  width: 100%;
}

/* ─── INPUTS ─── */
.input, .textarea, .select {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--gray3);
  color: var(--white);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--gold);
}

.input::placeholder, .textarea::placeholder {
  color: var(--muted);
}

.textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.field {
  margin-bottom: var(--space-md);
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

.field-error {
  color: var(--red);
  font-size: 12px;
  margin-top: 6px;
}

/* Password field with toggle button */
.field-password {
  position: relative;
}

.field-password .toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
}

.field-password .input {
  padding-right: 40px;
}

/* ─── CARDS ─── */
.card {
  background: var(--gray);
  border: 1px solid var(--gray3);
  padding: var(--space-lg);
}

.card-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
}

/* Stat card (metrics on dashboard) */
.stat {
  background: var(--gray);
  border: 1px solid var(--gray3);
  padding: var(--space-lg);
  text-align: center;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  color: var(--gold);
  line-height: 1;
}

.stat-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: var(--space-sm);
  letter-spacing: 0.1em;
}

.stat-green .stat-value { color: var(--green); }
.stat-red .stat-value { color: var(--red); }

/* ─── BADGES ─── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.badge-gold { color: var(--gold); }
.badge-green { color: var(--green); }
.badge-red { color: var(--red); }
.badge-muted { color: var(--muted); }

/* ─── MODAL ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--gray);
  border: 1px solid var(--gray3);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-xl);
}

.modal-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 24px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

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

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gray);
  color: var(--white);
  border: 1px solid var(--gold);
  padding: 12px 20px;
  font-size: 13px;
  z-index: 2000;
  transition: transform var(--transition);
  max-width: 90vw;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

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

/* ─── EMPTY STATES ─── */
.empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--muted);
}

.empty-title {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.empty-text {
  font-size: 13px;
  line-height: 1.6;
}

/* ─── DIVIDERS ─── */
.divider {
  height: 1px;
  background: var(--gray3);
  margin: var(--space-lg) 0;
}
