/* Relatórios (relatorios.js): folha por cima do app, abaixo da folha da Bia (z 230) e acima da
   bolha da conversa (z 225). Nada pisca: o carregando é uma faixa de etapas com texto, e a
   única animação (a folha subindo) some com prefers-reduced-motion. */
.rel-folha { position: fixed; inset: 0; z-index: 228; display: flex; align-items: flex-end; justify-content: center; }
.rel-folha[hidden] { display: none; }
.rel-fundo { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.rel-painel {
    position: relative; width: 100%; max-width: 36rem; max-height: 94vh; overflow-y: auto;
    background: #fff; color: #1e293b; border-radius: 1.5rem 1.5rem 0 0;
    padding: 1rem 1rem 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .15); animation: rel-sobe .2s ease-out;
}
@media (min-width: 640px) {
    .rel-folha { align-items: center; padding: 1rem; }
    .rel-painel { border-radius: 1.5rem; padding: 1.5rem 1.5rem 0; }
}
@keyframes rel-sobe { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rel-painel { animation: none; } }
body.rel-aberta { overflow: hidden; }

.rel-topo { display: flex; align-items: center; gap: .75rem; margin-bottom: .8rem; }
.rel-bia { width: 48px; height: 48px; flex-shrink: 0; border-radius: 999px; padding: 5px; background: var(--mel-creme, #FFF6E0); border: 2px solid #fcd34d; }
.rel-bia .abelha { width: 100%; height: 100%; }
.rel-tit { font-size: 1.2rem; font-weight: 800; margin: 0; line-height: 1.2; }
.rel-tit:focus { outline: none; }
.rel-sub { margin: 0; font-size: .78rem; font-weight: 600; color: #64748b; }
.rel-x {
    margin-left: auto; width: 44px; height: 44px; border-radius: 999px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #475569; font-size: 1.1rem;
}

.rel-tipos { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; }
@media (min-width: 520px) { .rel-tipos { grid-template-columns: repeat(4, 1fr); } }
.rel-tipo { min-height: 44px; border-radius: .9rem; padding: .4rem .5rem; font-size: .85rem; font-weight: 700; border: 2px solid #e2e8f0; background: #fff; color: #334155; }
.rel-tipo[aria-pressed="true"] { background: #fef3c7; border-color: #fbbf24; color: #422006; }

.rel-periodo { display: flex; align-items: center; gap: .5rem; margin: .8rem 0 .4rem; }
.rel-periodo-txt { flex: 1; text-align: center; font-weight: 800; margin: 0; color: #422006; }
.rel-nav { width: 44px; height: 44px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: #f8fafc; border: 1px solid #e2e8f0; color: #334155; }
.rel-nav:disabled { opacity: .4; }

.rel-corpo { padding-bottom: .5rem; }
.rel-titulo { font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #92400e; margin: .4rem 0 .2rem; }
.rel-resumo { font-size: 1.02rem; line-height: 1.5; margin: 0 0 .8rem; padding: .8rem .9rem; border-radius: 1rem; background: #fffbeb; border: 1px solid #fde68a; }
.rel-bloco { margin: 0 0 .9rem; }
.rel-bloco h3 { font-size: .95rem; font-weight: 800; margin: 0 0 .35rem; padding-bottom: .3rem; border-bottom: 1px solid #e2e8f0; color: #422006; }
.rel-bloco dl { margin: 0; }
.rel-item { display: flex; justify-content: space-between; gap: .75rem; padding: .3rem 0; font-size: .9rem; }
.rel-item dt { flex: 0 1 42%; color: #475569; }
.rel-item dd { flex: 1 1 58%; margin: 0; font-weight: 700; text-align: right; }
.rel-bloco ul { margin: 0; padding-left: 1.1rem; font-size: .9rem; line-height: 1.5; list-style: disc; }
.rel-vazio, .rel-nota { font-size: .82rem; color: #64748b; margin: 0; }
.rel-erro { margin: .5rem 0; padding: .7rem .8rem; border-radius: .9rem; background: #fff7ed; color: #9a3412; font-weight: 600; font-size: .9rem; }

.rel-carregando p { font-size: .85rem; color: #64748b; margin: .5rem 0 0; }
.rel-etapas { display: flex; gap: .5rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.rel-etapas li { flex: 1; display: flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700; color: #94a3b8; border-top: 4px solid #e2e8f0; padding-top: .4rem; }
.rel-etapas li b { width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; background: #e2e8f0; color: #64748b; }
.rel-etapas li.atual { color: #422006; border-top-color: #fbbf24; }
.rel-etapas li.atual b { background: #fbbf24; color: #422006; }

/* Botões presos no pé da folha */
.rel-acoes {
    position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
    margin: 0 -1rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #e2e8f0;
}
@media (min-width: 640px) { .rel-acoes { margin: 0 -1.5rem; padding: .8rem 1.5rem; } }
.rel-btn {
    min-height: 48px; border-radius: 1rem; padding: .6rem .8rem; font-weight: 800; font-size: .92rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: #fbbf24; color: #422006; border: 2px solid transparent;
}
.rel-btn:disabled { opacity: .5; }
.rel-btn-leve { background: #fff; color: #334155; border-color: #e2e8f0; }
.rel-aviso { margin: 0; padding: 0 0 .6rem; font-size: .8rem; color: #166534; font-weight: 600; }
.rel-aviso:empty { padding: 0; }
.rel-tipo:focus-visible, .rel-btn:focus-visible, .rel-nav:focus-visible, .rel-x:focus-visible { outline: 3px solid #92400e; outline-offset: 2px; }

body.dark-theme .rel-painel, body.dark-theme .rel-acoes { background: #1e293b; color: #f1f5f9; }
body.dark-theme .rel-acoes { border-top-color: #334155; }
body.dark-theme .rel-sub, body.dark-theme .rel-vazio, body.dark-theme .rel-nota, body.dark-theme .rel-item dt { color: #94a3b8; }
body.dark-theme .rel-x, body.dark-theme .rel-nav, body.dark-theme .rel-tipo, body.dark-theme .rel-btn-leve { background: #0f172a; color: #e2e8f0; border-color: #334155; }
body.dark-theme .rel-tipo[aria-pressed="true"] { background: rgba(146, 64, 14, .4); color: #fef3c7; border-color: #92400e; }
body.dark-theme .rel-resumo { background: rgba(146, 64, 14, .25); border-color: #92400e; }
body.dark-theme .rel-bloco h3, body.dark-theme .rel-periodo-txt { color: #fde68a; border-bottom-color: #334155; }
