/* ===== RBytes Oficinas — estilos globais (complementam o Bootstrap 5) ===== */

html {
    font-size: 15px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* ----- Login ----- */
.login-fundo {
    background: radial-gradient(circle at 20% 20%, #2b3440 0%, #12161c 60%, #0b0d10 100%);
    min-height: 100vh;
}

/* ----- Validação ----- */
.validation-summary-valid {
    display: none;
}

.validation-summary-errors ul {
    margin-bottom: 0;
    padding-left: 1.1rem;
}

.input-validation-error {
    border-color: var(--bs-form-invalid-border-color, #dc3545);
}

.input-validation-error:focus {
    box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25);
}

/* ----- Placa de veículo (visual Mercosul) ----- */
.placa {
    display: inline-block;
    min-width: 6.5rem;
    padding: .3rem .5rem .15rem;
    border: 2px solid #1c1c1c;
    border-top: .45rem solid #0b3d91;
    border-radius: .35rem;
    background: #fff;
    color: #1c1c1c;
    font-family: "Consolas", "Courier New", monospace;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: center;
    line-height: 1.1;
}

.placa-sm {
    min-width: 5.2rem;
    padding: .15rem .35rem .05rem;
    border-width: 1px;
    border-top-width: .3rem;
    font-size: .8rem;
}

/* ----- Painel ----- */
.card-indicador {
    transition: transform .12s ease, box-shadow .12s ease;
}

.card-indicador:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .08);
}

.indicador-cor {
    display: inline-block;
    width: .75rem;
    height: .75rem;
    border-radius: 50%;
}

/* ----- Abertura de OS ----- */
.etapa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    margin-right: .5rem;
    border-radius: 50%;
    background: var(--bs-dark);
    color: #fff;
    font-size: .85rem;
}

.busca-resultados {
    position: absolute;
    top: calc(100% + .25rem);
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 22rem;
    overflow-y: auto;
}

/* Listas flutuantes de sugestões: Tabela FIPE (fipe.js; marca, modelo e ano do veículo) e catálogo de serviços
   (servicos.js; descrição do serviço na abertura da OS e no orçamento). */
.sugestoes-fipe,
.sugestoes-servico {
    position: fixed;
    z-index: 1060;
    max-height: 18rem;
    overflow-y: auto;
}

.sugestoes-fipe .list-group-item.active .text-muted,
.sugestoes-servico .list-group-item.active .text-muted {
    color: inherit !important;
}

.selecao-card {
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-left: .3rem solid var(--bs-primary);
    border-radius: .5rem;
    background: var(--bs-light);
}

.nivel-combustivel .btn {
    font-size: .85rem;
    white-space: nowrap;
}

.tabela-itens th.col-codigo { width: 8rem; }
.tabela-itens th.col-qtd { width: 6rem; }
.tabela-itens th.col-valor { width: 8rem; }
.tabela-itens th.col-total { width: 7.5rem; }
.tabela-itens th.col-mecanico { width: 12rem; }
.tabela-itens th.col-acao { width: 3rem; }

/* Descrição nunca fica espremida: abaixo disso a tabela rola na horizontal (.table-responsive). */
.tabela-itens td:first-child {
    min-width: 14rem;
}

.tabela-itens td {
    min-width: 5.5rem;
}

.tabela-itens td:last-child {
    min-width: 0;
}

.tabela-itens td[data-total-linha] {
    padding-top: .9rem;
}

@media (min-width: 1200px) {
    .resumo-os {
        position: sticky;
        top: calc(var(--rb-topo-altura) + 1rem);
    }
}

/* ----- Detalhes ----- */
.texto-livre {
    white-space: pre-line;
}

/* Medidor de combustível (classes em vez de style="", compatível com a Content-Security-Policy). */
.progress-combustivel { height: 6px; }
.progress-bar.combustivel-0 { width: 5%; }
.progress-bar.combustivel-1 { width: 25%; }
.progress-bar.combustivel-2 { width: 50%; }
.progress-bar.combustivel-3 { width: 75%; }
.progress-bar.combustivel-4 { width: 100%; }

/* Cabeçalhos de tabela não quebram linha (ex.: "Nº OS" no celular). */
.table thead th {
    white-space: nowrap;
}

.historico-veiculo .list-group-item {
    background: transparent;
}

/* ----- Impressão da OS ----- */
@media print {
    body {
        background: #fff !important;
    }

    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
}

/* ----- Status da esteira sem cor equivalente no Bootstrap ----- */
.text-bg-indigo {
    color: #fff !important;
    background-color: #6610f2 !important;
}

