/* ==================================================================
   Pede o Som — Design System
   Identidade: casa noturna. Fundo aubergine (não preto), CTA âmbar de
   refletor de palco, destaque neon magenta. Display Unbounded, UI Manrope,
   números da fila em Space Mono (cara de "setlist/ticket"). Mobile-first.
   ================================================================== */

:root {
  --bg:      #140B1F;
  --bg-2:    #1B0F2B;
  --panel:   rgba(255,255,255,.055);
  --panel-2: rgba(255,255,255,.085);
  --brd:     rgba(255,255,255,.10);
  --brd-2:   rgba(255,255,255,.18);

  --ink:     #F4EEF7;
  --muted:   #A99BB8;

  --gold:    #FFB627;  /* refletor / CTA principal */
  --gold-2:  #FF9E1B;
  --neon:    #FF3D81;  /* neon nightlife */
  --violet:  #7C3AED;  /* ponte do gradiente */
  --ok:      #38E1D6;
  --danger:  #FF5C5C;

  --grad:    linear-gradient(135deg, var(--neon) 0%, var(--gold) 100%);
  --grad-v:  linear-gradient(135deg, var(--violet) 0%, var(--neon) 100%);

  --r:   18px;
  --r-sm:12px;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --maxw: 520px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(124,58,237,.25), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(255,61,129,.20), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 20px 18px 96px; }

/* ---------- tipografia ---------- */
h1, h2, h3 { font-family: 'Unbounded', sans-serif; font-weight: 700; margin: 0 0 .3em; letter-spacing: -.02em; }
h1 { font-size: 1.7rem; line-height: 1.12; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
.eyebrow { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
a { color: var(--gold); text-decoration: none; }

/* ---------- marca / equalizer ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.brand .logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; }
.eq i { width: 3px; height: 40%; background: var(--gold); border-radius: 3px; animation: eq 900ms ease-in-out infinite; }
.eq i:nth-child(2){ animation-delay: .15s; background: var(--neon); }
.eq i:nth-child(3){ animation-delay: .30s; }
.eq i:nth-child(4){ animation-delay: .45s; background: var(--neon); }
@keyframes eq { 0%,100%{ height:25%; } 50%{ height:95%; } }

/* ---------- cards / painel ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; }
.row.between { justify-content: space-between; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- botões ---------- */
.btn {
  appearance: none; border: 1px solid var(--brd-2); background: var(--panel-2);
  color: var(--ink); font-family: inherit; font-weight: 700; font-size: .95rem;
  padding: 14px 18px; border-radius: 999px; cursor: pointer; width: 100%;
  transition: transform .12s ease, filter .2s ease, box-shadow .2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-gold { background: var(--grad); border: none; color: #2a1400; box-shadow: 0 10px 30px rgba(255,158,27,.35); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-lg { padding: 18px 20px; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-icon { width: auto; padding: 10px 14px; }

/* botões grandes da tela pública */
.big-actions { display: grid; gap: 12px; }
.action-btn {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px; border-radius: var(--r); border: 1px solid var(--brd);
  background: var(--panel); color: var(--ink); cursor: pointer; width: 100%;
  font-family: inherit; transition: border-color .2s, transform .12s, background .2s;
}
.action-btn:active { transform: translateY(1px); }
.action-btn:hover { border-color: var(--brd-2); background: var(--panel-2); }
.action-btn .ico { font-size: 1.4rem; width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center; border-radius: 12px; background: var(--grad-v); }
.action-btn .t { font-weight: 800; font-size: 1.02rem; }
.action-btn .d { font-size: .8rem; color: var(--muted); }

/* ---------- campos ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
input, textarea, select {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
  background: rgba(0,0,0,.25); border: 1px solid var(--brd); border-radius: var(--r-sm);
  padding: 13px 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,182,39,.18); }
textarea { min-height: 84px; resize: vertical; }

/* ---------- pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--brd); color: var(--muted); }
.badge { font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; text-transform: capitalize; }
.badge.novo     { background: rgba(255,61,129,.18);  color: #ff8fb6; }
.badge.visto    { background: rgba(124,58,237,.18);  color: #c4a6ff; }
.badge.analise  { background: rgba(56,225,214,.14);  color: var(--ok); }
.badge.aceito   { background: rgba(255,182,39,.18);  color: var(--gold); }
.badge.tocado   { background: rgba(56,225,214,.18);  color: var(--ok); }
.badge.recusado { background: rgba(255,92,92,.16);   color: var(--danger); }
.badge.ativo    { background: rgba(56,225,214,.16);  color: var(--ok); }
.badge.encerrado{ background: rgba(255,255,255,.08); color: var(--muted); }

/* ---------- fila ao vivo (assinatura) ---------- */
.queue-pos {
  font-family: 'Space Mono', monospace; font-weight: 700; font-size: 1.5rem;
  min-width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px;
  background: rgba(255,182,39,.14); color: var(--gold); border: 1px solid rgba(255,182,39,.35);
  box-shadow: 0 0 24px rgba(255,182,39,.25);
}
.queue-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--brd); }
.queue-item:last-child { border-bottom: none; }
.mine { border: 1px solid rgba(255,182,39,.4); border-radius: var(--r-sm); padding: 12px; background: rgba(255,182,39,.06); }

/* ---------- big number / stat ---------- */
.stat { text-align: center; }
.stat .n { font-family: 'Unbounded', sans-serif; font-size: 1.6rem; font-weight: 800; }
.stat .n.gold { color: var(--gold); }

/* ---------- estrelas ---------- */
.stars { display: inline-flex; gap: 6px; font-size: 1.8rem; cursor: pointer; }
.stars .s { color: rgba(255,255,255,.22); transition: transform .1s, color .15s; }
.stars .s.on { color: var(--gold); text-shadow: 0 0 16px rgba(255,182,39,.5); }
.stars .s:active { transform: scale(1.2); }

/* ---------- toast / loader / vazio ---------- */
.toast { position: fixed; left: 50%; bottom: 78px; transform: translateX(-50%) translateY(20px);
  background: #241636; border: 1px solid var(--brd-2); color: var(--ink); padding: 12px 18px;
  border-radius: 999px; box-shadow: var(--shadow); opacity: 0; transition: all .25s; z-index: 99; font-weight: 600; font-size: .9rem;
  /* CRÍTICO: o toast fica sobre a barra de ícones. Sem pointer-events:none ele
     vira uma "máscara invisível" (opacity 0 mas ainda no ar) que engole os
     toques nos ícones do meio. Nunca remover esta linha. */
  pointer-events: none; max-width: 88vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255,92,92,.6); }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; min-height: 60dvh; text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8,4,14,.7); backdrop-filter: blur(6px);
  display: none; align-items: flex-end; z-index: 80; }
