/* ===========================================================================
   GM ERP - tema visual (sem build; só CSS sobre o Bootstrap 5.3)
   - Paleta alinhada ao logo (azuis #0F3D63 / #1C5FA8, accent #F28C28)
   - Tipografia Inter; layout sidebar + topbar; modo escuro (data-bs-theme)
   =========================================================================== */

:root {
    /* Paleta principal */
    --blue-primary:   #0F3D63;
    --blue-secondary: #1C5FA8;
    --blue-light:     #4F8FD8;
    --white:          #FFFFFF;
    --bg-light:       #F5F7FA;

    /* Tons de cinza */
    --gray-900: #2B2F36;
    --gray-800: #3B3F46;
    --gray-700: #555B65;
    --gray-500: #8C939F;
    --gray-300: #D9DEE6;
    --gray-200: #E8EBEF;
    --gray-100: #F4F6F8;

    /* Destaque (uso restrito: CTA, ativo, badges, gráficos) */
    --accent:       #F28C28;
    --accent-hover: #DD7A18;
    --accent-light: #FFD7AE;

    /* Estados do sistema */
    --success: #34A853;
    --info:    #2D9CDB;
    --warning: #F4B400;
    --error:   #D93025;

    /* Sequência sugerida para gráficos */
    --chart-1: var(--blue-primary);
    --chart-2: var(--blue-secondary);
    --chart-3: var(--blue-light);
    --chart-4: var(--accent);
    --chart-5: var(--success);
    --chart-6: var(--gray-500);

    /* Aliases legados (PDF / JS) */
    --brand:     var(--blue-primary);
    --brand-600: var(--blue-secondary);
    --brand-700: #0A2944;

    /* Bootstrap - tokens dirigidos por CSS var */
    --bs-primary:       var(--blue-primary);
    --bs-primary-rgb:   15, 61, 99;
    --bs-secondary:     var(--gray-500);
    --bs-secondary-rgb: 140, 147, 159;
    --bs-success:       var(--success);
    --bs-success-rgb:   52, 168, 83;
    --bs-info:          var(--info);
    --bs-info-rgb:      45, 156, 219;
    --bs-warning:       var(--warning);
    --bs-warning-rgb:   244, 180, 0;
    --bs-danger:        var(--error);
    --bs-danger-rgb:    217, 48, 37;

    --bs-link-color:       var(--blue-secondary);
    --bs-link-hover-color: var(--blue-light);

    --bs-body-font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-bg:          var(--bg-light);
    --bs-body-color:       var(--gray-700);
    --bs-emphasis-color:   var(--gray-900);
    --bs-secondary-color:  #6B7280;
    --bs-border-color:     var(--gray-200);
    --bs-border-radius:    0.6rem;
    --bs-border-radius-lg: 0.8rem;

    /* Superfícies do app (dashboard) */
    --surface:        var(--white);
    --surface-border: var(--gray-200);

    /* Sidebar */
    --sidebar-bg:         var(--blue-primary);
    --sidebar-fg:         #D6E5F5;
    --sidebar-fg-muted:   rgba(214, 229, 245, .55);
    --sidebar-hover-bg:   var(--blue-secondary);
    --sidebar-active-bg:  var(--accent);

    /* Tabelas */
    --table-head-bg:     var(--gray-100);
    --table-stripe-even: #FBFCFD;
    --table-hover-bg:    #EEF5FC;
    --table-selected-bg: #DCEBFA;

    --app-sidebar-w: 272px;
}

[data-bs-theme="dark"] {
    --bs-body-bg:         #101820;
    --bs-body-color:      #F5F7FA;
    --bs-emphasis-color:  #F5F7FA;
    --bs-secondary-color: #8C939F;
    --bs-border-color:    #27384B;

    --surface:        #162433;
    --surface-border: #27384B;

    --bs-secondary-bg: #1a2d42;
    --bs-tertiary-bg:  #131f2e;

    --bs-primary-rgb:      79, 143, 216;
    --bs-link-color:       var(--blue-light);
    --bs-link-hover-color: #7FB0E8;

    --sidebar-bg:       #0A2944;
    --sidebar-fg:       #D6E5F5;
    --sidebar-fg-muted: rgba(214, 229, 245, .45);

    --table-head-bg:     #1a2d42;
    --table-stripe-even: #131f2e;
    --table-hover-bg:    #1e3348;
    --table-selected-bg: #243a52;
}

body {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* .bg-light e .text-bg-light do Bootstrap não acompanham o tema escuro;
   mapeia para superfícies neutras do tema para manter o texto legível */
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bs-tertiary-bg) !important;
}
[data-bs-theme="dark"] .text-bg-light {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
}
[data-bs-theme="dark"] .text-bg-light.text-dark {
    color: var(--bs-body-color) !important;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--gray-900);
    font-weight: 700;
}

[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .h1, [data-bs-theme="dark"] .h2,
[data-bs-theme="dark"] .h3, [data-bs-theme="dark"] .h4,
[data-bs-theme="dark"] .h5, [data-bs-theme="dark"] .h6 {
    color: var(--bs-emphasis-color);
}

/* Títulos dentro de superfícies coloridas (badges, cards sólidos legados) */
[class*="text-bg-"] .h1, [class*="text-bg-"] .h2,
[class*="text-bg-"] .h3, [class*="text-bg-"] .h4,
[class*="text-bg-"] .h5, [class*="text-bg-"] .h6,
[class*="text-bg-"] .display-1, [class*="text-bg-"] .display-2,
[class*="text-bg-"] .display-3, [class*="text-bg-"] .display-4,
[class*="text-bg-"] .display-5, [class*="text-bg-"] .display-6 {
    color: inherit;
}

/* Botões (variantes do BS são valores compilados) */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--blue-primary);
    --bs-btn-border-color: var(--blue-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--blue-secondary);
    --bs-btn-hover-border-color: var(--blue-secondary);
    --bs-btn-active-bg: var(--brand-700);
    --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-disabled-bg: var(--blue-primary);
    --bs-btn-disabled-border-color: var(--blue-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--blue-primary);
    --bs-btn-bg: var(--white);
    --bs-btn-border-color: var(--blue-primary);
    --bs-btn-hover-color: var(--blue-primary);
    --bs-btn-hover-bg: var(--white);
    --bs-btn-hover-border-color: var(--blue-primary);
    --bs-btn-active-bg: var(--white);
    --bs-btn-active-border-color: var(--blue-primary);
    --bs-btn-active-color: var(--blue-primary);
}
.btn-cta {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-hover);
}

/* ---------------------------------------------------------------------------
   Layout: sidebar + main
   --------------------------------------------------------------------------- */
.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    inset: 0 auto 0 0;
    width: var(--app-sidebar-w);
    background-color: #0F3D63;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    z-index: 1045;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform .2s ease, width .2s ease;
}
[data-bs-theme="dark"] .app-sidebar {
    background-color: #0A2944;
}

.app-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .85rem 1rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.app-brand:hover { color: #fff; }
.app-brand-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: .45rem .65rem;
    background: var(--white);
    border-radius: var(--bs-border-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .14);
    transition: background .12s, box-shadow .12s;
}
.app-brand:hover .app-brand-logo-wrap {
    background: var(--bg-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.app-brand-logo {
    height: 44px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}
.app-brand .logo-badge {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: .5rem;
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 130%);
    color: #fff;
    font-size: 1rem;
}

.side-nav { padding: .5rem 0 1.5rem; flex: 1 1 auto; }

.side-section {
    font-size: .67rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--sidebar-fg-muted);
    padding: 1rem 1.25rem .35rem;
    font-weight: 600;
}

.side-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .5rem 1.25rem;
    color: var(--sidebar-fg);
    text-decoration: none;
    font-size: .9rem;
    border-left: 3px solid transparent;
    transition: background .12s, color .12s;
}
.side-link:hover { background: var(--sidebar-hover-bg); color: #fff; }
.side-link.active {
    background: var(--sidebar-active-bg);
    color: #fff;
    border-left-color: var(--accent);
    font-weight: 600;
}
.side-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; opacity: .92; }