.text-bg-roxo {
    color: #fff !important;
    background-color: #9333ea !important;
}

/* ----- Galeria de fotos da OS (componente FotosOS) ----- */
.foto-os {
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    background: #fff;
}

.foto-os img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--bs-tertiary-bg);
}

.foto-os figcaption {
    padding: .4rem .5rem;
}

.progresso-envio {
    height: 1.25rem;
}

/* Janela da webcam (camera.js): imagem ao vivo no formato da câmera, sem cortar. */
.camera-fotos-area {
    position: relative;
    overflow: hidden;
    border-radius: .5rem;
    background: #000;
}

.camera-fotos-video {
    display: block;
    width: 100%;
    max-height: 65vh;
    object-fit: contain;
}

.camera-fotos-aviso {
    position: absolute;
    inset: auto 1rem 1rem;
    padding: .6rem .8rem;
    border-radius: .4rem;
    background: rgba(255, 255, 255, .92);
    color: var(--bs-danger-text-emphasis);
}

.navbar .nav-link {
    white-space: nowrap;
}

/* ===== Área logada: menu lateral ===== */
:root {
    --rb-lateral-aberto: 16.5rem;
    --rb-lateral-recolhido: 4.75rem;
    --rb-lateral-largura: var(--rb-lateral-aberto);
    --rb-topo-altura: 4.5rem;
    --rb-menu-fundo: #141920;
    --rb-menu-fundo-base: #0d1116;
    --rb-menu-texto: #c4ccd8;
    --rb-menu-suave: #8590a2;
    --rb-menu-hover: rgba(255, 255, 255, .06);
    --rb-menu-ativo: rgba(255, 193, 7, .13);
    --rb-menu-borda: rgba(255, 255, 255, .08);
    --rb-menu-ambar: #ffc107;
    --rb-menu-gradiente: linear-gradient(135deg, #ffd54a 0%, #ffc107 45%, #ff9500 100%);
}

/* O cabeçalho fica fixo no topo: elementos "sticky" das telas e as âncoras (#...) descontam a altura dele.
   4.5rem é a altura com a explicação em uma linha; quando ela quebra linha, o site.js grava a altura real. */

/* Páginas sem login (ex.: erro) só têm a barra simples da marca, que rola com a página. */
.sem-menu {
    --rb-topo-altura: 0px;
}

html {
    scroll-padding-top: calc(var(--rb-topo-altura) + .75rem);
}

.min-w-0 {
    min-width: 0;
}

/* Marca de campo obrigatório nos rótulos (a mesma da página de cadastro). */
.obrigatorio {
    margin-left: .2rem;
    color: #dc3545;
    font-weight: 700;
}

.pular-conteudo:focus {
    position: fixed;
    top: .5rem;
    left: .5rem;
    z-index: 2000;
    padding: .5rem .85rem;
    border-radius: .5rem;
    background: #fff;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .2);
}

/* ----- Marca ----- */
.app-marca {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    color: #fff;
    font-weight: 600;
    letter-spacing: .01em;
    text-decoration: none;
    white-space: nowrap;
}

.app-marca:hover,
.app-marca:focus {
    color: #fff;
}

.app-marca-destaque {
    color: var(--rb-menu-ambar);
}

.app-marca-icone {
    display: inline-flex;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .7rem;
    background: var(--rb-menu-gradiente);
    box-shadow: 0 .35rem 1rem rgba(255, 170, 0, .22);
    color: #12161c;
    font-size: 1.2rem;
}

/* ----- Barra simples da marca (páginas sem login) ----- */
.app-topo {
    display: flex;
    align-items: center;
    height: 3.5rem;
    padding: 0 1rem;
    background: var(--rb-menu-fundo);
    box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .18);
    color: #fff;
}

/* ----- Cabeçalho fixo da área logada: nome e explicação da tela + usuário ----- */
.app-cabecalho {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 4.5rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 .35rem 1.25rem rgba(17, 24, 39, .05);
    backdrop-filter: saturate(180%) blur(10px);
}

.app-cabecalho-botao {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: .6rem;
    color: var(--bs-emphasis-color);
    font-size: 1.6rem;
}

.app-cabecalho-botao:hover,
.app-cabecalho-botao:focus-visible {
    background: var(--bs-tertiary-bg);
}

.app-cabecalho-textos {
    flex: 1 1 auto;
    min-width: 0;
}

