/* Componentes de UI compartilhados entre site público e /admin — extraído de old/styles.css. */

/* Marca e identidade */
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 850; font-size: 1.25rem; white-space: nowrap; flex-shrink: 0; }
.brand span { margin-bottom: 0; line-height: 1; }
.brand-logo { height: 44px; width: auto; max-width: 150px; border-radius: 0; object-fit: contain; background: none; flex-shrink: 0; }
.brand b { color: var(--orange); font-weight: 950; }
.icon-button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); border-radius: 10px; }
.icon-button:hover, .icon-button:active { background: var(--surface-soft); color: var(--ink); }
.icon-button svg { width: 21px; height: 21px; }
.profile-button { display: flex; align-items: center; gap: 9px; border: 0; background: none; color: var(--ink); font-size: .82rem; font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.profile-button:hover { color: var(--orange); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--ink); color: var(--lime); font-size: .68rem; }
.avatar img, .rank-avatar img { display: block; width: 100%; height: 100%; aspect-ratio: 1 / 1; border-radius: 50%; object-fit: cover; object-position: center; flex-shrink: 0; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { flex-shrink: 0; margin-left: -10px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-sm { width: 22px; height: 22px; aspect-ratio: 1 / 1; font-size: .58rem; flex-shrink: 0; }
.qa-author { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .72rem; font-weight: 700; margin-bottom: 6px; }
.qa-author-response { margin-top: 10px; margin-bottom: 0; }
.faq-grid details, .faq-grid .qa-item { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.faq-grid summary { cursor: pointer; font-weight: 800; }
.faq-grid details p, .faq-grid .qa-item p { margin: 10px 0 0; color: var(--muted); }

/* Tela de autenticação (base) — usada pelo site público e pelo /admin */
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; grid-template-rows: 1fr auto; }
.auth-panel { display: grid; place-items: center; padding: 34px; background: var(--surface); }
.auth-box { width: min(420px, 100%); }
.auth-box h2 { margin: 10px 0 4px; font-size: 2rem; letter-spacing: -.04em; }
.auth-switch, .demo-note { text-align: center; font-size: .82rem; color: var(--muted); margin-top: 22px; }
.demo-note { padding: 12px; background: var(--surface-soft); border-radius: 12px; line-height: 1.5; }

/* Formulários */
label { display: grid; gap: 7px; margin-top: 18px; font-size: .82rem; font-weight: 750; }
.field-label { display: block; margin-top: 18px; font-size: .82rem; font-weight: 750; }
input, select, textarea { width: 100%; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: var(--surface-raised); color: var(--ink); transition: .2s; }
textarea { resize: none; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,24,39,.08); }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0; }
.checkbox { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 500; }
.checkbox input { width: auto; accent-color: var(--ink); }
.text-button { padding: 0; border: 0; background: none; color: var(--orange); font-weight: 800; }
.field-error { color: #b91c1c; font-size: .78rem; font-weight: 700; margin: -6px 0 0; }
[data-theme="dark"] .field-error { color: #ff9b9b; }

/* Botões — Reset universal contra bordas internas e contornos */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: 0;
  outline: 0 !important;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-clip: padding-box;
}

button::-moz-focus-inner {
  border: 0;
  padding: 0;
}

.primary-button, .secondary-button, .ghost-button, .danger-button, .success-button {
  border: 0 !important;
  outline: 0 !important;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 850;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s, background-color .15s, color .15s;
  box-sizing: border-box;
  background-clip: padding-box;
}
.primary-button { color: #190b03; background: linear-gradient(135deg,#ff9a19,var(--orange) 58%,var(--pink)); box-shadow: 0 8px 24px rgba(255,106,0,.25); }
.primary-button:hover { color: #100701; background: linear-gradient(135deg,#ffad38,#ff7a16 58%,#ff5688); box-shadow: 0 10px 28px rgba(255,106,0,.34); }
.secondary-button { background: var(--ink); color: var(--paper); }
.ghost-button { background: var(--surface-soft); color: var(--ink); }
.ghost-button:hover { color: var(--ink); background: color-mix(in srgb,var(--orange) 16%,var(--surface-soft)); }
.danger-button { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .danger-button { color: #ff9b9b; background: #421e24; }
.success-button { background: #dff7e9; color: #087443; }
.success-button:hover { background: #c9f2dc; }
[data-theme="dark"] .success-button { color: #8dffc0; background: #123c29; }
[data-theme="dark"] .success-button:hover { background: #16492f; }
.primary-button:hover, .secondary-button:hover, .ghost-button:hover, .success-button:hover { transform: translateY(-1px); }
.primary-button:active, .secondary-button:active, .ghost-button:active, .success-button:active, .filter-button:active, .admin-tab:active { transform: translateY(1px); }
.full { width: 100%; display: flex; justify-content: space-between; }
[data-theme="dark"] .secondary-button { color: #0b0d10; background: #f1f4ef; }
[data-theme="dark"] .secondary-button:hover { color: #090b0d; background: #ffffff; }
[data-theme="dark"] .ghost-button { color: #f3f6ef; background: #202832; }
[data-theme="dark"] .ghost-button:hover { color: #ffffff; background: #2b3743; }

/* Listas filtráveis (usado em campanhas, e listas admin) */
.filter-bar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 22px; }
.search-field { position: relative; margin: 0; }
.search-field span { position: absolute; z-index: 1; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-field input { padding-left: 38px; }
.sort-field { margin: 0; display: flex; }
.results-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: .75rem; }
.filter-button { border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: var(--surface); color: var(--muted); font-weight: 750; font-size: .75rem; }
.filter-button:hover { color: var(--ink); background: color-mix(in srgb,var(--orange) 16%,var(--surface-soft)); }
.filter-button.active { background: var(--orange); color: #190b03; border-color: var(--orange); }
.filter-button.active:hover { color: #190b03; background: #ff812b; }
[data-theme="dark"] .filter-button { color: #c8d0c8; background: #131a21; }
[data-theme="dark"] .filter-button.active { color: #160a02; background: var(--orange); }

/* Layout de página */
/* 100vh no iOS Safari é calculado com a barra de endereço recolhida (maior que a área realmente
   visível quando ela está à mostra) — sobra uma altura "fantasma" que só aparece ao rolar até o
   fim, dando a sensação de dar pra descer bastante além do rodapé antes de finalmente parar.
   100dvh (dynamic viewport height) recalcula com a barra visível/escondida; navegador sem suporte
   ignora essa linha e fica só com 100vh. */
main { min-height: 100vh; min-height: 100dvh; }
.view { width: min(1280px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 90px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin: 42px 0 18px; }
.section-head h2, .page-head h1 { margin: 5px 0 0; letter-spacing: -.045em; }
.section-head h2 { font-size: 1.8rem; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; }
.page-head h1 { font-size: 2.4rem; }
/* Flex item sem min-width:0 nunca encolhe abaixo do próprio conteúdo — com um h1/parágrafo
   comprido ao lado de um botão de ação (ex.: "Marcar todas como lidas"), a linha toda ficava
   mais larga que a tela e empurrava o botão pra fora à direita no mobile. */
.page-head > *, .section-head > * { min-width: 0; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; color: var(--muted); font-size: .72rem; }
.breadcrumb b { opacity: .45; }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Cartões e estatísticas */
.content-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; overflow-wrap: break-word; }
.feedback-attachment { display: block; margin-top: 10px; width: fit-content; }
.feedback-attachment img { display: block; max-width: 220px; max-height: 160px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; }

/* Admin: feedbacks (lista de cards clicáveis) — mesmo padrão reaproveitado pelo site em
   "Meus outros feedbacks" (privado), card compacto que abre modal com o conteúdo completo. */
.admin-feedback-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.admin-feedback-card, .my-feedback-card { cursor: pointer; transition: transform .15s, border-color .15s; }
.admin-feedback-card:hover, .admin-feedback-card:focus-visible, .my-feedback-card:hover, .my-feedback-card:focus-visible { transform: translateY(-2px); border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); }
.admin-feedback-card h3, .my-feedback-card h3 { margin: 6px 0; }
.admin-feedback-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .75rem; }
.admin-feedback-engagement { font-size: .72rem; color: var(--muted); }
.admin-feedback-status { margin-top: 14px; }
.admin-feedback-status select { width: 100%; }
.my-feedback-card { padding: 18px; }
.my-feedback-card p { margin: 0; font-size: .78rem; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.stat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); max-width: 420px; }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); max-width: 640px; }
.stat-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.stat-card span { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
/* flex em vez de block: o <small> de sufixo (" · 3", " / 5") é um item próprio, então quebra
   inteiro pra linha de baixo em vez de partir no meio ("R$ 0,00 ·" / "0") quando o card estreita. */
.stat-card strong { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; margin-top: 8px; font-size: 1.7rem; letter-spacing: -.04em; }
.admin-metrics { grid-template-columns: repeat(5,1fr); }

/* Admin > Pagamentos: painel da campanha selecionada (meta x arrecadado, estornos) */
.campaign-refund-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; }
.goal-bar { height: 10px; margin: 18px 0 9px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.goal-bar span { display: block; height: 100%; border-radius: inherit; background: var(--orange); transition: width .35s ease; }
.goal-bar.reached span { background: #12a05f; }
[data-theme="dark"] .goal-bar.reached span { background: #3ddc8d; }
.goal-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .78rem; }
.goal-legend .goal-pct { color: var(--lime-dark); }
.goal-legend .goal-pct.ok { color: #087443; }
[data-theme="dark"] .goal-legend .goal-pct.ok { color: #8dffc0; }
.stat-card.tone-success strong { color: #087443; }
.stat-card.tone-warn strong { color: #9a5b00; }
.stat-card.tone-muted strong { color: var(--muted); }
[data-theme="dark"] .stat-card.tone-success strong { color: #8dffc0; }
[data-theme="dark"] .stat-card.tone-warn strong { color: #ffd88a; }
.stat-card small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.notice { padding: 13px; border-radius: 12px; background: color-mix(in srgb, var(--lime) 12%, var(--surface)); color: var(--ink-soft); border: 1px solid color-mix(in srgb, var(--lime) 28%, transparent); font-size: .78rem; line-height: 1.5; }
.empty-state { padding: 50px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state strong { display: block; font-size: 1.2rem; margin-bottom: 7px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.tag-row span { padding: 4px 7px; border-radius: 999px; color: var(--orange); background: color-mix(in srgb,var(--orange) 12%,var(--surface-soft)); font-size: .58rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }

/* Listas de item (arquivos, atividade, notificações) */
.file-list, .activity-list, .notification-list { display: grid; gap: 10px; }
.file-row, .activity-row { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); min-width: 0; }
.file-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 11px; background: #ede9fe; color: var(--purple); font-weight: 900; font-size: .68rem; }
.file-info { min-width: 0; flex: 1; }
.file-info strong, .file-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info small { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.notification-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.notification-card.unread { border-color: color-mix(in srgb,var(--orange) 45%,var(--line)); background: color-mix(in srgb,var(--orange) 5%,var(--surface)); }
.notification-card.linked { cursor: pointer; transition: transform .2s, border-color .2s; }
.notification-card.linked:hover, .notification-card.linked:focus-visible { transform: translateY(-2px); border-color: color-mix(in srgb, var(--lime) 45%, var(--line)); }
.notification-card h3, .notification-card p { margin: 3px 0; }
.notification-card p { color: var(--muted); font-size: .76rem; }
.notification-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: #190b03; background: var(--orange); font-weight: 950; }
.timeline { display: grid; gap: 6px; }
.timeline > div { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 10px; padding: 8px 12px; border-left: 2px solid var(--orange); border-radius: 0 9px 9px 0; background: var(--surface); }
.timeline time { color: var(--muted); font-size: .65rem; }
.timeline > div strong { display: block; font-size: .8rem; }
.timeline > div p { margin: 1px 0 0; font-size: .72rem; }

/* Tabela */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
/* Lista de navegação do OneDrive (admin/js/files.js) vive dentro do <dialog>, que trava em
   min(520px, ...) — o min-width padrão de 720px (pensado pras tabelas largas do admin) sobrava
   pra fora do modal e obrigava rolar a barra horizontal só pra alcançar o botão "Abrir". */
#browseList table { min-width: 0; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: .78rem; }
th { color: var(--muted); background: var(--surface-soft); text-transform: uppercase; letter-spacing: .06em; font-size: .65rem; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 9px; border-radius: 999px; font-size: .66rem; font-weight: 850; background: var(--surface-soft); color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.pill svg { flex-shrink: 0; width: 11px; height: 11px; }
.pill.success { color: #087443; background: #dff7e9; }
.pill.pending { color: #9a5b00; background: #fff0cf; }
.pill.danger { color: #b91c1c; background: #fee2e2; }
.pill.info { color: #2f5fd6; background: #e4ecff; }
.pill.done { color: #6d28d9; background: #efe6fe; }
[data-theme="dark"] .pill.success { color: #8dffc0; background: #123c29; }
[data-theme="dark"] .pill.pending { color: #ffd88a; background: #453211; }
[data-theme="dark"] .pill.info { color: #a9c3ff; background: #1c2c4d; }
[data-theme="dark"] .pill.done { color: #d3b8ff; background: #34215c; }
[data-theme="dark"] .pill.danger { color: #ff9b9b; background: #421e24; }
#pendingUsersBadge { margin-left: 4px; font-weight: 850; }

/* Abas secundárias (uso pontual, ex.: dentro de uma seção do admin) */
.admin-tabs { display: flex; gap: 8px; margin: 24px 0 16px; overflow-x: auto; }
.admin-tab { white-space: nowrap; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: .75rem; font-weight: 800; }
.admin-tab:hover { color: var(--ink); background: color-mix(in srgb,var(--orange) 16%,var(--surface-soft)); }
.admin-tab.active { color: #190b03; background: var(--orange); border-color: var(--orange); }
.admin-tab.active:hover { color: #190b03; background: #ff812b; }
[data-theme="dark"] .admin-tab { color: #c8d0c8; background: #131a21; }
[data-theme="dark"] .admin-tab.active { color: #160a02; background: var(--orange); }

/* Toast e modal */
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translate(-50%, 120px); padding: 12px 16px; color: var(--paper); background: var(--ink); border-radius: 12px; font-size: .78rem; font-weight: 750; box-shadow: var(--shadow); transition: transform .25s; }
.toast.show { transform: translate(-50%, 0); }
/* Um <dialog> aberto via showModal() entra na "top layer" do navegador, que clipa qualquer
   descendente — mesmo position:fixed — aos limites da própria caixa do dialog (por isso não
   basta reparentar o #toast pra dentro dele, precisa também virar absolute ancorado no rodapé
   do próprio dialog em vez de fixed relativo à viewport). */
dialog > .toast { position: absolute; bottom: 16px; }
dialog { position: fixed !important; inset: 0 !important; margin: auto !important; width: min(520px, calc(100% - 28px)); max-height: min(88vh, 720px); overflow-y: auto; border: 0; border-radius: 22px; padding: 28px; color: var(--ink); background: var(--surface); box-shadow: 0 25px 80px rgba(17,24,39,.24); scrollbar-width: thin; scrollbar-color: var(--line) transparent; z-index: 1000; }
dialog::-webkit-scrollbar { width: 6px; }
dialog::-webkit-scrollbar-track { background: transparent; }
dialog::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
dialog::-webkit-scrollbar-thumb:hover { background: var(--muted); }
/* document.scrollingElement é o <html>, não o <body>, nos browsers modernos em standards mode —
   travar só o overflow do body deixava o scroll do mouse fora da dialog ainda rolar o fundo por
   baixo do modal. Trava os dois pra cobrir qualquer navegador/modo. */
html.modal-open, body.modal-open { overflow: hidden !important; }
dialog::backdrop { background: rgba(17,24,39,.55); backdrop-filter: blur(4px); }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 20; width: 32px; height: 32px; border: 0; border-radius: 50%; color: #ffffff; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); font-size: 1.1rem; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); transition: transform 0.2s ease, background 0.2s ease; }
.modal-close:hover { background: rgba(0, 0, 0, 0.85); transform: scale(1.08); }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal-grid .full-span { grid-column: 1 / -1; }
.modal-grid div.full-span { margin-top: 18px; }
.modal-grid button.full-span { margin-top: 18px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.auth-wizard h2 { margin: 6px 0 4px; }
.auth-wizard .auth-intro { margin: 4px 0 0; }
.auth-wizard .auth-steps { margin: 8px 0 2px; }
.auth-wizard label { margin-top: 8px; }
.auth-wizard .modal-grid div.full-span { margin-top: 8px; }
.auth-wizard .field-label { margin-top: 12px; }
.auth-wizard button.full-span { margin-top: 8px; }
dialog:has(.auth-wizard) { padding: 22px 28px; }
.auth-steps { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; }
.auth-step-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .72rem; font-weight: 800; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); }
.auth-step-dot.active { color: #190b03; background: var(--orange); border-color: var(--orange); }
.auth-step-dot.done { color: var(--orange); border-color: var(--orange); }
.auth-step-line { flex: 1; height: 2px; background: var(--line); }
.auth-step-line.done { background: var(--orange); }
.username-feedback { display: block; font-size: .72rem; font-weight: 700; margin-top: 2px; color: var(--muted); }
.username-feedback.ok { color: #087443; }
.username-feedback.taken { color: #b91c1c; }
[data-theme="dark"] .username-feedback.ok { color: #8dffc0; }
[data-theme="dark"] .username-feedback.taken { color: #ff9b9b; }

@media (max-width: 640px) {
  dialog {
    width: min(520px, calc(100% - 18px));
    max-height: 92dvh;
    padding: 20px 16px;
    border-radius: 18px;
  }
  dialog:has(.auth-wizard) {
    padding: 16px 14px;
  }
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .modal-grid label {
    grid-column: 1 / -1;
  }
  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-actions button {
    width: 100%;
  }
  input, select, textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .form-row {
    flex-wrap: wrap;
    gap: 8px 12px;
  }
}

/* Skeleton de carregamento */
.skeleton-card { overflow: hidden; padding-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.skeleton-card span, .skeleton-card i { position: relative; display: block; overflow: hidden; background: var(--surface-soft); }
.skeleton-card span { height: 190px; }
.skeleton-card i { height: 12px; margin: 15px 18px 0; border-radius: 6px; }
.skeleton-card i:nth-child(3) { width: 70%; }
.skeleton-card i:nth-child(4) { width: 42%; }
.skeleton-card span::after, .skeleton-card i::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg,transparent,color-mix(in srgb,var(--ink) 8%,transparent),transparent); animation: shimmer 1.25s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Gerenciador de arquivos (admin) */
.file-manager-head, .file-manager-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 16px; }
.file-manager-head label { width: min(520px,100%); margin: 0; }
.file-manager-head > div, .file-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.file-manager-layout { display: grid; grid-template-columns: 230px 1fr; gap: 18px; }
.folder-panel { align-self: start; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.folder-panel h3 { margin: 8px 0 16px; }
.folder-panel button { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; width: 100%; padding: 10px; border: 0; border-radius: 9px; color: var(--muted); text-align: left; background: transparent; }
.folder-panel button.active, .folder-panel button:hover { color: var(--ink); background: var(--surface-soft); }
.storage-box { display: grid; gap: 4px; margin-top: 20px; padding: 12px; border-radius: 12px; background: var(--surface-soft); font-size: .68rem; }
.storage-box span, .storage-box small { color: var(--muted); }
.admin-file-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.admin-file-card { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.admin-file-card h3 { margin: 13px 0 6px; }
.admin-file-card p, .admin-file-card small { color: var(--muted); font-size: .72rem; line-height: 1.5; }
.file-card-top { display: flex; justify-content: space-between; gap: 8px; }
.file-actions { margin-top: 14px; }

/* Gerenciador de imagens (capa + galeria) — arrastar-e-soltar pra reordenar, 1ª = capa */
.image-manager { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 8px; }
.image-thumb { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); cursor: grab; }
.image-thumb:active { cursor: grabbing; }
.image-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.image-thumb-badge { position: absolute; top: 6px; left: 6px; z-index: 2; padding: 3px 8px; border-radius: 999px; background: var(--orange); color: #190b03; font-size: .58rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.image-thumb-loading { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; font-size: .66rem; font-weight: 800; text-align: center; padding: 6px; }
.image-thumb button { position: absolute; bottom: 6px; right: 6px; left: 6px; z-index: 2; padding: 5px 6px; font-size: .62rem; border-radius: 8px; opacity: 0; transition: opacity .15s; }
.image-thumb:hover button, .image-thumb:focus-within button { opacity: 1; }
/* Telas touch não têm :hover persistente — sem isso o botão "Remover" da miniatura fica invisível e inalcançável no mobile */
@media (hover: none) {
  .image-thumb button { opacity: 1; }
}

/* Tela admin "Avatares" — grade de presets trocáveis por upload */
.avatar-preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; margin-top: 10px; }
.avatar-preset-slot { display: grid; justify-items: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); text-align: center; }
.avatar-preset-thumb { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--surface); border: 1px solid var(--line); }
.avatar-preset-name { font-size: .74rem; font-weight: 800; color: var(--muted); }
.avatar-preset-upload { cursor: pointer; font-size: .68rem; padding: 6px 10px; }

/* Recorte quadrado (foto não-quadrada enviada pelo admin) — arrastar + zoom, sem lib nova */
/* grid-column:1/-1 pq o .cropper nasce dentro do .image-manager (grid de miniaturas quadradas
   auto-fill) — sem isso ele herdava a largura de uma única coluna estreita e o zoom/botões
   (dimensionados a 100% do .cropper) vazavam pra fora do modal. */
.cropper { display: grid; grid-column: 1 / -1; justify-items: center; gap: 12px; }
.cropper-viewport { position: relative; overflow: hidden; margin: 0 auto; border-radius: 12px; background: var(--surface-soft); cursor: grab; touch-action: none; }
.cropper-viewport:active { cursor: grabbing; }
.cropper-viewport img { position: absolute; top: 50%; left: 50%; max-width: none; user-select: none; pointer-events: none; }
.cropper-zoom { width: 100%; max-width: 320px; display: grid; gap: 6px; font-size: .72rem; font-weight: 750; color: var(--muted); }
.cropper-zoom input { width: 100%; }

/* Carrossel horizontal (campanhas relacionadas) — sem biblioteca, scroll nativo com snap */
.carousel { position: relative; }
.carousel-track { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > * { flex: 0 0 min(300px, 82vw); scroll-snap-align: start; }
.carousel-nav { position: absolute; top: 40%; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 1.2rem; box-shadow: var(--shadow); }
.carousel-prev { left: -18px; }
.carousel-next { right: -18px; }
.photo-count-badge { position: absolute; top: 10px; right: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 20px; background: rgba(0,0,0,.68); backdrop-filter: blur(6px); color: #fff; font-size: .75rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.photo-count-badge svg { flex-shrink: 0; }
@media (max-width: 900px) {
  .carousel-nav { display: none; }
}

/* Relatórios e configurações (admin) */
.report-grid, .settings-grid { display: grid; grid-template-columns: 1.4fr .6fr; gap: 16px; }
.info-list { display: grid; gap: 13px; margin: 22px 0; }
.info-row { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: .82rem; }
.info-row span { color: var(--muted); }
/* min-width:0 é o que permite o item flex encolher abaixo do min-content e a quebra agir —
   sem ele, e-mail/identificador longo estoura a largura do card (visível em 390px). */
.info-row > * { min-width: 0; overflow-wrap: break-word; }
.metric-bar { display: grid; grid-template-columns: 90px 1fr 35px; gap: 9px; align-items: center; margin-top: 14px; font-size: .7rem; }
.metric-bar i { height: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.metric-bar b { display: block; height: 100%; border-radius: inherit; background: var(--orange); }
.theme-choice { display: flex; gap: 9px; margin-top: 18px; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; padding: 7px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--surface-soft); }
.editor-toolbar button { min-width: 34px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
[data-theme="dark"] .editor-toolbar button { color: #f3f6ef; background: #202832; }
.rich-editor { min-height: 150px; padding: 14px; border: 1px solid var(--line); border-radius: 0 0 12px 12px; outline: none; background: var(--surface-raised); line-height: 1.6; }

/* Shell do /admin — sidebar nova (não existia no app antigo, que usava abas) */
.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; min-width: 0; width: 100%; max-width: 100vw; overflow-x: hidden; }
.admin-sidebar { padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.admin-sidebar-header { padding: 8px 10px 20px; }
.admin-sidebar-group { margin-bottom: 18px; }
.admin-sidebar-group-label { padding: 0 10px; margin-bottom: 6px; color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.admin-sidebar-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 10px; border: 0; border-radius: 10px; color: var(--ink-soft); background: none; text-align: left; font-size: .82rem; font-weight: 700; }
.admin-sidebar-link:hover { color: var(--ink); background: var(--surface-soft); }
.admin-sidebar-link.active { color: #190b03; background: var(--orange); }
.admin-sidebar-link[disabled] { opacity: .5; cursor: default; }
.admin-sidebar-badge { padding: 2px 7px; border-radius: 999px; font-size: .6rem; font-weight: 800; background: var(--surface-soft); color: var(--muted); }
.admin-sidebar-footer { margin-top: auto; padding: 14px 10px; color: var(--muted); font-size: .78rem; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--topbar); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.admin-main { min-width: 0; width: 100%; max-width: 100%; overflow-x: hidden; box-sizing: border-box; }
.admin-content { width: min(1180px, calc(100% - 56px)); margin: 0 auto; padding: 32px 0 90px; min-width: 0; max-width: 100%; box-sizing: border-box; }
@media (max-width: 900px) {
  .admin-shell { display: flex; flex-direction: column; width: 100%; max-width: 100vw; overflow-x: hidden; }
  .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 100vw; box-sizing: border-box; }
  .admin-sidebar-header { padding: 0 0 6px; }
  .admin-sidebar-footer { display: none; }
  #adminNav { display: flex; gap: 8px; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; width: 100%; max-width: 100%; box-sizing: border-box; }
  #adminNav::-webkit-scrollbar { display: none; }
  .admin-sidebar-group { display: flex; align-items: center; gap: 6px; margin-bottom: 0; flex-shrink: 0; }
  .admin-sidebar-group-label { display: none; }
  .admin-sidebar-link { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-soft); white-space: nowrap; font-size: .78rem; flex-shrink: 0; width: auto; }
  .admin-sidebar-link.active { color: #190b03; background: var(--orange); border-color: var(--orange); }
  .admin-main { width: 100%; max-width: 100vw; overflow-x: hidden; box-sizing: border-box; }
  .admin-topbar { height: auto; min-height: 52px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; width: 100%; max-width: 100vw; box-sizing: border-box; }
  .admin-content { width: calc(100% - 24px); max-width: 100%; padding: 20px 0 80px; box-sizing: border-box; overflow-x: hidden; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-metrics { grid-template-columns: repeat(2, 1fr); }
  .report-grid, .settings-grid, .admin-file-grid, .file-manager-layout, .split-grid { grid-template-columns: 1fr; }
  .admin-feedback-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .modal-grid { grid-template-columns: 1fr; }
  .stat-grid, .admin-metrics { grid-template-columns: 1fr 1fr; }
  .table-wrap { overflow-x: visible; border: 0; background: none; }
  table { min-width: 0; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { margin-bottom: 12px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  td { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: right; overflow-wrap: break-word; }
  td:last-child { border-bottom: 0; }
  /* <br> não separa nome de e-mail dentro do td virado flex (viram itens irmãos na mesma linha);
     forçar o <small> a ocupar a linha inteira devolve o empilhamento que o <br> daria. */
  td > small { flex-basis: 100%; text-align: right; }
  .stat-card { padding: 16px; }
  .stat-card strong { font-size: 1.4rem; }
  /* "Estornar os N confirmados (R$ …)" é longo e os botões são nowrap por padrão — sem isso
     o rótulo vaza a viewport em telas de 360px. */
  .campaign-refund-head .file-actions { width: 100%; }
  .campaign-refund-head .file-actions button { flex: 1 1 auto; white-space: normal; }
  td::before { content: attr(data-label); flex-shrink: 0; color: var(--muted); font-weight: 750; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
}

/* Badges de links em sugestões de campanha */
.suggestion-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--orange);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.suggestion-link-badge:hover {
  border-color: var(--orange);
  background: color-mix(in srgb, var(--orange) 12%, var(--surface-soft));
  transform: translateY(-1px);
}

/* Modal de Confirmação Personalizado (Padrão do Site) */
.custom-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 12, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.custom-confirm-overlay.inside-modal {
  position: absolute;
  inset: 0;
  z-index: 100;
  border-radius: 22px;
  background: rgba(8, 12, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.custom-confirm-overlay.active {
  opacity: 1;
  visibility: visible;
}

.custom-confirm-card {
  width: min(380px, calc(100% - 24px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.92);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.custom-confirm-overlay.active .custom-confirm-card {
  transform: scale(1);
}

.custom-confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--orange) 16%, var(--surface-soft));
  color: var(--orange);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  box-shadow: 0 0 20px color-mix(in srgb, var(--orange) 25%, transparent);
}

.custom-confirm-icon svg {
  width: 28px;
  height: 28px;
}

.custom-confirm-icon.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.custom-confirm-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 850;
  color: var(--ink);
  text-align: center;
  letter-spacing: -0.01em;
}

.custom-confirm-message {
  margin: 0 0 24px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
  max-width: 340px;
}

.custom-confirm-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.custom-confirm-actions button {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.86rem;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.custom-confirm-actions button:active {
  transform: scale(0.97);
}

@media (max-width: 480px) {
  .custom-confirm-actions {
    flex-direction: column-reverse;
  }
}

/* Grid de Emblemas e Conquistas no Perfil */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.badge-card:hover {
  transform: translateY(-3px);
  border-color: var(--orange);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.badge-card.unlocked {
  background: color-mix(in srgb, var(--surface) 92%, #000);
}

.badge-card.locked {
  opacity: 0.55;
  filter: grayscale(0.85);
}

.badge-card-icon {
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}

.badge-card-title {
  font-size: 0.82rem;
  font-weight: 850;
  color: var(--ink);
  margin: 4px 0 2px;
  line-height: 1.25;
}

.badge-card-level-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.badge-level-tag.level-0 { background: rgba(107, 114, 128, 0.2); color: var(--muted); }
.badge-level-tag.level-1 { background: rgba(205, 127, 50, 0.2); color: #e59849; border: 1px solid rgba(205, 127, 50, 0.35); }
.badge-level-tag.level-2 { background: rgba(192, 192, 192, 0.2); color: #d1d5db; border: 1px solid rgba(192, 192, 192, 0.35); }
.badge-level-tag.level-3 { background: rgba(255, 215, 0, 0.2); color: #f59e0b; border: 1px solid rgba(255, 215, 0, 0.35); }
.badge-level-tag.level-4 { background: rgba(185, 242, 255, 0.2); color: #38bdf8; border: 1px solid rgba(185, 242, 255, 0.35); }

/* Community Hub Styles */
.community-post-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.community-post-card:hover { border-color: color-mix(in srgb, var(--orange) 30%, var(--line)); }
.reaction-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--ink); font-size: 0.78rem; font-weight: 750; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.reaction-btn:hover { background: color-mix(in srgb, var(--orange) 15%, var(--surface-soft)); border-color: var(--orange); }