/* Favoritos do menu -------------------------------------------------------- */
/* O link ocupa a linha e a estrela fica ao lado, fora da âncora. */
.side-item { display: flex; align-items: stretch; }
/* A estrela ao lado já faz o papel do respiro à direita: sem o padding-right
   do link, o rótulo ganha ~1rem antes de precisar truncar. */
.side-item .side-link { flex: 1 1 auto; min-width: 0; padding-right: .25rem; }
/* O rótulo trunca em vez de passar por baixo da estrela; o min-width:0 é o
   que permite o item flex encolher abaixo do conteúdo. */
.side-link-texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-fav {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.1rem;
    padding: 0;
    background: none;
    border: 0;
    color: var(--sidebar-fg-muted);
    font-size: .85rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s, color .12s;
}
.side-item:hover .side-fav,
.side-fav:focus-visible,
.side-fav.is-on { opacity: 1; }
.side-fav:hover { color: #fff; }
.side-fav.is-on { color: var(--accent); }

/* Modo enxuto: só favoritos (e Início). O bloco completo continua no DOM,
   mas contém APENAS itens já autorizados - o filtro é feito no servidor. */
.side-nav.tem-favoritos #menu-completo { display: none; }
.side-nav.tem-favoritos.mostrar-tudo #menu-completo { display: block; }

.side-ver-tudo {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    margin-top: .5rem;
    padding: .55rem 1.25rem;
    background: none;
    border: 0;
    border-top: 1px solid var(--sidebar-hover-bg);
    color: var(--sidebar-fg-muted);
    font-size: .82rem;
    cursor: pointer;
}
.side-ver-tudo:hover { background: var(--sidebar-hover-bg); color: #fff; }
.side-nav.mostrar-tudo .side-ver-tudo i { transform: rotate(180deg); }

.app-main {
    margin-left: var(--app-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .2s ease;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: 56px;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 0 1.25rem;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--surface-border);
}

.app-crumb { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.app-crumb a { color: var(--bs-secondary-color); text-decoration: none; }
.app-crumb a:hover { color: var(--bs-link-color); }
.app-crumb .bi-chevron-right { font-size: .65rem; color: var(--bs-secondary-color); }
.app-crumb .crumb-current { font-weight: 600; }

.topbar-icon {
    color: var(--bs-secondary-color);
    border: 0;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    padding: .35rem .5rem;
    border-radius: .5rem;
}
.topbar-icon:hover { background: var(--bs-secondary-bg); color: var(--bs-body-color); }

.app-content { padding: 1.5rem; flex: 1 1 auto; }

.app-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 1044;
}
.app-backdrop.is-visible { display: block; }

/* Mobile: sidebar vira gaveta */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.is-open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
    .app-main { margin-left: 0; }
    body.sidebar-open { overflow: hidden; }
}
@media (min-width: 992px) {
    /* O backdrop é da gaveta mobile; o hambúrguer, no desktop, recolhe a
       sidebar para o modo "rail" (só ícones). */
    .app-backdrop { display: none !important; }
}

/* Modo rail: sidebar encolhida a uma coluna de ícones (só desktop).
   A classe fica no <html>, aplicada antes do primeiro paint em base.html.
   Encolher a variável já reposiciona a sidebar e o conteúdo de uma vez. */
@media (min-width: 992px) {
    html.sidebar-rail { --app-sidebar-w: 64px; }

    /* Rótulos, seções e estrelas de favorito não cabem: só o ícone fica.
       O nome do item vira tooltip (instanciada em base.html). */
    html.sidebar-rail .side-link-texto,
    html.sidebar-rail .side-section,
    html.sidebar-rail .side-fav,
    html.sidebar-rail .side-ver-tudo,
    html.sidebar-rail .side-distribuidor span { display: none; }

    html.sidebar-rail .side-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        border-left-width: 0;
        border-right: 3px solid transparent;
    }
    html.sidebar-rail .side-link.active { border-right-color: var(--accent); }
    html.sidebar-rail .side-link i { width: auto; font-size: 1.15rem; }

    /* Sem as seções e sem o botão "Ver tudo", quem usa favoritos ficaria preso
       a eles: no rail o menu completo aparece sempre, como lista de ícones. */
    html.sidebar-rail .side-nav.tem-favoritos #menu-completo { display: block; }

    html.sidebar-rail .app-brand { padding: .85rem .5rem; }
    html.sidebar-rail .app-brand-logo-wrap { padding: .3rem; }
    html.sidebar-rail .app-brand-logo { height: 28px; }

    html.sidebar-rail .side-distribuidor { padding: .6rem .5rem .85rem; }
}

/* ---------------------------------------------------------------------------
   Polimento de componentes
   --------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--surface-border);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.card.shadow-sm { box-shadow: 0 1px 3px rgba(16, 24, 40, .07) !important; }

.table > :not(caption) > * > * { padding-block: .6rem; }
.table thead th {
    font-size: .8rem;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    background: var(--table-head-bg);
    border-bottom-color: var(--surface-border);
}
.table.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: var(--surface); }
.table.table-striped > tbody > tr:nth-of-type(even) > * { background-color: var(--table-stripe-even); }
.table:not(.table-cards) > tbody > tr:nth-of-type(even) > * { background-color: var(--table-stripe-even); }
/* Coluna de ações fica de fora: evita conflito com dropdown (ex.: Operar em Ferramentas). */
.table-hover > tbody > tr:hover > *:not(.td-actions) { background-color: var(--table-hover-bg) !important; }
.table > tbody > tr.table-active > *:not(.td-actions),
.table > tbody > tr.table-active:hover > *:not(.td-actions) { background-color: var(--table-selected-bg) !important; }

/* Dropdowns dentro de tabelas - hover legível e menu fora do overflow horizontal */
.table-responsive .td-actions .btn-group { position: static; }
.table-responsive .td-actions .dropdown-menu { z-index: 1050; }
.dropdown-menu .dropdown-item .bi { margin-right: .45rem; opacity: .9; }
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus-visible {
    background-color: var(--table-hover-bg);
    color: var(--bs-emphasis-color);
}
.dropdown-menu .dropdown-item.text-danger:hover,
.dropdown-menu .dropdown-item.text-danger:focus-visible {
    color: var(--bs-danger-text-emphasis);
    background-color: var(--bs-danger-bg-subtle);
}

/* Células com texto longo (e-mail, URLs) - não estouram a largura da tabela */
.table td.td-break,
.table th.td-break {
    max-width: 14rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Topbar / toasts (evita style= inline sob CSP estrita) */
.crumb-org-name { max-width: 14rem; }
.toast-container-app { bottom: 3.5rem; }

/* Barra de carregamento global do HTMX */
#top-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    z-index: 2000;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    opacity: 0;
    transition: opacity .2s;
}
#top-progress.loading {
    opacity: 1;
    width: 100%;
    animation: gm-progress 1.4s ease-in-out infinite;
}
@keyframes gm-progress {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* HTMX indicators (mantido) */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline; }

[x-cloak] { display: none !important; }

/* Scrollbar discreta */
.app-sidebar::-webkit-scrollbar { width: 8px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 8px; }

