/*
 * ArquivoZap Notas · sistema visual
 * Documentação dos tokens e componentes: docs/design.md
 * Sem etapa de build: este arquivo é servido como está.
 */

@font-face { font-family: 'Figtree'; font-weight: 400; font-display: swap; src: url('../fonts/figtree-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 500; font-display: swap; src: url('../fonts/figtree-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 600; font-display: swap; src: url('../fonts/figtree-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 700; font-display: swap; src: url('../fonts/figtree-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 600; font-display: swap; src: url('../fonts/outfit-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 700; font-display: swap; src: url('../fonts/outfit-latin-700-normal.woff2') format('woff2'); }

:root {
    /* Marca */
    --verde-950: #0F2826;
    --verde-900: #163A37;
    --verde-800: #1E4A46;
    --verde-700: #2A5F59;   /* cor principal: verde-azulado do eucalipto */
    --verde-600: #3E7F74;   /* destaque */
    --verde-200: #C6E2DA;
    --verde-100: #E1F0EC;
    --verde-50:  #F1F8F6;
    --milho: #F2B632;       /* atenção leve, homologação */
    --terra: #9A6A3C;      /* madeira */
    --folha: #A8D5C6;     /* folha clara do eucalipto */

    /* Neutros puxados para o verde */
    --texto: #172423;
    --sutil: #566967;
    --borda: #D8E3E1;
    --borda-forte: #BFD0CD;
    --fundo: #F3F7F6;
    --superficie: #FFFFFF;

    /* Estados */
    --erro: #B3261E;
    --erro-fundo: #FDECEA;
    --erro-borda: #F2B8B5;
    --aviso: #7A4F00;
    --aviso-fundo: #FFF4D6;
    --aviso-borda: #F0D58C;
    --sucesso: #1D5A2B;
    --sucesso-fundo: #E3F3E7;
    --sucesso-borda: #B7DFC2;

    /* Nomes antigos, mantidos para telas que ainda os usam */
    --verde: var(--verde-700);
    --verde-escuro: var(--verde-800);
    --verde-claro: var(--verde-100);
    --branco: var(--superficie);
    --sucesso-fundo-antigo: var(--sucesso-fundo);

    /* Tipografia */
    --fonte: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --fonte-titulo: 'Outfit', 'Figtree', system-ui, sans-serif;
    --fonte-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    /* Forma */
    --raio: 12px;
    --raio-campo: 9px;
    --sombra: 0 1px 2px rgba(22, 58, 55, .06), 0 1px 1px rgba(22, 58, 55, .04);
    --sombra-alta: 0 10px 30px rgba(15, 40, 38, .16), 0 2px 6px rgba(15, 40, 38, .08);
    --altura-toque: 44px;
    --largura-lateral: 248px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 16px/1.5 var(--fonte);
    color: var(--texto);
    background: var(--fundo);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--verde-700); text-underline-offset: 2px; }
a:hover { color: var(--verde-600); }
h1, h2, h3 { font-family: var(--fonte-titulo); font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
:focus-visible { outline: 3px solid var(--verde-600); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ------------------------------------------------------------------ */
/* Estrutura: menu lateral (computador), barra do topo, abas (celular) */
/* ------------------------------------------------------------------ */

.app { display: grid; grid-template-columns: var(--largura-lateral) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.lateral {
    background: var(--verde-900);
    color: #E4EFEC;
    display: flex; flex-direction: column; gap: 1rem;
    padding: 1rem .75rem 1.25rem;
    position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
}
.lateral .logo { display: flex; align-items: center; padding: .25rem .5rem .5rem; }
.lateral .logo img { height: 34px; width: auto; display: block; }
.lateral .botao-emitir { margin: 0 .25rem; }
.menu-grupo { display: flex; flex-direction: column; gap: 2px; }
.menu-grupo > span { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8DB5AC; padding: .5rem .75rem .25rem; }
.menu-grupo a, .menu-grupo button {
    display: flex; align-items: center; gap: .65rem;
    color: #D9E8E4; text-decoration: none; font: inherit; font-size: .95rem; font-weight: 500;
    padding: .5rem .75rem; border-radius: 8px; border: 0; background: none; cursor: pointer; width: 100%; text-align: left;
}
.menu-grupo a:hover, .menu-grupo button:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-grupo a.ativo { background: rgba(168, 213, 198, .16); color: #fff; box-shadow: inset 3px 0 0 #A8D5C6; }
.menu-grupo svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.menu-grupo form { margin: 0; }
.lateral .rodape-lateral { margin-top: auto; }

.principal { min-width: 0; display: flex; flex-direction: column; }

.barra-topo {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem 1.5rem; min-height: 60px;
    background: rgba(243, 247, 246, .92);
    backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--borda);
}
.barra-topo .logo-celular { display: none; }
.barra-topo .logo-celular img { height: 30px; display: block; }
.barra-topo .espaco { flex: 1; }

.conteudo { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.5rem; flex: 1; }
.conteudo-estreito { max-width: 760px; }

.abas-celular { display: none; }
.veu { display: none; }

.rodape { text-align: center; color: var(--sutil); font-size: .85rem; padding: 1.5rem 1rem 2rem; }
.rodape a { color: inherit; }

/* Seletor de empresa */
.seletor-empresa { position: relative; min-width: 0; }
.seletor-empresa > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; gap: .6rem;
    padding: .35rem .6rem .35rem .4rem; border-radius: 12px;
    border: 1px solid var(--borda); background: var(--superficie);
    min-height: var(--altura-toque); max-width: 100%;
}
.seletor-empresa > summary::-webkit-details-marker { display: none; }
.seletor-empresa > summary:hover { border-color: var(--borda-forte); }
.seletor-empresa[open] > summary { border-color: var(--verde-600); box-shadow: 0 0 0 3px var(--verde-100); }
.seletor-empresa .seta { width: 16px; height: 16px; color: var(--sutil); flex: none; }
.empresa-texto { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.empresa-texto strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26ch; }
.empresa-texto small { font-size: .76rem; color: var(--sutil); white-space: nowrap; font-variant-numeric: tabular-nums; }
.iniciais {
    width: 34px; height: 34px; border-radius: 9px; flex: none;
    display: grid; place-items: center;
    background: var(--verde-100); color: var(--verde-800);
    font: 700 .8rem/1 var(--fonte-titulo); letter-spacing: .02em;
}
.seletor-empresa .menu-empresas {
    position: absolute; left: 0; top: calc(100% + 6px); z-index: 30;
    width: min(380px, calc(100vw - 2rem)); max-height: min(70vh, 520px); overflow-y: auto;
    background: var(--superficie); border: 1px solid var(--borda); border-radius: 14px; box-shadow: var(--sombra-alta);
    padding: .4rem;
}
.menu-empresas .grupo-conta { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--sutil); padding: .6rem .6rem .25rem; }
.menu-empresas form { margin: 0; }
.menu-empresas button {
    display: flex; align-items: center; gap: .6rem; width: 100%;
    padding: .5rem .6rem; border: 0; border-radius: 10px; background: none; cursor: pointer;
    font: inherit; color: inherit; text-align: left;
}
.menu-empresas button:hover { background: var(--verde-50); }
.menu-empresas button[aria-current="true"] { background: var(--verde-100); }
.menu-empresas button[aria-current="true"] .iniciais { background: var(--verde-700); color: #fff; }
.menu-empresas .rodape-menu { border-top: 1px solid var(--borda); margin-top: .35rem; padding: .5rem .6rem .25rem; display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; }

/* Menu do usuário (topo direito) */
.menu-usuario { position: relative; }
.menu-usuario > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .3rem; border-radius: 999px; }
.menu-usuario > summary::-webkit-details-marker { display: none; }
.menu-usuario > summary:hover { background: var(--verde-100); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--verde-700); color: #fff; font: 700 .8rem/1 var(--fonte-titulo); }
.menu-usuario .menu-suspenso { right: 0; left: auto; }
.menu-suspenso {
    position: absolute; top: calc(100% + 6px); z-index: 30; min-width: 220px;
    background: var(--superficie); border: 1px solid var(--borda); border-radius: 12px; box-shadow: var(--sombra-alta); padding: .35rem;
}
.menu-suspenso a, .menu-suspenso button { display: block; width: 100%; text-align: left; padding: .55rem .7rem; border-radius: 8px; color: var(--texto); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu-suspenso a:hover, .menu-suspenso button:hover { background: var(--verde-50); }
.menu-suspenso form { margin: 0; }
.menu-suspenso .quem { padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--borda); margin-bottom: .3rem; font-size: .88rem; color: var(--sutil); }
.menu-suspenso .quem strong { display: block; color: var(--texto); font-size: .95rem; }

/* Topo simples para quem não entrou (termos, privacidade) */
.topo-publico { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.5rem; background: var(--superficie); border-bottom: 1px solid var(--borda); }
.topo-publico img { height: 32px; display: block; }

/* Celular e tablet pequeno */
@media (max-width: 900px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .lateral {
        position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(300px, 86vw); height: 100%;
        transform: translateX(-105%); transition: transform .22s ease;
        padding-top: calc(1rem + env(safe-area-inset-top, 0px));
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
        box-shadow: var(--sombra-alta);
    }
    .menu-aberto .lateral { transform: none; }
    .veu { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(15, 40, 38, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
    .menu-aberto .veu { opacity: 1; pointer-events: auto; }
    .barra-topo { padding: .5rem max(1rem, env(safe-area-inset-right, 0px)) .5rem max(1rem, env(safe-area-inset-left, 0px)); padding-top: calc(.5rem + env(safe-area-inset-top, 0px)); gap: .5rem; }
    .barra-topo .logo-celular { display: block; }
    .barra-topo .seletor-empresa { flex: 1; }
    .barra-topo .seletor-empresa > summary { width: 100%; }
    .empresa-texto strong { max-width: none; }
    .barra-topo .ocultar-celular { display: none; }
    .barra-topo .espaco { display: none; }
    .seletor-empresa .menu-empresas { position: fixed; left: max(.75rem, env(safe-area-inset-left, 0px)); right: max(.75rem, env(safe-area-inset-right, 0px)); top: calc(64px + env(safe-area-inset-top, 0px)); width: auto; }
    .alerta, .faixa-homologacao { font-size: .86rem; padding: .55rem .8rem; margin-bottom: .6rem; }
    .numero strong { font-size: 1.3rem; }
    .numeros { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .saudacao h1 { font-size: 1.45rem; }
    .conteudo { padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) calc(88px + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px)); }
    .rodape { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
    .abas-celular {
        display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        background: var(--superficie); border-top: 1px solid var(--borda);
        padding: .35rem max(.25rem, env(safe-area-inset-right, 0px)) calc(.35rem + env(safe-area-inset-bottom, 0px)) max(.25rem, env(safe-area-inset-left, 0px));
        box-shadow: 0 -4px 16px rgba(15, 40, 38, .06);
    }
    .abas-celular a, .abas-celular button {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        font: 600 .7rem/1.1 var(--fonte); color: var(--sutil); text-decoration: none;
        background: none; border: 0; padding: .3rem 0; cursor: pointer; min-height: var(--altura-toque);
    }
    .abas-celular svg { width: 23px; height: 23px; }
    .abas-celular .ativo { color: var(--verde-700); }
    .abas-celular .aba-emitir span.circulo {
        width: 52px; height: 52px; border-radius: 16px; margin-top: -22px;
        display: grid; place-items: center; background: var(--verde-700); color: #fff;
        box-shadow: 0 6px 16px rgba(42, 95, 89, .35);
    }
    .abas-celular .aba-emitir { color: var(--verde-700); }
    h1 { font-size: 1.35rem; }
}

/* ------------------------------------------------------------------ */
/* Componentes                                                          */
/* ------------------------------------------------------------------ */

.cabecalho { display: flex; justify-content: space-between; align-items: center; gap: .75rem 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.cabecalho h2 { margin: 0; }
.cabecalho .sutil { margin: .15rem 0 0; }
.sutil { color: var(--sutil); font-size: .93rem; }
.voltar { display: inline-flex; align-items: center; gap: .3rem; font-size: .9rem; color: var(--sutil); text-decoration: none; margin-bottom: .35rem; }
.voltar:hover { color: var(--verde-700); }

.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.25rem 1.35rem; margin-bottom: 1rem; box-shadow: var(--sombra); }
.cartao > h2:first-child { margin-top: 0; }
.cartao-estreito { max-width: 440px; margin: 3rem auto; }
.duas-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.duas-colunas > * { min-width: 0; }
@media (max-width: 800px) { .duas-colunas { grid-template-columns: 1fr; } .cartao { padding: 1rem; } }

/* Formulários */
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 600; margin-bottom: .5rem; }
.linha { display: flex; gap: .75rem 1rem; flex-wrap: wrap; }
.campo { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; flex: 1 1 150px; min-width: 0; }
.campo.largo { flex: 3 1 260px; }
.campo label { font-size: .86rem; font-weight: 600; color: #2C3D3B; }
.obrigatorio { color: var(--erro); }
input, select, textarea {
    font: inherit; font-size: 1rem; color: var(--texto);
    padding: .55rem .7rem; min-height: var(--altura-toque);
    border: 1px solid var(--borda-forte); border-radius: var(--raio-campo);
    background: var(--superficie); width: 100%;
    transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 88px; resize: vertical; }
select {
    appearance: none; -webkit-appearance: none; padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23566967'%3E%3Cpath d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .6rem center; background-size: 18px;
}
input:hover, select:hover, textarea:hover { border-color: #A5B9B5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--verde-600); box-shadow: 0 0 0 3px var(--verde-100); }
input[readonly] { background: var(--fundo); color: var(--sutil); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--verde-700); padding: 0; }
input[type=file] { padding: .45rem; }
.com-erro input, .com-erro select, .com-erro textarea { border-color: var(--erro); }
.com-erro input:focus, .com-erro select:focus, .com-erro textarea:focus { box-shadow: 0 0 0 3px var(--erro-fundo); }
.erro { color: var(--erro); font-size: .83rem; font-weight: 500; }
.ajuda { color: var(--sutil); font-size: .82rem; }
.marcar { display: flex; gap: .55rem; align-items: flex-start; margin-bottom: 1rem; font-size: .93rem; line-height: 1.4; cursor: pointer; }
.marcar input { width: 20px; flex: none; margin-top: 1px; }

details summary { cursor: pointer; color: var(--verde-700); font-size: .93rem; font-weight: 600; margin-bottom: .5rem; }
details.mais { border-top: 1px dashed var(--borda); padding-top: .75rem; margin-top: .25rem; }

/* Botões */
.botao {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: var(--altura-toque); padding: .5rem 1rem;
    border: 1px solid var(--borda-forte); border-radius: 10px;
    background: var(--superficie); color: var(--texto);
    font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .12s, border-color .12s, transform .06s;
}
.botao:hover { background: var(--verde-50); border-color: #A5B9B5; color: var(--texto); }
.botao:active { transform: translateY(1px); }
.botao svg { width: 18px; height: 18px; flex: none; }
.botao-primario { background: var(--verde-700); border-color: var(--verde-700); color: #fff; }
.botao-primario:hover { background: var(--verde-800); border-color: var(--verde-800); color: #fff; }
.lateral .botao-primario { background: var(--folha); border-color: var(--folha); color: #0F2826; }
.lateral .botao-primario:hover { background: #BDE2D6; border-color: #BDE2D6; color: #0F2826; }
.botao-perigo { color: var(--erro); border-color: var(--erro-borda); }
.botao-perigo:hover { background: var(--erro-fundo); border-color: var(--erro); color: var(--erro); }
.botao-fantasma { border-color: transparent; background: none; }
.botao-pequeno { min-height: 34px; padding: .3rem .65rem; font-size: .86rem; border-radius: 8px; }
.botao-grande { min-height: 54px; padding: .75rem 1.4rem; font-size: 1.05rem; border-radius: 12px; }
.botao.largo { width: 100%; }
.botao[disabled] { opacity: .6; cursor: progress; }
.link { background: none; border: 0; color: var(--verde-700); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.barra-acoes { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.barra-acoes form, .acoes form { margin: 0; }
.acoes { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }

/* Avisos */
.alerta { display: block; padding: .8rem 1rem; border-radius: var(--raio); margin-bottom: 1rem; border: 1px solid transparent; font-size: .95rem; }
.alerta a { color: inherit; font-weight: 700; }
.alerta ul { margin: 0; padding-left: 1.2rem; }
.alerta-sucesso { background: var(--sucesso-fundo); border-color: var(--sucesso-borda); color: var(--sucesso); }
.alerta-aviso { background: var(--aviso-fundo); border-color: var(--aviso-borda); color: var(--aviso); }
.alerta-erro { background: var(--erro-fundo); border-color: var(--erro-borda); color: #7A1A14; }
.faixa-homologacao {
    display: flex; align-items: center; gap: .5rem;
    background: repeating-linear-gradient(-45deg, #FFF4D6 0 12px, #FFEDBF 12px 24px);
    color: var(--aviso); border: 1px solid var(--aviso-borda);
    padding: .5rem .85rem; border-radius: var(--raio); margin-bottom: 1rem; font-size: .9rem; font-weight: 500;
}

/* Tabelas: no celular viram cartões (cada td precisa de data-rotulo) */
.tabela { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; margin-bottom: 1rem; box-shadow: var(--sombra); }
.tabela th, .tabela td { padding: .7rem .8rem; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: middle; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela th { background: var(--verde-50); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sutil); }
.tabela tbody tr:hover td { background: #F9FCFB; }
.tabela tr.selecionada td { background: var(--verde-50); }
.tabela .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela tfoot td { font-weight: 600; border-top: 1px solid var(--borda); border-bottom: 0; }
.tabela tfoot .total td { font-size: 1.05rem; }
.vazio { text-align: center; color: var(--sutil); padding: 2rem 1rem; }
@media (max-width: 800px) {
    .tabela { display: block; overflow-x: auto; }
    .tabela.responsiva { display: table; overflow: visible; border: 0; background: none; box-shadow: none; }
    .tabela.responsiva thead { display: none; }
    .tabela.responsiva tbody, .tabela.responsiva tr, .tabela.responsiva td { display: block; }
    .tabela.responsiva tr { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: .6rem .85rem; margin-bottom: .6rem; box-shadow: var(--sombra); }
    .tabela.responsiva td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
    .tabela.responsiva td::before { content: attr(data-rotulo); color: var(--sutil); font-size: .82rem; font-weight: 600; text-align: left; }
    .tabela.responsiva td:not([data-rotulo])::before { content: none; }
    .tabela.responsiva td.principal-celula { font-weight: 700; font-size: 1.02rem; text-align: left; justify-content: flex-start; padding-bottom: .35rem; }
    .tabela.responsiva td.acoes { justify-content: flex-start; padding-top: .5rem; }
    .tabela.responsiva td.vazio { display: block; text-align: center; }
    .tabela.responsiva .num { text-align: right; }
}

.filtros { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filtros input[type=search] { flex: 1 1 260px; width: auto; }
.filtros select, .filtros input[type=date] { width: auto; }
.filtros label { display: flex; gap: .4rem; align-items: center; font-size: .9rem; color: var(--sutil); }

/* Situação de notas e selos */
.status { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #ECEFEC; color: #3D4540; white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .75; }
.status-autorizada, .status-autorizado { background: var(--sucesso-fundo); color: var(--sucesso); }
.status-rejeitada, .status-denegada, .status-rejeitado, .status-denegado { background: var(--erro-fundo); color: var(--erro); }
.status-cancelada, .status-cancelado { background: #ECECEC; color: #555; }
.status-cancelada::before, .status-cancelado::before { opacity: .4; }
.status-pendente { background: var(--aviso-fundo); color: var(--aviso); }
.status-rascunho { background: #EEF1F6; color: #3F4B63; }
.selo { display: inline-block; font-size: .68rem; font-weight: 800; padding: .15rem .5rem; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.selo-homologacao { background: #FFE29A; color: #5C3D00; }
.selo-producao { background: #C9F0D3; color: #1D5A2B; }

/* Itens da nota */
.item { border: 1px solid var(--borda); border-radius: var(--raio); padding: .9rem 1rem .25rem; margin-bottom: .75rem; background: var(--verde-50); }
.item-cabecalho { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.total-nota { display: flex; justify-content: flex-end; align-items: baseline; gap: .5rem; font-size: 1rem; margin: .75rem 0 0; color: var(--sutil); }
.total-nota strong { font: 700 1.5rem/1 var(--fonte-titulo); color: var(--texto); font-variant-numeric: tabular-nums; }

.dados { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.dados dt { font-weight: 600; color: var(--sutil); font-size: .9rem; }
.dados dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.chave { font-family: var(--fonte-mono); font-size: .9em; letter-spacing: .02em; overflow-wrap: anywhere; }
@media (max-width: 600px) { .dados { grid-template-columns: 1fr; gap: .1rem; } .dados dd { margin-bottom: .5rem; } }

.paginacao { display: flex; gap: 1rem; justify-content: center; align-items: center; margin: 1rem 0; color: var(--sutil); }

.legal { max-width: 820px; margin: 0 auto; line-height: 1.6; }
.legal h2 { margin-top: 1.6rem; font-size: 1.15rem; }
.legal .pendente { background: var(--aviso-fundo); padding: 0 .25rem; border-radius: 3px; }

/* ------------------------------------------------------------------ */
/* Painel inicial                                                       */
/* ------------------------------------------------------------------ */

.saudacao { margin-bottom: 1.25rem; }
.saudacao h1 { font-size: 1.75rem; }
.saudacao p { margin: .2rem 0 0; color: var(--sutil); }

.atalhos { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.atalho {
    display: flex; align-items: center; gap: .85rem;
    padding: 1rem 1.1rem; border-radius: 14px; text-decoration: none;
    background: var(--superficie); border: 1px solid var(--borda); color: var(--texto); box-shadow: var(--sombra);
    font: inherit; text-align: left; cursor: pointer; width: 100%;
    transition: border-color .12s, transform .08s, box-shadow .12s;
}
.atalho:hover { border-color: var(--verde-600); color: var(--texto); box-shadow: 0 4px 14px rgba(42, 95, 89, .12); }
.atalho:active { transform: translateY(1px); }
.atalho .icone { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--verde-100); color: var(--verde-700); flex: none; }
.atalho .icone svg { width: 24px; height: 24px; }
.atalho strong { display: block; font-size: 1rem; }
.atalho small { display: block; color: var(--sutil); font-size: .84rem; line-height: 1.3; }
.atalho.principal-atalho { background: var(--verde-700); border-color: var(--verde-700); color: #fff; }
.atalho.principal-atalho small { color: #C6E2DA; }
.atalho.principal-atalho .icone { background: rgba(255,255,255,.14); color: #fff; }
.atalho.principal-atalho:hover { background: var(--verde-800); color: #fff; }
.atalhos form { margin: 0; display: flex; }

.numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.numero { background: var(--superficie); border: 1px solid var(--borda); border-radius: 14px; padding: .9rem 1.1rem; box-shadow: var(--sombra); }
.numero span { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--sutil); }
.numero strong { display: block; font: 700 1.65rem/1.2 var(--fonte-titulo); font-variant-numeric: tabular-nums; margin-top: .2rem; }
.numero small { color: var(--sutil); font-size: .84rem; }

.pendencias { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .5rem; }
.pendencias li { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: 12px; border: 1px solid var(--aviso-borda); background: var(--aviso-fundo); color: var(--aviso); }
.pendencias li.grave { border-color: var(--erro-borda); background: var(--erro-fundo); color: #7A1A14; }
.pendencias li span { flex: 1; min-width: 0; }
.pendencias svg { width: 20px; height: 20px; flex: none; }

.lista-notas { list-style: none; margin: 0; padding: 0; }
.lista-notas li + li { border-top: 1px solid var(--borda); }
.lista-notas a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem 1rem; padding: .7rem .25rem; text-decoration: none; color: var(--texto); border-radius: 8px; }
.lista-notas a:hover { background: var(--verde-50); }
.lista-notas .quem { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista-notas .valor { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.lista-notas .detalhe { color: var(--sutil); font-size: .85rem; }

/* ------------------------------------------------------------------ */
/* Emissão em passos                                                    */
/* ------------------------------------------------------------------ */

.passos { display: flex; gap: .5rem; list-style: none; margin: 0 0 1.25rem; padding: 0; counter-reset: passo; overflow-x: auto; }
.passos li { flex: 1 1 0; min-width: 0; counter-increment: passo; }
.passos button {
    width: 100%; display: flex; align-items: center; gap: .55rem; text-align: left;
    padding: .55rem .7rem; border-radius: 12px; border: 1px solid var(--borda); background: var(--superficie);
    font: inherit; font-size: .9rem; font-weight: 600; color: var(--sutil); cursor: pointer;
}
.passos button::before {
    content: counter(passo); flex: none;
    width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: var(--fundo); border: 1px solid var(--borda-forte); font-size: .82rem; color: var(--sutil);
}
.passos .feito button { color: var(--texto); }
.passos .feito button::before { content: '✓'; background: var(--verde-100); border-color: var(--verde-200); color: var(--verde-700); }
.passos .atual button { border-color: var(--verde-600); color: var(--texto); box-shadow: 0 0 0 3px var(--verde-100); }
.passos .atual button::before { background: var(--verde-700); border-color: var(--verde-700); color: #fff; }
.passos .com-erro button::before { background: var(--erro); border-color: var(--erro); color: #fff; content: '!'; }
.passo-oculto { display: none; }
.navegacao-passos {
    display: flex; gap: .5rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
    position: sticky; bottom: 0; z-index: 10;
    margin: 0 -.25rem; padding: .75rem .25rem;
    background: linear-gradient(to bottom, rgba(243,247,246,0), var(--fundo) 30%);
}
.navegacao-passos .direita { display: flex; gap: .5rem; margin-left: auto; }
.revisao { display: grid; gap: .75rem; }
.revisao .bloco { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--borda); border-radius: 12px; background: var(--superficie); }
.revisao .bloco > div { min-width: 0; }
.revisao .bloco span { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sutil); }
.revisao .bloco p { margin: .15rem 0 0; overflow-wrap: anywhere; }
.revisao .total { font: 700 1.6rem/1.1 var(--fonte-titulo); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
    .passos button { flex-direction: column; text-align: center; font-size: .74rem; padding: .45rem .25rem; gap: .25rem; }
    .navegacao-passos { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* ------------------------------------------------------------------ */
/* Entrar e criar conta                                                 */
/* ------------------------------------------------------------------ */

.acesso { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--superficie); }
.acesso-marca {
    position: relative; overflow: hidden;
    background: var(--verde-900); color: #E4EFEC;
    padding: 2.5rem clamp(1.5rem, 5vw, 4rem); display: flex; flex-direction: column; gap: 2rem;
}
.acesso-marca::after {
    /* linhas de plantio ao fundo */
    content: ''; position: absolute; inset: auto -20% -35% -20%; height: 70%;
    background: repeating-radial-gradient(ellipse at 50% 0%, rgba(168, 213, 198, .10) 0 2px, transparent 2px 26px);
    pointer-events: none;
}
.acesso-marca img { height: 42px; width: auto; align-self: flex-start; }
.acesso-marca h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.12; color: #fff; margin: auto 0 0; max-width: 18ch; }
.acesso-marca ul { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: .7rem; max-width: 42ch; position: relative; z-index: 1; }
.acesso-marca li { display: flex; gap: .65rem; align-items: flex-start; color: #C6E2DA; }
.acesso-marca li svg { width: 22px; height: 22px; flex: none; color: #A8D5C6; margin-top: 1px; }
.acesso-form { display: flex; align-items: center; justify-content: center; padding: 2rem max(1.25rem, env(safe-area-inset-right, 0px)) 2rem max(1.25rem, env(safe-area-inset-left, 0px)); }
.acesso-form > div { width: 100%; max-width: 400px; }
.acesso-form h1 { font-size: 1.75rem; margin-bottom: .35rem; }
.acesso-form .sutil { margin: 0 0 1.5rem; }
.acesso-form .rodape-acesso { margin-top: 1.25rem; text-align: center; color: var(--sutil); font-size: .93rem; }
.acesso-form .legal-acesso { margin-top: 2rem; text-align: center; font-size: .8rem; color: var(--sutil); }
.acesso-form .legal-acesso a { color: inherit; }
.acesso-logo { display: block; height: 52px; width: auto; margin: 0 0 2rem; }
@media (max-width: 860px) {
    .acesso { grid-template-columns: minmax(0, 1fr); }
    .acesso-marca { display: none; }
    .acesso-form { align-items: flex-start; padding-top: calc(2rem + env(safe-area-inset-top, 0px)); }
    .acesso-logo { height: 46px; margin: 0 auto 1.75rem; }
    .acesso-form h1, .acesso-form > div > .sutil { text-align: center; }
}
