/* =========================================================
   Sistema ERP Fiscal - Estilos personalizados
   Layout inspirado em ERPs modernos (Omie/Bling/Conta Azul).
   Tema controlado por data-bs-theme (light/dark) do Bootstrap 5.
   ========================================================= */

:root {
    --erp-sidebar-width: 250px;
    --erp-sidebar-width-collapsed: 68px;
    --erp-topbar-height: 56px;
    --erp-sidebar-bg: #1f2a44;
    --erp-sidebar-bg-hover: #2b3a5c;
    --erp-sidebar-color: #c8d2e8;
    --erp-sidebar-active: #0d6efd;
}

body {
    background-color: var(--bs-body-bg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Layout principal ---------- */
.erp-wrapper {
    display: flex;
    min-height: 100vh;
}

.erp-sidebar {
    width: var(--erp-sidebar-width);
    background: var(--erp-sidebar-bg);
    color: var(--erp-sidebar-color);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    transition: width .2s ease;
    z-index: 1030;
}

.erp-main {
    flex: 1;
    margin-left: var(--erp-sidebar-width);
    transition: margin-left .2s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Estado recolhido */
body.sidebar-collapsed .erp-sidebar { width: var(--erp-sidebar-width-collapsed); }
body.sidebar-collapsed .erp-main { margin-left: var(--erp-sidebar-width-collapsed); }
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .erp-nav-section { display: none; }
body.sidebar-collapsed .erp-nav-item { text-align: center; }

/* ---------- Marca ---------- */
.erp-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.2rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap;
}
.erp-brand i { font-size: 1.4rem; color: var(--erp-sidebar-active); }
/* Logo da empresa na marca: 40x40, círculo perfeito */
.erp-brand-logo {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    border-radius: 50% !important;
    object-fit: cover;
    background: #fff;
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
}
/* Sidebar recolhida (68px): centraliza a logo */
body.sidebar-collapsed .erp-brand { justify-content: center; }

/* ---------- Navegação ---------- */
.erp-nav { padding: .5rem 0; }
.erp-nav-section {
    padding: .8rem 1.2rem .3rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,.4);
}
.erp-nav-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .65rem 1.2rem;
    color: var(--erp-sidebar-color);
    text-decoration: none;
    white-space: nowrap;
    border-left: 3px solid transparent;
    transition: background .15s, border-color .15s;
}
.erp-nav-item i { font-size: 1.1rem; min-width: 20px; text-align: center; }
.erp-nav-item:hover { background: var(--erp-sidebar-bg-hover); color: #fff; }
.erp-nav-item.active {
    background: var(--erp-sidebar-bg-hover);
    color: #fff;
    border-left-color: var(--erp-sidebar-active);
}

/* ---------- Topbar ---------- */
.erp-topbar {
    height: var(--erp-topbar-height);
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.erp-toggle, .erp-theme-toggle, .erp-user {
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: 1.2rem;
}
.erp-user { font-size: 1rem; }

/* ---------- Conteúdo ---------- */
.erp-content { padding: 1.5rem; flex: 1; }

/* ---------- Cards de indicadores ---------- */
.erp-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ---------- Página de login ---------- */
.erp-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2a44 0%, #0d6efd 100%);
    padding: 1rem;
}
.erp-login-card {
    background: var(--bs-body-bg);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border-radius: 16px;
}
.erp-login-logo { font-size: 2.6rem; color: #0d6efd; }

/* ---------- Combo com busca dentro de input-group ----------
   O data-busca (site.js) embrulha o <select> num .erp-combo e põe ali o campo visível.
   Dentro de um .input-group esse wrapper precisa se comportar como o próprio controle:
   crescer para ocupar a linha e emendar sem canto arredondado no botão ao lado. */
.input-group > .erp-combo {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}
.input-group > .erp-combo:not(:last-child) > .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Quantidade na linha de itens (OS/Orçamento): largura fixa e enxuta — todo o resto
   da linha sobra para a descrição do produto/serviço. */
.erp-qtd-item {
    flex: 0 0 84px !important;
    width: 84px;
    max-width: 84px;
    text-align: right;
}

/* ---------- Impressão (relatórios) ---------- */
@media print {
    .erp-sidebar, .erp-topbar, .no-print { display: none !important; }
    .erp-main { margin-left: 0 !important; }
    .erp-content { padding: 0 !important; }
    .card { border: none !important; box-shadow: none !important; }
    a[href]:after { content: ""; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 768px) {
    .erp-sidebar { width: var(--erp-sidebar-width-collapsed); }
    .erp-main { margin-left: var(--erp-sidebar-width-collapsed); }
    .nav-text, .brand-text, .erp-nav-section { display: none; }
    body.sidebar-collapsed .erp-sidebar { width: var(--erp-sidebar-width); }
    body.sidebar-collapsed .erp-main { margin-left: var(--erp-sidebar-width); }
    body.sidebar-collapsed .nav-text,
    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .erp-nav-section { display: inline; }
}

/* ---------- Suporte técnico (menu flutuante) ---------- */
/* Fica acima de tudo, mas abaixo dos modais do Bootstrap (1055) para não cobrir
   um diálogo aberto. */
.erp-suporte {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.erp-suporte-botao {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    transition: transform .2s ease, background-color .2s ease;
}

.erp-suporte-botao:hover,
.erp-suporte-botao:focus {
    color: #fff;
    transform: translateY(-2px);
}

/* Arrastável: o ícone é levado para onde não cobre nada.
   touch-action/user-select são o que faz o arraste funcionar no toque e no mouse sem
   selecionar texto nem rolar a página junto. */
.erp-suporte-botao {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Enquanto arrasta: nada de salto (o hover sobe 2px) e o cursor diz o que está acontecendo. */
.erp-suporte.arrastando .erp-suporte-botao {
    cursor: grabbing;
    transform: none;
}

/* Ícone na metade ESQUERDA da tela: o painel de 288px tem de abrir para a direita. */
.erp-suporte.a-esquerda { align-items: flex-start; }

/* Canal único vira botão direto: usa a cor do próprio canal. */
.erp-suporte-botao-whatsapp { background: #25d366; }
.erp-suporte-botao-whatsapp:hover, .erp-suporte-botao-whatsapp:focus { background: #1eb455; }
.erp-suporte-botao-telefone { background: #198754; }
.erp-suporte-botao-email { background: #6f42c1; }
.erp-suporte-botao-site { background: #0dcaf0; }

/* Vira "X" quando o painel está aberto — o mesmo botão fecha o menu. */
.erp-suporte.aberto .erp-suporte-botao { transform: rotate(90deg); }

.erp-suporte-painel {
    width: 288px;
    max-width: calc(100vw - 40px);
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
    overflow: hidden;
}

.erp-suporte-cabecalho {
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
}

.erp-suporte-canal {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .85rem;
    text-decoration: none;
    color: var(--bs-body-color);
    border-bottom: 1px solid var(--bs-border-color);
}

.erp-suporte-canal:last-child { border-bottom: 0; }
.erp-suporte-canal:hover, .erp-suporte-canal:focus { background: var(--bs-tertiary-bg); }

.erp-suporte-icone {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--bs-secondary, #6c757d);
}

.erp-suporte-canal.whatsapp .erp-suporte-icone { background: #25d366; }
.erp-suporte-canal.telefone .erp-suporte-icone { background: #198754; }
.erp-suporte-canal.email .erp-suporte-icone { background: #6f42c1; }
.erp-suporte-canal.site .erp-suporte-icone { background: #0dcaf0; }

.erp-suporte-texto { display: flex; flex-direction: column; min-width: 0; }
.erp-suporte-titulo { font-weight: 600; line-height: 1.2; }

.erp-suporte-detalhe {
    font-size: .8rem;
    color: var(--bs-secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media print {
    .erp-suporte { display: none !important; }
}

/* ---------- Fale Conosco (chat dentro do painel de suporte) ---------- */
/* O chat ocupa o MESMO painel dos canais: abrir a conversa troca o conteúdo, em vez de
   empilhar uma segunda caixinha por cima da primeira. */

/* Número de mensagens novas, grudado no botão flutuante. */
.erp-suporte-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--bs-danger, #dc3545);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bs-body-bg);
}

.erp-suporte-botao { position: relative; }

.erp-suporte-canal.chat .erp-suporte-icone { background: #0d6efd; }

/* Botão de canal: o "Fale Conosco" é <button>, os outros são <a>. Repete o reset para os
   dois ficarem iguais na lista. */
button.erp-suporte-canal {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    background: transparent;
    text-align: left;
    font: inherit;
}

.erp-fc-voltar {
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color);
    padding: 0 .4rem 0 0;
    font-size: 1rem;
    line-height: 1;
}

/* Nome da empresa no alto da conversa: razão social é longa e o painel é estreito. */
.erp-fc-titulo {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.erp-fc-mensagens {
    height: 280px;
    max-height: 48vh;
    overflow-y: auto;
    padding: .6rem .7rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    background: var(--bs-tertiary-bg);
}

.erp-fc-msg { display: flex; flex-direction: column; max-width: 85%; }
.erp-fc-msg.minha { align-self: flex-end; align-items: flex-end; }
.erp-fc-msg.dele { align-self: flex-start; align-items: flex-start; }

.erp-fc-balao {
    padding: .4rem .6rem;
    border-radius: .6rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    font-size: .85rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.erp-fc-msg.minha .erp-fc-balao {
    background: var(--bs-primary, #0d6efd);
    border-color: transparent;
    color: #fff;
}

.erp-fc-meta { font-size: .7rem; color: var(--bs-secondary-color); margin-top: .15rem; }

.erp-fc-vazio {
    margin: auto;
    padding: .5rem;
    text-align: center;
    font-size: .82rem;
    color: var(--bs-secondary-color);
}

.erp-fc-rodape {
    display: flex;
    align-items: flex-end;
    gap: .4rem;
    padding: .5rem;
    border-top: 1px solid var(--bs-border-color);
}

.erp-fc-rodape textarea {
    flex: 1 1 auto;
    resize: none;
    font-size: .85rem;
    border-radius: .5rem;
}

.erp-fc-aviso { padding: 0 .7rem .4rem; font-size: .76rem; color: var(--bs-danger, #dc3545); }

/* Caixa de entrada do suporte: uma linha por empresa. */
.erp-fc-lista { max-height: 320px; overflow-y: auto; }

.erp-fc-conversa {
    position: relative;
    display: block;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    background: transparent;
    text-align: left;
    padding: .55rem .85rem;
    font: inherit;
    color: var(--bs-body-color);
}

.erp-fc-conversa:hover, .erp-fc-conversa:focus { background: var(--bs-tertiary-bg); }

.erp-fc-conversa-topo { display: flex; justify-content: space-between; gap: .5rem; }
.erp-fc-conversa-nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-fc-conversa-em { flex: 0 0 auto; font-size: .72rem; color: var(--bs-secondary-color); }

.erp-fc-conversa-resumo {
    display: block;
    font-size: .78rem;
    color: var(--bs-secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 1.6rem;
}

.erp-fc-pastilha {
    position: absolute;
    right: .7rem;
    bottom: .5rem;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--bs-danger, #dc3545);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* Bandeira de não lidas no item do menu SaaS — a mesma contagem do botão flutuante. */
.erp-nav-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--bs-danger, #dc3545);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* ---------- Anexos do Fale Conosco ---------- */

/* Enquanto o arquivo sobe o recado não é erro: vermelho ali assustaria à toa. */
.erp-fc-aviso.neutro { color: var(--bs-secondary-color); }

.erp-fc-clipe {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 1.15rem;
    line-height: 1;
    padding: .35rem .2rem;
}

.erp-fc-clipe:hover:not(:disabled) { color: var(--bs-primary, #0d6efd); }
.erp-fc-clipe:disabled { opacity: .5; }

/* Os escolhidos, antes de enviar. */
.erp-fc-escolhidos {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    padding: .4rem .7rem 0;
}

.erp-fc-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    max-width: 100%;
    padding: .15rem .25rem .15rem .4rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .8rem;
    background: var(--bs-tertiary-bg);
    font-size: .74rem;
}

.erp-fc-chip-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 10rem; }
.erp-fc-chip-tam { color: var(--bs-secondary-color); flex: 0 0 auto; }

.erp-fc-chip-x {
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 1rem;
    line-height: 1;
    padding: 0 .15rem;
}

.erp-fc-chip-x:hover { color: var(--bs-danger, #dc3545); }

/* Já enviados, dentro do balão. */
.erp-fc-anexos {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-top: .25rem;
    justify-content: inherit;
}

.erp-fc-msg.minha .erp-fc-anexos { justify-content: flex-end; }

.erp-fc-foto img {
    max-width: 150px;
    max-height: 150px;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color);
    display: block;
    object-fit: cover;
}

.erp-fc-anexo {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    max-width: 100%;
    padding: .3rem .5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: .78rem;
    text-decoration: none;
}

.erp-fc-anexo:hover { background: var(--bs-tertiary-bg); }
.erp-fc-anexo-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11rem; }
.erp-fc-anexo-tam { color: var(--bs-secondary-color); flex: 0 0 auto; }

/* Resposta do atendimento automático: visivelmente diferente de gente. Robô que se passa
   por pessoa só ganha a confiança do cliente uma vez. */
.erp-fc-msg.robo .erp-fc-balao {
    background: var(--bs-tertiary-bg);
    border-style: dashed;
    color: var(--bs-body-color);
}

/* ---------- Histórico de suporte (tela do Super Administrador) ---------- */
.erp-hist-conversa {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-height: 70vh;
    overflow-y: auto;
}

.erp-hist-msg { display: flex; flex-direction: column; max-width: 70%; }
.erp-hist-msg.cliente { align-self: flex-start; align-items: flex-start; }
.erp-hist-msg.suporte { align-self: flex-end; align-items: flex-end; }

.erp-hist-balao {
    padding: .5rem .7rem;
    border-radius: .6rem;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    font-size: .88rem;
}

.erp-hist-msg.suporte .erp-hist-balao { background: var(--bs-tertiary-bg); }
.erp-hist-msg.robo .erp-hist-balao { border-style: dashed; }

.erp-hist-texto { white-space: pre-wrap; word-break: break-word; }

/* Nota interna: o cliente nunca viu esta linha, e quem lê precisa saber disso antes de
   responder "como eu te disse". */
.erp-hist-msg.interna .erp-hist-balao {
    background: var(--bs-warning-bg-subtle, #fff3cd);
    border-color: var(--bs-warning-border-subtle, #ffe69c);
}

.erp-hist-interna {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bs-warning-text-emphasis, #997404);
    margin-bottom: .15rem;
}

.erp-hist-anexos { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.erp-hist-anexos img { max-width: 180px; max-height: 180px; border-radius: .4rem; display: block; }

.erp-hist-arquivo {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .4rem;
    font-size: .8rem;
    text-decoration: none;
}

.erp-hist-meta {
    font-size: .74rem;
    color: var(--bs-secondary-color);
    margin-top: .2rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}

/* ---------- Agenda (calendário mensal) ---------- */
.erp-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--bs-border-color);
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    overflow: hidden;
}

.erp-cal-dow {
    background: var(--bs-tertiary-bg);
    padding: .4rem .5rem;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--bs-secondary-color);
    text-align: center;
}

.erp-cal-dia {
    background: var(--bs-body-bg);
    min-height: 116px;
    padding: .35rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

/* Dia da semana vizinha, mostrado só para fechar a linha. */
.erp-cal-dia.fora { background: var(--bs-tertiary-bg); }
.erp-cal-dia.fora .erp-cal-num { opacity: .45; }

.erp-cal-num {
    font-size: .8rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    align-self: flex-end;
}

.erp-cal-dia.hoje { box-shadow: inset 0 0 0 2px var(--bs-primary); }

.erp-cal-dia.hoje .erp-cal-num {
    background: var(--bs-primary);
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.erp-cal-ev {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-left: 3px solid transparent;
    background: var(--bs-tertiary-bg);
    border-radius: .25rem;
    padding: .15rem .35rem;
    font-size: .74rem;
    line-height: 1.25;
    color: var(--bs-body-color);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-cal-ev:hover { background: var(--bs-secondary-bg); }
.erp-cal-ev .hora { font-weight: 600; margin-right: .2rem; }

/* Cores por tipo/situação — as mesmas do AgendaController.CorDoTipo. */
.erp-cal-ev.visita { border-left-color: #0d6efd; }
.erp-cal-ev.retorno { border-left-color: #6f42c1; }
.erp-cal-ev.entrega { border-left-color: #fd7e14; }
.erp-cal-ev.reuniao { border-left-color: #20c997; }
.erp-cal-ev.outro { border-left-color: #6c757d; }
.erp-cal-ev.os { border-left-color: #0dcaf0; }
.erp-cal-ev.realizado { border-left-color: #198754; }
.erp-cal-ev.cancelado { border-left-color: #adb5bd; text-decoration: line-through; opacity: .7; }
.erp-cal-ev.atrasado { border-left-color: #dc3545; }

.erp-cal-mais { font-size: .7rem; color: var(--bs-secondary-color); padding-left: .35rem; }

/* Cartão do vendedor (foto, iniciais quando não há foto). */
.erp-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bs-secondary-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--bs-secondary-color);
    flex: 0 0 auto;
}

.erp-avatar-lg { width: 64px; height: 64px; font-size: 1.25rem; }

@media (max-width: 768px) {
    .erp-cal-dia { min-height: 78px; }
    .erp-cal-ev { font-size: .68rem; }
}

/* ---------- Avarias de chegada do veículo ---------- */
/* Altura fixa para a galeria não virar escada: fotos de celular vêm em retrato e paisagem
   na mesma linha. */
.erp-avaria-foto {
    height: 140px;
    width: 100%;
    object-fit: cover;
    background: var(--bs-tertiary-bg);
    border-top-left-radius: calc(.375rem - 1px);
    border-top-right-radius: calc(.375rem - 1px);
}

/* ---------- Pesquisa de item na OS (produtos utilizados e serviços executados) ---------- */
/* Amarelo claro: é por este campo que a OS é montada, e ele precisa saltar aos olhos entre os
   combos cinzas da mesma linha. A cor fica no foco também — o Bootstrap troca o fundo ao focar. */
.erp-busca-item,
.erp-busca-item:focus {
    background-color: #fff8d5;
    color: #212529;
}

.erp-busca-item::placeholder {
    color: #8a7b3f;
}

/* ---------- Busca global + central de comandos (caixa do topo) ---------- */
/* O nome é "-global-" porque .erp-busca-item já existe acima, e é outra coisa: o campo amarelo
   de pesquisa de item da OS. Duas coisas com o mesmo nome pintariam o menu de amarelo. */
.erp-busca-global {
    position: relative;
    max-width: 520px;
    width: 100%;
}

.erp-busca-global-painel {
    position: absolute;
    top: calc(100% + .25rem);
    left: 0;
    right: 0;
    z-index: 1045;
    max-height: 70vh;
    overflow-y: auto;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.erp-busca-global-item {
    color: var(--bs-body-color);
}

/* O realce vale para o mouse E para as setas do teclado: a navegação por teclado é o motivo de
   existir o atalho Ctrl+K, e sem o realce em .active não se vê onde o Enter vai cair. */
.erp-busca-global-item:hover,
.erp-busca-global-item.active {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}