/* ---------------------------------------------------------------------------
   Tabelas que viram cartões no mobile (.table-cards)
   - No desktop, tabela normal.
   - Abaixo de 768px, cada <tr> vira um cartão e cada <td> mostra o rótulo
     da coluna via atributo data-label="...".
   - Células de ação devem usar class="td-actions" para ocupar a largura toda.
   --------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .table-cards thead { display: none; }

    .table-cards,
    .table-cards tbody,
    .table-cards tr,
    .table-cards td { display: block; width: 100%; }

    .table-cards tr {
        background: var(--surface);
        border: 1px solid var(--surface-border);
        border-radius: var(--bs-border-radius);
        box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
        margin-bottom: .75rem;
        padding: .35rem .9rem;
    }
    .table-cards.table-hover > tbody > tr:hover > * { background: transparent; }

    .table-cards td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: .45rem 0 !important;
        border: 0;
        border-bottom: 1px solid var(--surface-border);
        text-align: right;
        white-space: normal;
    }
    .table-cards tr > td:last-child { border-bottom: 0; }

    .table-cards td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        text-align: left;
        font-size: .72rem;
        font-weight: 600;
        letter-spacing: .02em;
        text-transform: uppercase;
        color: var(--bs-secondary-color);
    }
    /* Células sem rótulo (ou de ação) não recebem o pseudo-rótulo */
    .table-cards td:not([data-label])::before { content: ""; }

    .table-cards td.td-break {
        flex-direction: column;
        align-items: flex-start;
        gap: .25rem;
        text-align: left;
        max-width: none;
    }

    /* Barras de progresso ocupam o espaço restante (não espremem ao lado do rótulo) */
    .table-cards td .progress { flex: 1 1 auto; min-width: 8rem; }

    /* Linha de ações: botões ocupam a largura toda, alinhados à direita */
    .table-cards td.td-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: .4rem;
        padding-top: .6rem !important;
    }
    .table-cards td.td-actions .btn { flex: 0 0 auto; }

    /* Estado vazio (colspan) volta a ocupar a linha inteira, centralizado */
    .table-cards td[colspan] { text-align: center; }
    .table-cards td[colspan]::before { content: ""; }

    /* Célula de edição inline: empilha os campos do formulário verticalmente */
    .table-cards td.td-form {
        display: block;
        text-align: left;
        padding-top: .55rem !important;
    }
    .table-cards td.td-form::before {
        content: attr(data-label);
        display: block;
        margin-bottom: .35rem;
        text-align: left;
    }
    .table-cards td.td-form form { flex-wrap: wrap; gap: .5rem !important; }
    .table-cards td.td-form form > * { flex: 1 1 7rem; }
    .table-cards td.td-form .row { margin: 0; }
    .table-cards td.td-form .form-control,
    .table-cards td.td-form .form-select { max-width: none !important; }

    /* Rodapé de total (tfoot) vira um cartão-resumo destacado */
    .table-cards tfoot { display: block; }
    .table-cards tfoot tr {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        background: var(--bs-tertiary-bg);
    }
    .table-cards tfoot th { display: block; border: 0; padding: .2rem 0; }
    .table-cards tfoot th:empty { display: none; }
}

/* ---------------------------------------------------------------------------
   Alvos de toque mais confortáveis no mobile (>= ~40px)
   --------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    /* Botões pequenos ganham área tocável; ícones ainda cabem lado a lado */
    .btn-sm {
        --bs-btn-padding-y: .45rem;
        --bs-btn-padding-x: .7rem;
        min-height: 40px;
    }
    /* Ícones da topbar (menu, tema, perfil) */
    .topbar-icon {
        min-width: 42px;
        min-height: 42px;
        padding: .5rem .6rem;
    }
    /* Links do menu lateral com mais respiro vertical */
    .side-link { padding-block: .7rem; }
    /* Sem hover no toque: a estrela de favorito fica sempre visível e maior */
    .side-fav, .home-shortcut-fav { opacity: 1; }
    .side-fav { width: 2.75rem; }
    /* Itens de dropdown (ações de ferramentas, perfil) */
    .dropdown-menu .dropdown-item { padding-block: .55rem; }
    /* Campos de formulário não encolhem abaixo do confortável */
    .form-control-sm, .form-select-sm { min-height: 38px; }
}

/* ---------------------------------------------------------------------------
   Dashboard - KPI cards
   --------------------------------------------------------------------------- */
/* Mantém o "primário subtil" alinhado à marca (tema claro e escuro) */
:root {
    --bs-primary-bg-subtle: #DCEBFA;
    --bs-primary-text-emphasis: var(--blue-primary);
    --bs-success-bg-subtle: #E6F4EA;
    --bs-success-text-emphasis: #1E7E34;
    --bs-info-bg-subtle: #E3F2FB;
    --bs-info-text-emphasis: #1A7AB8;
    --bs-warning-bg-subtle: #FEF7E0;
    --bs-warning-text-emphasis: #9A7200;
    --bs-danger-bg-subtle: #FCEAE8;
    --bs-danger-text-emphasis: #A52714;
}
[data-bs-theme="dark"] {
    --bs-primary-bg-subtle: #1a3550;
    --bs-primary-text-emphasis: var(--blue-light);
    --bs-success-bg-subtle: #1a3324;
    --bs-success-text-emphasis: #6DD58C;
    --bs-info-bg-subtle: #1a2f3f;
    --bs-info-text-emphasis: #6EC4F0;
    --bs-warning-bg-subtle: #3a3018;
    --bs-warning-text-emphasis: #F5D060;
    --bs-danger-bg-subtle: #3a1f1c;
    --bs-danger-text-emphasis: #F08078;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    height: 100%;
    padding: 1rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    text-decoration: none;
    color: inherit;
    transition: transform .12s, box-shadow .12s;
}
a.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 24, 40, .12); color: inherit; }
.kpi-card.is-static { pointer-events: none; }

.kpi-icon {
    flex: 0 0 46px;
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: .7rem;
    font-size: 1.3rem;
}
.kpi-value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: .82rem; color: var(--bs-secondary-color); }
.kpi-sub { font-size: .72rem; margin-top: .1rem; }

.kpi-primary   .kpi-icon { background: var(--bs-primary-bg-subtle);   color: var(--bs-primary-text-emphasis); }
.kpi-success   .kpi-icon { background: var(--bs-success-bg-subtle);   color: var(--bs-success-text-emphasis); }
.kpi-danger    .kpi-icon { background: var(--bs-danger-bg-subtle);    color: var(--bs-danger-text-emphasis); }
.kpi-info      .kpi-icon { background: var(--bs-info-bg-subtle);      color: var(--bs-info-text-emphasis); }
.kpi-warning   .kpi-icon { background: var(--bs-warning-bg-subtle);   color: var(--bs-warning-text-emphasis); }
.kpi-secondary .kpi-icon { background: var(--bs-secondary-bg-subtle); color: var(--bs-secondary-text-emphasis); }
.kpi-dark      .kpi-icon { background: var(--bs-tertiary-bg);         color: var(--bs-emphasis-color); }

/* Cards de métrica (orçamento, financeiro, RDO…) - fundo claro, legível */
.stat-card {
    border: 1px solid var(--surface-border);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.stat-card-value {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0;
    color: var(--bs-emphasis-color);
    white-space: nowrap;
}
/* clamp mais baixo: 5 cards na saúde financeira não quebram o "R$ valor" */
.stat-card-value-lg { font-size: clamp(1.05rem, 1.6vw, 1.65rem); }
/* Botão de ajuda inline (popover) - ex.: provisão de custo */
.btn-ajuda-conceito {
    --ajuda-size: 1.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ajuda-size);
    height: var(--ajuda-size);
    padding: 0;
    margin-left: .2rem;
    vertical-align: middle;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--blue-secondary);
    font-size: .95rem;
    line-height: 1;
    cursor: help;
    opacity: .8;
    transition: opacity .15s ease, transform .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-ajuda-conceito:hover,
