/* Botao com icone em circulo colorido + texto ao lado - padrao adotado em
   2026-08-10 (Ruptura Atacado) e extendido pro projeto inteiro a pedido
   do usuario. Fundo branco/contorno claro, a cor fica so' no circulo do
   icone (nao no fundo do botao inteiro). Uso: <a/button class="btn
   btn-icon-pill rounded-pill"><span class="btn-icon-circle
   btn-icon-circle-red"><i class="bi ..."></i></span> Texto</a> - pra
   botao so'-icone (sem texto), usar rounded-circle no lugar de
   rounded-pill e nao colocar texto depois do span. */
.btn-icon-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    height: 42px;
    padding: 0.2rem 1.1rem 0.2rem 0.2rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a1a1a;
    background: #ffffff;
    border: 1px solid #e2e6ef;
    box-shadow: 0 1px 2px rgba(10, 29, 99, 0.06);
    transition: box-shadow .15s ease, transform .15s ease;
}

.btn-icon-pill:hover:not(:disabled) {
    box-shadow: 0 3px 8px rgba(10, 29, 99, 0.14);
    transform: translateY(-1px);
    color: #1a1a1a;
}

.btn-icon-pill:disabled {
    opacity: 0.55;
    box-shadow: none;
}

.btn-icon-pill.rounded-circle {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
}

.btn-icon-pill.rounded-circle .btn-icon-circle {
    margin: 0;
}

.btn-icon-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.btn-icon-circle-red { background: #c0392b; }
.btn-icon-circle-green { background: #1f8a4c; }
.btn-icon-circle-blue { background: #2f5aa8; }
.btn-icon-circle-navy { background: #0a1d63; }
.btn-icon-circle-gray { background: #6c757d; }

.btn-icon-pill-sep {
    width: 1px;
    align-self: stretch;
    background: #dde3f0;
    margin: 0 0.2rem;
}

.st-calc-minimizado-chip {
    display: none;
    align-items: center;
    gap: 0.5rem;
    position: fixed;
    left: 22px;
    bottom: 22px;
    max-width: min(320px, calc(100vw - 44px));
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 999px;
    background: #0a1d63;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 4px 14px rgba(10, 29, 99, 0.35);
    transition: box-shadow .15s ease, transform .15s ease;
    z-index: 1060;
}

.st-calc-minimizado-chip.show {
    display: inline-flex;
}

.st-calc-minimizado-chip:hover {
    box-shadow: 0 6px 18px rgba(10, 29, 99, 0.45);
    transform: translateY(-2px);
    color: #ffffff;
}

.st-calc-minimizado-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Chip da calculadora de COMPRA, mesmo padrao visual do de venda acima
   (pedido do usuario 2026-09-10: minimizar as duas ao mesmo tempo) -
   empilhado por cima pra nao sobrepor quando as duas estao minimizadas
   juntas. */
.compra-calc-minimizado-chip {
    bottom: 78px;
    background: #0b3a8e;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #eaf1fb 0%, #fdf4e9 40%, #fff7eb 100%);
    color: #0f2138;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-x: hidden;
}

.container-fluid > .row {
    align-items: flex-start;
}

.container-fluid > .row > main.col {
    min-width: 0;
    flex: 1 1 0%;
}

@media (min-width: 768px) {
    .container-fluid > .row {
        flex-wrap: nowrap;
    }

    .app-sidebar-column {
        flex: 0 0 225px;
        max-width: 225px;
    }
}

@media (min-width: 768px) {
    .products-page-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: flex-start;
    }

    .products-page-row > .app-sidebar-column,
    .products-page-row > .col-md-2 {
        flex: 0 0 225px !important;
        max-width: 225px !important;
    }

    .products-page-row > main,
    .products-page-row > main.col {
        flex: 1 1 auto !important;
        max-width: calc(100% - 225px) !important;
        min-width: 0 !important;
    }
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    border-radius: 40px;
    overflow: hidden;
    max-width: 1020px;
    width: 100%;
    border: none;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 40px 120px rgba(17, 40, 22, 0.16);
}

.login-banner {
    background: linear-gradient(135deg, #007a3d 0%, #00924f 45%, #ff8c24 100%);
    color: #ffffff;
    min-height: 100%;
    padding: 3rem 2.8rem;
    position: relative;
}

.login-banner::before {
    content: '';
    position: absolute;
    right: -40px;
    top: 0;
    width: 220px;
    height: 100%;
    background: rgba(255, 255, 255, 0.08);
    transform: skewX(-12deg);
}

.login-banner .brand-title {
    font-size: 3.4rem;
    letter-spacing: 0.16em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    font-weight: 900;
}

.login-banner .brand-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.94);
    margin-bottom: 1.5rem;
}

.login-banner .feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-banner .feature-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.15rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.96);
    font-weight: 500;
}

.login-banner .feature-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.9rem;
    color: #fff2d1;
}

