/* ═══════════════════════════════════════════════════════
   Components — Buttons, Cards, Badges, Forms, Modals
   ═══════════════════════════════════════════════════════ */

/* ── Buttons ── */
button { cursor: pointer; font-family: var(--font-body); transition: all .2s var(--ease); }

.btn {
  border: none; border-radius: var(--radius-md);
  padding: 14px 24px; font-size: 1rem; font-weight: 500;
  letter-spacing: .02em; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px;
  transition: all .2s var(--ease);
}
.btn-full { width: 100%; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #2d2418; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.btn-dark:disabled { background: var(--warm); color: var(--muted); cursor: not-allowed; transform: none; box-shadow: none; }

.btn-yes {
  background: var(--green); color: #fff; border-radius: 14px;
  padding: 15px; font-family: var(--font-heading); font-style: italic;
  font-size: 1.1rem; width: 100%; border: none;
}
.btn-yes:hover { background: #236040; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(45,122,79,.3); }

.btn-no {
  background: none; color: var(--red); border: 1.5px solid rgba(192,57,43,.3);
  border-radius: 14px; padding: 14px; font-size: 1rem; width: 100%;
}
.btn-no:hover { background: var(--red-bg); }

.btn-reschedule {
  background: rgba(201,146,42,.1); color: var(--gold);
  border: 1.5px solid rgba(201,146,42,.35); border-radius: 14px;
  padding: 13px; font-size: .95rem; width: 100%;
  font-family: var(--font-body);
}
.btn-reschedule:hover { background: rgba(201,146,42,.18); }

.btn-outline {
  background: none; border: 1.5px solid var(--border); border-radius: var(--radius-pill);
  padding: 8px 20px; color: var(--muted); font-size: .88rem;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-ghost {
  background: none; border: none; color: var(--muted); font-size: .9rem;
  text-decoration: underline; padding: 4px 8px;
}
.btn-ghost:hover { color: var(--ink); }

.btn-gold {
  background: var(--gold); color: #fff; border: none;
  border-radius: var(--radius-md); padding: 12px 24px; font-size: .95rem;
}
.btn-gold:hover { background: #b07d1e; transform: translateY(-1px); }

.btn-red {
  background: var(--red); color: #fff; border: none;
  border-radius: var(--radius-md); padding: 12px 24px; font-size: .95rem;
}
.btn-red:hover { background: #a93226; }

.btn-sm { padding: 8px 16px; font-size: .85rem; border-radius: var(--radius-sm); }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--warm); border: 1px solid var(--border); color: var(--muted);
  font-size: 1rem;
}
.btn-icon:hover { background: var(--gold-light); color: var(--gold); border-color: var(--gold); }

/* ── Inputs ── */
input, textarea, select {
  font-family: var(--font-body); font-size: 1rem;
  background: #fff; border: 1.5px solid var(--border);
  color: var(--ink); width: 100%; padding: 11px 14px;
  border-radius: var(--radius-sm); outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,146,42,.12);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
select { cursor: pointer; }
select option { background: var(--paper); }
textarea { resize: vertical; min-height: 88px; line-height: 1.65; }
input[type="file"] { padding: 8px; font-size: .9rem; }

.input-flat {
  background: transparent; border: none; border-bottom: 1.5px solid var(--border);
  border-radius: 0; padding: 7px 2px;
}
.input-flat:focus { border-bottom-color: var(--gold); box-shadow: none; }

.form-group { margin-bottom: 20px; }

/* ── Labels ── */
.lbl {
  display: block; font-size: .72rem; letter-spacing: .1em;
  color: var(--muted); margin-bottom: 6px;
  text-transform: uppercase; font-weight: 500;
}
.form-error {
  color: var(--red); font-size: .82rem; margin-top: 5px;
  display: none; animation: fadeIn .2s ease;
}
.form-error.show { display: block; }

/* ── Cards ── */
.inv-card {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 16px 20px; margin-bottom: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: box-shadow .2s var(--ease), transform .15s var(--ease), border-color .2s;
  animation: fadeUp .4s ease both;
}
.inv-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.inv-card.status-accepted  { border-left: 4px solid var(--green); }
.inv-card.status-declined  { border-left: 4px solid var(--red); }
.inv-card.status-pending   { border-left: 4px solid var(--gold); }
.inv-card.status-reschedule{ border-left: 4px solid var(--gold); }

@media (max-width: 768px) {
  .inv-card { padding: 14px 16px; gap: 12px; }
}

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; letter-spacing: .06em; border-radius: 20px;
  padding: 3px 10px; font-weight: 500;
}
.badge-pending    { background: var(--gold-dim); color: var(--gold); }
.badge-accepted   { background: var(--green-bg); color: var(--green); }
.badge-declined   { background: var(--red-bg); color: var(--red); }
.badge-reschedule { background: var(--gold-dim); color: var(--gold); }
.badge-role {
  font-size: .65rem; padding: 2px 8px; border-radius: 10px;
  font-weight: 600; letter-spacing: .04em;
}
.badge-founder    { background: var(--purple-bg); color: var(--purple); }
.badge-tech-admin { background: var(--blue-bg); color: var(--blue); }
.badge-moderator  { background: var(--gold-dim); color: var(--gold); }
.badge-user       { background: var(--warm); color: var(--muted); }

/* ── Pills (filter) ── */
.pill {
  background: none; color: var(--muted); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 15px; font-size: .8rem;
  transition: all .2s var(--ease); cursor: pointer;
}
.pill.on { background: var(--gold-light); color: var(--ink); border-color: var(--gold); }
.pill:hover:not(.on) { border-color: var(--gold); color: var(--gold); }
.pill-wrap { position: relative; display: inline-block; }
.pill-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; font-size: .7rem; font-weight: 600;
  background: rgba(0,0,0,.08); margin-left: 6px;
  line-height: 1;
}
.pill.on .pill-count { background: rgba(0,0,0,.08); color: var(--ink); }

/* ── Tabs ── */
.tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: var(--warm); border-radius: var(--radius-sm); padding: 4px;
}
.tab {
  flex: 1; padding: 10px 16px; border: none; background: transparent;
  border-radius: var(--radius-sm); cursor: pointer; font-size: .88rem;
  color: var(--muted); transition: all .2s var(--ease); font-weight: 500;
  position: relative;
}
.tab.active { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.tab:hover:not(.active) { color: var(--ink); }
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; font-size: .65rem; font-weight: 700;
  background: var(--red); color: #fff; margin-left: 6px;
  line-height: 1;
}

