:root {
    --verde: #145c45;
    --verde-escuro: #0e3b2e;
    --dourado: #8a6a12;
    --fundo: #f4f7f5;
    --texto: #1c2421;
    --suave: #3e4c47;
    --linha: #d5e0db;
    --sombra: 0 8px 24px rgba(14, 59, 46, 0.06);
}

* { box-sizing: border-box; }

body.sem-moldura {
    padding: 0;
}

.acesso {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.acesso .cartao {
    width: min(640px, 100%);
}

.campo-data .calendario-btn {
    position: relative;
    overflow: hidden;
}

.calendario-nativo {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    background: var(--fundo);
    color: var(--texto);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 1.02rem;
    line-height: 1.45;
    padding: 56px 0 0 252px;
}

.pular {
    position: absolute;
    left: 1rem;
    top: -4rem;
    background: #fff;
    color: var(--verde-escuro);
    padding: .5rem 1rem;
    z-index: 10;
}

.pular:focus { top: .5rem; }

.lateral {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 252px;
    z-index: 1030;
    flex-direction: column;
    background: var(--verde-escuro);
    color: #fff;
    border-right: 3px solid #c6a15b;
    overflow: hidden;
}

.marca {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.2;
    padding: 1rem .85rem .85rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.marca-produto {
    display: block;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.por-aion {
    color: #e4d3a1;
    font-size: .78rem;
    font-weight: 600;
}

.marca-acesso {
    margin: 0 0 1rem;
    color: var(--verde-escuro);
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.marca-acesso .por-aion {
    color: var(--dourado);
}

.menu-movel .offcanvas-header {
    justify-content: center;
    position: relative;
}

.menu-movel .offcanvas-title {
    width: 100%;
    margin: 0;
    text-align: center;
    color: #fff;
}

.menu-movel .btn-close {
    position: absolute;
    right: 1rem;
}

.logo-perfil {
    display: block;
    max-height: 72px;
    max-width: 180px;
}

.menu-lateral {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .75rem .65rem 1.5rem;
    overflow: auto;
}

.menu-lateral .grupo {
    margin: .85rem .45rem .25rem;
    color: #e4d3a1;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.menu-lateral a {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: rgba(255, 255, 255, .92);
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    padding: .55rem .7rem;
    border: 1px solid transparent;
}

.menu-lateral a i {
    font-size: 1.15rem;
    width: 1.4rem;
    text-align: center;
}

.menu-lateral .rotulo-menu {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.menu-lateral .legenda {
    font-size: .75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .72);
}

.menu-lateral a:hover,
.menu-lateral a.ativo {
    background: #fff;
    color: var(--verde-escuro);
    border-color: #c6a15b;
}

.menu-lateral a:hover .legenda,
.menu-lateral a.ativo .legenda {
    color: var(--suave);
}

.aviso-pilha {
    position: fixed;
    top: 72px;
    right: 1rem;
    z-index: 1080;
    width: min(420px, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.aviso-pilha:empty {
    display: none;
}

.aviso {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    margin: 0;
    padding: .85rem 1rem;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(14, 59, 46, .16);
    background: #fff;
}

.aviso p {
    margin: 0;
    flex: 1;
}

.aviso i {
    font-size: 1.15rem;
    line-height: 1.3;
}

.aviso-ok {
    border: 1px solid #b7dfc6;
    background: #f3faf6;
    color: #0e5c32;
}

.aviso-erro {
    border: 1px solid #f0c2c2;
    background: #fff6f6;
    color: #8c2f2f;
}

.aviso-fechar {
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    line-height: 1;
}

.alert {
    border: 0;
    border-radius: 14px;
    box-shadow: var(--sombra);
    padding: .9rem 1rem .9rem 2.7rem;
    position: relative;
}

.alert::before {
    font-family: "bootstrap-icons";
    position: absolute;
    left: 1rem;
    top: .95rem;
}

.alert-success {
    background: #f3faf6;
    color: #0e5c32;
}

.alert-success::before { content: "\F26A"; }

.alert-danger {
    background: #fff6f6;
    color: #8c2f2f;
}

.alert-danger::before { content: "\F332"; }

.alert-warning {
    background: #fbf6ea;
    color: #6b4e09;
}

.alert-warning::before { content: "\F333"; }

.alert-info {
    background: #eef4fb;
    color: #1d3f73;
}

.alert-info::before { content: "\F431"; }

.alert-info a {
    color: inherit;
    font-weight: 700;
}

.dialogo {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(14, 59, 46, .48);
}

.dialogo[hidden] {
    display: none !important;
}

.dialogo-painel {
    width: min(440px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 1.35rem 1.4rem 1.2rem;
    box-shadow: 0 22px 60px rgba(14, 59, 46, .28);
}

.dialogo-icone {
    margin: 0 0 .35rem;
    color: var(--verde);
    font-size: 1.7rem;
    line-height: 1;
}

.dialogo-painel p {
    margin-bottom: 0;
    color: var(--suave);
}

.btn-perigo {
    --bs-btn-bg: #8c2f2f;
    --bs-btn-border-color: #8c2f2f;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #6e2222;
    --bs-btn-hover-border-color: #6e2222;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #6e2222;
    --bs-btn-active-border-color: #6e2222;
    --bs-btn-active-color: #fff;
}

.faixa-topo {
    position: fixed;
    top: 0;
    left: 252px;
    right: 0;
    height: 56px;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.15rem;
    background: #fff;
    border-bottom: 1px solid var(--linha);
}

.faixa-topo .modulo {
    display: block;
    color: var(--suave);
    font-size: .78rem;
}

.menu-movel {
    background: var(--verde-escuro);
    color: #fff;
    width: 280px;
}

.topo {
    background: var(--verde-escuro);
    box-shadow: 0 2px 0 #c6a15b;
}

.topo .navbar-brand {
    color: #fff;
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    font-weight: 700;
}

.topo .navbar-brand small {
    color: #e4d3a1;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.topo .nav-link {
    color: rgba(255, 255, 255, .9);
    font-weight: 600;
    border-radius: 999px;
    padding: .45rem .85rem;
}

.topo .nav-link:hover,
.topo .nav-link.ativo {
    color: var(--verde-escuro);
    background: #fff;
}

.btn-primario {
    --bs-btn-bg: var(--verde);
    --bs-btn-border-color: var(--verde);
    --bs-btn-hover-bg: var(--verde-escuro);
    --bs-btn-hover-border-color: var(--verde-escuro);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--verde-escuro);
    --bs-btn-active-border-color: var(--verde-escuro);
}

.btn-contorno {
    --bs-btn-color: var(--verde);
    --bs-btn-border-color: var(--verde);
    --bs-btn-hover-bg: var(--verde);
    --bs-btn-hover-border-color: var(--verde);
    --bs-btn-hover-color: #fff;
}

.pagina h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-bottom: .25rem;
}

.olho {
    color: var(--suave);
    margin-bottom: 1.25rem;
}

.cartao {
    background: #fff;
    border: 1px solid var(--linha);
    border-radius: 8px;
    box-shadow: var(--sombra);
    padding: 1.15rem;
}

.atalho {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.atalho:hover { border-color: var(--verde); }

.atalho .numero {
    font-size: 2rem;
    font-weight: 700;
    color: var(--verde-escuro);
    line-height: 1;
}

.atalho .rotulo {
    color: var(--suave);
    font-size: .92rem;
}

.abas-cesta {
    gap: .35rem;
    border-bottom: 0;
    flex-wrap: wrap;
}

.abas-cesta .nav-link {
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--suave);
    font-weight: 700;
    background: #e7eeeb;
}

.abas-cesta .nav-link.feito {
    background: #e5f4ea;
    color: #0e5c32;
}

.abas-cesta .nav-link.active {
    color: #fff;
    background: var(--verde);
    border-color: var(--verde);
}

.painel-aba {
    background: #fff;
    border: 1px solid var(--linha);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--sombra);
    margin-top: .75rem;
}

.selo {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .15rem .65rem;
    font-size: .78rem;
    font-weight: 700;
}

.selo-elaboracao { background: #e7f0ec; color: var(--verde-escuro); }
.selo-concluida { background: var(--verde); color: #fff; }
.selo-cancelada { background: #f8e6e6; color: #8c2f2f; }
.selo-valida { background: #e5f4ea; color: #0e5c32; }
.selo-auto { background: #f8efd9; color: #7a4e00; }
.selo-manual { background: #f8e6e6; color: #8c2f2f; }
.selo-mantida { background: #e7eef8; color: #1d3f73; }

.kpi {
    border: 1px solid var(--linha);
    border-radius: 14px;
    padding: .9rem 1rem;
    background: #fff;
    height: 100%;
}

.kpi .rotulo {
    font-size: .75rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--suave);
    font-weight: 700;
}

.kpi .valor {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--verde-escuro);
}

.passo-numero {
    display: inline-grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    margin-bottom: 0.35rem;
    border-radius: 50%;
    background: var(--verde);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.recorte-abas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.recorte-abas label {
    border: 1px solid var(--linha);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    background: #fff;
    cursor: pointer;
}

.recorte-abas input {
    margin-right: 0.35rem;
}

.recorte-painel[hidden] {
    display: none !important;
}

.lista-mun {
    max-height: 240px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.25rem 0.75rem;
    padding: 0.5rem;
    border: 1px solid var(--linha);
    border-radius: 12px;
    background: #fff;
}

.lista-mun label {
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    margin: 0;
}

.sugestoes {
    border: 1px solid var(--linha);
    border-radius: 12px;
    padding: 1rem;
    background: #f8fbf9;
}

details.cartao summary,
.cartao details summary {
    cursor: pointer;
    font-weight: 600;
}

.cesta-grade {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.cesta-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--linha);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--sombra);
}

.cesta-card:hover {
    border-color: var(--verde);
}

.cesta-card strong {
    font-size: 1.15rem;
}

.cesta-card p {
    margin: 0;
    color: var(--suave);
}

.cesta-card .meta {
    color: var(--suave);
    font-size: 0.92rem;
}

.cesta-card .acao {
    margin-top: auto;
    color: var(--verde);
    font-weight: 700;
}

.kpi.destaque {
    border-color: var(--verde);
    box-shadow: inset 0 0 0 1px var(--verde);
    background: #f3faf6;
}

.faixa {
    background: #f7f4ea;
    border-radius: 12px;
    padding: .75rem 1rem;
    color: #5c4a16;
    font-size: .95rem;
}

.linha-fora { opacity: .72; }

.moeda {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tabela thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--suave);
    white-space: nowrap;
}

.rodape {
    color: var(--suave);
    font-size: .85rem;
    padding: 1.5rem 0 2rem;
    text-align: center;
}

.rodape-marca {
    color: var(--verde-escuro);
    font-weight: 700;
    text-decoration: none;
}

.rodape-marca:hover {
    color: var(--verde);
}

:focus-visible {
    outline: 3px solid var(--dourado);
    outline-offset: 2px;
}

.origem { border-left: 6px solid var(--verde); }
.origem-PNCP { border-left-color: #145c45; }
.origem-COMPRAS_PUBLICAS { border-left-color: #1d4e89; }
.origem-HISTORICO_PREFEITURA { border-left-color: #8a6a12; }
.origem-TABELA_OFICIAL { border-left-color: #3d6b4f; }
.origem-COTACAO_DIRETA { border-left-color: #6b3f55; }
.origem .numero { font-size: 1.7rem; font-weight: 700; color: var(--verde-escuro); line-height: 1; }
.origem .rotulo { color: var(--suave); font-size: .85rem; }

@media (max-width: 991.98px) {
    body { padding-left: 0; }
    .faixa-topo { left: 0; }
}

@media (max-width: 576px) {
    .pagina h1 { font-size: 1.45rem; }
    .kpi .valor { font-size: 1.25rem; }
}
