/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; border: none; border-radius: var(--radius);
  font-weight: 700; font-size: .875rem; cursor: pointer;
  transition: all .15s; font-family: inherit; line-height: 1;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover   { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active  { transform: translateY(0) scale(0.97); filter: brightness(0.92); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; filter: none; }

.btn-primary  { background: var(--accent);  color: #fff; }
.btn-success  { background: var(--green);   color: #fff; }
.btn-danger   { background: var(--accent);  color: #fff; }
.btn-ghost    { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }
.btn-purple   { background: var(--purple);  color: #fff; }
.btn-teal     { background: var(--teal);    color: #fff; }
.btn-blue     { background: var(--blue);    color: #fff; }
.btn-gold     { background: var(--gold);    color: #1a1200; }
.btn-orange   { background: #f97316;        color: #fff; }

/* Sizes */
.btn-full  { width: 100%; padding: .8rem 1rem;    margin-bottom: .5rem; }
.btn-sm    { padding: .35rem .7rem;  font-size: .78rem; border-radius: 8px; }
.btn-xs    { padding: .25rem .55rem; font-size: .72rem; border-radius: 6px; }
.btn-small { width: auto; flex: 1; padding: .6rem .75rem; font-size: .82rem; border-radius: 10px; margin-bottom: 0; }
.btn-full:last-child { margin-bottom: 0; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; }
.btn-row:last-child { margin-bottom: 0; }

/* ── CARD ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem;
}
.card-title {
  font-size: .7rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 1rem;
}

/* ── FORM ── */
.field { margin-bottom: .875rem; }
.field label {
  display: block; font-size: .75rem; font-weight: 600;
  color: var(--muted2); margin-bottom: .4rem;
  text-transform: uppercase; letter-spacing: .5px;
}
input[type="text"], input[type="number"], input[type="password"],
input[type="email"], input[type="file"], textarea, select {
  width: 100%; padding: .65rem .875rem;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text);
  font-size: .875rem; transition: border-color .15s, box-shadow .15s;
  outline: none; font-family: inherit; appearance: none; -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(233,69,96,0.5); box-shadow: 0 0 0 3px rgba(233,69,96,0.1);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

/* ── TOAST / NOTIF ── */
.toast-el, #notif {
  position: fixed; background: var(--surface2);
  border: 1px solid var(--border2); border-left: 3px solid var(--green);
  color: var(--text); padding: .8rem 1.1rem; border-radius: var(--radius);
  z-index: 9999; font-weight: 600; font-size: .875rem;
  max-width: min(440px, calc(100vw - 3rem)); word-break: break-word;
  box-shadow: var(--shadow); animation: slideIn .2s ease;
}
.toast-el { bottom: 1.5rem; right: 1.5rem; }
#notif     { bottom: 1.25rem; left: 50%; transform: translateX(-50%); animation: toastIn .2s ease; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-el.err, #notif.err { border-left-color: var(--accent); }
@keyframes slideIn { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes toastIn  { from{transform:translateX(-50%) translateY(12px);opacity:0} to{transform:translateX(-50%) translateY(0);opacity:1} }

/* ── OVERLAY / DIALOG ── */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); padding: 1rem;
}
.dialog {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 2rem; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
}
.dialog h3 { font-size: 1.15rem; font-weight: 700; color: var(--accent); margin-bottom: .75rem; }
.dialog p  { color: var(--muted2); font-size: .9rem; line-height: 1.65; margin-bottom: 1rem; }
.dialog-hint { font-size: .8rem; color: var(--muted2); margin-bottom: .875rem; line-height: 1.55; }
.dialog-btns { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }

/* ── LINK ITEMS ── */
.link-item {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .875rem 1rem; margin-bottom: .625rem; position: relative;
}
.link-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: .3rem; }
.link-val   { font-size: .8rem; color: #a78bfa; padding-right: 70px; word-break: break-all; line-height: 1.4; }
.copy-btn {
  position: absolute; top: .75rem; right: .75rem;
  padding: .25rem .6rem; font-size: .7rem; font-weight: 700;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 6px; color: var(--text); cursor: pointer; transition: all .15s;
}
.copy-btn:hover { background: var(--purple); border-color: var(--purple); }

/* ── QR BOX ── */
.qr-box { text-align: center; padding: 1rem 0; }
.qr-box img { background: #fff; padding: .625rem; border-radius: var(--radius); max-width: 160px; }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 2.5rem; color: var(--muted); font-size: .875rem; }
.empty-icon { font-size: 2rem; margin-bottom: .5rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); font-size: .875rem; line-height: 1.7; }
.empty-state .empty-icon { font-size: 2rem; display: block; margin-bottom: .5rem; }

/* ── ERR ── */
.err {
  color: #ff6b6b; font-size: .8rem; margin-bottom: .75rem;
  padding: .55rem .8rem; background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.2); border-radius: 8px;
}

/* ── JOIN CODE ── */
.join-code-display {
  display: inline-flex; align-items: center; gap: .75rem;
  background: rgba(245,158,11,0.08); border: 2px solid rgba(245,158,11,0.3);
  border-radius: var(--radius); padding: .75rem 1.25rem; margin: .5rem 0;
}
.join-code-val {
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 2rem; font-weight: 900; color: var(--gold); letter-spacing: 6px;
}
.join-code-label { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: .2rem; }

/* ── SECTION DIVIDER ── */
.section-label {
  font-size: .68rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); margin: 1.25rem 0 .625rem;
  display: flex; align-items: center; gap: .5rem;
}
.section-label::before, .section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── STATUS PILL ── */
.status-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 99px; }
.status-pill.handled { background: rgba(16,185,129,0.15); color: var(--green); }
.status-pill.pending { background: rgba(233,69,96,0.12);  color: var(--accent); }

/* ── STRENGTH BAR (setup pages) ── */
.strength-bar  { height: 4px; background: var(--border2); border-radius: 99px; margin-top: .5rem; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 99px; transition: width .3s, background .3s; }
