/* 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: 10px; color: var(--ink); font-weight: 900; font-size: 1.15rem; white-space: nowrap; flex-shrink: 0; }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; box-shadow: 0 0 20px rgba(255,106,0,.28); }
.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; border-radius: 50%; background: var(--ink); color: var(--lime); font-size: .68rem; }
.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; 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 { 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 { 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; }
.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 */
.primary-button, .secondary-button, .ghost-button, .danger-button, .success-button { border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 850; white-space: nowrap; transition: transform .15s, box-shadow .15s, background-color .15s, color .15s; }
.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 */
main { min-height: 100vh; }
.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; }
.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; }
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); }
.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); }
dialog { 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); }
dialog::backdrop { background: rgba(17,24,39,.55); backdrop-filter: blur(4px); }
.modal-close { float: right; width: 35px; height: 35px; border: 0; border-radius: 50%; color: var(--ink); background: var(--surface-soft); font-size: 1.2rem; }
.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; }

/* 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; }
@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; }
.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; }
.admin-content { width: min(1180px, calc(100% - 56px)); margin: 0 auto; padding: 32px 0 90px; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-topbar { height: auto; min-height: 56px; padding: 10px 16px; flex-wrap: wrap; }
  .admin-content { width: min(100% - 28px, 1180px); }
  .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; }
}
