/* Estilo comum das páginas do Portal (Utilidades, Consumo do Almoxarifado, etc.):
   cores, cabeçalho institucional, cartões, formulário, tabela, admin-bar, mensagens.
   Extraído em 2026-09-22 pra parar de copiar isto em cada página nova — pedido do usuário
   ("está poluído, dá pra reduzir as linhas"). Começou só na página de Consumo do Almoxarifado;
   outras páginas continuam com o CSS delas embutido até serem migradas também. */

:root {
  --azul: #17365d; --azul2: #24578a; --claro: #eef4fa; --verde: #2e7d32; --vermelho: #b3261e;
  --cinza: #5f6b76; --borda: #d7e0e8; --fundo: #f5f7fa; --branco: #ffffff;
  --sombra: 0 8px 24px rgba(23, 54, 93, .10);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--fundo); color: #1e2933; }

header { background: linear-gradient(110deg, #0b3f6b 0%, #14538f 55%, #1a63a8 100%); color: white; box-shadow: 0 5px 18px rgba(6, 60, 85, .20); }
.cabecalho-institucional { max-width: 1420px; margin: 0 auto; padding: 22px 28px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.logo-box { width: 76px; height: 76px; flex: 0 0 auto; padding: 10px; border-radius: 20px; background: rgba(255,255,255,.98); box-shadow: 0 6px 16px rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.cabecalho-textos { flex: 1 1 320px; min-width: 0; }
.badge-topo { display: inline-block; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: white; border-radius: 999px; padding: 4px 13px; font-size: 11px; font-weight: 800; letter-spacing: .3px; margin-bottom: 9px; }
.cabecalho-textos h1 { margin: 0; font-size: clamp(20px, 2.4vw, 30px); line-height: 1.15; font-weight: 800; }
.cabecalho-textos p { margin: 4px 0 0; opacity: .9; font-size: 13px; }
.cabecalho-widgets { display: flex; gap: 12px; flex: 0 0 auto; flex-wrap: wrap; align-items: center; }
.btn-voltar-portal { display: inline-flex; align-items: center; justify-content: center; height: 42px; width: 210px; padding: 0 16px; border-radius: 9px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: white; font-weight: 700; font-size: 13px; font-family: inherit; text-decoration: none; white-space: nowrap; cursor: pointer; box-sizing: border-box; }
.btn-voltar-portal:hover { background: rgba(255,255,255,.26); }
.botoes-topo-empilhados { display: flex; flex-direction: column; gap: 8px; }
.widgets-empilhados { display: flex; flex-direction: column; gap: 6px; }
.widget-cabecalho { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 9px; padding: 7px 11px; width: 160px; box-sizing: border-box; backdrop-filter: blur(2px); }
.widget-icone { font-size: 15px; line-height: 1; }
.widget-cabecalho strong { display: block; font-size: 12px; font-weight: 800; }
.widget-cabecalho span { display: block; font-size: 9.5px; opacity: .88; line-height: 1.3; }

.container { max-width: 1420px; margin: 0 auto; padding: 18px; }
.card { background: white; border-radius: 15px; padding: 18px; box-shadow: var(--sombra); margin-bottom: 18px; }
.card h2, .card h3 { margin-top: 0; color: var(--azul); }
.card-recolhivel > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-recolhivel > summary::-webkit-details-marker { display: none; }
.card-recolhivel > summary h2 { margin: 0; }
.card-recolhivel > summary::after { content: "▾"; color: var(--azul); font-size: 18px; margin-left: auto; }
.card-recolhivel[open] > summary::after { content: "▴"; }
.card-recolhivel > summary .dica-abrir { font-size: 12px; color: var(--cinza); font-weight: 400; order: 2; }
.card-recolhivel[open] > summary { margin-bottom: 10px; }
/* Reforça o recolher nativo do <details> (alguns webviews não escondem o conteúdo sozinhos
   quando fechado) — só esconde quando fechado; aberto, cada filho mantém seu display próprio
   (flex em .acoes, grid em .grade-3/4, etc.), por isso não existe uma regra para [open]. */
.card-recolhivel:not([open]) > *:not(summary) { display: none !important; }

.grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grade-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grade-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo.largo { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 700; color: #344454; }
input, select, textarea { width: 100%; border: 1px solid var(--borda); border-radius: 10px; padding: 11px 12px; font-size: 15px; background: white; }
input[readonly] { background: var(--fundo); color: var(--cinza); cursor: not-allowed; }
textarea { min-height: 80px; resize: vertical; }
.acoes { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.btn { border: 0; border-radius: 10px; padding: 12px 18px; cursor: pointer; font-weight: 700; }
.btn-primario { background: var(--azul); color: white; }
.btn-secundario { background: #e9eef3; color: #344454; }
.btn-perigo { background: #fdecea; color: var(--vermelho); }
.btn:disabled { opacity: .55; cursor: wait; }

.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: white; border: 1px solid var(--borda); border-radius: 12px; padding: 10px 16px; margin-bottom: 18px; font-size: 13px; color: var(--cinza); }
.admin-bar a { color: var(--azul2); font-weight: 700; cursor: pointer; }
.admin-bar strong { color: var(--azul); }
.admin-login-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-login-form input { padding: 8px 10px; border: 1px solid var(--borda); border-radius: 8px; font-size: 13px; }
.admin-login-form .btn { padding: 8px 14px; font-size: 13px; }

.mensagem { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: max-content; max-width: min(520px, calc(100vw - 32px)); z-index: 9999; color: white; padding: 22px 28px; border-radius: 16px; font-weight: 700; font-size: 16px; line-height: 1.4; text-align: center; cursor: pointer; box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .4), 0 18px 48px rgba(0, 0, 0, .3); }   /* aviso no MEIO da tela (padrão de todos os apps); clique fecha */
.mensagem::before { display: block; font-size: 32px; line-height: 1.1; margin-bottom: 6px; }
.mensagem.sucesso::before { content: "✔"; } .mensagem.erro::before { content: "⚠"; }
.mensagem.sucesso { background: var(--verde); } .mensagem.erro { background: var(--vermelho); }
.carregando { display: none; position: fixed; inset: 0; background: rgba(255,255,255,.72); z-index: 9998; align-items: center; justify-content: center; font-weight: 700; color: var(--azul); }

.tabela-responsiva { width: 100%; overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { border-bottom: 1px solid #e7edf3; padding: 9px; text-align: left; }
th { background: var(--claro); color: var(--azul); font-size: 12px; text-transform: uppercase; }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 800; background: #eef4f8; }
.linha-clicavel { cursor: pointer; }
.linha-clicavel:hover { background: var(--claro); }

@media (max-width: 1180px) {
  .cabecalho-institucional { padding: 14px; gap: 14px; }
  .logo-box { width: 60px; height: 60px; border-radius: 15px; }
  .cabecalho-widgets { width: 100%; }
  .widgets-empilhados { flex: 1 1 auto; }
  .widget-cabecalho { width: 100%; }
  .grade, .grade-3, .grade-4 { grid-template-columns: 1fr; }
  .campo.largo { grid-column: auto; }
}