.login-card .card-body {
    padding: 3.5rem 3rem;
}

.login-card .form-control {
    border-radius: 16px;
    border: 1px solid #dce6dd;
    padding: 1rem 1.15rem;
    background: #f7faf6;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-card .form-control:focus {
    border-color: #82c384;
    box-shadow: 0 0 0 0.15rem rgba(0, 122, 61, 0.12);
}

.login-card .form-label {
    font-weight: 700;
    color: #153525;
}

.login-card .btn-login {
    border-radius: 16px;
    padding: 1rem 1.2rem;
    background: #ff7c29;
    border: none;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 18px 35px rgba(255, 124, 41, 0.22);
    transition: transform 0.2s ease, background 0.2s ease;
}

.login-card .btn-login:hover {
    background: #e86b1f;
    transform: translateY(-1px);
}

.login-card .form-text {
    color: #5f6d63;
}

.login-card .alert {
    border-radius: 16px;
}

.bg-panel {
    background: #f8faf5;
}

.login-panel-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #102e1b;
}

.login-panel-subtitle {
    color: #4f6258;
    margin-bottom: 1.7rem;
}

.login-card .form-check-label {
    color: #4f6258;
}

.login-card .card-body .badge {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

@media (max-width: 991.98px) {
    .login-banner {
        display: none;
    }
}

.navbar {
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.06);
}

/* Topbar mais compacta - pedido do usuario 2026-08-30, pra sobrar mais
   espaco vertical pro conteudo. Botoes/icones so' encolhidos AQUI
   (escopo #app-topbar), nao mexe no .btn-icon-pill padrao usado em
   "Gerar PDF/Excel" e afins no resto do sistema. */
#app-topbar {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}
#app-topbar .btn-icon-pill {
    height: 34px;
    padding: 0.15rem 0.85rem 0.15rem 0.15rem;
    font-size: 0.8rem;
    gap: 0.45rem;
}
#app-topbar .btn-icon-pill.rounded-circle {
    width: 34px;
    height: 34px;
}
#app-topbar .btn-icon-circle {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
}