.btn-ajuda-conceito:focus-visible {
    opacity: 1;
    color: var(--accent);
    transform: translateY(-1px);
    outline: none;
    box-shadow: 0 2px 6px rgba(15, 61, 99, .18);
}
[data-bs-theme="dark"] .btn-ajuda-conceito {
    color: var(--blue-light);
}
.popover {
    max-width: min(22rem, 92vw);
    font-size: .875rem;
    line-height: 1.45;
}
.kpi-card-col .btn-ajuda-conceito {
    pointer-events: auto;
}
.kpi-card-wrap {
    position: relative;
    height: 100%;
}
.kpi-card-wrap.has-ajuda-float .kpi-card {
    padding-right: 2.15rem;
}
.kpi-card-body {
    flex: 1;
    min-width: 0;
}
.kpi-ajuda-float {
    position: absolute;
    top: .55rem;
    right: .65rem;
    z-index: 2;
    line-height: 1;
}
.evm-dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    margin-right: .2rem;
    vertical-align: middle;
}
.evm-ok { background: #12B76A; }
.evm-custo { background: #F79009; }
.evm-prazo { background: #2E90FA; }
.evm-critico { background: #F04438; }

.card-header .btn-ajuda-conceito,
.stat-card-label .btn-ajuda-conceito,
h2 .btn-ajuda-conceito,
h5 .btn-ajuda-conceito {
    vertical-align: middle;
}

.stat-card-label {
    font-size: .82rem;
    color: var(--bs-secondary-color);
    margin-top: .2rem;
}
.stat-card-primary  { border-top: 3px solid var(--blue-primary); }
.stat-card-primary  .stat-card-value { color: var(--blue-primary); }
.stat-card-success  { border-top: 3px solid var(--success); }
.stat-card-success  .stat-card-value { color: #1E7E34; }
.stat-card-info     { border-top: 3px solid var(--info); }
.stat-card-info     .stat-card-value { color: #1A7AB8; }
.stat-card-warning  { border-top: 3px solid var(--warning); }
.stat-card-warning  .stat-card-value { color: #9A7200; }
.stat-card-danger   { border-top: 3px solid var(--error); }
.stat-card-danger   .stat-card-value { color: var(--error); }
.stat-card-secondary { border-top: 3px solid var(--gray-500); }
.stat-card-secondary .stat-card-value { color: var(--gray-700); }
.stat-card-muted {
    border-top: 3px solid var(--gray-300);
    background: var(--gray-100);
}
[data-bs-theme="dark"] .stat-card-muted { background: var(--bs-tertiary-bg); }
[data-bs-theme="dark"] .stat-card-success  .stat-card-value { color: #6DD58C; }
[data-bs-theme="dark"] .stat-card-info     .stat-card-value { color: #6EC4F0; }
[data-bs-theme="dark"] .stat-card-warning  .stat-card-value { color: #F5D060; }
[data-bs-theme="dark"] .stat-card-danger   .stat-card-value { color: #F08078; }
[data-bs-theme="dark"] .stat-card-primary  .stat-card-value { color: var(--blue-light); }

/* Lista de pendências */
.pendencia-item { display: flex; align-items: center; gap: .65rem; }
.pendencia-item .bi { width: 1.3rem; text-align: center; }
.chart-box { position: relative; height: 280px; }

/* Tela inicial */
.home-hero { border: 1px solid var(--surface-border); }

/* Login (páginas públicas: entrar, 2FA etc.) */
.login-layout {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    justify-items: center;
    align-items: center;
    padding-inline: 1rem;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-light);
}
.login-layout-stack {
    grid-row: 2;
    width: min(100%, 400px);
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.login-shell {
    width: 100%;
}
.login-card {
    border: 1px solid var(--surface-border);
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    background: var(--white);
}
.login-card-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.5rem 1.15rem;
    background: var(--blue-primary);
    border-bottom: 3px solid var(--accent);
}
.login-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: .55rem .85rem;
    background: var(--white);
    border-radius: var(--bs-border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.login-logo {
    max-height: 50px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.login-card-body {
    padding: 1.25rem 1.5rem 1.4rem;
}
.login-card-title {
    margin: 0 0 .25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    text-align: center;
}
.login-card-subtitle {
    margin: 0 0 1rem;
    font-size: .9rem;
    color: #6B7280;
    text-align: center;
}
.login-form .form-label {
    font-weight: 600;
    color: var(--gray-900);
    font-size: .875rem;
}
.login-form .form-control {
    border-color: var(--gray-300);
    padding-block: .5rem;
}
.login-form .form-control:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 .2rem rgba(15, 61, 99, .12);
}

/* Campo de senha com botão de mostrar/ocultar (olhinho) */
.pw-field {
    position: relative;
    display: block;
}
.pw-field .pw-input {
    /* Espaço à direita para o texto não passar por baixo do olho */
    padding-right: 2.75rem;
}
.pw-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
    transition: color .12s ease;
}
.pw-toggle:hover,
.pw-toggle:focus-visible {
    color: var(--gray-900);
    outline: none;
}
.pw-toggle .bi { font-size: 1.05rem; line-height: 1; }
[data-bs-theme="dark"] .pw-toggle { color: var(--gray-500); }
[data-bs-theme="dark"] .pw-toggle:hover,
[data-bs-theme="dark"] .pw-toggle:focus-visible { color: var(--gray-100); }

/* Campo OTP (2FA) - 6 dígitos em caixas separadas */
.otp-hint { margin-top: -.25rem; }
.otp-boxes {
    display: flex;
    gap: .45rem;
    justify-content: center;
}
.otp-boxes.is-invalid .otp-box {
    border-color: var(--error);
}
.otp-box {
    width: 2.75rem;
    height: 3.25rem;
    padding: 0;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    border: 1px solid var(--gray-300);
    border-radius: var(--bs-border-radius);
    background: var(--white);
    color: var(--gray-900);
    caret-color: var(--blue-secondary);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.otp-box:focus {
    border-color: var(--blue-secondary);
    box-shadow: 0 0 0 .2rem rgba(28, 95, 168, .18);
    outline: none;
}
.otp-box.filled {
    border-color: var(--blue-primary);
    background: #FAFCFE;
}
@media (max-width: 575.98px) {
    .otp-boxes { gap: .35rem; }
    .otp-box {
        width: 2.4rem;
        height: 2.9rem;
        font-size: 1.2rem;
    }
}

.login-block-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
    font-size: 1.75rem;
}
.login-block-progress {
    height: 4px;
    background: var(--gray-200);
}
.login-block-progress .progress-bar {
    background: var(--warning);
}

[data-bs-theme="dark"] .login-layout {
    background: #101820;
}
[data-bs-theme="dark"] .login-card {
    background: #162433;
    border-color: #27384B;
}
[data-bs-theme="dark"] .login-card-brand {
    background: #0A2944;
}
[data-bs-theme="dark"] .login-card-title {
    color: #F5F7FA;
}
[data-bs-theme="dark"] .login-card-subtitle {
    color: #8C939F;
}
[data-bs-theme="dark"] .login-form .form-label {
    color: #F5F7FA;
}
[data-bs-theme="dark"] .login-form .form-control {
    background: #101820;
    border-color: #27384B;
    color: #F5F7FA;
}
[data-bs-theme="dark"] .login-form .form-control:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 .2rem rgba(79, 143, 216, .2);
}
[data-bs-theme="dark"] .otp-box {
    background: #101820;
    border-color: #27384B;
    color: #F5F7FA;
}

/* Login: viewport baixa (ex: 1366×768) — compacta paddings e logo, mantém centralizado */
@media (max-height: 780px) {
    .login-card-brand {
        padding: .75rem 1.25rem .65rem;
    }
    .login-logo {
        max-height: 36px;
    }
    .login-card-body {
        padding: .9rem 1.5rem 1rem;
    }
    .login-card-title {
        font-size: 1.1rem;
        margin-bottom: .15rem;
    }
    .login-card-subtitle {
        font-size: .82rem;
        margin-bottom: .75rem;
    }
    .login-form .mb-3 {
        margin-bottom: .6rem !important;
    }
    .login-form .form-control {
        padding-block: .4rem;
    }
    .login-signup {
        margin-top: .35rem !important;
    }
}

/* Login: viewport muito baixa no desktop — permite rolagem */
@media (min-width: 768px) and (max-height: 560px) {
    .login-layout {
        grid-template-rows: auto;
        min-height: 100dvh;
        height: auto;
        overflow-y: auto;
        padding-block: .75rem;
    }
    .login-layout-stack {
        grid-row: auto;
    }
}

@media (max-width: 767.98px) {
    .login-layout {
        min-height: 100dvh;
        height: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        grid-template-rows: auto 1fr;
        align-content: start;
        padding: max(1.25rem, env(safe-area-inset-top, 0px)) 1rem 0;
    }
    .login-layout-stack {
        grid-row: 1;
    }
    .login-card-brand {
        padding: 1rem 1.25rem .875rem;
    }
    .login-logo {
        max-height: 44px;
    }
    .login-card-body {
        padding: 1.1rem 1.25rem 1.25rem;
    }
    .login-card-title {
        font-size: 1.1rem;
        margin-bottom: .15rem;
    }
    .login-card-subtitle {
        font-size: .82rem;
        margin-bottom: 1rem;
    }
    .login-form .form-control {
        padding-block: .45rem;
    }
    .login-signup {
        margin-top: .5rem !important;
    }
}
[data-bs-theme="dark"] .otp-box.filled {
    background: #1A2836;
    border-color: var(--blue-light);
}
[data-bs-theme="dark"] .otp-box:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 .2rem rgba(79, 143, 216, .2);
}

.home-hero-logo {
    flex: 0 0 auto;
    max-height: 68px;
    max-width: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.home-hero-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
}
.home-shortcut {
    border: 1px solid var(--surface-border);
    color: inherit;
    transition: transform .12s, box-shadow .12s;
}
.home-shortcut:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .12);
    color: inherit;
}
.home-shortcut-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: .65rem;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-size: 1.15rem;
}
.home-widget-link:hover .text-body { color: var(--bs-primary); }

/* Estrela de favorito sobre o card de atalho (fora da âncora). */
.home-shortcut-wrap .home-shortcut .card-body { padding-right: 2.75rem; }
.home-shortcut-fav {
    position: absolute;
    top: .4rem;
    right: .4rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 50%;
    color: var(--bs-secondary-color);
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s, color .12s, background .12s;
}
.home-shortcut-wrap:hover .home-shortcut-fav,
.home-shortcut-fav:focus-visible,
.home-shortcut-fav.is-on { opacity: 1; }
.home-shortcut-fav:hover { background: var(--bs-secondary-bg); }
.home-shortcut-fav.is-on { color: var(--bs-warning); }

/* Colapsável só quando há favoritos; sem favoritos a home mostra tudo, como antes. */
.home-modulos.colapsavel { display: none; }
.home-modulos.colapsavel.mostrar-tudo { display: block; }

/* Gantt do cronograma (renderizado no servidor) */
.gantt { --gantt-label: 16rem; font-size: .85rem; }
.gantt-head, .gantt-row { display: flex; align-items: stretch; }
.gantt-row { border-top: 1px solid var(--bs-border-color); }
.gantt-label {
    width: var(--gantt-label); flex: 0 0 var(--gantt-label);
    padding: .45rem .6rem; display: flex; flex-direction: column; justify-content: center;
}
.gantt-label .etapa-nome { font-weight: 600; line-height: 1.15; }
.gantt-label .etapa-datas { font-size: .72rem; color: var(--bs-secondary-color); }
.gantt-track { position: relative; flex: 1 1 auto; min-height: 2.6rem; }
.gantt-head .gantt-track { min-height: 1.6rem; }
.gantt-bar {
    position: absolute; top: 50%; transform: translateY(-50%);
    height: 1.3rem; border-radius: .35rem; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.gantt-bar-fill { position: absolute; inset: 0 auto 0 0; background: rgba(0,0,0,.30); }
.gantt-bar-label {
    position: relative; z-index: 1; font-size: .72rem; line-height: 1.3rem;
    padding: 0 .4rem; white-space: nowrap; color: #fff; font-weight: 600;
    text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bs-danger); z-index: 3; }
.gantt-month { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--bs-border-color);
    padding-left: .2rem; font-size: .7rem; color: var(--bs-secondary-color); white-space: nowrap; }

/* Mobile: o Gantt rola na horizontal; a coluna "Etapa" fica fixa (sticky) */
@media (max-width: 767.98px) {
    .gantt {
        --gantt-label: 8.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Cada linha cresce com o conteúdo (mín. = largura visível), gerando o scroll */
    .gantt-head, .gantt-row { width: max-content; min-width: 100%; }
    /* Trilha do tempo ganha largura mínima para as barras serem legíveis */
    .gantt-track { min-width: 30rem; }
    /* Rótulo da etapa acompanha o scroll grudado na esquerda */
    .gantt-label {
        position: sticky;
        left: 0;
        z-index: 4;
        background: var(--surface);
        box-shadow: 1px 0 0 var(--surface-border);
    }
}

/* ---------------------------------------------------------------------------
   Diário de Obra (RDO) - layout otimizado para canteiro / mobile
   --------------------------------------------------------------------------- */
.rdo-mensal-picker input[type="month"] {
    width: 8.75rem;
    min-width: 8.75rem;
}

.rdo-campo .rdo-anexo-thumb {
    object-fit: cover;
    height: 140px;
    width: 100%;
    background: var(--bs-tertiary-bg);
}

.rdo-campo .form-control[type="file"] {
    min-height: 42px;
    padding-top: .55rem;
}

@media (max-width: 767.98px) {
    .rdo-campo .list-group {
        max-height: 12rem !important;
    }
    .rdo-campo .card-body .row.g-2 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .rdo-campo .rdo-workflow-sticky {
        position: sticky;
        bottom: .5rem;
        z-index: 10;
        box-shadow: 0 -4px 16px rgba(16, 24, 40, .15);
    }
    .rdo-campo .rdo-workflow-sticky .btn {
        min-height: 44px;
        flex: 1 1 auto;
    }
    .rdo-campo .rdo-anexo-thumb {
        height: 120px;
    }
}

/* ---------------------------------------------------------------------------
   Modal HTMX: formulários carregados dentro de #modal-content
   O <form> envolve header/body/footer; sem flex no form o .modal-body não rola
   e o conteúdo inferior fica cortado (ex.: edição de fornecedor).
   --------------------------------------------------------------------------- */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-content > form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* ---------------------------------------------------------------------------
   Botão flutuante de feedback (reportar bug / sugerir melhoria)
   Pequeno e translúcido; fica opaco no hover/foco. Abaixo do modal (z 1055).
   Canto inferior DIREITO (fora da sidebar); os toasts sobem acima dele.
   --------------------------------------------------------------------------- */
.fab-feedback {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1045;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    opacity: .45;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .15);
    transition: opacity .15s ease, transform .15s ease;
}

.fab-feedback:hover,
.fab-feedback:focus-visible {
    opacity: 1;
    transform: translateY(-1px);
}

/* Página pública /conheca - alinhada ao login (azul #0F3D63 / #1C5FA8, accent #F28C28) */
.landing-page {
    background: var(--bg-light);
    color: var(--gray-900);
    scroll-behavior: smooth;
}
.landing-page #modulos,
.landing-page #capturas,
.landing-page #para-quem,
.landing-page #comparativo,
.landing-page #fluxo-integrado,
.landing-page #seguranca,
.landing-page #clientes,
.landing-page #planos,
.landing-page #faq,
.landing-page #contato {
    scroll-margin-top: calc(3.25rem + env(safe-area-inset-top, 0px));
}
.landing-nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}
.landing-nav .container {
    min-height: 3.25rem;
}
.landing-nav .landing-logo {
    height: 38px;
    width: auto;
    display: block;
}
.landing-nav-actions .btn-sm,
.landing-nav-actions .landing-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: .35rem .75rem;
    line-height: 1;
}
.landing-nav-actions .landing-nav-btn .bi {
    line-height: 1;
    font-size: 1rem;
}
.landing-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-secondary) 100%);
    color: #fff;
}
.landing-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 100% 0%, rgba(242, 140, 40, .10) 0%, transparent 55%);
    pointer-events: none;
}
.landing-hero .container { position: relative; z-index: 1; }
.landing-hero h1,
.landing-hero-title {
    color: #fff;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
}
.landing-hero .lead { color: rgba(255, 255, 255, .88); }
.landing-hero-accent { color: var(--accent); }
.landing-hero-note { color: rgba(255, 255, 255, .72); }
.landing-hero-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 1.35rem;
    background: var(--white);
    border-radius: var(--bs-border-radius-lg);
    border-bottom: 3px solid var(--accent);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .20);
}
.landing-hero-logo {
    max-height: 120px;
    width: auto;
    display: block;
}
.landing-section { padding: 4rem 0; }
.landing-section-alt { background: var(--white); }
.landing-section-muted { background: var(--bg-light); }
.landing-heading {
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--blue-primary);
}
.landing-module {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.5rem;
    height: 100%;
}
.landing-module h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: .4rem;
    color: var(--gray-900);
}
.landing-module-kicker {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .2rem;
}
.landing-module p {
    font-size: .9rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0;
    line-height: 1.5;
}
.landing-module-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--blue-primary);
    background: var(--gray-100);
    margin-bottom: .75rem;
}
.landing-highlight {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--bs-border-radius-lg);
    padding: 2rem;
}
.landing-lic-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}
.landing-lic-item .landing-check {
    flex-shrink: 0;
    font-size: 1.1rem;
    margin-top: .15rem;
    color: var(--accent);
}
.landing-cta {
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-secondary) 100%);
    color: #fff;
}
.landing-cta h2 {
    color: #fff;
    font-weight: 700;
}
.landing-cta-lead { color: rgba(255, 255, 255, .85); }
.landing-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
}
.landing-cta-actions .btn-lg { min-height: 48px; }
.landing-footer {
    background: var(--blue-primary);
    color: rgba(255, 255, 255, .75);
    font-size: .875rem;
}
.btn-landing-accent {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-hover-color: #fff;
    font-weight: 600;
}
.btn-wa {
    --bs-btn-bg: #25D366;
    --bs-btn-border-color: #25D366;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #1EBE5A;
    --bs-btn-hover-border-color: #1EBE5A;
    --bs-btn-hover-color: #fff;
    font-weight: 600;
}
.social-icons {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.social-icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #6B7280;
    font-size: 1.05rem;
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease;
}
.social-icon:hover { text-decoration: none; }
.social-icon--wa:hover { color: #25D366; background: rgba(37, 211, 102, .12); }
.social-icon--ig:hover { color: #E4405F; background: rgba(228, 64, 95, .12); }
.social-icon--email:hover { color: #0d6efd; background: rgba(13, 110, 253, .12); }
.social-icon--status:hover { color: #dc3545; background: rgba(220, 53, 69, .12); }
.landing-footer .social-icon { color: rgba(255, 255, 255, .65); }
.landing-footer .social-icon--wa:hover,
.landing-footer .social-icon--ig:hover,
.landing-footer .social-icon--email:hover {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}
.landing-wa-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1030;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    font-size: 1.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .20);
    text-decoration: none;
}
.landing-wa-float:hover { color: #fff; }

/* ---- Acessibilidade de teclado ---- */
.landing-skip {
    position: fixed;
    top: -100px;
    left: 12px;
    z-index: 2000;
    padding: .75rem 1rem;
    background: #fff;
    color: #123e60;
    border-radius: var(--bs-border-radius);
}
.landing-skip:focus { top: 10px; }
.landing-page :focus-visible { outline: 3px solid #b45a00; outline-offset: 3px; }
#conteudo:focus { outline: none; }

/* ---- Scroll reveal (respeita prefers-reduced-motion via JS) ----
   Só esconde com JS ativo (classe .js no <html>): sem script, prévia de link
   e impressão mostram o conteúdo. */
.js .landing-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .5s ease, transform .5s ease;
    will-change: opacity, transform;
}
.landing-reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ---- Módulos: realce da marca no hover ---- */
.landing-module {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.landing-module:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 61, 99, .10);
    border-color: var(--accent-light);
}

/* ---- Hero: moldura de navegador com a captura ---- */
.landing-browser {
    background: var(--white);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .35);
}
.landing-browser-bar {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem .85rem;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}
.landing-browser-bar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #D0D5DD;
}
.landing-browser-bar span:nth-child(1) { background: #F87171; }
.landing-browser-bar span:nth-child(2) { background: #FBBF24; }
.landing-browser-bar span:nth-child(3) { background: #34D399; }
.landing-browser-body { background: var(--bg-light); }

/* ---- Placeholder de captura (trocar por <img class="landing-shot-img">) ---- */
.landing-shot-img {
    display: block;
    width: 100%;
    height: auto;
}
.landing-shot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 260px;
    color: var(--blue-primary);
    background:
        repeating-linear-gradient(45deg, rgba(15, 61, 99, .035) 0, rgba(15, 61, 99, .035) 12px, transparent 12px, transparent 24px);
}
.landing-shot-placeholder i { font-size: 2.4rem; }
.landing-shot-placeholder span { font-weight: 600; }
.landing-shot-placeholder small { color: var(--bs-secondary-color); }
.landing-shot-placeholder--lg { min-height: 340px; }

/* ---- Barra de confiança ---- */
.landing-trustbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 0;
}
.landing-trust-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    justify-content: center;
    height: 100%;
}
@media (min-width: 768px) {
    .landing-trust-item { justify-content: flex-start; }
}
.landing-trust-item i {
    font-size: 1.5rem;
    color: var(--accent);
    flex-shrink: 0;
}
.landing-trust-item strong { display: block; color: var(--gray-900); line-height: 1.2; }
.landing-trust-item span { font-size: .85rem; color: var(--bs-secondary-color); }

