/* PedeBis: componentes do design system v1 (02 §4).
   Anatomia fixa; cor, raio e fonte vêm dos tokens. Prefixo "ds-" para não
   colidir com as classes antigas enquanto as telas migram (Fases 1 a 3). */

/* ---------- Botão ---------- */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: var(--radius-control); border: 1px solid transparent;
  font-family: var(--font-body); font-size: 15px; font-weight: 700; line-height: 1;
  color: var(--fg); background: transparent; cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), opacity var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.ds-btn.primario { background: var(--accent); color: var(--on-accent); }
.ds-btn.secundario { border-color: rgba(255, 255, 255, 0.28); }
.ds-btn.fantasma { color: var(--fg-muted); }
.ds-btn.perigo { border-color: var(--danger); color: var(--danger); }
.ds-btn.pequeno { min-height: 40px; padding: 0 14px; font-size: 13px; }
.ds-btn.grande { min-height: 56px; font-size: 16px; }
.ds-btn.largo { width: 100%; }
.ds-btn:hover { filter: brightness(1.06); }
.ds-btn:active { transform: scale(0.98); }
.ds-btn[disabled], .ds-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
/* Estado carregando: trava o toque duplo e mostra o giro */
.ds-btn.carregando { pointer-events: none; color: transparent; position: relative; }
.ds-btn.carregando::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  color: var(--on-accent); animation: ds-giro 0.8s linear infinite;
}
.ds-btn.secundario.carregando::after, .ds-btn.fantasma.carregando::after { color: var(--fg); }
@keyframes ds-giro { to { transform: rotate(360deg); } }

/* ---------- Dock (único primário do Ao vivo, fixo no rodapé) ---------- */
.ds-dock {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.ds-dock .ds-btn { width: 100%; min-height: 56px; font-family: var(--font-display); font-weight: 900; font-size: 18px; letter-spacing: -0.01em; }
.ds-dock .sub { font-size: 12px; color: var(--fg-muted); text-align: center; }

/* ---------- Card e Row ---------- */
.ds-card {
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.ds-card.destaque { border-color: var(--accent); }
.ds-card.destaque-vivo { border-color: var(--live); }

.ds-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; min-height: 44px;
}
.ds-row:last-child { border-bottom: 0; }
.ds-row.hl { background: var(--surface-2); margin: 0 -14px; padding: 12px 14px; border-radius: var(--radius-thumb); }
.ds-row .thumb { flex: 0 0 44px; width: 44px; height: 44px; border-radius: var(--radius-thumb); background: var(--surface-3); background-size: cover; background-position: center; display: grid; place-items: center; color: var(--fg-muted); }
.ds-row .corpo { flex: 1; min-width: 0; }
.ds-row .titulo { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-row .sub { font-size: 12px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-row .valor { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ds-row .num-fila { flex: 0 0 24px; text-align: center; font-size: 13px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }

/* ---------- Stat (três por linha) ---------- */
.ds-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ds-stat { text-align: center; }
.ds-stat .num { font-size: 26px; display: block; }
.ds-stat .rotulo { font-size: 11px; color: var(--fg-muted); }

/* ---------- Chips ---------- */
.ds-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.ds-chips::-webkit-scrollbar { display: none; }
.ds-chip {
  flex: 0 0 auto; padding: 8px 12px; border-radius: var(--radius-control);
  background: var(--surface-1); border: 1px solid var(--line); color: var(--fg);
  font-family: var(--font-body); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; min-height: 36px;
}
.ds-chip.ativo { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Field ---------- */
.ds-field { display: flex; flex-direction: column; gap: 6px; }
.ds-field label { font-size: 12px; font-weight: 700; color: var(--fg-muted); }
.ds-field input, .ds-field select, .ds-field textarea {
  min-height: 48px; padding: 12px 14px; border-radius: var(--radius-input);
  background: var(--surface-1); border: 1px solid var(--line); color: var(--fg);
  font-family: var(--font-body); font-size: 15px; font-weight: 500; width: 100%;
}
.ds-field input:focus, .ds-field select:focus, .ds-field textarea:focus { outline: none; border-color: var(--accent); }
.ds-field .hint { font-size: 11px; color: var(--fg-muted); }

/* ---------- LivePill ---------- */
.ds-livepill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: var(--radius-control); background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg);
}
.ds-livepill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
.ds-livepill.neutra::before { background: var(--fg-muted); }

/* ---------- BandTop (só Palco, perfil da banda, Fila/Palco do artista) ---------- */
.ds-bandtop {
  position: relative; min-height: 260px; padding: 16px;
  background: radial-gradient(120% 70% at 50% 0%, var(--band) 0%, var(--band-deep) 55%, var(--bg) 100%);
}

/* ---------- Régua (abas do Ao vivo, no lugar da barra) ---------- */
.ds-regua { display: flex; align-items: center; gap: 18px; padding: 8px 16px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.ds-regua a, .ds-regua button {
  background: none; border: 0; padding: 10px 0; font-family: var(--font-body); font-size: 13px; font-weight: 700;
  color: rgba(255, 255, 255, 0.6); text-decoration: none; cursor: pointer; border-bottom: 2px solid transparent; min-height: 44px;
}
.ds-regua .ativa { color: var(--fg); border-bottom-color: var(--accent); }
.ds-regua .sair { margin-left: auto; color: var(--fg-muted); font-weight: 500; }

/* ---------- TabBar (Dia) e ActionCenter ---------- */
.ds-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface-1); border-top: 1px solid var(--line);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: stretch;
}
.ds-tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--fg-muted); text-decoration: none; font-size: 11px; font-weight: 500;
}
.ds-tabbar a svg { width: 24px; height: 24px; stroke-width: 1.8; }
.ds-tabbar a.ativo { color: var(--fg); font-weight: 700; }
.ds-tabbar a.ativo svg { stroke-width: 2.3; }
.ds-tabbar .central { position: relative; }
.ds-tabbar .central .bola {
  position: absolute; top: -24px; width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.ds-tabbar .central .bola svg { width: 26px; height: 26px; stroke-width: 2.2; }
.ds-tabbar .central span { margin-top: 30px; font-size: 10px; color: var(--accent); font-weight: 700; }
.ds-com-tabbar { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

/* LiveAccessory: card acima da barra quando há show ligado à pessoa */
.ds-liveacc {
  position: fixed; left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 44;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; color: var(--fg); text-decoration: none;
}
.ds-liveacc .quadrado { width: 34px; height: 34px; border-radius: 8px; background: var(--band); display: grid; place-items: center; }
.ds-liveacc .rotulo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--live); }
.ds-liveacc .nome { font-size: 14px; font-weight: 700; }