.list-group-item {
    border: none;
    padding: 16px;
    font-weight: 600;
    color: #c9dbf5;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease;
    border-radius: 0 24px 24px 0;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidebar-link.active {
    background: #2fa4e7;
    color: #ffffff;
}

.sidebar-link.active .bi {
    color: #ffffff;
}

.list-group-item.active .bi {
    color: #ffffff;
}

.sidebar-header {
    background: linear-gradient(135deg, #07235c, #0b3a8e);
    color: #ffffff;
}


.sidebar-link .bi {
    font-size: 1.1rem;
    margin-right: 0.85rem;
    color: #c9dbf5;
}

.sidebar-link.active .bi,
.sidebar-link:hover .bi {
    color: #ffffff;
}

.sidebar-link.active {
    font-weight: 700;
}

.table thead th {
    background: #eaf1fb;
    color: #07235c;
}

.btn-outline-primary,
.btn-outline-danger,
.btn-outline-secondary {
    border-radius: 14px;
}

.btn-outline-primary {
    border-color: #0b3a8e;
    color: #0b3a8e;
}

.btn-outline-primary:hover {
    background: rgba(11, 58, 142, 0.08);
}

.btn-secondary {
    background: #0b3a8e;
    color: #f8faf8;
    border: 1px solid transparent;
}

.btn-secondary:hover {
    background: #07235c;
    color: #ffffff;
}

/* Botao de acao principal (cor de marca) - substitui btn-success nos CTAs
   que nao sao mensagem/selo de "sucesso" (Novo Usuario, Cadastrar, Salvar,
   Adicionar item, Criar cotacao etc). Alertas de sucesso e selos "Ativo"
   continuam verdes (convencao universal de UI), so' os botoes de acao
   principal viraram azuis - ver skill/memoria do projeto. */
.btn-brand {
    background: #0b3a8e;
    border-color: #0b3a8e;
    color: #ffffff;
}

.btn-brand:hover,
.btn-brand:focus {
    background: #07235c;
    border-color: #07235c;
    color: #ffffff;
}

.icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

/* Bootstrap's bg-primary e' o azul padrao (#0d6efd) - substituido pelo azul
   de marca aqui pra bater com sidebar/cabecalhos, sem mexer na classe
   bg-primary em si (usada por outros elementos fora do dashboard). */
.icon-circle.bg-primary {
    background-color: #0b3a8e !important;
}

.dashboard-card {
    border-radius: 16px;
    min-height: 108px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card .card-body {
    height: 100%;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(11, 58, 142, 0.14) !important;
}

.dashboard-card h6 {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.dashboard-card h4 {
    font-weight: 800;
    color: #12295a;
}

.dashboard-hero {
    background: linear-gradient(135deg, rgba(11, 58, 142, 0.10), rgba(255, 124, 41, 0.06));
    border-left: 6px solid #0b3a8e;
    border-radius: 24px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(11, 58, 142, 0.12);
}

.dashboard-hero-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0b3a8e, #1a56c4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 6px 14px rgba(11, 58, 142, 0.35);
}

.dashboard-hero h2 {
    font-weight: 800;
    color: #12295a;
}

.dashboard-hero p {
    margin-bottom: 0.25rem;
}

.dashboard-hero .btn {
    min-width: 160px;
}

.import-check-card {
    border: 1px solid #d3e0f5;
    border-radius: 14px;
    overflow: hidden;
}

/* Resumo em chips compactos - padrao adotado em 2026-08-16, substitui o
   antigo .resumo-tabela (formato de tabela) em todas as telas de listagem.
   Icone colorido + valor em negrito + rotulo pequeno em maiuscula, dentro
   de um card arredondado. Tambem serve pra envolver busca/filtro (variante
   .resumo-chip-busca, input sem borda propria dentro do chip). */
.resumo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.resumo-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: #f5f7fb;
    border: 1px solid #dde3f0;
    border-radius: 10px;
    padding: 0.4rem 0.8rem;
}

.resumo-chip i {
    font-size: 1.05rem;
}

.resumo-chip .resumo-chip-valor {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.1;
    color: #0a1d63;
}

.resumo-chip .resumo-chip-label {
    display: block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5a6684;
    white-space: nowrap;
}

.resumo-chip-danger i,
.resumo-chip-danger .resumo-chip-valor { color: #8c1d1d; }
.resumo-chip-warning i { color: #7d5600; }
.resumo-chip-info i { color: #0b3a8e; }
.resumo-chip-success i { color: #16653a; }
.resumo-chip-muted i { color: #6c757d; }

.resumo-chip-busca {
    flex: 1 1 260px;
    max-width: 420px;
}

.resumo-chip input.form-control {
    border: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    font-weight: 700;
    color: #0a1d63;
}

.resumo-chip-busca input.form-control {
    font-weight: 400;
    color: #212529;
    width: 100%;
}

.resumo-chip-filtro-num {
    width: 44px;
    text-align: center;
}

@media (max-width: 900px) {
    .resumo-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
}

.import-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.import-summary .summary-chip {
    padding: 0.48rem 0.72rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid transparent;
    line-height: 1.1;
}

.import-summary .summary-ok {
    background: #e9f8ef;
    color: #16653a;
    border-color: #b9e8ca;
}

.import-summary .summary-missing {
    background: #fdecec;
    color: #8c1d1d;
    border-color: #f6c5c5;
}

.import-summary .summary-ready {
    background: #fff6e2;
    color: #7d5600;
    border-color: #f4dfae;
}

.import-summary .summary-imported {
    background: #e8f1ff;
    color: #1f4f93;
    border-color: #bfd5fb;
}

.import-check-header {
    background: linear-gradient(90deg, #07235c, #0b3a8e);
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.import-check-header[data-bs-toggle="collapse"] .bi-chevron-right {
    transition: transform 0.2s ease;
}

.import-check-header[data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-right {
    transform: rotate(90deg);
}

.import-check-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 0.75rem 1rem;
    background: #f4f7fb;
    border-bottom: 1px solid #e0e7f2;
    font-size: 0.92rem;
    color: #223552;
}

.import-check-table thead th {
    background: #0a1d63;
    color: #ffffff;
    border-color: #09164c;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    padding: 0.4rem 1.5rem;
}

.import-check-table tbody td {
    vertical-align: middle;
    border-top: 1px solid #e7edf7;
    font-size: 0.78rem;
    line-height: 1.15;
    padding: 0.15rem 1.5rem;
}

/* Dentro de modal (mais estreito que a tela cheia), o padding largo acima
   empurra colunas pra fora da area visivel, escondendo a ultima coluna
   atras de um scroll horizontal nao obvio - achado real 2026-08-26 no
   modal "Arquivos na pasta" (coluna Acoes sumindo). */
.modal .import-check-table thead th,
.modal .import-check-table tbody td {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.import-check-table .file-path {
    display: inline-block;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.import-check-table .btn-sm {
    padding: 0.08rem 0.4rem;
    font-size: 0.72rem;
    line-height: 1.3;
}

.import-check-table .btn-sm i {
    font-size: 0.72rem;
}

.import-check-table .status-pill {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.import-check-table .status-success {
    background: #e9f8ef;
    color: #16653a;
    border-color: #b9e8ca;
}

.import-check-table .status-danger {
    background: #fdecec;
    color: #8c1d1d;
    border-color: #f6c5c5;
}

.import-check-table .status-warning {
    background: #fff6e2;
    color: #7d5600;
    border-color: #f4dfae;
}

.import-check-table .status-info {
    background: #e8f1ff;
    color: #1f4f93;
    border-color: #bfd5fb;
}

.import-check-table .status-secondary {
    background: #f0f2f5;
    color: #415165;
    border-color: #d7dfe9;
}

.import-check-table .status-text-success {
    color: #16653a;
}

.import-check-table .status-text-danger {
    color: #8c1d1d;
}

.import-check-table .status-text-warning {
    color: #7d5600;
}

.import-check-table .status-text-info {
    color: #1f4f93;
}

.import-check-table .status-text-secondary {
    color: #415165;
}

.status-pill {
    display: inline-block;
    padding: 0.24rem 0.56rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
}

.status-ativa {
    background: #e9f8ef;
    color: #16653a;
    border-color: #b9e8ca;
}

.status-vencendo {
    background: #fff6e2;
    color: #7d5600;
    border-color: #f4dfae;
}

.status-esgotada {
    background: #fdecec;
    color: #8c1d1d;
    border-color: #f6c5c5;
}

.status-vencida,
.status-info {
    background: #e8f1ff;
    color: #1f4f93;
    border-color: #bfd5fb;
}

#subsidy-list-grid .tabulator-header {
    background: #052a78;
    border-bottom: 1px solid #041f59;
}

#subsidy-list-grid .tabulator-header .tabulator-col {
    background: #052a78;
    border-right: 1px solid #214a9d;
}

#subsidy-list-grid .tabulator-header .tabulator-col .tabulator-col-title,
#subsidy-list-grid .tabulator-header .tabulator-col .tabulator-col-title-holder,
#subsidy-list-grid .tabulator-header .tabulator-col .tabulator-arrow {
    color: #ffffff;
    font-weight: 700;
}

#subsidy-list-grid .tabulator-row:nth-child(even) {
    background: #f6f8fb;
}

.import-check-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e0e7f2;
    background: #f8fbff;
    color: #1e3358;
    font-size: 0.9rem;
}

@media (max-width: 767.98px) {
    .import-summary {
        gap: 0.45rem;
    }

    .import-summary .summary-chip {
        font-size: 0.77rem;
    }

    .import-check-meta {
        flex-direction: column;
        gap: 0.45rem;
    }

    .import-check-table .file-path {
        max-width: 190px;
    }
}

.profile-card {
    border-radius: 24px;
    border: 1px solid #dfe9fa;
    background: #ffffff;
}

.profile-card .form-control {
    background: #f6f9fd;
}

.profile-card .form-label {
    color: #07235c;
}

.profile-card .mb-3 strong {
    color: #12295a;
}

.table thead th {
    background: #eaf1fb;
    color: #07235c;
}

.text-primary,
a.text-primary {
    color: #0b3a8e !important;
}

.list-panel {
    border: 1px solid #dfe9e2;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(17, 40, 22, 0.06);
}

.list-panel-header {
    padding: 0.85rem 1rem;
    background: #f1f8f3;
    border-bottom: 1px solid #dfe9e2;
    font-weight: 700;
    color: #134022;
}

.list-panel-body {
    max-height: 62vh;
    overflow: auto;
}

.products-table {
    min-width: 1650px;
    white-space: nowrap;
    margin-bottom: 0;
}

.products-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eaf1fb;
}

#products-list-grid .tabulator-header .tabulator-col {
    min-height: 36px;
}

#products-list-grid .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 6px 8px;
}

#products-list-grid .tabulator-header .tabulator-col input {
    height: 30px;
    padding: 4px 8px;
}

#products-list-grid .tabulator-row .tabulator-cell {
    padding: 6px 8px;
    line-height: 1.2;
}

/* Escondido por padrao em QUALQUER largura de tela (nao so' desktop) -
   sem isso, no mobile (onde o bloco desktop abaixo nem se aplica) o
   painel viraria um <div> comum, sem overflow escondido nem
   position:fixed, aparecendo solto no meio da pagina. No desktop, o
   JS alterna a classe .show (ver bloco @media abaixo) pra exibir. */
.sidebar-flyout-panel {
    display: none;
}

/* Menu lateral (desktop): trilha fixa e estreita (64px, nunca
   encolhe/expande) com um icone por MODULO (Produtos/Vendas/
   Administracao) + Dashboard avulso no topo - clicar num modulo abre
   um painel flutuante ao lado com as paginas daquele grupo (ver
   .sidebar-flyout-panel, app/Layout/sidebar.php e footer.php) -
   pedido do usuario 2026-08-29, depois de rejeitar duas tentativas
   anteriores (hover-expand e clique-fixar numa lista plana). O
   conteudo (main/#app-topbar) reserva so' os 64px da trilha via
   margin-left; o painel fica por cima (overlay), sem
   empurrar/redimensionar nenhuma tabela. */
@media (min-width: 768px) {
    .app-sidebar-column {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 64px;
        overflow-x: hidden;
        overflow-y: auto;
        z-index: 1050;
        box-shadow: 2px 0 14px rgba(0, 0, 0, 0.18);
    }

    .app-sidebar-column .sidebar-link-text {
        display: none;
    }
    .app-sidebar-column .sidebar-header {
        justify-content: center;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .sidebar-rail {
        gap: 0.15rem;
        padding: 0.4rem 0;
    }
    .sidebar-rail-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        width: 100%;
        padding: 0.6rem 0.25rem;
        border: none;
        background: transparent;
        color: #c9dbf5;
        text-decoration: none;
        cursor: pointer;
    }
    .sidebar-rail-item .bi {
        font-size: 1.2rem;
    }
    .sidebar-rail-label {
        font-size: 0.62rem;
        text-align: center;
        line-height: 1.1;
        white-space: normal;
    }
    .sidebar-rail-item:hover,
    .sidebar-rail-item.panel-open {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
    }
    .sidebar-rail-item.active {
        background: #2fa4e7;
        color: #ffffff;
    }

    /* Painel flutuante por modulo - escondido por padrao (.show via
       JS), lista as paginas do grupo reaproveitando .sidebar-link. */
    .sidebar-flyout-panel {
        display: none;
        position: fixed;
        top: 0;
        left: 64px;
        width: 240px;
        height: 100vh;
        overflow-y: auto;
        background: linear-gradient(180deg, #0b3a8e, #07235c);
        z-index: 1049;
        box-shadow: 2px 0 14px rgba(0, 0, 0, 0.18);
    }
    .sidebar-flyout-panel.show {
        display: block;
    }
    .sidebar-flyout-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
        color: #ffffff;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
    .sidebar-flyout-panel .sidebar-link-text {
        display: inline;
    }
    .sidebar-flyout-panel .sidebar-link {
        white-space: nowrap;
    }

    .container-fluid > .row > main.col,
    .products-page-row > main.col {
        margin-left: 64px;
    }

    /* Barra superior (Gestao Comercial, "Ola/Ultima atualizacao/
       Arquivos/Meu perfil") e' fora do container-fluid > row, largura
       cheia - precisa do mesmo respiro que o main, senao o menu fixo
       cobria o comeco do texto "Gestao Comercial" (achado real
       2026-08-29, nome do projeto atualizado 2026-09-10). */
    #app-topbar {
        margin-left: 64px;
    }

    /* Abas das telas visitadas recentemente - mesmo respiro de
       margin-left que o topbar/main, fica logo abaixo do topbar em
       fluxo normal (nao e' fixa verticalmente). */
    .page-tabs-bar {
        margin-left: 64px;
        margin-bottom: 0.6rem;
        overflow-x: auto;
        white-space: nowrap;
        background: #ffffff;
        border-bottom: 1px solid #e3e8f2;
        padding: 0 0.5rem;
    }
    .page-tabs-bar:empty {
        display: none;
    }
    .page-tab {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        padding: 0.2rem 0.4rem 0.2rem 0.6rem;
        margin: 0.15rem 0.2rem 0.15rem 0;
        border-radius: 999px;
        background: #eef2fa;
        color: #354265;
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 600;
        border: 1px solid transparent;
        flex: 0 0 auto;
    }
    .page-tab:hover {
        background: #e2e9f8;
        color: #12295a;
    }
    .page-tab.active {
        background: #0b3a8e;
        color: #ffffff;
        border-color: #0b3a8e;
    }
    .page-tab-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: none;
        background: transparent;
        color: inherit;
        opacity: 0.6;
        font-size: 0.7rem;
        line-height: 1;
        padding: 0;
    }
    .page-tab-close:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.12);
    }

    .products-page-row > main.col {
        max-width: calc(100% - 64px) !important;
    }

    .sidebar-header h4 {
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    .app-sidebar-column {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        max-width: 82vw;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
    }

    .app-sidebar-column.show {
        transform: translateX(0);
    }

    .app-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(9, 22, 13, 0.45);
        z-index: 1040;
    }

    .app-sidebar-backdrop.show {
        display: block;
    }

    .navbar .navbar-brand {
        font-size: 1.15rem;
    }

    main.col,
    main.col.p-4 {
        padding: 1rem !important;
    }
}

