/* ============================================================
   PedidoFlex — Identidade "Atlântico" (corporativo sóbrio)
   Paleta: primary #1E5FD0 · navy #0E2A47 · bg #EEF2F7 · card #FFFFFF
   ============================================================ */
:root {
    --primary: #1E5FD0;
    --primary-dark: #174CB0;
    --primary-soft: #E8EFFC;
    --secondary: #16233A;

    --bg: #EEF2F7;
    --card: #FFFFFF;
    --text: #16233A;
    --muted: #5D6B84;
    --border: #DBE3EE;

    --sidebar-bg: #0E2A47;
    --sidebar-bg-2: #16385C;
    --sidebar-text: #B7C6DC;
    --sidebar-text-strong: #FFFFFF;

    --radius-card: 12px;
    --radius-btn: 9px;
    --input-h: 44px;
    --shadow: 0 1px 3px rgba(22,35,58,.07), 0 6px 18px rgba(22,35,58,.05);
    --shadow-md: 0 10px 26px rgba(22,35,58,.10);

    --sidebar-w: 280px;
    --sidebar-w-collapsed: 78px;
    --topbar-h: 64px;

    /* Densidade por formato (Opção A) — sobrescritos nos media queries do fim do arquivo */
    --content-pad: 26px;
    --content-max: 1560px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
}

a { text-decoration: none; color: var(--primary); }

.validation-summary-valid { display: none; }

/* Bootstrap alinhado ao tema */
.btn { border-radius: var(--radius-btn); }
.btn-primary {
    --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark);
    --bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark);
}
.text-primary { color: var(--primary) !important; }
.form-control, .form-select { min-height: var(--input-h); border-radius: var(--radius-btn); border-color: var(--border); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(30,95,208,.15); }

/* ============================================================
   SHELL
   ============================================================ */
.app-shell { min-height: 100vh; }
.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left .2s ease;
}
body.sidebar-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }
.content { padding: var(--content-pad); flex: 1; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex; flex-direction: column;
    z-index: 1040; overflow: hidden;
    transition: width .2s ease, transform .2s ease;
}
.sidebar-header {
    height: var(--topbar-h); flex-shrink: 0;
    display: flex; align-items: center; gap: 12px; padding: 0 22px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; overflow: hidden; white-space: nowrap; }