/* ---- Hero: prova social (vitrine) ---- */
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    padding: .35rem .85rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .92);
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .20);
}
.landing-hero-proof i { color: var(--accent); }

/* ---- Benefícios honestos (faixa compacta) ---- */
.landing-benefits {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 0;
}
.landing-benefit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .5rem .35rem;
    height: 100%;
}
.landing-benefit i {
    font-size: 1.35rem;
    color: var(--accent);
}
.landing-benefit strong {
    display: block;
    font-size: .88rem;
    color: var(--gray-900);
    line-height: 1.25;
}
.landing-benefit span {
    font-size: .78rem;
    color: var(--bs-secondary-color);
    line-height: 1.4;
    max-width: 18ch;
}
@media (min-width: 768px) {
    .landing-benefit span { max-width: none; }
}

/* ---- Personas (para quem é) ---- */
.landing-persona {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.5rem;
    height: 100%;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.landing-persona:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 61, 99, .10);
    border-color: var(--accent-light);
}
.landing-persona-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--blue-primary);
    background: var(--gray-100);
    margin-bottom: .75rem;
}
.landing-persona h3 {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: .45rem;
}
.landing-persona > p {
    font-size: .9rem;
    color: var(--bs-secondary-color);
    line-height: 1.5;
    margin-bottom: .85rem;
}
.landing-persona-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.landing-persona-list li {
    font-size: .84rem;
    color: var(--gray-900);
    padding-left: 1.1rem;
    position: relative;
    line-height: 1.45;
}
.landing-persona-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