/* ── Notification badge ── */
.notif-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  font-size: .6rem; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 50%; padding: 0 4px;
  position: absolute; top: -5px; right: -7px;
  animation: pop .3s cubic-bezier(.34,1.56,.64,1) both;
  pointer-events: none;
}

/* ── Divider ── */
.div-line {
  display: flex; align-items: center; gap: 12px; margin: 20px 0; opacity: .35;
}
.div-line::before, .div-line::after { content: ''; flex: 1; height: 1px; background: var(--gold); }
.div-line i { font-size: .6rem; color: var(--gold); font-style: normal; }

/* ── Link box ── */
.link-box {
  background: var(--warm); border-radius: 10px; padding: 14px 16px;
  border: 1px solid var(--border);
}
.link-text {
  font-size: .72rem; font-family: monospace; word-break: break-all;
  color: var(--ink); margin-bottom: 10px; line-height: 1.5; user-select: all;
}

/* ── Copy OK flash ── */
.copy-ok { background: var(--green) !important; color: #fff !important; }

/* ── Empty state ── */
.empty { text-align: center; padding: 64px 0; color: var(--muted); }
.empty-icon { font-size: 2.5rem; margin-bottom: 14px; opacity: .5; }

/* ── Avatar ── */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: var(--warm);
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: .9rem; font-weight: 600; color: var(--gold);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; border-width: 3px; }
.avatar-xl { width: 96px; height: 96px; font-size: 2rem; border-width: 3px; }

