@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@500;700;800&family=Poppins:wght@400;500;600;700&family=Mulish:wght@700;800&display=swap");

/* Radar LIVE, adaptado dos tokens e componentes da Agência NP. */
:root {
  --space-black: #02000a;
  --space-deep: #090018;
  --nebula: #46045c;
  --violet: #9008c8;
  --violet-deep: #7b01bc;
  --neon: #d400ff;
  --neon-soft: #d62efd;
  --orchid: #ef80f6;
  --white: #fff;
  --gradient-cta: linear-gradient(90deg, #7b01bc 0%, #d62efd 100%);
  --font-display: "Monument Extended", "Unbounded", "Arial Black", sans-serif;
  --font-body: "Garet", "Poppins", system-ui, sans-serif;
  --font-label: "Mulish", "Muli", system-ui, sans-serif;
  --surface: #11091e;
  --surface-raised: #1b0e2b;
  --line: #51325d;
  --text-muted: #c8b8d1;
  --danger: #ff4d7d;
  --danger-deep: #8a0f35;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body { margin: 0; min-width: 320px; background: var(--space-black); color: var(--white); font: 400 14px/1.5 var(--font-body); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--orchid); outline-offset: 3px; }
::selection { background: var(--violet); color: var(--white); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 10; background: var(--space-deep); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1400px; min-height: 80px; margin: auto; padding: 12px 32px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 16px; flex: none; white-space: nowrap; }
.brand-logo { display: block; width: 68px; height: 48px; object-fit: contain; }
.brand-divider { width: 1px; height: 30px; background: var(--orchid); opacity: .7; }
.brand-name { font: 800 15px/1.2 var(--font-display); letter-spacing: .02em; }
.brand-name em { color: var(--neon); font-style: normal; }
nav { display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: thin; flex: 1; }
nav button { flex: none; border: 1px solid transparent; border-radius: 0; background: transparent; color: var(--text-muted); padding: 10px 14px; white-space: nowrap; font-weight: 600; }
nav button:hover, nav button.active { color: var(--white); background: var(--violet); }
.profile { max-width: 210px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-muted); font-size: 12px; text-align: right; }

main { max-width: 1400px; margin: auto; padding: 36px 32px 80px; }
.eyebrow { margin: 0 0 14px; color: var(--orchid); font: 800 11px/1.3 var(--font-label); letter-spacing: .13em; text-transform: uppercase; }
h1, .section-heading h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; text-transform: uppercase; }
.hero { min-height: 245px; padding: 34px 38px; display: flex; align-items: end; justify-content: space-between; gap: 24px; border: 1px solid var(--orchid); background: var(--space-deep); }
.hero-copy { min-width: 0; }
.hero h1 { margin: 0; max-width: 650px; font-size: clamp(26px, 3.2vw, 44px); }
.hero h1 span, .login-panel h1 span { color: var(--neon); }
.run-state { margin: 18px 0 0; color: var(--text-muted); }
.stats { display: flex; gap: 1px; align-self: stretch; flex: none; background: var(--line); border: 1px solid var(--line); }
.stats article { display: flex; flex-direction: column; justify-content: end; width: 112px; padding: 18px 13px; background: var(--surface); }
.stats strong { color: var(--neon); font: 800 32px/1 var(--font-display); }
.stats span { margin-top: 12px; color: var(--text-muted); font: 700 11px/1.2 var(--font-label); text-transform: uppercase; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 46px 0 18px; }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2 { margin: 0; font-size: clamp(20px, 2vw, 26px); }
.league-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 10px; scrollbar-width: thin; }
.league-tabs button { flex: none; min-height: 38px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-muted); font-weight: 700; }
.league-tabs button[aria-selected="true"] { border-color: var(--orchid); background: var(--violet-deep); color: var(--white); }
.toolbar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-bottom: 22px; }
.toolbar label { display: block; min-width: 160px; }
.toolbar .search-field { flex: 1; min-width: 230px; }
.toolbar input, .toolbar select, #accessForm input, #accessForm select { height: 46px; width: 100%; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--white); }
.toolbar input::placeholder, #accessForm input::placeholder { color: #b4a2be; }
.toolbar input:hover, .toolbar select:hover, #accessForm input:hover, #accessForm select:hover { border-color: var(--orchid); }
.primary, .toolbar button, .actions .main { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; border: 1px solid var(--white); border-radius: 999px; padding: 10px 22px; background: var(--gradient-cta); color: var(--white); text-decoration: none; font-weight: 700; white-space: nowrap; }
.primary:hover, .toolbar button:hover, .actions .main:hover { filter: brightness(1.15); }
.toolbar button { font-size: 13px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); }
.card:hover { border-color: var(--orchid); }
.person { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar { width: 56px; height: 56px; flex: none; border: 2px solid var(--orchid); border-radius: 50%; object-fit: cover; background: var(--nebula); }
.person > div { min-width: 0; }
.person h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 700; }
.handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.chip { display: inline-block; border: 1px solid var(--line); padding: 4px 9px; color: var(--text-muted); font: 700 10px/1.2 var(--font-label); text-transform: uppercase; }
.chip.premium { border-color: var(--orchid); color: var(--orchid); }
.chip.live { border-color: var(--neon); background: var(--violet); color: var(--white); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 17px; background: var(--line); border: 1px solid var(--line); }
.metrics div { min-width: 0; padding: 12px 9px; background: var(--surface-raised); }
.metrics b { display: block; overflow-wrap: anywhere; color: var(--white); font-size: 13px; line-height: 1.2; }
.metrics small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 10px; line-height: 1.2; }
.gifts { display: flex; align-items: center; gap: 7px; min-height: 38px; color: var(--text-muted); }
.gift { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 0; object-fit: cover; background: var(--surface-raised); }
.owner { margin-top: 12px; color: var(--orchid); font-size: 12px; }
.supporters { display: block; margin-top: 8px; color: var(--text-muted); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 20px; }
.actions button { min-height: 40px; border: 1px solid var(--orchid); border-radius: 0; background: transparent; color: var(--white); padding: 8px 12px; font-weight: 600; }
.actions button:hover { background: var(--nebula); }
.actions .main { flex: 1; border-radius: 999px; padding-inline: 16px; }
.empty { border: 1px solid var(--line); padding: 55px 20px; color: var(--text-muted); text-align: center; }