/* Barra de filtros do modulo "Vendas (SaveWeb)" - compartilhada entre
   bi_vendas.php e bi_vendas_detalhe.php (ver app/Views/partials/
   saveweb_vendas_filtros.php) - pedido do usuario 2026-09-03 pra nao
   duplicar o mesmo CSS/HTML em cada tela. Cabecalho escuro + chips de
   periodo pre-definido (Hoje/Mes atual/Mes anterior) + grid responsivo
   com icone por campo - pedido original do usuario 2026-09-02:
   "reformule ... mais estetica e dinamica, como um dashboard de vendas".
   Fixa no topo ao rolar (sticky) - pedido 2026-09-03 ("quero esse rotulo
   fixo... e funcional"), pra nao precisar voltar ao topo pra trocar
   filtro com a lista/graficos abertos. #app-topbar (Layout/header.php)
   NAO e' sticky, entao some ao rolar e esse card assume o topo sozinho.
   z-index abaixo do menu mobile (.app-sidebar-column/.sidebar-flyout-
   panel, 1040+) pra continuar coberto por eles quando abertos. */
.saveweb-vendas-filtros {
    border: 1px solid #bfd5fb;
    border-radius: 0.5rem;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.saveweb-vendas-filtros .card-header {
    background: linear-gradient(90deg, #08144a, #0a1d63);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
}
.saveweb-vendas-periodo-presets {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.saveweb-vendas-preset {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #dbe6ff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}
.saveweb-vendas-preset:hover {
    background: #fff;
    color: #0a1d63;
}
/* Preset ativo (De/Ate' atual bate com Hoje/Mes atual/Mes anterior) -
   pedido do usuario 2026-09-02 ("destaque qual filtro esta
   selecionado"). Cor de destaque (nao branco, pra distinguir de hover) +
   mantem destacado mesmo sem mouse em cima. */
.saveweb-vendas-preset.ativo {
    background: #ffb020;
    border-color: #ffb020;
    color: #1a1300;
}
.saveweb-vendas-preset.ativo:hover {
    background: #ffb020;
    color: #1a1300;
}
.saveweb-vendas-filtros .card-body {
    padding: 1rem 1.1rem;
    background: #f7faff;
}
.saveweb-vendas-filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.9rem 1rem;
    align-items: end;
}
.saveweb-vendas-campo label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #4a5a80;
    margin-bottom: 0.3rem;
}
.saveweb-vendas-campo label .bi {
    color: #0b74e5;
}
.saveweb-vendas-campo-acao {
    display: flex;
}
.saveweb-vendas-campo-acao .btn {
    width: 100%;
    font-weight: 600;
}