/* ── Modal / Overlay ── */
.overlay {
  position: fixed; inset: 0; background: rgba(18,12,6,.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .2s ease;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--paper); border-radius: var(--radius-lg);
  max-width: 480px; width: 100%; padding: 28px;
  border: 1px solid var(--border); animation: fadeUp .3s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-title {
  font-family: var(--font-heading); font-size: 1.3rem;
  font-weight: 400; font-style: italic; margin-bottom: 16px;
}

/* ── Toast ── */
#toast-container {
  position: fixed; top: 70px; right: 20px; z-index: 500;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--paper);
  padding: 12px 20px; border-radius: var(--radius-md);
  font-size: .9rem; max-width: 340px;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
  animation: slideInRight .3s var(--ease);
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
}
.toast.toast-success { border-left: 4px solid var(--green); }
.toast.toast-error   { border-left: 4px solid var(--red); }
.toast.toast-info    { border-left: 4px solid var(--blue); }
.toast.removing { animation: slideOutRight .3s var(--ease) forwards; }

/* ── Detail row ── */
.detail-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.05);
}
.detail-row:last-child { border-bottom: none; }
.detail-icon { font-size: 1.1rem; width: 28px; text-align: center; flex-shrink: 0; }
.detail-label {
  font-size: .68rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .08em; font-weight: 500; min-width: 48px;
}
.detail-value { font-size: .88rem; color: var(--ink); font-weight: 500; }

/* ── Firebase dot ── */
.fb-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); display: inline-block;
  margin-right: 5px; transition: background .4s;
}
.fb-dot.ok  { background: var(--green); }
.fb-dot.err { background: var(--red); }

/* ── Confetti ── */
.confetti-piece {
  position: fixed; width: 8px; height: 8px; border-radius: 2px;
  pointer-events: none; z-index: 999;
  animation: confetti-fall linear forwards;
}

/* ── Loader / Spinner ── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.page-loader {
  min-height: 60vh; display: flex; align-items: center;
  justify-content: center;
}

/* ── Tabs ── */
.tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px;
}
.tab {
  padding: 10px 20px; font-size: .95rem; color: var(--muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; font-weight: 500;
  transition: all .2s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--gold); border-bottom-color: var(--gold); font-weight: 600;
}

@media (max-width: 768px) {
  .tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    border-bottom: none;
  }
  .tab {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 0;
    text-align: center;
  }
  .tab.active {
    border-bottom-color: var(--border) !important;
    background: var(--warm);
    color: var(--ink);
  }
}

/* ── Toggle switch ── */
.toggle-wrap {
  display: flex; align-items: center; gap: 10px;
}
.toggle {
  position: relative; width: 48px; height: 26px;
  background: var(--border); border-radius: 13px;
  cursor: pointer; border: none; transition: background .3s;
}
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; background: #fff;
  border-radius: 50%; transition: transform .3s var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.toggle.on { background: var(--gold); }
.toggle.on::after { transform: translateX(22px); }
.toggle-label { font-size: .85rem; color: var(--muted); }

@media (max-width: 768px) {
  .toggle { width: 40px; height: 22px; flex-shrink: 0; }
  .toggle::after { width: 16px; height: 16px; top: 3px; left: 3px; }
  .toggle.on::after { transform: translateX(18px); }
  .toggle-wrap { gap: 8px; }
  .toggle-label { font-size: .78rem; }
}

/* ── Checkbox list ── */
.check-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s;
}
.check-item:hover { background: var(--warm); }
.check-box {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-radius: 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.check-item.checked .check-box {
  background: var(--gold); border-color: var(--gold); color: #fff;
}

/* ── Reschedule form ── */
.reschedule-form {
  background: var(--warm); border-radius: 14px; padding: 18px;
  margin-top: 14px; border: 1px solid var(--border);
  animation: fadeUp .3s ease both;
}

/* ── Skeleton loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--warm) 25%, #e8dfd0 50%, var(--warm) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