.admin-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.panel { min-width: 0; border: 1px solid var(--line); padding: 24px; background: var(--surface); }
.panel h2 { margin: 0 0 8px; font: 700 18px/1.3 var(--font-body); }
.panel p { color: var(--text-muted); }
.panel form { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.panel #email { flex: 2; min-width: 190px; }
.panel #role { flex: 1; min-width: 145px; }
#accessList { overflow-wrap: anywhere; }
#accessList p { border-top: 1px solid var(--line); padding-top: 12px; }
#code { display: block; margin-top: 20px; color: var(--neon); font: 800 26px/1.3 var(--font-display); letter-spacing: .05em; }

.login-screen { min-height: min(700px, calc(100vh - 160px)); display: flex; align-items: center; justify-content: center; }
.login-panel { width: min(760px, 100%); border: 1px solid var(--orchid); background: var(--space-deep); padding: clamp(28px, 6vw, 70px); }
.login-panel h1 { margin: 0; font-size: clamp(30px, 5vw, 58px); }
.login-panel > p:not(.eyebrow) { max-width: 550px; margin: 24px 0; color: var(--text-muted); font-size: 16px; }
.login-panel small { display: block; margin-top: 18px; color: var(--text-muted); }

dialog { width: min(650px, calc(100% - 28px)); max-height: calc(100vh - 28px); overflow: auto; padding: 26px; border: 1px solid var(--orchid); border-radius: 0; background: var(--space-deep); color: var(--white); }
dialog::backdrop { background: #02000ad9; }
dialog h2 { margin: 0 36px 10px 0; font: 800 22px/1.25 var(--font-display); text-transform: uppercase; }
dialog h2 small { display: block; margin-top: 7px; color: var(--text-muted); font: 400 13px var(--font-body); text-transform: none; }
dialog h3 { margin-top: 25px; color: var(--neon); }
.close { float: right; border: 0; background: transparent; color: var(--white); font-size: 28px; line-height: 1; }
#toast { position: fixed; z-index: 30; left: 50%; bottom: 20px; display: none; width: max-content; max-width: calc(100% - 32px); transform: translateX(-50%); border: 1px solid var(--orchid); background: var(--space-deep); color: var(--white); padding: 12px 18px; text-align: center; }

@media (max-width: 1000px) {
  .header-inner { flex-wrap: wrap; gap: 8px 18px; }
  nav { order: 3; flex-basis: 100%; }
  .profile { margin-left: auto; }
  .hero { align-items: stretch; flex-direction: column; }
  .stats { align-self: stretch; }
  .stats article { width: auto; flex: 1; }
}
@media (max-width: 700px) {
  .header-inner { padding: 9px 16px 0; }
  .brand-logo { width: 53px; height: 38px; }
  .brand-name { font-size: 12px; }
  .profile { max-width: 125px; font-size: 10px; }
  nav { margin-inline: -16px; padding: 0 12px; }
  nav button { padding: 12px 10px; font-size: 12px; }
  main { padding: 18px 16px 60px; }
  .hero { min-height: 0; padding: 24px 18px 18px; }
  .hero h1 { font-size: clamp(25px, 7vw, 36px); }
  .stats strong { font-size: 24px; }
  .stats article { padding: 13px 8px; }
  .stats span { margin-top: 8px; font-size: 9px; }
  .section-heading { margin-top: 32px; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar label, .toolbar .search-field { min-width: 0; }
  .toolbar .search-field { grid-column: 1 / -1; }
  .toolbar button { min-width: 0; }
  .admin-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .panel form > * { width: 100%; }
  .login-screen { min-height: calc(100vh - 120px); }
}
@media (max-width: 390px) {
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .search-field { grid-column: auto; }
  .stats span { font-size: 8px; }
  .card { padding: 16px; }
}

.list-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--orchid); padding: 14px 16px; margin-bottom: 14px; color: var(--white); }
.list-status[hidden], .list-status button[hidden] { display: none; }
.list-status button { border: 1px solid var(--orchid); background: transparent; color: var(--white); padding: 8px 12px; cursor: pointer; }

.result-count { margin: .3rem 0 0; color: var(--text-muted); font-size: .9rem; }

.toolbar .live-filter { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 14px; border: 1px solid var(--orchid); color: var(--white); cursor: pointer; white-space: nowrap; font-size: 13px; }
.toolbar .live-filter:has(input:checked) { background: var(--orchid); color: var(--white); }
.toolbar .live-filter input { width: 17px; height: 17px; padding: 0; margin: 0; accent-color: #a979f7; flex: none; }

/* Janela dos dados e aviso de arquivados */
.data-window { flex: none; margin: 0; border: 1px solid var(--line); padding: 6px 12px; color: var(--text-muted); font: 700 11px/1.3 var(--font-label); letter-spacing: .08em; text-transform: uppercase; cursor: help; }
.archive-notice { margin: 0 0 18px; border: 1px solid var(--danger); border-left-width: 6px; padding: 16px 18px; background: #2a0717; }
.archive-notice strong { display: block; color: var(--danger); font: 800 13px/1.3 var(--font-label); letter-spacing: .08em; text-transform: uppercase; }
.archive-notice p { margin: 6px 0 0; color: var(--white); }
.toolbar .date-field { display: flex; align-items: center; gap: 8px; min-width: 170px; padding-left: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-muted); font-size: 12px; }
.toolbar .date-field input { border: 0; padding-left: 4px; color-scheme: dark; }

/* Cartões */
.card.archived { border-style: dashed; }
.chip.archived { border-color: var(--danger); color: var(--danger); }
.last-seen { margin: -6px 0 14px; color: var(--text-muted); font-size: 12px; }
.last-seen time { color: var(--white); font-weight: 600; }
.last-seen.stale time { color: var(--danger); }
.select-card { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; cursor: pointer; }
.select-card input { width: 18px; height: 18px; margin: 0; accent-color: var(--neon); cursor: pointer; }
.select-card ~ .person { padding-right: 34px; }
.card.selected { border-color: var(--neon); box-shadow: inset 0 0 0 1px var(--neon); }

/* Revelação ao rolar: fade up uma única vez */
.card.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .55s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--reveal-delay, 0ms); }
.card.reveal.is-visible { opacity: 1; transform: none; }