.overlay.show { display: flex; }
.sheet { width: 100%; max-width: var(--maxw); margin: 0 auto; background: var(--bg-2);
  border: 1px solid var(--brd); border-bottom: none; border-radius: 22px 22px 0 0; padding: 20px;
  animation: up .28s ease; max-height: 90dvh; overflow: auto; }
@media (min-width: 560px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }

/* ---------- header público ---------- */
.hero { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--brd); }
.hero .cover { height: 150px; background: var(--grad-v); background-size: cover; background-position: center; }
.hero .body { padding: 16px; background: var(--panel); backdrop-filter: blur(14px); }
.avatar { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; border: 2px solid var(--bg);
  margin-top: -46px; background: var(--bg-2); }

/* ---------- utilidades ---------- */
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.hide { display: none !important; }
.divider { height: 1px; background: var(--brd); margin: 14px 0; }
.tab-bar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(20,11,31,.92);
  backdrop-filter: blur(14px); border-top: 1px solid var(--brd); display: flex;
  /* Acima de avisos flutuantes (toast/indicador) para que os toques sempre
     cheguem nos ícones. Fica abaixo apenas do modal (overlay usa 50 -> ver abaixo). */
  z-index: 60; }
.tab-bar button { flex: 1; background: none; border: none; color: var(--muted); font-family: inherit;
  padding: 12px 4px 18px; font-size: .72rem; font-weight: 700; cursor: pointer; display: grid; gap: 2px; }
.tab-bar button .ti { font-size: 1.2rem; }
.tab-bar button.on { color: var(--gold); }
.tab-bar button { position: relative; }
.tab-bar button .dot-unread { position: absolute; top: 8px; right: 26%; width: 8px; height: 8px;
  border-radius: 50%; background: var(--neon); box-shadow: 0 0 6px var(--neon); }

/* Chat de suporte */
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; padding: 4px 2px; }
.chat-bubble { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: .92rem; line-height: 1.35; }
.chat-bubble .hora { display: block; font-size: .68rem; opacity: .6; margin-top: 3px; }
.chat-bubble.mine { align-self: flex-end; background: var(--grad); color: #2a1400; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--brd); border-bottom-left-radius: 4px; }
.chat-input-row { display: flex; gap: 8px; margin-top: 10px; }
.chat-input-row textarea { flex: 1; min-height: 44px; max-height: 100px; resize: none; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Indicador de conexão (tela de pedidos) */
.conn{position:fixed;top:10px;right:10px;z-index:50;display:none;align-items:center;gap:6px;
  padding:5px 10px;border-radius:999px;font:600 12px/1 Manrope,sans-serif;
  background:rgba(0,0,0,.55);backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,.12);
  pointer-events:none} /* nunca engolir toques */
.conn .dot{width:8px;height:8px;border-radius:50%}
.conn.on{color:var(--ok)} .conn.on .dot{background:var(--ok);box-shadow:0 0 8px var(--ok)}
.conn.off{color:var(--gold)} .conn.off .dot{background:var(--gold);animation:pisca 1s infinite}
@keyframes pisca{50%{opacity:.25}}

/* Folha imprimível do QR */
@media print{
  body *{visibility:hidden}
  #folhaQR, #folhaQR *{visibility:visible}
  #folhaQR{position:absolute;inset:0;display:flex}
}

/* Prévia da foto do artista (perfil) */
.foto-prev{width:96px;height:96px;border-radius:16px;border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.05) center/cover no-repeat;display:grid;place-items:center;
  color:var(--muted);font-size:12px;margin:6px 0}
.foto-prev.tem{border-color:var(--gold)}