.brand-mark {
    min-width: 38px; height: 38px; border-radius: 10px;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.brand-title { font-weight: 700; font-size: 1.1rem; color: #fff; }
.brand-sub { font-size: .7rem; color: var(--sidebar-text); display: block; margin-top: -3px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px 28px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.nav-section-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
    color: #6D87A8; padding: 12px 12px 4px; font-weight: 700;
}

.menu-link, .menu-toggle {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 6px 12px; margin: 1px 0;
    border: 0; background: transparent; border-radius: var(--radius-btn);
    color: var(--sidebar-text); font-size: .92rem; font-family: inherit;
    cursor: pointer; text-align: left;
    transition: background .15s, color .15s;
}
.menu-link:hover, .menu-toggle:hover { background: var(--sidebar-bg-2); color: var(--sidebar-text-strong); }
.menu-link > i:first-child, .menu-toggle > i:first-child { font-size: 1.1rem; min-width: 22px; text-align: center; }
.menu-link.active { background: rgba(255,255,255,.10); color: #fff; box-shadow: none; font-weight: 600; }

.menu-chevron { margin-left: auto; font-size: .75rem; transition: transform .2s ease; }
.menu-toggle:not(.collapsed) .menu-chevron { transform: rotate(90deg); }

/* submenus aninhados: guia à esquerda + indentação por nível */
.submenu { margin-left: 20px; border-left: 1px solid rgba(255,255,255,.08); }
.submenu .menu-link, .submenu .menu-toggle { font-size: .87rem; color: #8FA5C0; padding: 9px 12px; }
.submenu .menu-link:hover, .submenu .menu-toggle:hover { color: #fff; }

/* Item atual destacado (vence a cor do submenu por especificidade) */
.sidebar-nav .menu-link.active {
    background: rgba(255,255,255,.10);
    color: #fff;
    box-shadow: none;
    font-weight: 600;
}

/* recolhido (somente ícones) */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .menu-text,
body.sidebar-collapsed .menu-chevron,
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .submenu { display: none; }
body.sidebar-collapsed .menu-link,
body.sidebar-collapsed .menu-toggle,
body.sidebar-collapsed .sidebar-brand { justify-content: center; }
/* não deixa um grupo aberto "vazar" quando recolhido */
body.sidebar-collapsed .submenu.show { display: none !important; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    height: var(--topbar-h); background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px; padding: 0 22px;
    position: sticky; top: 0; z-index: 1030;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-brand { font-weight: 700; font-size: 1.05rem; color: var(--secondary); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
    position: relative; width: 42px; height: 42px;
    border: 0; background: transparent; border-radius: var(--radius-btn);
    color: var(--muted); font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: #EDF2F9; color: var(--text); }
.badge-dot {
    position: absolute; top: 8px; right: 9px; width: 9px; height: 9px;
    border-radius: 50%; background: #C93A3A; border: 2px solid #fff;
}

.user-btn {
    display: flex; align-items: center; gap: 10px;
    border: 0; background: transparent; cursor: pointer;
    padding: 4px 10px 4px 4px; border-radius: var(--radius-btn);
    transition: background .15s;
}
.user-btn:hover { background: #EDF2F9; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary); color: #fff; font-weight: 600; font-size: .85rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-name { font-size: .9rem; font-weight: 600; color: var(--text); }
.user-role { font-size: .74rem; color: var(--muted); }

.dropdown-menu { border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-md); }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; }
.dropdown-item .bi { font-size: 1rem; }
.notif-menu { width: 300px; }

/* ============================================================
   CARDS / DASHBOARD
   ============================================================ */
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.page-subtitle { color: var(--muted); margin: 0 0 24px; font-size: .92rem; }

.card-surface {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-card); box-shadow: var(--shadow);
}

.stat-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-card); box-shadow: var(--shadow);
    padding: 20px; height: 100%;
    display: flex; align-items: center; gap: 16px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 54px; height: 54px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.45rem;
}
.stat-info { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: .82rem; color: var(--muted); }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-trend { font-size: .76rem; font-weight: 600; }
.trend-up { color: #188554; } .trend-down { color: #C93A3A; }
.icon-blue { background: #E8EFFC; color: #1E5FD0; }
.icon-amber { background: #F7EDD8; color: #B97E11; }
.icon-green { background: #E2F3EA; color: #188554; }
.icon-violet { background: #ECE9F8; color: #6D5BD0; }

.panel-title { font-weight: 700; font-size: 1rem; margin: 0; }

/* ---- Gráfico de barras (mock, CSS puro) ---- */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.bar-chart .bar {
    flex: 1; background: linear-gradient(180deg, #6FA0E8, var(--primary));
    border-radius: 6px 6px 0 0; min-height: 4px;
    transition: opacity .15s;
}
.bar-chart .bar:hover { opacity: .8; }

/* ---- Barras horizontais por status (mock) ---- */
.hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hbar-label { width: 130px; font-size: .82rem; color: var(--muted); flex-shrink: 0; }
.hbar-track { flex: 1; background: #EDF2F9; border-radius: 6px; height: 12px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 6px; }
.hbar-value { width: 34px; text-align: right; font-size: .82rem; font-weight: 600; }

/* ---- Tabela ---- */
.table-clean { width: 100%; border-collapse: collapse; }
.table-clean th {
    text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 700; padding: 8px 14px; border-bottom: 1px solid var(--border);
}
.table-clean td { padding: 7px 14px; border-bottom: 1px solid #EDF2F9; font-size: .9rem; }
.table-clean tbody tr:hover { background: #F0F5FD; }

/* Tabelas largas (muitas colunas): largura mínima para ROLAREM limpo no tablet em vez
   de espremer as colunas. Só no tablet/desktop — no celular (<992px) o empilhamento
   (.table-mobile-cards) ou a rolagem natural cuidam, então nada de min-width lá. */
@media (min-width: 992px) {
    .table-larga { min-width: 1080px; }
    .table-larga.table-xlarga { min-width: 1320px; }
}

/* ---- Detalhe de comissão: cabeçalho do grupo (pedido) + linhas de item ---- */
.comissao-detalhe .comissao-pedido-head { cursor: pointer; }
.comissao-detalhe .comissao-pedido-head > td { background: #F4F8FE; border-top: 2px solid var(--border); }
.comissao-detalhe .comissao-pedido-head:hover > td { background: #EAF1FC; }
.comissao-detalhe .comissao-pedido-head a { color: var(--primary); text-decoration: none; }
.comissao-detalhe .comissao-caret { transition: transform .15s ease; color: var(--muted); }
.comissao-detalhe .comissao-pedido-head.aberto .comissao-caret { transform: rotate(90deg); }

/* ---- Autocomplete de produto ---- */
.autocomplete-list {
    position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow-md); max-height: 240px; overflow-y: auto; display: none;
}
.autocomplete-list.show { display: block; }
.autocomplete-item { padding: 8px 12px; cursor: pointer; font-size: .88rem; }
.autocomplete-item:hover { background: #EDF2F9; }
.autocomplete-item small { color: var(--muted); }

/* ============================================================
   BADGE STATUS
   ============================================================ */
.badge-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    font-size: .76rem; font-weight: 700; line-height: 1;
}
/* Ponto de estado na cor do texto (leitura rápida na tabela) */
.badge-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-orcamento { background: #E5E9FB; color: #4348B8; } /* índigo */
.status-rascunho  { background: #E9EDF4; color: #5D6B84; } /* cinza-azulado */
.status-enviado   { background: #E8EFFC; color: #1E5FD0; } /* azul Atlântico */
.status-pendente  { background: #F9EFDC; color: #B97E11; } /* âmbar */
.status-aprovado  { background: #E2F3EA; color: #188554; } /* verde */
.status-integrado { background: #FDEBD3; color: #B45309; } /* laranja (claro/escuro) */
.status-faturado  { background: #D8EEE2; color: #0C5C3D; } /* verde escuro */
.status-rejeitado { background: #FBE4D6; color: #C2410C; } /* laranja-avermelhado (distinto de cancelado) */
.status-cancelado { background: #F7E3E3; color: #B23131; } /* vermelho */

/* ============================================================
   BREADCRUMB
   ============================================================ */
.pf-breadcrumb {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: .85rem; color: var(--muted); margin-bottom: 16px;
}
.pf-breadcrumb a { color: var(--muted); }
.pf-breadcrumb a:hover { color: var(--primary); }
.pf-breadcrumb .sep { font-size: .62rem; opacity: .55; }
.pf-breadcrumb .current { color: var(--text); font-weight: 600; }

/* ============================================================
   HEADER DO PEDIDO
   ============================================================ */
.pedido-header { padding: 20px 24px; margin-bottom: 16px; }
.pedido-header-main { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.pedido-header-num { font-size: 1.4rem; font-weight: 700; }
.pedido-header-meta { display: flex; align-items: center; gap: 18px; margin-top: 8px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.pedido-header-meta .bi { margin-right: 5px; }
.pedido-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   CARD CLIENTE
   ============================================================ */
.cliente-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #EDF2F9; font-size: .9rem; }
.cliente-row:last-child { border-bottom: 0; }
.cliente-row .bi { color: var(--primary); width: 18px; text-align: center; }
.cliente-row .label { color: var(--muted); }
.cliente-row .value { margin-left: auto; font-weight: 600; text-align: right; }

/* ============================================================
   PENDÊNCIAS
   ============================================================ */
.pendencias-card { background: #FBF6E4; border: 1px solid #F0DCA8; border-radius: var(--radius-card); padding: 18px 20px; margin-bottom: 16px; }
.pendencias-head { color: #9A6A10; font-weight: 700; font-size: 1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.pendencias-list { list-style: none; margin: 0; padding: 0; }
.pendencias-list li { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-top: 1px solid #F0DCA8; }
.pendencias-list li:first-child { border-top: 0; }
.pendencias-list .bi { color: #B97E11; margin-top: 2px; }
.pendencia-code { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #7E5A0F; background: #F0DCA8; padding: 2px 8px; border-radius: 6px; }
.pendencia-msg { font-size: .9rem; color: #6B4E14; margin-top: 4px; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline-item { position: relative; padding: 0 0 18px 38px; }
.timeline-item::before { content: ''; position: absolute; left: 13px; top: 26px; bottom: -2px; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot {
    position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: .82rem;
}
.timeline-item.is-cancel .timeline-dot { background: #F7E3E3; color: #B23131; }
.timeline-title { font-weight: 600; font-size: .9rem; }
.timeline-date { font-size: .78rem; color: var(--muted); }

/* ============================================================
   LOGIN / RESPONSIVO
   ============================================================ */
.auth-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(14,42,71,.55); z-index: 1035; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-mobile-open .sidebar { transform: translateX(0); }
    .app-main { margin-left: 0 !important; }
    body.sidebar-mobile-open .sidebar-overlay { display: block; }
    .user-meta { display: none; }
}

/* ============================================================
   CATÁLOGO DE PRODUTOS (editor de pedido)
   ============================================================ */
.catalogo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 620px;
    overflow-y: auto;
    padding-right: 4px;
}
.catalogo-card {
    border: 1px solid var(--border, #DBE3EE);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    transition: box-shadow .15s, border-color .15s;
}
.catalogo-card:hover { box-shadow: 0 6px 16px rgba(22,35,58,.08); border-color: var(--primary, #1E5FD0); }
.catalogo-img {
    width: 100%; height: 96px; object-fit: cover; border-radius: 8px; background: #EDF2F9;
}
.catalogo-img-vazia {
    display: flex; align-items: center; justify-content: center;
    color: #8CA0B8; font-size: 1.6rem; border: 1px dashed #C3D0E2;
}
.catalogo-cod { font-size: .72rem; color: var(--muted, #5D6B84); font-weight: 600; }
.catalogo-desc {
    font-size: .82rem; font-weight: 600; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2em;
}
.catalogo-grupo { font-size: .72rem; color: var(--muted, #5D6B84); }
.catalogo-meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; flex-wrap: wrap; }
.catalogo-preco { font-weight: 700; color: var(--text, #16233A); }
.catalogo-acao { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.catalogo-qtd { width: 64px; }
.catalogo-acao .btn { flex: 1; white-space: nowrap; }

/* ---- Grade de produtos (aba Selecionar Itens) + carrinho ---- */
.grid-img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: #EDF2F9; }
.grid-img-vazia { display: inline-flex; align-items: center; justify-content: center; color: #8CA0B8; border: 1px dashed #C3D0E2; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border, #DBE3EE); border-radius: 7px; overflow: hidden; }
.qty-stepper .qty-btn {
    border: 0; background: #F3F7FC; width: 26px; height: 26px; font-size: .95rem; line-height: 1;
    color: var(--text, #16233A); cursor: pointer;
}
.qty-stepper .qty-btn:hover { background: #E8EFFC; color: var(--primary, #1E5FD0); }
.qty-stepper .cat-qtd { width: 48px; height: 26px; border: 0; text-align: center; -moz-appearance: textfield; font-size: .82rem; }
.qty-stepper .cat-qtd::-webkit-outer-spin-button, .qty-stepper .cat-qtd::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cat-fav { font-size: 1.1rem; line-height: 1; }

/* ---- Aba Finalizar: escolha do tipo de documento ---- */
.doc-choice { display: flex; flex-direction: column; gap: 10px; }
.doc-option {
    border: 1px solid var(--border, #DBE3EE); border-radius: 10px; padding: 12px 14px; cursor: pointer;
    display: block; transition: border-color .15s, box-shadow .15s;
}
.doc-option:hover { border-color: var(--primary, #1E5FD0); }
.doc-option input { margin-right: 8px; }
.doc-option span { font-weight: 600; }
.doc-option:has(input:checked) { border-color: var(--primary, #1E5FD0); box-shadow: 0 0 0 2px rgba(30,95,208,.15); background: #F3F7FC; }

/* ---- Densidade do editor de pedido (Fase 15.1) ---- */
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: .82rem; border-bottom: 1px dashed #E8EEF6; }
.kv:last-child { border-bottom: 0; }
.kv > span { color: var(--muted, #5D6B84); white-space: nowrap; }
.kv > b { text-align: right; }
.table-compacta th, .table-compacta td { padding-top: 3px !important; padding-bottom: 3px !important; vertical-align: middle; }
.table-compacta td { font-size: .84rem; }
/* Inputs e botões do carrinho/grade mais baixos (linhas ~40% menores) */
.table-compacta .form-control-sm { min-height: 0; height: 28px; padding: 1px 8px; font-size: .82rem; line-height: 1.2; }
/* Esconde as setinhas dos inputs numéricos do carrinho (mais espaço para o valor) */
.table-compacta input[type=number] { -moz-appearance: textfield; }
.table-compacta input[type=number]::-webkit-outer-spin-button,
.table-compacta input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.table-compacta .btn-sm { padding: 2px 8px; line-height: 1.1; }
.table-compacta .acoes-item { white-space: nowrap; }
.grid-img-sm { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; background: #EDF2F9; display: inline-block; }
span.grid-img-sm.grid-img-vazia { display: inline-flex; align-items: center; justify-content: center; color: #8CA0B8; border: 1px dashed #C3D0E2; }
/* Botão Adicionar compacto, em uma única linha */
.cat-add { white-space: nowrap; padding: 3px 10px !important; font-size: .8rem; }

.resumo-bar {
    background: #EDF2F9; border-radius: 999px; padding: 5px 14px; color: var(--text, #16233A);
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.resumo-bar b { color: var(--primary, #1E5FD0); }

.pf-toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 1080;
    background: #188554; color: #fff; padding: 12px 18px; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(22,35,58,.2); font-weight: 600; font-size: .9rem;
    opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.pf-toast.show { opacity: 1; transform: translateY(0); }
.pf-toast.erro { background: #C93A3A; }

/* ============================================================
   MOBILE — vendedor em campo (frente 4)
   ============================================================ */

/* Barra fixa inferior do editor de pedido (só mobile) */
.pedido-bottombar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px; background: #fff; border-top: 1px solid var(--border, #DBE3EE);
    box-shadow: 0 -4px 16px rgba(22,35,58,.08);
}
.pedido-bottombar .bar-total { font-size: 1.05rem; font-weight: 700; }
.pedido-bottombar .bar-itens { font-size: .78rem; color: var(--muted, #5D6B84); }

@media (max-width: 991.98px) {
    /* Tabelas viram cards empilhados (carrinho e listagem de pedidos) */
    .table-mobile-cards thead { display: none; }
    .table-mobile-cards, .table-mobile-cards tbody,
    .table-mobile-cards tr, .table-mobile-cards td { display: block; width: 100%; }
    .table-mobile-cards tr {
        border: 1px solid var(--border, #DBE3EE); border-radius: 12px;
        margin-bottom: 10px; padding: 10px 12px; background: #fff;
    }
    .table-mobile-cards td {
        display: flex; justify-content: space-between; align-items: center;
        gap: 10px; padding: 4px 0 !important; border: none; text-align: right;
    }
    .table-mobile-cards td::before {
        content: attr(data-label);
        font-size: .74rem; color: var(--muted, #5D6B84); font-weight: 600; text-align: left;
        flex-shrink: 0;
    }
    .table-mobile-cards td:not([data-label])::before,
    .table-mobile-cards td[data-label=""]::before { content: none; }
    .table-mobile-cards td .form-control { max-width: 140px; }
    .table-mobile-cards td[colspan] { justify-content: center; text-align: center; }

    /* Alvos de toque maiores no editor */
    .qty-stepper .qty-btn { width: 40px; height: 40px; font-size: 1.1rem; }
    .qty-stepper .cat-qtd { width: 56px; height: 40px; font-size: .95rem; }
    .table-compacta .form-control-sm { height: 38px; font-size: .95rem; }
    .cat-add { padding: 8px 14px !important; font-size: .9rem; }
    .acoes-item .btn { min-width: 42px; min-height: 38px; }

    /* Cabeçalho do pedido recolhível (economiza a tela toda para os itens) */
    #cabecalhoCards { display: none; }
    #cabecalhoCards.aberto { display: flex; }

    /* Barra-resumo do topo das abas quebra linha sem estourar */
    .resumo-bar { flex-wrap: wrap; }
    .pedido-header-main { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ============================================================
   ATLÂNTICO — refinamentos de fidelidade ao mockup
   ============================================================ */

/* Conteúdo centralizado com largura máxima (respiro nas telas largas) */
.content { max-width: var(--content-max); margin: 0 auto; width: 100%; }

/* Busca global da topbar */
.topbar-search {
    align-items: center; gap: 9px; color: var(--muted);
    background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
    padding: 0 15px; width: 320px;
}
.topbar-search input {
    border: 0; background: transparent; padding: 8px 0; width: 100%;
    font-size: .9rem; color: var(--text);
}
.topbar-search input:focus { outline: none; }
.topbar-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* Badge de contagem no menu (ex.: aprovações pendentes) */
.menu-badge {
    margin-left: auto; background: #B97E11; color: #fff;
    font-size: .68rem; font-weight: 700; border-radius: 999px; padding: 2px 8px;
}

/* Cartões de KPI da listagem de pedidos */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi-top {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    color: var(--muted); font-size: .76rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
}
.kpi-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-delta { font-size: .82rem; font-weight: 600; color: var(--muted); }
.kpi-delta.up { color: #188554; }
.kpi-delta.down { color: #C93A3A; }
.kpi-delta.warn { color: #B97E11; }
.kpi-spark { color: var(--primary); opacity: .9; }
.kpi-spark svg { width: 64px; height: 22px; display: block; }
.kpi-spark polyline { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 960px) { .kpi-row { grid-template-columns: 1fr 1fr; } }

/* Rótulos de filtros/campos em caixa alta discreta (padrão do mockup) */
.card-surface .form-label.small {
    text-transform: uppercase; font-size: .72rem; letter-spacing: .06em;
    font-weight: 700; color: var(--muted);
}

/* ============================================================
   CHIPS DE VÍNCULO (carteira: vendedor <-> cliente)
   ============================================================ */
.chips-box { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; align-items: center; }
.chip-item {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--primary-soft); color: var(--primary-dark);
    border-radius: 999px; padding: 5px 8px 5px 13px; font-size: .85rem; font-weight: 600;
}
.chip-item .chip-x {
    border: 0; background: none; color: inherit; font-size: 1.05rem; line-height: 1;
    padding: 0 5px; cursor: pointer; border-radius: 50%;
}
.chip-item .chip-x:hover { background: rgba(30,95,208,.15); }
.chips-vazio { color: var(--muted); font-size: .85rem; }

/* Tabelas com menu dropdown nas linhas: rolam na horizontal quando são largas
   (tablet) SEM cortar o menu "Ações" — os menus escapam do container via Popper
   strategy:fixed (site.js). Antes usávamos overflow:visible, mas isso fazia a
   tabela larga vazar a página no tablet em vez de rolar. */
.table-permite-dropdown { overflow-x: auto; }

/* Campo de busca das listagens (pílula com ícone) + contador do filtro em tempo real */
.search { position: relative; display: flex; align-items: center; }
.search > i { position: absolute; left: 14px; color: var(--muted, #5D6B84); pointer-events: none; }
.search > input { width: 100%; border: 1px solid var(--border, #DBE3EE); border-radius: 999px; padding: 9px 16px 9px 38px; font-size: .9rem; background: var(--card, #fff); transition: border-color .15s, box-shadow .15s; }
.search > input:focus { outline: none; border-color: var(--primary, #1E5FD0); box-shadow: 0 0 0 3px rgba(30, 95, 208, .15); }
.busca-contador { font-size: .78rem; color: var(--muted, #5D6B84); align-self: center; white-space: nowrap; }

/* Cards de estatística clicáveis (dashboard) */
.stat-link { display: block; text-decoration: none; color: inherit; }
.stat-link .stat-card { transition: box-shadow .15s, transform .15s; }
.stat-link:hover .stat-card { box-shadow: 0 6px 18px rgba(30, 95, 208, .18); transform: translateY(-1px); }

/* Linha expansível (+) da listagem de Pedidos: célula do botão e painel de detalhe */
.pf-exp-celula { width: 36px; }
.pf-exp-celula .pf-expandir { padding: .1rem .35rem; line-height: 1; }
.pf-detalhe-celula { background: #EAF2FE; padding: .85rem 1rem; border-top: 2px solid var(--primary, #1E5FD0); }

/* Pedido em RASCUNHO: fundo cinza clarinho na listagem (chama atenção: não foi enviado) */
.linha-rascunho td { background: #F1F3F7; }
/* Linha com o detalhe (+) aberto: destaque azul claro (vence o cinza do rascunho) */
.linha-expandida td { background: #EAF2FE !important; }

/* Truncamento elegante em colunas de listagem (texto completo no tooltip) */
.td-nowrap { white-space: nowrap; }
.td-trunc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-trunc-sm { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 780px) {
    /* No layout de cards do mobile as células voltam a quebrar normalmente */
    .td-trunc, .td-trunc-sm { max-width: none; white-space: normal; }
}

/* ============================================================
   INÍCIO 2 — gráfico de barras duplas (pedidos x faturados)
   ============================================================ */
.gbar-wrap { display: flex; gap: 10px; }

/* Eixo vertical de valores: rótulos alinhados às linhas de grade */
.gbar-eixo {
    position: relative; flex: 0 0 auto; min-width: 64px;
    height: 280px; font-size: .66rem; color: var(--muted);
}
.gbar-eixo span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }

.gbar-scroll { flex: 1; min-width: 0; overflow-x: auto; padding-bottom: 2px; }
.gbar-plot { position: relative; height: 280px; min-width: max-content; }
.gbar-gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed #dce4f0; }

.gbar-row {
    position: relative; display: flex; align-items: flex-end; gap: 4px; height: 100%;
}
.gbar-dia {
    flex: 1 1 0; min-width: 34px; height: 100%;
    display: flex; align-items: flex-end; justify-content: center; gap: 2px;
}
.gbar-col {
    width: 45%; max-width: 20px; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px;
}
.gbar { width: 100%; max-width: 16px; flex-shrink: 0; border-radius: 4px 4px 0 0; transition: opacity .15s; }
.gbar-dia:hover .gbar { opacity: .75; }
.gbar-cor-pedidos { background: #ED7A1C; }   /* laranja: pedidos colocados */
.gbar-cor-faturado { background: #188554; }  /* verde: pedidos faturados  */

/* Bolinha com a quantidade de pedidos no topo de cada barra */
.gbar-bolha {
    flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px;
    color: #fff; font-size: .6rem; font-weight: 700; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 2px rgba(14, 42, 71, .3);
}
.gbar-bolha-pedidos { background: #ED7A1C; }
.gbar-bolha-faturado { background: #188554; }

/* Datas dd/MM/aa inclinadas, na mesma malha de colunas das barras */
.gbar-labels { display: flex; gap: 4px; height: 44px; margin-top: 8px; min-width: max-content; }
.gbar-rotulo { flex: 1 1 0; min-width: 34px; display: flex; justify-content: center; align-items: flex-start; }
.gbar-rotulo span {
    font-size: .62rem; color: var(--muted); white-space: nowrap;
    transform: rotate(-55deg) translateX(-12px); transform-origin: center;
}
.gbar-legenda {
    display: inline-block; width: 12px; height: 12px; border-radius: 3px;
    vertical-align: -1px; margin-right: 4px;
}

/* Cartões do Início 2 com filete de cor à esquerda */
.kpi-borda-laranja { border-left: 4px solid #ED7A1C; }
.kpi-borda-verde { border-left: 4px solid #188554; }
.kpi-borda-vermelha { border-left: 4px solid #C93A3A; }
.kpi-borda-roxa { border-left: 4px solid #9B1C86; }
.kpi-borda-azul { border-left: 4px solid #1E5FD0; }
.kpi-card .kpi-top i { font-size: 1.05rem; opacity: .55; }

/* Combo de cliente do filtro de pedidos (sugestões com teclado) */
.combo-clientes { position: relative; }
.combo-opcoes {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 1050;
    background: #fff; border: 1px solid #d7dfeb; border-radius: 8px;
    max-height: 300px; overflow-y: auto;
    box-shadow: 0 10px 28px rgba(14, 42, 71, .16);
}
.combo-opcao { padding: 7px 12px; cursor: pointer; font-size: .875rem; line-height: 1.25; }
.combo-opcao:hover, .combo-opcao.ativa { background: #EAF1FC; }
.combo-fantasia { font-size: .74rem; color: var(--muted); }

/* Hub de relatórios: cards clicáveis */
a.relatorio-card { color: var(--text); transition: border-color .15s, box-shadow .15s, transform .12s; }
a.relatorio-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Metas: barra de progresso inline na linha da tabela (% dentro da barra) */
.meta-bar {
    position: relative; height: 22px; min-width: 130px;
    background: #E7EDF5; border-radius: 6px; overflow: hidden;
}
.meta-bar-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    border-radius: 6px; min-width: 2px; transition: width .3s ease;
}
.meta-bar-fill.meta-ok { background: #188554; }     /* >= 100% (bateu) */
.meta-bar-fill.meta-bom { background: #ED7A1C; }    /* >= 50% (a caminho) */
.meta-bar-fill.meta-baixo { background: #C93A3A; }  /* < 50% (baixo) */
.meta-bar-label {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700; color: #fff;
    text-shadow: 0 1px 2px rgba(12, 28, 50, .5);
    font-variant-numeric: tabular-nums; letter-spacing: .2px;
}

/* Editor de pedido: código do item em vermelho */
.cod-produto { color: #C93A3A; font-weight: 600; }

/* Estoque: mantém o verde/vermelho do badge, mas sem a bolinha */
.badge-sem-bolinha::before { display: none !important; }

/* Campo de filtro e campos preenchidos: fundo verde bem claro (mesma cor) */
.campo-filtro, .campo-preenchido { background-color: #E9F7EF !important; }

/* Campo obrigatório ainda não preenchido: fundo vermelho bem claro (falta preencher) */
.campo-faltando { background-color: #FCEBEA !important; }

/* Desconto do item acima do máximo da tabela: destaca que vai para aprovação */
.cart-desc.desc-acima { border-color: #ED7A1C; background-color: #FFF6EC; }

/* Combo de cliente do modal Novo Pedido: item ativo pela seta do teclado */
.autocomplete-item.ativa { background: #EAF1FC; }

/* Devolução: badge e destaque (valores negativos, subtrai das vendas) */
.status-devolucao { background: #F3D9F0; color: #9B1C86; }

/* ============================================================
   DENSIDADE POR FORMATO (Opção A) — no fim do arquivo de propósito,
   para vencer por ordem de cascata os componentes definidos acima.
   Referência = desktop 1441–1919px (valores padrão do :root).
   • Notebook (992–1440): mais compacto, ganha altura no 768.
   • FHD+ (≥1920): usa um pouco mais da largura da tela.
   • Abaixo de 992px vale o layout mobile (sidebar em gaveta + cards).
   ============================================================ */
@media (min-width: 992px) and (max-width: 1440px) {
    body { font-size: 14px; }
    :root {
        --sidebar-w: 240px;
        --content-pad: 16px;
        --input-h: 40px;
    }
    .page-title { font-size: 1.35rem; }
    .page-subtitle { margin-bottom: 16px; }
    .table-clean td { padding: 6px 12px; }
    .table-clean th { padding: 7px 12px; }
    .kpi-card { padding: 13px 15px; }
    .card-surface { border-radius: 10px; }
}

@media (min-width: 1920px) {
    :root { --content-max: 1680px; }
}

/* ============================================================
   Menu Moderno (rail à esquerda -> flyout à direita) — design 22
   Reusa a classe .sidebar (slot fixo + toggle mobile). Cores da
   identidade: rail --sidebar-bg (navy), acento --primary (azul).
   ============================================================ */
.sidebar-mm { overflow: visible; padding: 0; }
.mm-rail { display: flex; flex-direction: column; height: 100vh; overflow-y: auto; overflow-x: hidden; padding: 10px 8px 20px; gap: 1px; background: var(--sidebar-bg); }
.mm-rail::-webkit-scrollbar { width: 6px; }
.mm-rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 6px; }
.mm-brand { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; color: #fff; font-weight: 800; white-space: nowrap; }
.mm-brand .mk { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--primary); color: #fff; flex: none; }
.mm-brand small { display: block; font-weight: 500; font-size: .68rem; color: var(--sidebar-text); }
.mm-search { display: flex; align-items: center; gap: 8px; margin: 2px 6px 10px; padding: 8px 10px; border-radius: 9px; background: rgba(255,255,255,.08); color: var(--sidebar-text); }
.mm-search input { border: 0; background: transparent; color: #fff; font: inherit; font-size: .84rem; outline: none; width: 100%; }
.mm-search input::placeholder { color: var(--sidebar-text); }
.mm-head { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sidebar-text); padding: 12px 12px 4px; }
.mm-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; cursor: pointer; font-size: .88rem; font-weight: 550; white-space: nowrap; border: 0; background: transparent; color: var(--sidebar-text); width: 100%; text-align: left; text-decoration: none; }
.mm-item:hover { background: #12335a; background: color-mix(in srgb, var(--primary) 14%, var(--sidebar-bg)); color: #fff; }
/* Ativo: azul discreto sobre o navy (mesmo tom do protótipo), não o azulão sólido. */
.mm-item.on, .mm-item.ativo { background: #163a66; background: color-mix(in srgb, var(--primary) 26%, var(--sidebar-bg)); color: #fff; }
.mm-item > .bi { font-size: 1.05rem; flex: none; }
.mm-item .mm-l { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.mm-item .mm-cw { font-size: .8rem; opacity: .6; transition: transform .15s; margin-left: auto; }
.mm-item.on .mm-cw { transform: rotate(90deg); }
.mm-item .mm-badge { background: #c93a3a; color: #fff; font-size: .62rem; font-weight: 800; border-radius: 999px; padding: 1px 6px; margin-left: auto; }
.mm-favs .mm-item > .bi { color: #e6b800; }
.mm-empty { font-size: .72rem; color: var(--sidebar-text); padding: 4px 12px 8px; line-height: 1.35; opacity: .8; }

.mm-flyout { position: fixed; top: var(--topbar-h); bottom: 0; left: var(--sidebar-w); width: min(760px, calc(100vw - var(--sidebar-w))); background: var(--card); border-right: 1px solid var(--border); box-shadow: 26px 0 60px -34px rgba(10,20,40,.5); overflow: auto; padding: 18px 22px; z-index: 1040; display: none; }
.mm-flyout.show { display: block; animation: mmIn .16s ease; }
@keyframes mmIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.mm-fhead { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.mm-fhead .mm-fi { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary); color: #fff; flex: none; }
.mm-fhead b { font-size: 1.05rem; color: var(--text); }
.mm-fclose { margin-left: auto; width: 30px; height: 30px; border: 1px solid var(--border); background: transparent; border-radius: 8px; cursor: pointer; color: var(--muted); }
.mm-fclose:hover { color: var(--text); border-color: var(--primary); }
.mm-cols { display: grid; gap: 20px 26px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.mm-col h4 { margin: 0 0 7px; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); font-weight: 800; }
.mm-col.ws h4 { color: var(--muted); }
.mm-link { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.mm-link:hover { background: var(--primary-soft); }
.mm-link > a { display: flex; align-items: center; gap: 9px; padding: 6px 8px; font-size: .85rem; color: var(--text); text-decoration: none; flex: 1; min-width: 0; }
.mm-link > a > .bi { color: var(--primary); opacity: .9; flex: none; }
.mm-link > a .mm-badge { margin-left: auto; background: #c93a3a; color: #fff; font-size: .62rem; font-weight: 800; border-radius: 999px; padding: 1px 6px; }
.mm-fav { border: 0; background: transparent; color: var(--muted); cursor: pointer; opacity: .3; padding: 4px 6px; border-radius: 6px; flex: none; }
.mm-link:hover .mm-fav { opacity: .6; }
.mm-fav:hover { opacity: 1; color: #e0a800; }
.mm-fav.on { opacity: 1; color: #e6b800; }
.mm-restag { margin-left: auto; font-size: .7rem; color: var(--muted); }

body.sidebar-collapsed .mm-rail .mm-l,
body.sidebar-collapsed .mm-rail .mm-cw,
body.sidebar-collapsed .mm-rail .mm-badge,
body.sidebar-collapsed .mm-rail .mm-head,
body.sidebar-collapsed .mm-rail .mm-brand span,
body.sidebar-collapsed .mm-rail .mm-search { display: none; }
body.sidebar-collapsed .mm-item { justify-content: center; }

/* container dos flyouts (irmão do rail): não ocupa espaço — os painéis são position:fixed */
.mm-flyouts { position: static; }
/* No celular o painel vira tela cheia (cobre topbar e rail); fecha no × */
@media (max-width: 991.98px) {
  .mm-flyout { top: 0; left: 0; width: 100vw; z-index: 1060; padding: 16px 18px; }
  .mm-flyout .mm-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .mm-flyout .mm-cols { grid-template-columns: 1fr; }
}

/* ============================================================
   MENU ACORDEÃO (estilos "Atlântico Clássico" e "F&O") — 3ª/4ª
   opção de menu do usuário (Meu Perfil > Estilo do menu).
   Mesma estrutura, duas peles: .acc-atl (navy) e .acc-fo (claro).
   ============================================================ */
.sidebar-acc .acc-item,
.sidebar-acc .acc-grupo-cab {
    display: flex; align-items: center; gap: 10px; width: 100%;
    border: 0; background: none; text-align: left; cursor: pointer;
    font: inherit; font-size: .88rem; padding: 8px 12px; border-radius: 8px;
    color: inherit; text-decoration: none;
}
.sidebar-acc .acc-item i, .sidebar-acc .acc-grupo-cab i { font-size: 1rem; flex: none; }
.sidebar-acc .acc-seta { margin-left: auto; font-size: .72rem !important; transition: transform .18s; }
.sidebar-acc .acc-grupo.aberto > .acc-grupo-cab .acc-seta { transform: rotate(90deg); }
.sidebar-acc .acc-corpo { display: none; }
.sidebar-acc .acc-grupo.aberto > .acc-corpo { display: block; }
.sidebar-acc .acc-subtitulo {
    font-size: .64rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    padding: 9px 12px 3px 38px; opacity: .6;
}
.sidebar-acc .acc-filho { padding-left: 38px; font-size: .85rem; }
.sidebar-acc .acc-badge {
    margin-left: auto; background: #E5484D; color: #fff; font-size: .68rem; font-weight: 700;
    border-radius: 999px; padding: 1px 7px; line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) { .sidebar-acc .acc-seta { transition: none; } }

/* ---- Pele 1: Atlântico Clássico (navy, identidade atual) ---- */
.acc-atl .acc-item:hover, .acc-atl .acc-grupo-cab:hover { background: rgba(255,255,255,.07); }
.acc-atl .acc-item.ativo { background: var(--primary); color: #fff; font-weight: 600; }
.acc-atl .acc-grupo-cab {
    text-transform: uppercase; font-size: .72rem; letter-spacing: .07em;
    font-weight: 700; color: #9DB4CE; margin-top: 2px;
}
.acc-atl .acc-grupo.aberto > .acc-grupo-cab { color: #fff; }
.acc-atl .acc-subtitulo { color: #7E97B5; opacity: 1; }

/* ---- Pele 2: Estilo F&O (claro, cantos retos, faixa ativa) ---- */
.acc-fo { background: #F5F6F8; color: #201F1E; border-right: 1px solid #E1E3E8; }
.acc-fo .sidebar-header { background: var(--sidebar-bg); border-bottom: 0; }
.acc-fo .sidebar-nav { padding: 6px 0 28px; }
.acc-fo .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }
.acc-fo .acc-item, .acc-fo .acc-grupo-cab { border-radius: 0; padding: 9px 16px; }
.acc-fo .acc-item:hover, .acc-fo .acc-grupo-cab:hover { background: #EBEDF1; }
.acc-fo .acc-item.ativo {
    background: #E1EAF7; box-shadow: inset 3px 0 0 #114A9F;
    color: #114A9F; font-weight: 600;
}
.acc-fo .acc-grupo-cab {
    text-transform: uppercase; font-size: .7rem; letter-spacing: .06em;
    font-weight: 700; color: #605E5C; border-top: 1px solid #E7E9ED;
}
.acc-fo .acc-grupo.aberto > .acc-grupo-cab { color: #114A9F; background: #EBEDF1; }
.acc-fo .acc-corpo { background: #FBFBFC; }
.acc-fo .acc-filho { padding-left: 42px; }
.acc-fo .acc-subtitulo { padding-left: 42px; color: #605E5C; opacity: 1; }

/* ============================================================
   RESPONSIVIDADE MOBILE — barra de navegação inferior + ajustes
   ============================================================ */
.bottom-nav { display: none; }
@media (max-width: 991.98px) {
    .bottom-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1045;
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        background: #fff; border-top: 1px solid var(--border, #DBE3EE);
        box-shadow: 0 -4px 16px rgba(22, 35, 58, .08);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bn-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px; padding: 8px 4px 7px; min-height: 56px;
        border: 0; background: none; text-decoration: none; cursor: pointer;
        color: var(--muted, #5D6B84); font-size: .66rem; font-weight: 600; font-family: inherit;
    }
    .bn-item i { font-size: 1.3rem; line-height: 1; }
    .bn-item.ativo { color: var(--primary, #1E5FD0); }
    .bn-item:active { background: #F0F4FA; }

    /* Conteúdo não fica escondido atrás da barra */
    .content { padding-bottom: 84px; }

    /* No editor de pedido a barra própria (total + Enviar) tem prioridade */
    body:has(.pedido-bottombar) .bottom-nav { display: none; }
    body:has(.pedido-bottombar) .content { padding-bottom: var(--content-pad); }

    /* tfoot das tabelas-cartão some (os totais já estão nos KPIs da tela) */
    .table-mobile-cards tfoot { display: none; }

    /* Botões de ação das linhas com alvo de toque confortável */
    .table-mobile-cards td .btn-sm { min-height: 40px; min-width: 44px; }

    /* Meu Perfil / telas com botões lado a lado: empilha sem apertar */
    .content .d-flex.gap-3.flex-wrap > form { width: 100%; }
    .content .d-flex.gap-3.flex-wrap > form .btn { width: 100%; }
}

/* ============================================================
   LISTA MOBILE COMPACTA (Pedidos e Clientes) — estilo escolhido
   "Compacto duas colunas": cartão baixo, fantasia à esquerda,
   valor/status à direita; pedidos agrupados por DATA. Desktop
   continua com as tabelas (este bloco só aparece < 992px).
   ============================================================ */
.lista-mobile { display: none; }
@media (max-width: 991.98px) {
    .lista-mobile { display: block; }
    .lista-mobile ~ .so-desktop, .so-desktop-mobile-oculto { display: none !important; }

    .lm-gtit {
        position: sticky; top: 0; z-index: 2; background: var(--bg, #EEF2F7);
        font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
        color: #77839B; padding: 8px 4px 4px;
    }
    .lm-card {
        display: flex; justify-content: space-between; align-items: center; gap: 10px;
        background: #fff; border: 1px solid #E5EAF2; border-radius: 13px;
        padding: 9px 12px; margin-bottom: 8px; color: inherit; text-decoration: none;
    }
    a.lm-card:active { background: #F4F7FB; }
    .lm-meio { flex: 1; min-width: 0; }
    .lm-t { font-weight: 600; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text, #16233A); }
    .lm-s { font-size: .7rem; color: #8A94A6; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .lm-end {
        font-size: .7rem; color: #5D6B84; margin-top: 2px; line-height: 1.35;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .lm-dir { text-align: right; flex: none; max-width: 42%; }
    .lm-v { font-size: .84rem; color: var(--text, #16233A); }
    .lm-st { font-size: .66rem; font-weight: 700; margin-top: 1px; }
    .lm-st.rascunho, .lm-st.orcamento { color: #5D6B84; }
    .lm-st.enviado { color: #1E5FD0; }
    .lm-st.pendenteaprovacao { color: #B58A00; }
    .lm-st.aprovado { color: #0E9F6E; }
    .lm-st.integrado { color: #B45309; }
    .lm-st.faturado { color: #157347; }
    .lm-st.cancelado, .lm-st.rejeitado { color: #B02A37; }
    .lm-chip {
        display: inline-flex; font-size: .62rem; font-weight: 700; padding: 2px 8px;
        border-radius: 999px; background: #FBEAEC; color: #B02A37; margin-top: 2px;
    }
    .lm-btn {
        display: inline-flex; align-items: center; gap: 5px; margin-top: 4px;
        border: 1px solid var(--primary, #1E5FD0); color: var(--primary, #1E5FD0);
        background: #fff; border-radius: 999px; padding: 4px 11px;
        font-size: .7rem; font-weight: 700; cursor: pointer;
    }
    .lm-vazio { text-align: center; color: var(--muted, #5D6B84); padding: 28px 8px; }
}

/* ============================================================
   CATÁLOGO MOBILE (editor de pedido): 1 produto por linha,
   layout horizontal e stepper com ±1 / ±10 (alvos grandes).
   Os cards (#catCards) só existem em telas < 992px.
   ============================================================ */
@media (max-width: 991.98px) {
    .catalogo-grid { grid-template-columns: 1fr; max-height: none; gap: 10px; }
    .cat-topo { display: flex; gap: 10px; align-items: flex-start; }
    .cat-mini-img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: #EDF2F9; flex: none; }
    .cat-info { flex: 1; min-width: 0; }
    .catalogo-card .catalogo-desc { min-height: 0; }
    .cat-rodape { display: flex; gap: 8px; align-items: stretch; margin-top: 2px; }
    .cat-rodape .qty-stepper { flex: none; }
    .cat-rodape .qty-btn { width: 38px; height: 44px; font-size: 1.05rem; }
    .cat-rodape .qty-btn.qty-dez { width: 42px; font-size: .78rem; font-weight: 700; background: #E8EFFC; color: var(--primary, #1E5FD0); }
    .cat-rodape .cat-qtd { width: 46px; height: 44px; font-size: .95rem; }
    .cat-rodape .cat-add { flex: 1; min-height: 44px; font-weight: 600; }
}

/* ============================================================
   ABAS DO EDITOR DE PEDIDO com cor (mais evidentes): pílulas
   azuladas; a ativa fica sólida no azul da marca.
   ============================================================ */
#abasPedido { gap: 6px; }
#abasPedido .nav-link {
    background: #EDF2FA; color: #3D5375; font-weight: 600;
    border: 1px solid #D5E0F0; border-radius: 9px;
    padding: 7px 14px; margin-bottom: 8px;
}
#abasPedido .nav-link:hover { background: #E0EAF9; color: var(--primary, #1E5FD0); }
#abasPedido .nav-link.active {
    background: var(--primary, #1E5FD0); color: #fff; border-color: var(--primary, #1E5FD0);
    box-shadow: 0 3px 10px rgba(30, 95, 208, .3);
}
#abasPedido .nav-link .badge { background: rgba(255,255,255,.25) !important; }
#abasPedido .nav-link:not(.active) .badge { background: var(--primary, #1E5FD0) !important; }

/* Botão "i" dos cards de relatório (abre a explicação funcional no modal) */
.rel-info {
    position: absolute; top: 12px; right: 22px;
    border: 0; background: none; padding: 4px;
    color: var(--muted, #5D6B84); font-size: 1.05rem; line-height: 1; cursor: pointer;
    border-radius: 50%; transition: color .15s, background .15s;
}
.rel-info:hover { color: var(--primary, #1E5FD0); background: #EAF1FC; }

/* Dashboard: complementos dos novos blocos (mês corrente) */
.stat-extra { display: block; font-size: .74rem; font-weight: 600; margin-top: 2px; }
.stat-card-mini { padding: 14px 16px; }
.stat-card-mini .stat-value { font-size: 1.15rem; }
.meta-track { display: block; height: 8px; border-radius: 999px; background: #E3E8F0; overflow: hidden; margin: 6px 0 2px; }
.meta-fill { display: block; height: 100%; border-radius: 999px; background: var(--primary, #1E5FD0); }
.meta-fill.meta-ok { background: #188554; }
.hbar-link { text-decoration: none; color: inherit; border-radius: 8px; }
.hbar-link:hover { background: #F1F5FB; }
.top-cliente-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #EEF1F6; }
.top-cliente-row:last-child { border-bottom: 0; }
.top-cliente-pos { flex: 0 0 30px; font-weight: 800; color: #1E5FD0; }
.top-cliente-nome { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-cliente-valor { text-align: right; font-weight: 700; white-space: nowrap; }

/* ============================================================
   TEMAS DE MENU CLARO (Parâmetros > Identidade Visual)
   Os temas "Neve", "Nuvem", "Linho", "Pérola" e "Areia" põem o
   menu lateral em fundo CLARO. Os tokens de cor já vêm do tema;
   aqui só corrigimos o que estava fixo em branco/transparências
   pensadas para o navy. Vale para as três peles de menu.
   ============================================================ */
body.menu-claro .sidebar { border-right: 1px solid var(--border); }
body.menu-claro .sidebar-header { border-bottom-color: rgba(0,0,0,.08); }
body.menu-claro .brand-title,
body.menu-claro .mm-brand { color: var(--sidebar-text-strong); }
body.menu-claro .nav-section-label,
body.menu-claro .mm-head { color: var(--muted); }
body.menu-claro .sidebar-nav::-webkit-scrollbar-thumb,
body.menu-claro .mm-rail::-webkit-scrollbar-thumb { background: rgba(0,0,0,.16); }

/* Menu padrão */
body.menu-claro .menu-link.active,
body.menu-claro .sidebar-nav .menu-link.active { background: var(--primary-soft); color: var(--primary); }
body.menu-claro .submenu { border-left-color: rgba(0,0,0,.10); }
body.menu-claro .submenu .menu-link,
body.menu-claro .submenu .menu-toggle { color: var(--sidebar-text); }
body.menu-claro .submenu .menu-link:hover,
body.menu-claro .submenu .menu-toggle:hover { color: var(--sidebar-text-strong); }

/* Menu moderno (mega-menu) */
body.menu-claro .mm-item:hover,
body.menu-claro .mm-item.on,
body.menu-claro .mm-item.ativo { color: var(--sidebar-text-strong); }
body.menu-claro .mm-search { background: rgba(0,0,0,.05); }
body.menu-claro .mm-search input { color: var(--sidebar-text-strong); }

/* Menu acordeão — pele Atlântico */
body.menu-claro .acc-atl .acc-item:hover,
body.menu-claro .acc-atl .acc-grupo-cab:hover { background: rgba(0,0,0,.05); }
body.menu-claro .acc-atl .acc-grupo-cab { color: var(--muted); }
body.menu-claro .acc-atl .acc-grupo.aberto > .acc-grupo-cab { color: var(--sidebar-text-strong); }
body.menu-claro .acc-atl .acc-subtitulo { color: var(--muted); }

/* ============================================================
   IDENTIDADE VISUAL (Parâmetros > Identidade Visual)
   Grade dos 30 temas: cada cartão traz um mini-mockup da tela
   (menu + corpo) pintado com as cores do próprio tema.
   ============================================================ */
.tema-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.tema-card {
    position: relative; display: block; cursor: pointer; margin: 0;
    background: var(--card); border: 2px solid var(--border);
    border-radius: var(--radius-card); overflow: hidden;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tema-card:hover { border-color: #B9C6DA; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tema-card.selecionado { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tema-radio { position: absolute; opacity: 0; pointer-events: none; }

.tema-mock { display: flex; height: 92px; }
.tema-mock-menu {
    width: 34%; padding: 10px 8px;
    display: flex; flex-direction: column; gap: 6px;
}
.tema-mock-marca { display: block; width: 22px; height: 22px; border-radius: 6px; }
.tema-mock-linha { display: block; height: 6px; border-radius: 3px; opacity: .85; }
.tema-mock-linha:nth-of-type(2) { width: 82%; }
.tema-mock-linha:nth-of-type(3) { width: 92%; opacity: 1; }
.tema-mock-linha:nth-of-type(4) { width: 66%; }
.tema-mock-corpo { flex: 1; padding: 12px 12px 0; display: flex; flex-direction: column; gap: 8px; }
.tema-mock-topo { display: block; height: 10px; border-radius: 4px; background: rgba(255,255,255,.85); }
.tema-mock-botao { display: block; width: 58px; height: 16px; border-radius: 6px; }
.tema-mock-chip { display: block; width: 78%; height: 22px; border-radius: 6px; }

.tema-info { display: block; padding: 10px 12px 12px; border-top: 1px solid var(--border); }
.tema-nome { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .88rem; }
.tema-desc { display: block; font-size: .74rem; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.tema-check { color: var(--primary); opacity: 0; transition: opacity .15s; margin-left: auto; }
.tema-card.selecionado .tema-check { opacity: 1; }

/* ============================================================
   MAPA DE VENDAS (Relatórios > Mapa)
   Leaflet + OpenStreetMap. Altura generosa no desktop e
   reduzida no celular, onde a tela já é o mapa inteiro.
   ============================================================ */
.mapa-vendas { height: 620px; width: 100%; background: var(--bg); }
/* Pin em gota, desenhado em HTML (divIcon do Leaflet) — sem imagem externa.
   Cores CHEIAS de propósito: sobre foto de satélite e mapa colorido, tom
   pastel some. A cor diz a situação do cliente; o furo branco no meio dá
   contraste em qualquer fundo e o anel marca posição aproximada. */
.pin {
    width: 26px; height: 26px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(15,23,42,.5);
}
.pin::after {
    content: ''; display: block;
    width: 8px; height: 8px; margin: 6px 0 0 6px;
    border-radius: 50%; background: rgba(255,255,255,.92);
}
.pin-comprou   { background: #E11D2F; }   /* vermelho forte — comprou */
.pin-semcompra { background: #3F4C60; }   /* cinza-ardósia escuro — não comprou */
.pin-bloqueado { background: #0B1220; }   /* quase preto — barrado */
.pin-inativo   { background: #8C9AAD; }   /* cinza médio — fora da carteira ativa */
.pin-aprox     { box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 3px 8px rgba(15,23,42,.5); }

/* Mesma gota, parada, para a legenda abaixo do mapa */
.mapa-pin-legenda {
    display: inline-block; width: 13px; height: 13px;
    border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(15,23,42,.35);
    vertical-align: -2px; margin-right: 7px;
}
.mapa-pin-legenda.pin-comprou   { background: #E11D2F; }
.mapa-pin-legenda.pin-semcompra { background: #3F4C60; }
.mapa-pin-legenda.pin-bloqueado { background: #0B1220; }
.mapa-pin-legenda.pin-inativo   { background: #8C9AAD; }

/* Agrupamento de pins: o padrão do markercluster é verde/amarelo translúcido,
   que some no mapa. Fica na mesma família forte dos pins. O seletor precisa do
   .leaflet-container na frente porque o CSS do plugin carrega DEPOIS deste. */
.leaflet-container .marker-cluster-small,
.leaflet-container .marker-cluster-medium,
.leaflet-container .marker-cluster-large {
    background: rgba(225,29,47,.30);
    border: 2px solid rgba(255,255,255,.9);
}
.leaflet-container .marker-cluster-small div,
.leaflet-container .marker-cluster-medium div,
.leaflet-container .marker-cluster-large div {
    background: #E11D2F; color: #fff;
    font: 700 12px/30px "Segoe UI", system-ui, sans-serif;
    box-shadow: 0 2px 6px rgba(15,23,42,.35);
}

.mapa-legenda {
    display: inline-block; width: 12px; height: 12px; border-radius: 50%;
    vertical-align: -1px; margin-right: 4px; opacity: .65;
}
.mapa-popup { font-size: .86rem; line-height: 1.5; min-width: 190px; }
.mapa-popup strong:first-child { display: block; margin-bottom: 4px; font-size: .95rem; }
.leaflet-container { font: inherit; }

@media (max-width: 991.98px) {
    .mapa-vendas { height: 420px; }
}

/* Logotipo da empresa nas telas públicas (login, esqueci/redefinir senha) */
.auth-logo { display: block; margin: 0 auto; max-height: 84px; max-width: 240px; object-fit: contain; }