/* Carregamento com skeleton e shimmer */
.card.skeleton { pointer-events: none; }
.skeleton-block { position: relative; display: block; overflow: hidden; height: 14px; background: var(--surface-raised); }
.skeleton-block::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(239, 128, 246, .14), transparent); animation: shimmer 1.4s ease-in-out infinite; }
.skeleton-avatar { width: 56px; height: 56px; flex: none; border-radius: 50%; }
.skeleton-lines { display: grid; flex: 1; gap: 8px; }
.skeleton-line { width: 55%; }
.skeleton-line.wide { width: 80%; }
.skeleton-chip { width: 52px; height: 22px; }
.skeleton-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 17px; }
.skeleton-metrics .skeleton-block { height: 58px; }
.skeleton-button { width: 100%; height: 40px; border-radius: 999px; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .card.reveal { opacity: 1; transform: none; transition: none; }
  .skeleton-block::after { animation: none; }
}

/* Fim do feed */
.feed-end { padding: 28px 0 8px; color: var(--text-muted); text-align: center; }
.feed-end button { margin-left: 8px; border: 1px solid var(--orchid); background: transparent; color: var(--white); padding: 8px 12px; }

/* Seleção em lote (admin) */
.bulk-bar { position: fixed; z-index: 20; left: 50%; bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: calc(100% - 32px); transform: translateX(-50%); border: 1px solid var(--neon); padding: 10px 12px 10px 18px; background: var(--space-deep); box-shadow: 0 12px 40px #000c; }
.bulk-bar span { margin-right: 6px; font-weight: 700; }
body.has-bulk-bar main { padding-bottom: 130px; }
body.has-bulk-bar #toast { bottom: 96px; }
.ghost { min-height: 40px; border: 1px solid var(--orchid); border-radius: 0; background: transparent; color: var(--white); padding: 8px 14px; font-weight: 600; }
.ghost:hover { background: var(--nebula); }
.danger { min-height: 40px; border: 1px solid var(--danger); border-radius: 999px; background: var(--danger-deep); color: var(--white); padding: 8px 18px; font-weight: 700; }
.danger:hover { background: #a8123f; }

/* Diálogo de confirmação */
.confirm-dialog { width: min(520px, calc(100% - 28px)); }
.confirm-dialog h2 { margin-right: 0; font-size: 18px; }
.confirm-dialog p { color: var(--text-muted); }
.dialog-warning { border-left: 4px solid var(--danger); padding: 10px 12px; background: #2a0717; color: var(--white) !important; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }

@media (max-width: 700px) {
  .section-heading { flex-wrap: wrap; align-items: start; }
  .toolbar .date-field { min-width: 0; }
  .bulk-bar { left: 12px; right: 12px; bottom: 12px; max-width: none; gap: 6px; padding: 8px 10px; transform: none; }
  .bulk-bar span { flex-basis: 100%; font-size: 12px; }
  .bulk-bar button { flex: 1 1 auto; min-height: 36px; padding: 6px 10px; font-size: 12px; }
}

/* Progresso da atualização de dados (admin) */
.progress-block { margin-top: 20px; }
.progress { position: relative; height: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-raised); }
.progress span { display: block; width: 0; height: 100%; background: var(--gradient-cta); transition: width .5s ease; }
.progress.running span { background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .28) 50%, rgba(255, 255, 255, 0) 100%), var(--gradient-cta); background-size: 200px 100%, 100% 100%; background-repeat: no-repeat; animation: progress-sweep 1.3s linear infinite; }
.progress.stalled { border-color: var(--danger); }
.progress.stalled span { background: var(--danger); }
.progress-text { margin: 10px 0 0; font-size: 13px; }
@keyframes progress-sweep { from { background-position: -200px 0, 0 0; } to { background-position: calc(100% + 200px) 0, 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .progress span { transition: none; }
  .progress.running span { animation: none; }
}

/* Ganhos do dia e selo de histórico */
.chip.no-history { border: 1px dashed var(--orchid); color: var(--white); cursor: help; }
.today-earnings { margin: -8px 0 14px; color: var(--text-muted); font-size: 12px; }
.today-earnings b { color: var(--white); }
.dialog-note { padding: 10px 12px; border: 1px dashed var(--orchid); color: var(--text-muted); }
.dialog-note b { color: var(--white); }