/* ---- Gancho: orçamento que alimenta a obra ---- */
.landing-hook-kicker {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .5rem;
}
.landing-hook-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.landing-hook-list li {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    color: var(--gray-900);
    line-height: 1.5;
    font-size: .92rem;
}
.landing-hook-list li i {
    color: var(--accent);
    flex-shrink: 0;
    margin-top: .12rem;
}
.landing-flow--hook {
    flex-wrap: wrap;
    gap: .65rem;
}
.landing-flow--hook .landing-flow-step {
    flex: 1 1 calc(50% - .5rem);
    min-width: 9.5rem;
}
.landing-flow--hook .landing-flow-arrow { display: none; }

/* Passos numerados do gancho "Orçamento que alimenta a obra" */
.landing-hook-steps {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.landing-hook-step {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--accent);
    border-radius: var(--bs-border-radius-lg);
    padding: 1rem 1.1rem;
}
.landing-hook-step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    color: var(--blue-primary);
    background: var(--gray-100);
}
.landing-hook-step strong {
    display: block;
    color: var(--gray-900);
    font-size: .95rem;
    margin-bottom: .2rem;
}
.landing-hook-step p {
    font-size: .84rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0;
    line-height: 1.45;
}

/* ---- Números (prova social real) ---- */
.landing-stats {
    background: var(--blue-primary);
    padding: 2.75rem 0;
}
.landing-stat {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: .5rem;
}
.landing-stat-num {
    /* Reserva a altura de 2 linhas e ancora o número embaixo: valores de uma
       linha ("R$ 166 mil") e de duas ("R$ 4,2 milhões") deixam os rótulos
       alinhados entre todos os cards. */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 2em;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--white);
}
.landing-stat-label {
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.25;
    color: rgba(255, 255, 255, .78);
}

/* ---- Dores ---- */
.landing-pain {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.5rem;
    height: 100%;
}
.landing-pain-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--accent);
    background: var(--accent-light);
    margin-bottom: .75rem;
}
.landing-pain h3 { font-size: 1.02rem; font-weight: 600; color: var(--gray-900); margin-bottom: .4rem; }
.landing-pain p { font-size: .9rem; color: var(--bs-secondary-color); margin-bottom: 0; line-height: 1.5; }