/* Desktop: a barra vira cabeçalho, mesmo DOM */
@media (min-width: 769px) {
  .ds-tabbar { position: sticky; top: 0; bottom: auto; height: 56px; border-top: 0; border-bottom: 1px solid var(--line); grid-auto-columns: max-content; justify-content: center; gap: 28px; padding: 0 16px; }
  .ds-tabbar a { flex-direction: row; gap: 8px; font-size: 13px; }
  .ds-tabbar .central .bola { position: static; width: 40px; height: 40px; box-shadow: none; }
  .ds-tabbar .central span { margin-top: 0; }
  .ds-com-tabbar { padding-bottom: 24px; }
  .ds-dock { position: sticky; left: auto; right: auto; bottom: 16px; max-width: 560px; margin: 16px auto 0; }
}

/* ---------- Notice (aviso pré-pagamento, rolável, botão fixo) ---------- */
.ds-notice { display: flex; flex-direction: column; min-height: 0; max-height: 60vh; }
.ds-notice .texto { overflow-y: auto; min-height: 0; padding: 14px; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-card); font-size: 15px; line-height: 1.5; }
.ds-notice .texto p { margin: 0 0 12px; }
.ds-notice .rodape { padding: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.ds-check { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 44px; cursor: pointer; }
.ds-check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* ---------- Skeleton ---------- */
.ds-skeleton { background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-3) 50%, var(--surface-1) 75%); background-size: 200% 100%; animation: ds-brilho 1.2s ease-in-out infinite; border-radius: var(--radius-thumb); min-height: 44px; }
@keyframes ds-brilho { from { background-position: 200% 0; } to { background-position: -200% 0; } }
