html, body { background: #F5F4EF; }

/* Carregando o sistema */
.carregando { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #F5F4EF; }
.carregando img { width: 120px; animation: pulsar 1.2s ease-in-out infinite alternate; }
@keyframes pulsar { from { opacity: .5; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

#blazor-error-ui { background: #fff3cd; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 2000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mud-table-row.linha-clicavel { cursor: pointer; }
.topo-icone { height: 32px; width: 32px; border-radius: 8px; }
.negativo { color: var(--mud-palette-error); }
.positivo { color: var(--mud-palette-success); }
.fraco { color: #7a7f73; }
.titulo-pagina { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* Login */
.tela-login {
    min-height: 100vh; display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center; padding: 16px;
    background: radial-gradient(120% 120% at 100% 0%, rgba(227,137,43,.35), transparent 55%), linear-gradient(150deg, #1B3F23 0%, #24532E 55%, #3C7A48 100%);
}
.tela-login img.logo { width: 96px; display: block; margin: 0 auto; }

/* Etapas (pedido, carga, pagamento) */
.etapa { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 500; white-space: nowrap; background: #eceee8; color: #4b5244; }
.etapa.ABERTO, .etapa.PROGRAMADA { background: #e8eef3; color: #3d5466; }
.etapa.NA_CARGA, .etapa.CARREGADA { background: #fff1d6; color: #8a5a00; }
.etapa.PARCIAL { background: #fde9d4; color: #9a4a00; }
.etapa.ENTREGUE, .etapa.CONCLUIDA, .etapa.OK { background: #dff3e5; color: #1d6b3c; }
.etapa.CANCELADO, .etapa.CANCELADA { background: #eeeeee; color: #777; text-decoration: line-through; }
.etapa.ACONFERIR { background: #fde3e1; color: #b42318; }

/* Painel */
.kpi { transition: box-shadow .15s, transform .15s; }
.kpi-link { cursor: pointer; }
.kpi-link:hover { box-shadow: 0 4px 14px rgba(36, 83, 46, .16); transform: translateY(-1px); }
.kpi-icone { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; }
.barras-mes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 150px; border-bottom: 1px solid #d8dad2; }
.barras-mes .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: .72rem; color: #4b5244; }
.barras-mes .barra { width: 70%; background: #3C7A48; border-radius: 4px 4px 0 0; min-height: 2px; }
.barras-mes-eixo { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; font-size: .72rem; color: #7a7f73; text-align: center; margin-top: 4px; }

/* Fotos e assinatura na gestão */
.fotos-grade { display: flex; flex-wrap: wrap; gap: 8px; }
.fotos-grade img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; cursor: zoom-in; border: 1px solid #e2e3dc; }
.assinatura-img { max-width: 320px; width: 100%; border: 1px solid #e2e3dc; border-radius: 8px; background: #fff; }
.miniatura { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; vertical-align: middle; }

/* Selo do Grupo Sintesys */
.selo-sintesys { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: #4b5244; font-size: .75rem; }
.selo-sintesys img { height: 30px; width: auto; display: block; }
.selo-sintesys.clara { color: rgba(255,255,255,.95); }
.mud-drawer .mud-drawer-content { display: flex; flex-direction: column; }
.menu-selo { margin-top: auto; padding: 16px 12px 14px; border-top: 1px solid #eceee8; display: flex; justify-content: center; }

/* ============ App do celular ============ */
.app { max-width: 640px; margin: 0 auto; padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
.app-topo { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
            background: #24532E; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.app-topo .titulo { flex: 1; min-width: 0; font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topo .sub { display: block; font-size: .72rem; font-weight: 400; opacity: .85; }
.app-sinal { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.18); white-space: nowrap; }
.app-sinal.off { background: #b42318; }
.app-rodape { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; background: #fff;
              border-top: 1px solid #e2e3dc; padding-bottom: env(safe-area-inset-bottom); }
.app-rodape a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: .7rem; color: #5b6152; text-decoration: none; position: relative; }
.app-rodape a.active { color: #24532E; font-weight: 600; }
.app-rodape .contador { position: absolute; top: 2px; left: 55%; background: #E3892B; color: #fff; border-radius: 999px; font-size: .65rem; padding: 0 6px; }

/* Botões grandes da tela inicial do celular */
.acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acao { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 14px; background: #fff; border: 1px solid #e2e3dc;
        text-decoration: none; color: #22281d; min-height: 96px; cursor: pointer; }
.acao:active { background: #eef3ea; }
.acao .mud-icon-root { color: #24532E; font-size: 2rem; }
.acao b { font-size: .95rem; }
.acao small { color: #7a7f73; font-size: .75rem; line-height: 1.2; }
.acao.destaque { background: #24532E; color: #fff; border-color: #24532E; }
.acao.destaque .mud-icon-root, .acao.destaque small { color: #fff; }

.cartao { background: #fff; border: 1px solid #e2e3dc; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.cartao.clicavel { cursor: pointer; }
.cartao.clicavel:active { background: #f3f6f0; }
.cartao h3 { margin: 0 0 4px; font-size: 1rem; }
.cartao .linha { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; padding: 3px 0; }
.cartao .linha + .linha { border-top: 1px dashed #eceee8; }
.secao { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: #7a7f73; margin: 16px 4px 6px; font-weight: 600; }

/* Quantidade de sacos com botões grandes */
.qtd { display: flex; align-items: center; gap: 6px; }
.qtd button { width: 42px; height: 42px; border-radius: 10px; border: 1px solid #cfd3c6; background: #f5f6f1; font-size: 1.3rem; font-weight: 600; color: #24532E; }
.qtd input { width: 64px; height: 42px; text-align: center; font-size: 1.1rem; font-weight: 600; border: 1px solid #cfd3c6; border-radius: 10px; }
.item-qtd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.item-qtd + .item-qtd { border-top: 1px solid #eceee8; }
.item-qtd .nome { flex: 1; min-width: 0; }
.item-qtd .nome small { display: block; color: #7a7f73; }

.botao-final { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 5; margin-top: 12px; }
.botao-final .mud-button-root { width: 100%; min-height: 54px; font-size: 1.05rem; border-radius: 14px; }

/* Câmera e assinatura */
.foto-botao { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; border: 2px dashed #9fb39a; border-radius: 12px; color: #24532E;
              background: #f5f8f2; cursor: pointer; font-weight: 500; padding: 8px; text-align: center; }
.foto-previa { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; display: block; }
.pdf-previa { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid #e2e3dc; }
.assinatura-quadro { position: relative; border: 2px dashed #9fb39a; border-radius: 12px; background: #fff; height: 200px; touch-action: none; }
.assinatura-quadro.com { border-style: solid; border-color: #24532E; }
.assinatura-quadro canvas { width: 100%; height: 100%; display: block; border-radius: 12px; touch-action: none; }
.assinatura-quadro .dica { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9aa092; pointer-events: none; }
.assinatura-quadro .linha { position: absolute; left: 10%; right: 10%; bottom: 42px; border-bottom: 1px solid #cfd3c6; pointer-events: none; }

@media print {
    .mud-appbar, .mud-drawer, .nao-imprimir { display: none !important; }
    .mud-main-content { padding-top: 0 !important; margin-left: 0 !important; }
    html, body { background: #fff !important; }
}
.campo-picker .mud-input-control { margin-top: 0; }