/* ---- Fluxo integrado ---- */
.landing-flow {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: .5rem;
    flex-wrap: nowrap;
}
.landing-flow-step {
    flex: 1 1 0;
    text-align: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-top: 3px solid var(--accent);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.25rem 1rem;
}
.landing-flow-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--blue-primary);
    background: var(--gray-100);
    margin-bottom: .6rem;
}
.landing-flow-step strong { display: block; color: var(--gray-900); font-size: .95rem; margin-bottom: .3rem; }
.landing-flow-step p { font-size: .82rem; color: var(--bs-secondary-color); margin-bottom: 0; line-height: 1.45; }
.landing-flow-arrow {
    align-self: center;
    color: var(--accent);
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ---- Capturas reais ---- */
.landing-shot {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    margin: 0;
}
.landing-shot .landing-shot-img { display: block; }
.landing-shot figcaption {
    padding: .75rem 1rem;
    font-size: .85rem;
    color: var(--bs-secondary-color);
    border-top: 1px solid var(--gray-200);
}
/* Captura mobile (retrato): centraliza o print do celular sem esticar */
.landing-shot--mobile {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.landing-shot--mobile .landing-shot-img {
    height: auto;
    max-height: 460px;
    width: auto;
    max-width: 100%;
    margin: 1.25rem auto 0;
    border-radius: var(--bs-border-radius);
    box-shadow: 0 6px 20px rgba(15, 61, 99, .12);
}
.landing-shot--mobile figcaption { margin-top: auto; }
/* Capturas de tela largas (desktop): no celular ficariam minúsculas e
   ilegíveis se espremidas na largura da viewport. Permite rolar na
   horizontal mantendo o print em tamanho legível. Sem efeito no desktop. */
.landing-shot-scroll { display: block; }
@media (max-width: 767.98px) {
    .landing-shot-scroll {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .landing-shot-scroll .landing-shot-img {
        flex: 0 0 auto;
        width: 680px;
        max-width: none;
    }
    /* dica de rolagem: leve sombra na borda direita do print */
    .landing-shot:not(.landing-shot--mobile),
    .landing-browser-body { position: relative; }
    .landing-shot:not(.landing-shot--mobile)::after,
    .landing-browser-body::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 2.25rem;
        pointer-events: none;
        background: linear-gradient(to right, rgba(15, 61, 99, 0), rgba(15, 61, 99, .12));
    }
}

/* ---- Diferenciais ---- */
.landing-diff {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.15rem 1.2rem;
    height: 100%;
}
.landing-diff i { font-size: 1.4rem; color: var(--accent); flex-shrink: 0; margin-top: .1rem; }
.landing-diff strong { display: block; color: var(--gray-900); font-size: .95rem; line-height: 1.25; }
.landing-diff span { font-size: .84rem; color: var(--bs-secondary-color); }

/* ---- Spotlight: painel de resultado (Business+) ---- */
.landing-spotlight {
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-secondary) 100%);
    color: #fff;
}
.landing-spotlight-badge { font-weight: 600; }
.landing-spotlight-title { color: #fff; font-weight: 700; letter-spacing: -.02em; }
.landing-spotlight-lead { color: rgba(255, 255, 255, .85); }
.landing-spotlight-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.landing-spotlight-list li {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    color: rgba(255, 255, 255, .92);
    line-height: 1.5;
}
.landing-spotlight-list li i { color: var(--accent); flex-shrink: 0; margin-top: .15rem; }
.landing-spotlight .landing-browser { box-shadow: 0 28px 70px rgba(0, 0, 0, .32); }
.landing-pain-link {
    display: inline-block;
    margin-top: .35rem;
    font-weight: 600;
    color: var(--blue-primary);
    text-decoration: none;
}
.landing-pain-link:hover { text-decoration: underline; color: var(--blue-secondary); }

/* ---- Comparativo planilhas × GM ERP ---- */
.landing-compare {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.5rem;
    height: 100%;
}
.landing-compare--destaque {
    border: 2px solid var(--accent);
    box-shadow: 0 10px 28px rgba(15, 61, 99, .10);
}
.landing-compare-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}
.landing-compare-title i { font-size: 1.25rem; }
.landing-compare--destaque .landing-compare-title i { color: var(--accent); }
.landing-compare-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.landing-compare-list li {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--bs-secondary-color);
}
.landing-compare-list li i { flex-shrink: 0; margin-top: .1rem; }
.landing-compare-list--contra li i { color: #DC3545; }
.landing-compare-list--pro li { color: var(--gray-900); }
.landing-compare-list--pro li i { color: var(--accent); }

/* ---- Prova social (depoimentos / logos) ---- */
.landing-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}
.landing-logo-client { max-height: 46px; width: auto; filter: grayscale(1); opacity: .7; }
.landing-quote {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.5rem;
    height: 100%;
    margin: 0;
}
.landing-quote-stars { color: var(--accent); font-size: .9rem; margin-bottom: .75rem; }
.landing-quote blockquote { font-size: .95rem; color: var(--gray-900); line-height: 1.55; margin-bottom: 1rem; }
.landing-quote-name { display: block; font-weight: 600; color: var(--gray-900); font-size: .9rem; }
.landing-quote-role { font-size: .82rem; color: var(--bs-secondary-color); }

/* ---- FAQ ---- */
.landing-faq .accordion-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--bs-border-radius) !important;
    margin-bottom: .6rem;
    overflow: hidden;
}
.landing-faq .accordion-button {
    font-weight: 600;
    color: var(--gray-900);
}
.landing-faq .accordion-button:not(.collapsed) {
    color: var(--blue-primary);
    background: var(--bs-primary-bg-subtle);
    box-shadow: none;
}
.landing-faq .accordion-button:focus {
    box-shadow: 0 0 0 .2rem rgba(15, 61, 99, .12);
}
.landing-faq .accordion-body { color: var(--bs-secondary-color); font-size: .92rem; }

.landing-hero-inner {
    padding-top: 2.75rem;
    padding-bottom: 2.75rem;
}
.landing-hero-title {
    font-size: clamp(1.65rem, 4.5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: #fff;
}
.landing-intro {
    font-size: 1.05rem;
    line-height: 1.6;
}
.landing-hero-actions .btn-lg,
.landing-cta-actions .btn-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.25;
    min-height: 48px;
    padding-top: .625rem;
    padding-bottom: .625rem;
}
/* Hero: 3 botões na metade da tela — empilha até XL */
.landing-hero-actions {
    align-items: stretch;
}
@media (max-width: 1199.98px) {
    .landing-hero-actions {
        flex-direction: column !important;
    }
    .landing-hero-actions .btn-lg {
        width: 100%;
    }
}
@media (min-width: 1200px) {
    .landing-hero-actions .btn-lg {
        flex: 1 1 auto;
        min-width: 0;
        padding-left: .85rem;
        padding-right: .85rem;
        font-size: .95rem;
    }
}
.landing-footer-inner {
    text-align: center;
}
.landing-footer-copy { line-height: 1.4; }

.landing-hero-note-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}
.landing-hero-note-link:hover { color: var(--accent-hover); }

/* Rodapé institucional (logo + descrição + contato + barra inferior) */
.landing-footer-brand { text-align: center; }
.landing-footer-logo {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: .95;
}
.landing-footer-about {
    color: rgba(255, 255, 255, .70);
    max-width: 52ch;
    margin-inline: auto;
    line-height: 1.6;
    font-size: .875rem;
}
.landing-footer-title {
    color: #fff;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
    margin-bottom: .75rem;
}
.landing-footer-contact li {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .45rem;
}
.landing-footer-contact i { color: rgba(255, 255, 255, .55); font-size: 1rem; }
.landing-footer-contact a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.landing-footer-contact a:hover { color: #fff; text-decoration: underline; }
.landing-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    background: rgba(0, 0, 0, .12);
    font-size: .8125rem;
    color: rgba(255, 255, 255, .6);
}
.landing-footer-bottom a {
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
}
.landing-footer-bottom a:hover {
    color: #fff;
    text-decoration: underline;
}
.landing-legal {
    padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 5rem);
    background: #f7f8fa;
}
.landing-legal-inner { max-width: 46rem; }
.landing-legal-eyebrow {
    margin: 0 0 .5rem;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--bs-primary, #0d6efd);
}
.landing-legal-header h1 {
    margin: 0 0 .75rem;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    line-height: 1.15;
}
.landing-legal-meta {
    margin: 0 0 2rem;
    color: #5c656d;
    font-size: .95rem;
    line-height: 1.45;
}
.landing-legal-body section + section { margin-top: 1.75rem; }
.landing-legal-body h2 {
    margin: 0 0 .65rem;
    font-size: 1.15rem;
}
.landing-legal-body p,
.landing-legal-body li {
    margin: 0 0 .75rem;
    line-height: 1.65;
    font-size: .98rem;
}
.landing-legal-body ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}
@media (max-width: 767.98px) {
    .landing-footer-brand,
    .landing-footer-contact-col { text-align: center; }
    .landing-footer-about { margin-inline: auto; }
    .landing-footer-contact li { justify-content: center; }
}