/* O título fica em uma linha; a explicação quebra linha quando precisa e aparece sempre inteira (o cabeçalho
   cresce e o site.js grava a altura real para os elementos "sticky"). */
.app-titulo {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-titulo {
    margin: 0;
    color: var(--bs-emphasis-color);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.3;
}

.app-descricao {
    margin: .1rem 0 0;
    color: var(--bs-secondary-color);
    font-size: .78rem;
    line-height: 1.35;
}

@media (min-width: 992px) {
    .app-cabecalho {
        gap: 1.25rem;
        padding: .5rem 1.75rem;
    }

    .app-titulo {
        font-size: 1.3rem;
    }

    .app-descricao {
        font-size: .875rem;
    }
}

/* Usuário logado: abre o menu com "Meus dados" e "Sair". */
.app-conta {
    flex: 0 0 auto;
}

.app-conta-botao {
    display: flex;
    align-items: center;
    gap: .6rem;
    max-width: 18rem;
    padding: .3rem .55rem .3rem .3rem;
    border: 1px solid transparent;
    border-radius: 2rem;
    background: transparent;
    color: var(--bs-body-color);
    text-align: left;
    transition: background-color .15s ease, border-color .15s ease;
}

.app-conta-botao:hover,
.app-conta-botao:focus-visible,
.app-conta-botao[aria-expanded="true"] {
    border-color: var(--bs-border-color);
    background: var(--bs-tertiary-bg);
}

.app-conta-botao:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.app-conta-textos {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.app-conta-nome,
.app-conta-perfil {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-conta-nome {
    font-size: .9rem;
    font-weight: 600;
}

.app-conta-perfil {
    color: var(--bs-secondary-color);
    font-size: .75rem;
}

.app-conta-menu {
    width: 17rem;
    max-width: calc(100vw - 1.5rem);
}

.app-conta-identificacao {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 1rem .35rem;
}

.app-conta-sair {
    color: var(--bs-danger);
}

.app-conta-sair:hover,
.app-conta-sair:focus {
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
}

/* Relatórios impressos levam o título e a explicação da tela no papel. */
@media print {
    .app-cabecalho-impressao {
        position: static;
        height: auto;
        padding: 0 0 .75rem;
        margin-bottom: .5rem;
        border-bottom: 2px solid #000;
        background: none;
        box-shadow: none;
        backdrop-filter: none;
    }

    .app-cabecalho-impressao .app-titulo {
        overflow: visible;
        white-space: normal;
    }
}

/* ----- Menu lateral (gaveta no celular, fixo no computador) ----- */
.app-lateral {
    --bs-offcanvas-width: 17.5rem;
    --bs-offcanvas-bg: var(--rb-menu-fundo);
    --bs-offcanvas-color: var(--rb-menu-texto);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* O .offcanvas-lg deixa background-color transparente no computador: a cor vem da imagem de fundo. */
    background-image: linear-gradient(180deg, var(--rb-menu-fundo) 0%, var(--rb-menu-fundo-base) 100%);
    color: var(--rb-menu-texto);
}

.app-lateral-cabecalho {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .5rem;
    min-height: 4.25rem;
    padding: 1rem 1.15rem .75rem;
}

.app-lateral-oficina {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .5rem;
    margin: 0 1rem .85rem;
    padding: .45rem .65rem;
    overflow: hidden;
    border: 1px solid var(--rb-menu-borda);
    border-radius: .55rem;
    background: rgba(255, 255, 255, .03);
    color: var(--rb-menu-texto);
    font-size: .8rem;
    white-space: nowrap;
}

.app-lateral-oficina span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-lateral-oficina .bi {
    color: var(--rb-menu-suave);
}

.app-lateral-acao {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin: 0 1rem .75rem;
    border: 0;
    background: var(--rb-menu-gradiente);
    box-shadow: 0 .4rem 1.1rem rgba(255, 170, 0, .2);
    color: #12161c;
    font-weight: 600;
    white-space: nowrap;
}

.app-lateral-acao:hover,
.app-lateral-acao:focus-visible {
    background: var(--rb-menu-gradiente);
    color: #12161c;
    filter: brightness(1.05);
}

.app-lateral-nav {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 .75rem .75rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
    scrollbar-width: thin;
}

.menu-secao {
    margin: 1rem .6rem .35rem;
    color: var(--rb-menu-suave);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    white-space: nowrap;
}

.menu-lista,
.menu-subitens {
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    margin-bottom: .125rem;
    padding: .55rem .75rem;
    border: 0;
    border-radius: .6rem;
    background: transparent;
    color: var(--rb-menu-texto);
    font-size: .925rem;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.menu-link > .bi:first-child {
    flex: 0 0 1.25rem;
    color: var(--rb-menu-suave);
    font-size: 1.1rem;
    text-align: center;
    transition: color .15s ease;
}

.menu-link:hover,
.menu-link:focus-visible {
    background: var(--rb-menu-hover);
    color: #fff;
}

.menu-link:hover > .bi:first-child,
.menu-link:focus-visible > .bi:first-child {
    color: #fff;
}

.menu-link:focus-visible,
.menu-sublink:focus-visible,
.app-lateral-botao:focus-visible {
    outline: 2px solid var(--rb-menu-ambar);
    outline-offset: -2px;
}

.menu-link.active {
    background: var(--rb-menu-ativo);
    box-shadow: inset 3px 0 0 var(--rb-menu-ambar);
    color: #fff;
    font-weight: 600;
}

.menu-link.active > .bi:first-child,
.menu-grupo-titulo.contem-ativo > .bi:first-child {
    color: var(--rb-menu-ambar);
}

.menu-grupo-titulo.contem-ativo {
    color: #fff;
}

.menu-seta {
    margin-left: auto;
    font-size: .7rem;
    opacity: .7;
    transition: transform .2s ease;
}

.menu-grupo-titulo:not(.collapsed) .menu-seta {
    transform: rotate(180deg);
}

.menu-subitens {
    margin: .125rem 0 .5rem 1.35rem;
    padding-left: .65rem;
    border-left: 1px solid var(--rb-menu-borda);
}

.menu-sublink {
    position: relative;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .65rem;
    border-radius: .5rem;
    color: var(--rb-menu-suave);
    font-size: .875rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.menu-sublink .bi {
    font-size: .95rem;
}

.menu-sublink:hover,
.menu-sublink:focus-visible {
    background: var(--rb-menu-hover);
    color: #fff;
}

.menu-sublink.active {
    color: #fff;
    font-weight: 600;
}

.menu-sublink.active .bi {
    color: var(--rb-menu-ambar);
}

/* Trecho da linha-guia do grupo acende ao lado do item atual. */
.menu-sublink.active::before {
    position: absolute;
    top: .35rem;
    bottom: .35rem;
    left: calc(-.65rem - 1.5px);
    width: 2px;
    border-radius: 2px;
    background: var(--rb-menu-ambar);
    content: "";
}

.app-lateral-rodape {
    flex: 0 0 auto;
    padding: .75rem;
    border-top: 1px solid var(--rb-menu-borda);
}

/* Avatar com as iniciais (cabeçalho e Meus dados). */
.app-avatar {
    display: inline-flex;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--rb-menu-gradiente);
    color: #12161c;
    font-size: .85rem;
    font-weight: 700;
}

.app-avatar-lg {
    flex-basis: 3rem;
    width: 3rem;
    height: 3rem;
    font-size: 1.05rem;
}

.app-lateral-botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: 100%;
    padding: .45rem .6rem;
    border: 1px solid var(--rb-menu-borda);
    border-radius: .55rem;
    background: transparent;
    color: var(--rb-menu-texto);
    font-size: .85rem;
    white-space: nowrap;
}

.app-lateral-botao:hover,
.app-lateral-botao:focus-visible {
    border-color: rgba(255, 255, 255, .18);
    background: var(--rb-menu-hover);
    color: #fff;
}

.app-lateral-botao .bi {
    transition: transform .2s ease;
}

.menu-recolhido [data-alternar-menu] .bi {
    transform: rotate(180deg);
}

/* ----- Conteúdo ----- */
.app-conteudo {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-pagina {
    flex: 1 0 auto;
}

.app-rodape {
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.app-rodape .app-pagina {
    flex: 0 0 auto;
}

@media (min-width: 992px) {
    .app-lateral {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1035;
        width: var(--rb-lateral-largura);
        border-right: 1px solid rgba(255, 255, 255, .04);
        transition: width .2s ease, box-shadow .2s ease;
    }

    .com-menu .app-conteudo {
        margin-left: var(--rb-lateral-largura);
        transition: margin-left .2s ease;
    }

    .app-pagina {
        padding-right: 1.75rem;
        padding-left: 1.75rem;
    }

    /* Recolhido: só os ícones. Passar o mouse (ou o foco do teclado) abre o menu por cima do conteúdo. */
    .menu-recolhido {
        --rb-lateral-largura: var(--rb-lateral-recolhido);
    }

    .menu-recolhido:not(.menu-sem-espiar) .app-lateral:hover,
    .menu-recolhido .app-lateral:focus-within {
        width: var(--rb-lateral-aberto);
        box-shadow: 1rem 0 2.5rem rgba(0, 0, 0, .3);
        transition-delay: .12s;
    }

    .menu-recolhido .app-lateral:not(:hover):not(:focus-within) .menu-rotulo,
    .menu-recolhido.menu-sem-espiar .app-lateral:not(:focus-within) .menu-rotulo {
        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;
    }

    .menu-recolhido .app-lateral:not(:hover):not(:focus-within) :is(.menu-seta, .app-lateral-oficina, .collapse),
    .menu-recolhido.menu-sem-espiar .app-lateral:not(:focus-within) :is(.menu-seta, .app-lateral-oficina, .collapse) {
        display: none !important;
    }

    .menu-recolhido .app-lateral:not(:hover):not(:focus-within) .menu-secao,
    .menu-recolhido.menu-sem-espiar .app-lateral:not(:focus-within) .menu-secao {
        height: 1px;
        margin: .65rem .6rem;
        overflow: hidden;
        background: var(--rb-menu-borda);
        color: transparent;
    }

    .menu-recolhido .app-lateral:not(:hover):not(:focus-within) :is(.menu-link, .app-lateral-cabecalho, .app-lateral-botao),
    .menu-recolhido.menu-sem-espiar .app-lateral:not(:focus-within) :is(.menu-link, .app-lateral-cabecalho, .app-lateral-botao) {
        justify-content: center;
        gap: 0;
        padding-right: 0;
        padding-left: 0;
    }

    .menu-recolhido .app-lateral:not(:hover):not(:focus-within) .app-lateral-acao,
    .menu-recolhido.menu-sem-espiar .app-lateral:not(:focus-within) .app-lateral-acao {
        margin-right: .85rem;
        margin-left: .85rem;
        padding-right: 0;
        padding-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-lateral,
    .com-menu .app-conteudo,
    .menu-link,
    .menu-sublink,
    .menu-seta,
    .app-lateral-botao .bi {
        transition: none !important;
    }
}

@media print {
    .com-menu .app-conteudo {
        margin-left: 0 !important;
    }
}

/* Áreas com rolagem própria recortam também os textos só para leitor de tela (.visually-hidden, posição
   absoluta): sem isso eles escapam do recorte e alargam a página inteira no celular. */
.table-responsive,
.overflow-auto,
.overflow-x-auto {
    position: relative;
}

/* ===== Carregamento temático (todos os layouts; exibido pelo carregamento.js) ===== */
/* A barra, o painel e o botão do WhatsApp ficam direto no body e são sempre fixos na tela: o "body >" dá a eles
   prioridade sobre regras genéricas dos layouts (ex.: "filhos diretos do body com position: relative"). */
body > .rb-barra-progresso {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 2001;
    height: 3px;
    pointer-events: none;
}

.rb-barra-progresso > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(90deg, #ffd54a 0%, #ffc107 45%, #ff9500 100%);
    box-shadow: 0 0 10px rgba(255, 170, 0, .7), 0 0 4px rgba(255, 149, 0, .6);
}

/* Avança rápido no começo e desacelera: nunca chega ao fim sozinha. */
.rb-barra-progresso.ativa > span {
    animation: rb-progresso 8s cubic-bezier(.1, .7, .2, 1) forwards;
}

.rb-barra-progresso.concluindo {
    opacity: 0;
    transition: opacity .3s ease .1s;
}

.rb-barra-progresso.concluindo > span {
    width: 100%;
    animation: none;
}

@keyframes rb-progresso {
    0% { width: 0; }
    10% { width: 30%; }
    100% { width: 88%; }
}

body > .rb-carregamento {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(11, 13, 16, .45);
    backdrop-filter: blur(3px);
    cursor: progress;
    animation: rb-surgir .2s ease both;
}

.rb-carregamento-cartao {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    min-width: 14rem;
    max-width: 18rem;
    padding: 1.5rem 1.75rem 1.25rem;
    border: 1px solid rgba(255, 193, 7, .22);
    border-radius: 1.25rem;
    background: linear-gradient(180deg, #171c23 0%, #0f1318 100%);
    box-shadow: 0 1.5rem 3.5rem rgba(0, 0, 0, .45);
    color: #e8ecf1;
    text-align: center;
}

.rb-carregamento-engrenagens {
    width: 5.5rem;
    height: 5.5rem;
    filter: drop-shadow(0 .4rem .9rem rgba(255, 170, 0, .25));
}

.rb-engrenagem-grande,
.rb-engrenagem-pequena {
    transform-box: fill-box;
    transform-origin: center;
}

.rb-engrenagem-grande {
    animation: rb-girar 2.4s linear infinite;
}

/* Gira ao contrário e 1,5 vez mais rápido, como duas engrenagens engatadas (12 e 8 dentes). */
.rb-engrenagem-pequena {
    animation: rb-girar 1.6s linear infinite reverse;
}

.rb-carregamento-texto {
    min-height: 1.4em;
    margin: 0;
    font-size: .925rem;
    font-weight: 600;
    letter-spacing: .01em;
}

@keyframes rb-girar {
    to { transform: rotate(360deg); }
}

@keyframes rb-surgir {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    body > .rb-carregamento {
        animation: none;
    }

    .rb-engrenagem-grande,
    .rb-engrenagem-pequena {
        animation-duration: 8s;
    }
}

/* ===== Botão flutuante do WhatsApp (área logada e páginas públicas da RBytes) ===== */
body > .rb-whatsapp {
    position: fixed;
    right: 1.25rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    z-index: 1030;
    display: inline-flex;
    align-items: center;
    height: 3.5rem;
    min-width: 3.5rem;
    padding: 0 1rem;
    border-radius: 2rem;
    background: #25d366;
    box-shadow: 0 .6rem 1.5rem rgba(18, 140, 126, .35), 0 .15rem .4rem rgba(0, 0, 0, .15);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.rb-whatsapp .bi {
    flex: 0 0 auto;
    font-size: 1.6rem;
    line-height: 1;
}

/* O rótulo abre ao passar o mouse ou focar pelo teclado (no celular fica só o ícone). */
.rb-whatsapp-rotulo {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    transition: max-width .25s ease, opacity .2s ease, margin-left .25s ease;
}

.rb-whatsapp:hover,
.rb-whatsapp:focus-visible {
    background: #1ebe5b;
    box-shadow: 0 .8rem 1.8rem rgba(18, 140, 126, .45), 0 .2rem .5rem rgba(0, 0, 0, .18);
    color: #fff;
    transform: translateY(-2px);
}

.rb-whatsapp:hover .rb-whatsapp-rotulo,
.rb-whatsapp:focus-visible .rb-whatsapp-rotulo {
    max-width: 10rem;
    margin-left: .55rem;
    opacity: 1;
}

.rb-whatsapp:focus-visible {
    outline: 3px solid rgba(37, 211, 102, .45);
    outline-offset: 3px;
}

/* Anel que pulsa algumas vezes ao abrir a página, para chamar a atenção sem incomodar. */
.rb-whatsapp::before {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, .55);
    content: "";
    animation: rb-pulso 2.2s ease-out 1s 3;
    pointer-events: none;
}

@keyframes rb-pulso {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); }
    70% { box-shadow: 0 0 0 .9rem rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (prefers-reduced-motion: reduce) {
    body > .rb-whatsapp,
    .rb-whatsapp-rotulo {
        transition: none;
    }

    .rb-whatsapp::before {
        animation: none;
    }
}

/* Com o botão na tela, o que fica preso no rodapé (avisos, barras de salvar) deixa espaço para ele. */
body:has(.rb-whatsapp) {
    --rb-espaco-flutuante: 4.75rem;
}

body:has(.rb-whatsapp) .toast-container.position-fixed.bottom-0 {
    bottom: var(--rb-espaco-flutuante) !important;
}

/* ----- Diálogos e avisos rápidos (SweetAlert2, wwwroot/js/dialogos.js) ----- */
/* Acima dos modais, das listas de sugestões e dos toasts do Bootstrap. */
.swal2-container {
    z-index: 1100;
}

.rb-dialogo {
    border-radius: .85rem;
    font-family: inherit;
}

.rb-dialogo .swal2-title {
    font-size: 1.25rem;
    line-height: 1.35;
    color: var(--bs-emphasis-color);
}

.rb-dialogo .swal2-html-container {
    font-size: .95rem;
    color: var(--bs-secondary-color);
}

.rb-dialogo .swal2-actions .btn {
    min-width: 7.5rem;
}

.rb-toast.swal2-popup {
    font-family: inherit;
}

.rb-toast .swal2-title {
    font-size: .92rem;
    font-weight: 500;
    line-height: 1.4;
}
