/*
 * Utilitários usados pelas telas do AV que não existem no styles.css pré-compilado do tema.
 */
.content-start { align-content: flex-start; }
.justify-items-center { justify-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.gap-x-5 { column-gap: 1.25rem; }
.gap-y-2\.5 { row-gap: .625rem; }
.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.h-fit { height: fit-content; }
.hover\:border-primary:hover { border-color: var(--primary); }
.leading-relaxed { line-height: 1.625; }
.list-disc { list-style-type: disc; }
.max-h-\[260px\] { max-height: 260px; }
.max-h-\[60vh\] { max-height: 60vh; }
.h-\[80vh\] { height: 80vh; }
.max-h-\[70px\] { max-height: 70px; }
.max-h-\[90px\] { max-height: 90px; }
.top-\[5\%\] { top: 5%; }
.max-w-\[170px\] { max-width: 170px; }
.max-w-\[1100px\] { max-width: 1100px; }
.max-w-\[400px\] { max-width: 400px; }
.max-w-\[560px\] { max-width: 560px; }
.max-w-\[56rem\] { max-width: 56rem; }
.max-w-md { max-width: 28rem; }
.max-w-3xl { max-width: 48rem; }
.min-h-20 { min-height: 5rem; }
.min-h-full { min-height: 100%; }
.min-h-0 { min-height: 0; }
.overscroll-contain { overscroll-behavior: contain; }
.overflow-visible { overflow: visible; }
.hover\:opacity-80:hover { opacity: .8; }
.decoration-dotted { text-decoration-style: dotted; }
.underline-offset-2 { text-underline-offset: 2px; }
.mt-1\.5 { margin-top: .375rem; }
.object-cover { object-fit: cover; }
.opacity-50 { opacity: .5; }
.overflow-y-auto { overflow-y: auto; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.size-24 { width: 6rem; height: 6rem; }
.size-36 { width: 9rem; height: 9rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-\[11px\] { font-size: 11px; line-height: 1.3; }
.w-64 { width: 16rem; }
.w-\[60px\] { width: 60px; }
.w-\[70px\] { width: 70px; }
.w-\[80px\] { width: 80px; }
.w-\[100px\] { width: 100px; }
.w-\[130px\] { width: 130px; }
.w-\[140px\] { width: 140px; }
.w-\[190px\] { width: 190px; }
.kt-btn-xs { height: 1.75rem; padding-inline: .5rem; font-size: .75rem; gap: .25rem; }
.kt-checkbox-label { font-size: .875rem; }
.list-disc { padding-left: 1.25rem; }
@media (min-width: 768px) {
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .xl\:w-\[48rem\] { width: 48rem; }
    .xl\:w-\[56rem\] { width: 56rem; }
}
@media (max-width: 640px) {
    .w-64 { width: 100%; }
}

/* Controle de acesso: matriz telas x perfis com cabeçalho e 1ª coluna fixos */
/* width:0 + min-width:100% impede que a tabela larga alargue a página; a rolagem fica dentro do quadro */
.matriz-acesso { overflow-x: auto; width: 0; min-width: 100%; }
.matriz-acesso table { width: 100%; border-collapse: separate; border-spacing: 0; }
.matriz-acesso thead th { position: sticky; top: 0; z-index: 2; background: var(--background); vertical-align: bottom; }
.matriz-acesso .matriz-tela { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--background); min-width: 240px; white-space: nowrap; }
.matriz-acesso thead .matriz-tela { z-index: 3; }
.matriz-acesso .matriz-perfil { min-width: 110px; text-align: center; }
.matriz-acesso .matriz-celula { text-align: center; }
.matriz-acesso tbody tr:hover td { background: var(--muted); }
.matriz-acesso tbody tr.matriz-sensiveis td { border-bottom: 2px solid var(--border); }
.matriz-acesso tbody tr td.matriz-alterado { background: color-mix(in srgb, var(--primary) 14%, transparent); }

/* Escala de voluntários */
.w-fit { width: fit-content; }
.leading-tight { line-height: 1.25; }
.kt-btn-xs.kt-btn-icon { width: 1.5rem; height: 1.5rem; padding: 0; }
.escala-grade td { vertical-align: top; }
.escala-grade tr.escala-fechado td { background: var(--muted); }
.escala-item { border-radius: .375rem; padding: .125rem .25rem; }
.escala-item:hover { background: var(--muted); }
.escala-item.escala-tro { background: color-mix(in srgb, var(--warning, #f6b100) 12%, transparent); }
.escala-item.escala-eu { background: color-mix(in srgb, var(--primary) 10%, transparent); box-shadow: inset 2px 0 0 var(--primary); }
.min-w-\[170px\] { min-width: 170px; }
/* Filtro com busca (KTSelect) em largura fixa: o componente ocupa o bloco todo */
.filtro-largo { width: min(420px, 100%); }
.filtro-largo .kt-select-wrapper, .filtro-largo .kt-select { width: 100%; }
.max-h-\[75vh\] { max-height: 75vh; }
@media (min-width: 768px) { .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/*
 * Menu lateral: altura sempre presa à tela, com rolagem própria (computador, tablet e celular).
 * Fica aqui, pelo id, porque o KTDrawer tira as classes de data-kt-drawer-class (inclusive
 * top-0/bottom-0) ao desligar o drawer no desktop: sem isso o menu crescia com os subitens
 * abertos, passava do fim da tela e não rolava.
 */
#sidebar { top: 0; bottom: 0; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; }
#sidebar_menu { flex: 1 1 0%; min-height: 0; }
#sidebar_menu > .kt-scrollable-y-auto { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }

/* Início: logos dos ministérios antes das boas-vindas (proporção mantida, menor no celular; vários dividem a linha) */
.logo-ministerio { display: block; flex: 0 1 auto; min-width: 0; width: 100%; height: auto; max-width: 240px; max-height: 260px; object-fit: contain; }
@media (min-width: 1024px) { .logo-ministerio { max-width: 440px; } }

/* Imagens de produto: miniatura sem cortar a foto (abre ampliada no x-modal-imagem) */
.produto-miniatura { width: 12rem; height: 12rem; object-fit: contain; background: #fff; cursor: zoom-in; }
.start-3 { inset-inline-start: calc(var(--spacing) * 3); }
/* ocupa a área do modal (amplia fotos pequenas), sem distorcer */
.modal-imagem-foto { display: block; width: 100%; height: 75vh; height: 75dvh; object-fit: contain; }

/* Listas de seleção (KTUI): mais largas que o campo e sem cortar o texto com "...",
   para ler o caminho completo do ministério. Dentro de modal fica na largura do campo (o corpo do modal rola). */
.kt-select-dropdown { min-width: min(32rem, calc(100vw - 2rem)); max-width: calc(100vw - 2rem); }
.kt-modal .kt-select-dropdown { min-width: 0; }
.kt-select-option-text { white-space: normal; overflow-wrap: anywhere; }
/* Lista longa rola dentro do dropdown (sem isso ela cresce além da tela e as últimas opções ficam inacessíveis) */
.kt-select-dropdown .kt-select-options { max-height: min(20rem, 50vh); overflow-y: auto; overscroll-behavior: contain; }

/* Filtro de múltipla escolha (x-filtro-multiplo): caixa com "Selecionar todos" e uma caixa de marcação por opção */
.filtro-multiplo { position: relative; }
.filtro-multiplo-botao { display: flex; align-items: center; cursor: pointer; overflow: hidden; }
.filtro-multiplo-botao span { min-width: 0; }
.filtro-multiplo-painel { position: absolute; z-index: 30; inset-inline-start: 0; top: calc(100% + 4px); min-width: 100%; width: max-content; max-width: min(30rem, calc(100vw - 2rem));
    background: var(--popover, var(--background)); border: 1px solid var(--border); border-radius: .5rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.filtro-multiplo-lista { max-height: 18rem; overflow-y: auto; overscroll-behavior: contain; }
.filtro-multiplo-opcao { display: flex; align-items: flex-start; gap: .5rem; padding: .4rem .75rem; font-size: .8125rem; cursor: pointer; }
.filtro-multiplo-opcao:hover { background: var(--muted); }
.filtro-multiplo-opcao input { margin-top: .125rem; flex: 0 0 auto; }
.filtro-multiplo-opcao[hidden] { display: none; }
.filtro-multiplo-linha { display: flex; align-items: flex-start; }
.filtro-multiplo-linha:hover { background: var(--muted); }
.filtro-multiplo-linha[hidden] { display: none; }
.filtro-multiplo-linha .filtro-multiplo-opcao { flex: 1 1 auto; min-width: 0; }
.filtro-multiplo-linha .filtro-multiplo-opcao:hover { background: transparent; }
.filtro-multiplo-ramo { flex: 0 0 auto; margin: .3rem .5rem 0 0; padding: .05rem .4rem; font-size: .6875rem; white-space: nowrap;
    border: 1px solid var(--border); border-radius: .375rem; color: var(--primary); background: var(--background); cursor: pointer; }
.filtro-multiplo-ramo:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }

/* Itens do catálogo (Semear) */
.catalogo-escalas { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.catalogo-escala-atual { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.catalogo-periodo-aberto { border-color: color-mix(in srgb, #16a34a 45%, transparent); background: color-mix(in srgb, #16a34a 6%, transparent); }
.catalogo-periodo-antes { border-color: color-mix(in srgb, var(--primary) 40%, transparent); background: color-mix(in srgb, var(--primary) 5%, transparent); }
.catalogo-periodo-encerrado { background: var(--muted); }
.catalogo-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1rem; }
.catalogo-item { overflow: hidden; display: flex; flex-direction: column; }
.catalogo-item[hidden] { display: none; }
.catalogo-foto { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; cursor: zoom-in; }
.catalogo-reservado .catalogo-foto { opacity: .45; filter: grayscale(1); }
.catalogo-meu { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.gap-0\.5 { gap: .125rem; }
.ms-auto { margin-inline-start: auto; }

/* Relatório de solicitações do catálogo */
.relatorio-catalogo tr.relatorio-entregue td { color: var(--secondary-foreground); }
.catalogo-thumb { display: block; width: 56px; height: 56px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: .375rem; cursor: zoom-in; }
span.catalogo-thumb { cursor: default; }
/* miniaturas lado a lado; o botão ✓ no canto marca/desmarca a entrega daquele item */
.catalogo-thumbs { display: flex; flex-wrap: wrap; gap: .5rem; }
.catalogo-thumb-item { position: relative; }
.catalogo-thumb-entrega { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
    font-size: 11px; border: 1px solid var(--border); background: var(--background); color: var(--secondary-foreground); cursor: pointer; }
.catalogo-thumb-entrega:hover { border-color: #16a34a; color: #16a34a; }
.catalogo-thumb-entregue .catalogo-thumb { opacity: .55; }
.catalogo-thumb-entregue .catalogo-thumb-entrega { background: #16a34a; border-color: #16a34a; color: #fff; }
@media print { .catalogo-thumb { width: 40px; height: 40px; } }
.relatorio-catalogo tr.relatorio-grupo td { background: var(--muted); font-weight: 600; }
@media print {
    #sidebar, header, .kt-card-header form, .nao-imprimir, .kt-card-footer { display: none !important; }
    .relatorio-catalogo { font-size: 11px; }
}