.landing-page:has(.landing-wa-float) .landing-footer-bottom {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}
.landing-nav.sticky-top {
    padding-top: env(safe-area-inset-top, 0);
}

@media (max-width: 575.98px) {
    .landing-nav .landing-logo { height: 32px; }
    .landing-nav .container {
        padding-left: .85rem;
        padding-right: .85rem;
        min-height: 3rem;
    }
    .landing-nav-actions .landing-nav-btn-icon,
    .landing-nav-actions .landing-nav-btn {
        width: 2.25rem;
        padding-left: 0;
        padding-right: 0;
    }

    .landing-hero-inner {
        padding-top: 1.75rem;
        padding-bottom: 2rem;
    }
    .landing-hero-title { font-size: 1.55rem; }
    .landing-hero .lead { font-size: 1rem; margin-bottom: .75rem !important; }
    .landing-hero-note { font-size: .9rem; margin-bottom: 1.25rem !important; }

    .landing-hero-actions .btn-lg {
        width: 100%;
    }
    .landing-cta-actions .btn-lg { width: 100%; }

    .landing-benefit span { max-width: none; }

    .landing-section { padding: 2.25rem 0; }
    .landing-intro { font-size: .975rem; }
    .landing-heading { font-size: 1.35rem; }

    .landing-module {
        padding: 1.15rem 1.2rem;
    }
    .landing-module h3 { font-size: 1rem; }

    .landing-highlight { padding: 1.35rem 1.2rem; }

    .landing-cta-lead { font-size: 1rem; }
    .landing-cta-actions .btn-lg { width: 100%; }

    .landing-footer-copy {
        font-size: .8125rem;
    }

    .landing-wa-float {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .landing-hero-inner {
        padding-top: 2.25rem;
        padding-bottom: 2.5rem;
    }
    .landing-section { padding: 3rem 0; }
}

/* Fluxo integrado: empilha em telas menores e gira as setas para baixo */
@media (max-width: 991.98px) {
    .landing-flow { flex-wrap: wrap; }
    .landing-flow-step { flex: 1 1 40%; }
    /* Empilhado: a seta ocupa a linha inteira (flex-basis:100%) e gira para
       baixo. Como o rotate pivota no centro do bloco, o glifo precisa estar
       centralizado na horizontal - senão a rotacao o desloca para cima do
       card anterior, deixando o ultimo passo aparentemente sem seta. */
    .landing-flow-arrow { transform: rotate(90deg); flex-basis: 100%; text-align: center; }
}
@media (max-width: 575.98px) {
    .landing-flow-step { flex: 1 1 100%; }
    .landing-trust-item { justify-content: flex-start; text-align: left; }
    .landing-trust-item > div { text-align: left; }
    .landing-pain { padding: 1.15rem 1.2rem; }
    .landing-shot-placeholder { min-height: 200px; }
    .landing-shot-placeholder--lg { min-height: 240px; }
}

@media (min-width: 992px) {
    .landing-hero-inner {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}
.login-signup {
    padding-top: .25rem;
}
.login-signup a {
    color: var(--blue-secondary);
    text-decoration: none;
    font-size: .875rem;
}
.login-signup a:hover { text-decoration: underline; }

/* Selo "Distribuído por Gama Tecnologia".
   Mobile: no fluxo (abaixo do card) para não sobrepor links quando o teclado abre.
   Desktop: fixo no rodapé da viewport. */
.login-distribuidor {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .25rem .5rem;
    opacity: .8;
    grid-row: 3;
    align-self: end;
    margin-top: .75rem;
    padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 768px) {
    .login-distribuidor {
        position: fixed;
        left: 50%;
        bottom: calc(.5rem + env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
        grid-row: auto;
        align-self: auto;
        margin-top: 0;
        padding-bottom: .25rem;
        pointer-events: none;
    }
}
.login-distribuidor-icon {
    height: 18px;
    width: auto;
}
.login-distribuidor-text {
    font-size: .6875rem;
    color: var(--bs-secondary-color, #6c757d);
    letter-spacing: .02em;
    white-space: nowrap;
}
.landing-distribuidor {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    color: rgba(255, 255, 255, .70);
    font-size: .7rem;
}
.landing-distribuidor-icon {
    height: 16px;
    width: auto;
}
.side-distribuidor {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1rem .85rem;
    margin-top: auto;
    font-size: .625rem;
    line-height: 1.25;
    color: var(--sidebar-fg-muted);
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.side-distribuidor-icon {
    height: 16px;
    width: auto;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Select pesquisável (static/js/searchable-select.js)
   --------------------------------------------------------------------------- */
.ss-wrap { position: relative; width: 100%; }
.ss-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    pointer-events: none;
}
.ss-toggle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ss-toggle.ss-placeholder { color: var(--bs-secondary-color); }
.ss-painel {
    position: fixed;
    z-index: 1095;
    display: flex;
    flex-direction: column;
    padding: .4rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    box-shadow: 0 .5rem 1.25rem rgba(15, 61, 99, .18);
}
.ss-painel[hidden] { display: none !important; }
.ss-busca-wrap {
    position: relative;
    margin-bottom: .35rem;
    flex: 0 0 auto;
}
.ss-busca-wrap .bi-search {
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary-color);
    font-size: .85rem;
    pointer-events: none;
}
.ss-busca { padding-left: 1.85rem; }
.ss-lista {
    overflow-y: auto;
    max-height: 16rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ss-grupo {
    padding: .35rem .55rem .15rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}
.ss-opcao {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    padding: .4rem .55rem;
    border-radius: .35rem;
    font-size: .9rem;
    line-height: 1.3;
    cursor: pointer;
}
.ss-opcao:hover,
.ss-opcao.is-active { background: var(--bs-tertiary-bg); }
.ss-opcao.is-selected { font-weight: 600; color: var(--blue-primary); }
[data-bs-theme="dark"] .ss-opcao.is-selected { color: var(--blue-light); }
.ss-opcao.disabled { opacity: .5; cursor: not-allowed; }
.ss-vazio {
    padding: .6rem .55rem;
    font-size: .85rem;
    color: var(--bs-secondary-color);
}

/* DRE V2 — cabeçalho de grupo recolhível.
   O chevron aponta para baixo quando o grupo está aberto. O Bootstrap põe
   .collapsed no botão enquanto o tbody correspondente está fechado. */
.dre-grupo-toggle i {
    transition: transform .15s ease-in-out;
    transform: rotate(90deg);
}
.dre-grupo-toggle.collapsed i {
    transform: rotate(0deg);
}

/* DRE V2 — o drill fica em todo rótulo e em toda célula de valor. Estilo de
   link em tudo vira parede de azul num relatório de 13 colunas: o link herda
   a cor do texto e só se anuncia no hover e no foco. */
.dre-drill {
    color: inherit;
    text-decoration: none;
}
.dre-drill:hover,
.dre-drill:focus-visible {
    color: var(--blue-primary);
    text-decoration: underline;
    text-underline-offset: .15em;
}
[data-bs-theme="dark"] .dre-drill:hover,
[data-bs-theme="dark"] .dre-drill:focus-visible {
    color: var(--blue-light);
}
/* Linha aberta no painel de detalhe. */
.dre-drill.is-ativo {
    font-weight: 600;
    color: var(--blue-primary);
}
[data-bs-theme="dark"] .dre-drill.is-ativo { color: var(--blue-light); }

/* O ícone de "abrir detalhe" só aparece na linha sob o cursor. */
.dre-drill-icone {
    opacity: 0;
    transition: opacity .12s ease-in-out;
}
tr:hover .dre-drill-icone,
.dre-drill:focus-visible .dre-drill-icone { opacity: .5; }
/* Sem cursor não há hover: em toque o ícone é a única pista de que abre. */
@media (hover: none) {
    .dre-drill-icone { opacity: .5; }
}
