/* =====================================================================================================
   BRAVU CRM V4 — camada visual única (carregada depois do style.css).
   Medidas, cores e estados copiados do protótipo aprovado (bravu_crm_v4_menu_igual_aprovado.html):
   menu lateral verde-preto (#0b100d), acento lime (#a3eb2d), conteúdo claro, layout compacto.
   Tema claro por padrão; escuro em :root[data-theme="dark"] (escolha guardada por navegador).
   ===================================================================================================== */

/* ---------- tokens (os nomes antigos continuam, só os valores mudaram) ---------- */
:root {
  --v4-lime: #a3eb2d; --v4-rail: #0b100d; --v4-rail2: #1c281b; --v4-railhover: #243323; --v4-railtext: #b3c0b2;
  --v4-bubble: #def4c3; --v4-chip-on-bg: #e4f6c9; --v4-chip-on-line: #b8df89; --v4-chip-on-ink: #233b1e;
  --v4-top: 67px;
  --bg: #f0f2ee; --surface: #ffffff; --row-alt: #f7faf5; --ink: #172018; --muted: #748575; --line: #e0e7dc;
  --accent: #a3eb2d; --accent-hover: #b4f24c; --accent-ink: #1d2b14;
  --mint: #347a31; --mint-soft: #e4f6c9;
  --field-bg: #f7faf5; --hover: #eff5e9;
  --shadow: 0 6px 24px rgba(14, 35, 17, .045);
  --font-display: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
:root[data-theme="dark"] {
  --v4-bubble: #354f2f; --v4-chip-on-bg: #2b4423; --v4-chip-on-line: #4f7a35; --v4-chip-on-ink: #d8f5b6;
  --bg: #101712; --surface: #19221b; --row-alt: #202c22; --ink: #edf3ed; --muted: #9faf9e; --line: #324235;
  --mint: #b9ec91; --mint-soft: rgba(163, 235, 45, .14);
  --field-bg: #202c22; --hover: #263629; --shadow: none;
}
/* a barra do vendedor e o login agora seguem o tema da página (antes eram sempre escuros) */
.vendor-topbar, .login-screen {
  --bg: inherit; --surface: inherit; --row-alt: inherit; --ink: inherit; --muted: inherit; --line: inherit;
  --mint: inherit; --mint-soft: inherit; --coral: inherit; --coral-soft: inherit; --amber: inherit; --amber-soft: inherit;
  --slate-soft: inherit; --field-bg: inherit; --hover: inherit; --shadow: inherit;
}
body { font-size: 14px; background: var(--bg); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid #74b721; outline-offset: 2px; }

/* ---------- estrutura: menu | (barra de cima + conteúdo) ---------- */
.shell { display: flex; grid-template-columns: none; height: 100vh; height: 100dvh; min-height: 460px; overflow: hidden; }
.shell.hidden { display: none !important; }
.v4-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.content { flex: 1; min-height: 0; overflow: auto; padding: 25px; }
.shell.sidebar-collapsed .content { padding-top: 25px; }

/* ---------- menu lateral ---------- */
.shell .sidebar {
  width: 248px; flex: 0 0 auto; background: var(--v4-rail); color: #edf3ed; padding: 0; gap: 0;
  position: relative; top: auto; height: auto; overflow: hidden; display: flex; flex-direction: column;
  transition: width .18s ease; z-index: 30; border: 0;
}
/* no computador a classe da gaveta (sidebar-collapsed) não muda nada: o menu tem sempre a mesma largura */
.shell.sidebar-collapsed .sidebar { width: 248px; }
.sidebar .brand { height: 83px; padding: 19px 13px 14px; display: flex; align-items: center; gap: 10px; white-space: nowrap; flex: none; }
.v4-mark { height: 32px; width: 32px; background: var(--v4-lime); color: #0b100d; border-radius: 9px; display: grid; place-items: center; font-size: 22px; flex: none; line-height: 1; }
.v4-mark svg { display: block; }
.brand .brand-text { display: block; min-width: 0; flex: none; }
.brand .brand-title { font-family: var(--font-body); font-size: 19px; font-weight: 800; letter-spacing: -.55px; color: #fff; line-height: 1.1; }
.brand .brand-title span { color: var(--v4-lime); }
.brand .brand-sub { display: block; color: #819285; font-size: 11px; margin-top: 4px; letter-spacing: .1px; }
/* botão X do menu: só existe na gaveta (celular/tablet) */
.v4-drawer-close { display: none; margin-left: auto; background: none; color: #bdc9bd; border: 0; border-radius: 7px; height: 32px; width: 32px; place-items: center; cursor: pointer; }
.v4-drawer-close:hover { background: var(--v4-railhover); }
/* menu: rolagem própria (o conteúdo rola separado) */
.v4-nav { overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 15px; scrollbar-width: thin; scrollbar-color: #334735 transparent; flex: 1; min-height: 0; }
.v4-section { line-height: normal; color: #728674; letter-spacing: 1.65px; font-size: 10px; font-weight: 800; margin: 16px 11px 7px; white-space: nowrap; text-transform: uppercase; }
.v4-section.v4-empty { display: none; }
.sidebar .v4-item {
  width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 11px; min-height: 41px; padding: 10px 11px;
  border: 0; background: transparent; color: var(--v4-railtext); text-align: left; border-radius: 10px; margin-bottom: 2px;
  position: relative; white-space: nowrap; font: 14px var(--font-body); font-weight: 400; cursor: pointer; transition: none;
}
.sidebar .v4-item:hover:not(:disabled) { background: var(--v4-railhover); color: var(--v4-railtext); }
.sidebar .v4-item:focus-visible { outline: 2px solid var(--v4-lime); outline-offset: -2px; }
.sidebar .v4-item.active { background: var(--v4-rail2); color: #fff; font-weight: 500; box-shadow: inset 0 0 0 1px #2f4a2a; }
.sidebar .v4-item.active::before { content: ""; height: 20px; width: 3px; background: var(--v4-lime); position: absolute; left: 0; top: 10px; border-radius: 0 3px 3px 0; }
.sidebar .v4-ico { display: flex; align-items: center; justify-content: center; line-height: 1; width: 20px; height: 20px; flex: none; }
.sidebar .v4-ico svg { width: 20px; height: 20px; display: block; }
.sidebar .v4-item.active .v4-ico { color: var(--v4-lime); }
.sidebar .v4-txt { overflow: hidden; text-overflow: ellipsis; }
.sidebar .v4-future { color: #718675; cursor: not-allowed; }
.sidebar .v4-future .v4-ico { color: #637265; }
.v4-soon { font-size: 10px; color: #718675; margin-left: auto; }
.sidebar .v4-chev { margin-left: auto; display: flex; color: #728674; transition: transform .15s; }
.shell.v4-cfg-open #nav-settings .v4-chev { transform: rotate(180deg); color: var(--v4-lime); }

/* ---------- Configurações: segunda coluna ao lado do menu (só ela) ---------- */
.v4-sub { width: 236px; flex: 0 0 auto; background: #121a14; color: #edf3ed; border-left: 1px solid #1f2b21; display: flex; flex-direction: column; min-height: 0; z-index: 29; }
.v4-sub[hidden] { display: none; }
.v4-sub-head { display: flex; align-items: center; gap: 8px; height: 83px; padding: 19px 12px 14px 18px; flex: none; }
.v4-sub-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; margin: 0; color: #fff; }
.v4-sub-close, .v4-sub-back { margin-left: auto; background: none; border: 0; color: #bdc9bd; height: 32px; width: 32px; border-radius: 7px; display: grid; place-items: center; cursor: pointer; }
.v4-sub-back { display: none; margin: 0; }
.v4-sub-close:hover, .v4-sub-back:hover { background: var(--v4-railhover); }
.v4-sub-nav { overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px 15px; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: #334735 transparent; }
.v4-sub-item { width: 100%; display: flex; align-items: center; gap: 11px; min-height: 41px; padding: 10px 11px; border: 0; background: transparent; color: var(--v4-railtext); border-radius: 10px; margin-bottom: 2px; font: 14px var(--font-body); text-align: left; cursor: pointer; position: relative; white-space: nowrap; }
.v4-sub-item .v4-ico { display: flex; width: 20px; height: 20px; flex: none; }
.v4-sub-item .v4-txt { overflow: hidden; text-overflow: ellipsis; }
.v4-sub-item:hover { background: var(--v4-railhover); }
.v4-sub-item:focus-visible { outline: 2px solid var(--v4-lime); outline-offset: -2px; }
.v4-sub-item.active { background: var(--v4-rail2); color: #fff; font-weight: 500; box-shadow: inset 0 0 0 1px #2f4a2a; }
.v4-sub-item.active::before { content: ""; height: 20px; width: 3px; background: var(--v4-lime); position: absolute; left: 0; top: 10px; border-radius: 0 3px 3px 0; }
.v4-sub-item.active .v4-ico { color: var(--v4-lime); }

/* ---------- barra de cima ---------- */
.v4-topbar { min-height: var(--v4-top); background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 10px 25px; flex: none; position: relative; z-index: 20; }
.v4-titles { min-width: 0; }
.v4-topbar h1 { font-size: 18px; margin: 0 0 3px; letter-spacing: -.3px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v4-subtitle { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v4-topright { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.v4-topbar .operation-select, .v4-opname { width: auto; max-width: 205px; min-width: 130px; background: var(--row-alt); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); padding: 9px; margin: 0; font: 13px var(--font-body); font-weight: 400; }
.v4-opname { display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v4-conn { color: #347a31; background: #e9f8e4; padding: 8px 10px; border-radius: 30px; font: 12px var(--font-body); white-space: nowrap; border: 0; cursor: pointer; }
.v4-conn::before { content: "● "; }
.v4-conn.v4-conn-warn { color: #936314; background: #fff0d2; }
:root[data-theme="dark"] .v4-conn { background: #274026; color: #b9ec91; }
:root[data-theme="dark"] .v4-conn.v4-conn-warn { background: #503d1f; color: #ffda93; }
.v4-avatar-wrap { position: relative; }
.v4-avatar { border: 1px solid var(--line); background: var(--row-alt); color: var(--ink); height: 35px; width: 35px; border-radius: 50%; font-weight: 800; cursor: pointer; font-family: var(--font-body); }
.v4-profile { position: absolute; right: 0; top: 46px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 10px 28px rgba(14, 35, 17, .14); z-index: 60; min-width: 230px; }
.v4-profile[hidden] { display: none; }
.v4-profile-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.v4-profile-head .user-name { font-weight: 700; font-size: 13px; }
.v4-profile-head .user-role { font-size: 12px; color: var(--muted); margin-top: 2px; }
.v4-profile button { display: block; width: 100%; text-align: left; padding: 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: 13px var(--font-body); cursor: pointer; }
.v4-profile button:hover { background: var(--hover); }
.v4-profile .app-version { font-size: 10.5px; color: var(--muted); padding: 6px 10px 2px; }
.v4-burger { display: none; background: transparent; border: 0; color: var(--ink); cursor: pointer; padding: 4px; border-radius: 8px; }
.v4-back { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); padding: 7px 9px; cursor: pointer; display: inline-flex; align-items: center; }
.v4-back.hidden { display: none; }
.v4-profile button { display: flex !important; align-items: center; gap: 9px; }
.v4-profile button [data-icon] { display: inline-flex; color: var(--muted); }
.v4-back:hover { background: var(--hover); }
.v4-backdrop { display: none; }

/* ---------- conteúdo: cabeçalhos, cartões, abas ---------- */
.v4-pagehead { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-bottom: 19px; }
.v4-pagehead h2 { font-size: 24px; letter-spacing: -.6px; margin: 0 0 6px; color: var(--ink); }
.v4-pagehead p { margin: 0; color: var(--muted); font-size: 13px; }
.v4-page { display: none; max-width: 1500px; margin: 0 auto; }
.content[data-view^="v4-"] #dashboard-view, .content[data-view^="v4-"] .table-wrap, .content[data-view^="v4-"] #empty { display: none !important; }
.content[data-view="v4-settings"] #v4-page-settings,
.content[data-view="v4-settings-integrations"] #v4-page-settings-integrations,
.content[data-view="v4-settings-preferences"] #v4-page-settings-preferences,
.content[data-view="v4-reports"] #v4-page-reports,
.content[data-view="v4-pad-cobrancas"] #v4-page-pad-cobrancas,
.content[data-view="v4-pad-integracoes"] #v4-page-pad-integracoes { display: block; }
.v4-section-title { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; margin: 20px 2px 10px; }
.v4-cardgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.v4-tile { text-align: left; color: var(--ink); display: flex; align-items: flex-start; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 17px; min-height: 100px; cursor: pointer; font: 14px var(--font-body); }
.v4-tile:hover:not(:disabled) { border-color: #9bcf6b; background: var(--hover); }
.v4-tileicon { width: 36px; height: 36px; flex: none; background: var(--mint-soft); color: var(--mint); border-radius: 10px; display: grid; place-items: center; }
.v4-tileicon svg { display: block; }
.v4-tile strong { display: block; margin: 3px 0 6px; }
.v4-tile small { color: var(--muted); line-height: 1.45; font-size: 12.5px; }
.v4-platform { margin-top: 6px; }
.v4-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); max-width: 560px; }
.v4-card h3 { margin: 0 0 14px; font-size: 16px; }
.v4-inline { display: flex; gap: 8px; align-items: center; }
.v4-pref input { width: 120px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--field-bg); color: var(--ink); font: 14px var(--font-body); }

/* as abas antigas do painel financeiro viraram itens de Gestão financeira no menu */
.dash-tabs { display: none !important; }

/* ---------- Pedidos: situação no topo da tela ---------- */
.v4-orders-head { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); margin: 0 auto 15px; max-width: 1500px; }
.content[data-view="orders"] .v4-orders-head { display: block; }
.v4-orders-label { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 11px; }
.v4-orders-head .filters { display: flex; flex-direction: row; flex-wrap: wrap; gap: 7px; }
.v4-orders-head .filter-btn { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: 12px var(--font-body); font-weight: 400; gap: 8px; justify-content: flex-start; white-space: nowrap; flex: none; }
.v4-orders-head .filter-btn:hover { background: var(--hover); color: var(--ink); }
.v4-orders-head .filter-btn.active { background: var(--v4-chip-on-bg); border-color: var(--v4-chip-on-line); color: var(--v4-chip-on-ink); font-weight: 700; }
.v4-orders-head .filter-btn .count, .v4-orders-head .filter-btn.active .count { font-family: var(--font-body); font-size: 11px; color: inherit; background: var(--row-alt); border: 1px solid var(--line); padding: 0 7px; border-radius: 20px; }
.v4-orders-head .filter-divider { width: 1px; height: auto; align-self: stretch; margin: 2px 3px; background: var(--line); }
.content[data-view="orders"] .topbar { max-width: 1500px; margin: 0 auto 15px; }
.content .topbar .search input, .content .topbar .sort-select { border-radius: 9px; background: var(--surface); }
.content[data-view="orders"] .table-wrap, .content[data-view="orders"] #empty { max-width: 1500px; margin-left: auto; margin-right: auto; }

/* ---------- tabelas e superfícies no estilo V4 ---------- */
.table-wrap { border-radius: 13px; overflow: auto; }
.orders-table thead th { background: var(--row-alt); color: var(--muted); font-size: 11px; letter-spacing: .5px; }
.home-card, .dash-card { border-radius: 14px; }
.btn-lime, .primary-btn, .accent-btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- Chat ao vivo: três colunas ocupando a área abaixo da barra de cima ---------- */
.content[data-view="chat"] { overflow: hidden; }
.content[data-view="chat"] .c2-shell { height: calc(100vh - var(--v4-top)); height: calc(100dvh - var(--v4-top)); }
.shell.sidebar-collapsed .c2-lhead { padding-left: 14px; }
.c2-shell { --c2-azul: #4f8a1c; }
/* busca: ícone à esquerda e filtros dentro da caixa (print de referência do Chat ao vivo) */
.c2-searchbox { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }
.c2-searchbox .c2-search { width: 100%; padding: 10px 42px 10px 40px; border-radius: 11px; }
.c2-search-ico { position: absolute; left: 12px; display: flex; color: var(--muted); pointer-events: none; }
.c2-filtro-btn { position: absolute; right: 6px; height: 32px; width: 32px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; }
.c2-filtro-btn:hover { background: var(--hover); color: var(--ink); }
.c2-filtro-btn .c2-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; padding: 0; border-radius: 50%; background: #74b721; font-size: 0; }
.c2-searchrow .c2-ico.sm { display: inline-grid; place-items: center; }
/* régua das 5 caixas: só ícones, mesma largura, a escolhida em verde */
.c2-caixas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.c2-caixa { height: 46px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--row-alt); color: var(--muted); border-radius: 11px; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.c2-caixa:hover { background: var(--hover); color: var(--ink); }
.c2-caixa:focus-visible { outline: 2px solid #74b721; outline-offset: 2px; }
.c2-caixa.on { border-color: #74b721; background: var(--v4-chip-on-bg); color: #3d6f15; box-shadow: 0 0 0 1px #74b721 inset; }
.c2-caixa.erro.on { color: #b45309; border-color: #d97706; box-shadow: 0 0 0 1px #d97706 inset; background: #fff4e0; }
.c2-shell[data-tema="dark"] .c2-caixa { background: #202c22; border-color: #324235; color: #9faf9e; }
.c2-shell[data-tema="dark"] .c2-caixa.on { background: rgba(163, 235, 45, .12); border-color: #a3eb2d; color: #a3eb2d; box-shadow: 0 0 0 1px #a3eb2d inset; }
.c2-shell[data-tema="dark"] .c2-caixa.erro.on { background: rgba(217, 119, 6, .14); border-color: #f59e0b; color: #fbbf24; box-shadow: 0 0 0 1px #f59e0b inset; }
.c2-head-main { min-width: 120px; }
.c2-head-acoes { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
.c2-ico svg, .c2-send svg, .c2-emoji svg, .c2-tpl-novo svg, .c2-pend-acoes svg, .c2-p-acoes svg, #c2-anexar svg { display: inline-block; vertical-align: middle; }
.c2-vazio { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; }
.c2-vazio p { margin: 0; }
.c2-boas-ico { color: #74b721; display: flex; }
.c2-bot svg { display: block; }
.c2-bot.erro { color: #b45309; border-color: #f2c48a; }
.c2-robo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--v4-chip-on-bg); color: var(--v4-chip-on-ink); }
.c2-erro { display: flex; gap: 9px; align-items: flex-start; padding: 9px 14px; background: #fff4e0; color: #7c4a03; font-size: 13px; border-bottom: 1px solid #f2d3a5; }
.c2-erro svg { flex: none; margin-top: 1px; color: #b45309; }
.c2-erro ul { margin: 6px 0 0; padding-left: 18px; }
.c2-erro code { font-size: 11px; background: rgba(0, 0, 0, .06); padding: 1px 5px; border-radius: 5px; }
.c2-shell[data-tema="dark"] .c2-erro { background: #3a2a12; color: #fde3b5; border-color: #5a4220; }
.c2-row.out .c2-bubble { background: var(--v4-bubble); border-color: var(--v4-bubble); color: var(--ink); }
.c2-item.on { box-shadow: inset 3px 0 0 #98db37; }
.c2-count { background: var(--v4-chip-on-bg); color: var(--v4-chip-on-ink); }
.c2-btn.azul { border-color: #8cc653; color: #3d6f15; }
.c2-field:focus-within { border-color: #8cc653; }
.c2-replybar, .c2-quote { border-left-color: #74b721; }
.c2-shell[data-tema="dark"] { --surface: #19221b; --bg: #101712; --ink: #edf3ed; --muted: #9faf9e; --line: #324235; --c2-azul: #a3eb2d; border-color: #324235; }
.c2-shell[data-tema="dark"] .c2-thread { background: #101712; }
.c2-shell[data-tema="dark"] .c2-bubble { background: #202c22; border-color: #202c22; color: #edf3ed; }
.c2-shell[data-tema="dark"] .c2-row.out .c2-bubble { background: var(--v4-bubble); border-color: var(--v4-bubble); color: #edf3ed; }
.c2-shell[data-tema="dark"] .c2-item.on { background: #263629; box-shadow: inset 3px 0 0 #98db37; }
.c2-shell[data-tema="dark"] .c2-item:hover { background: #263629; }
.c2-shell[data-tema="dark"] .c2-tab.on { background: rgba(163, 235, 45, .14); border-color: #a3eb2d; }
.c2-shell[data-tema="dark"] .c2-btn.azul { color: #b9ec91; border-color: #4f7a35; }
.c2-shell[data-tema="dark"] .c2-btn.azul:hover { background: rgba(163, 235, 45, .1); }
.c2-shell[data-tema="dark"] .c2-wave i.on { background: #0b100d; }

/* ---------- login ---------- */
.v4-login-brand { justify-content: center; margin-bottom: 22px; gap: 12px; height: auto; padding: 0; }
.v4-login-brand .brand-title { color: var(--ink); }
.v4-login-brand .brand-title span { color: #4f8a1c; }
:root[data-theme="dark"] .v4-login-brand .brand-title span { color: var(--v4-lime); }
.v4-login-brand .brand-sub { color: var(--muted); }

/* ---------- tela do vendedor: mesmo menu verde-preto à esquerda e barra clara em cima ---------- */
.vendor-shell:not([data-embedded="1"]) {
  display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: var(--v4-top) minmax(0, 1fr);
  height: 100vh; height: 100dvh; min-height: 0; overflow: hidden;
}
.vendor-shell.hidden { display: none !important; }
.vendor-brand { grid-column: 1; grid-row: 1; background: var(--v4-rail); color: #edf3ed; }
.vendor-brand .brand { height: var(--v4-top); padding: 0 13px; display: flex; align-items: center; gap: 10px; }
.vendor-shell:not([data-embedded="1"]) .vendor-topbar { grid-column: 2; grid-row: 1; padding: 10px 25px; background: var(--surface); border-bottom: 1px solid var(--line); }
.vendor-top-title { font-size: 18px; font-weight: 700; letter-spacing: -.3px; color: var(--ink); }
.vendor-shell:not([data-embedded="1"]) .vendor-tabs {
  grid-column: 1; grid-row: 2; flex-direction: column; gap: 2px; padding: 16px 10px; background: var(--v4-rail); border: 0; overflow: auto;
}
.vendor-shell:not([data-embedded="1"]) .vendor-tab-btn {
  width: 100%; text-align: left; color: var(--v4-railtext); font: 14px var(--font-body); padding: 10px 11px; border: 0; border-radius: 10px; margin: 0 0 2px; position: relative;
}
.vendor-shell:not([data-embedded="1"]) .vendor-tab-btn:hover { background: var(--v4-railhover); color: var(--v4-railtext); }
.vendor-shell:not([data-embedded="1"]) .vendor-tab-btn.active { background: var(--v4-rail2); color: #fff; border: 0; }
.vendor-shell:not([data-embedded="1"]) .vendor-tab-btn.active::before { content: ""; height: 20px; width: 3px; background: var(--v4-lime); position: absolute; left: 0; top: 10px; border-radius: 0 3px 3px 0; }
.vendor-shell:not([data-embedded="1"]) .vendor-content { grid-column: 2; grid-row: 2; overflow: auto; max-width: none; margin: 0; padding: 25px; }
.vendor-shell[data-embedded="1"] { flex: 1; min-height: 0; overflow: auto; }
.vendor-shell[data-embedded="1"] .vendor-brand { display: none; }
.vendor-shell[data-embedded="1"] .vendor-tabs { background: transparent; border-bottom: 1px solid var(--line); padding: 14px 25px 0; gap: 7px; flex-wrap: wrap; }
.vendor-shell[data-embedded="1"] .vendor-tab-btn { font: 13px var(--font-body); }
.vendor-shell[data-embedded="1"] .vendor-tab-btn.active { color: var(--v4-chip-on-ink); border-bottom-color: #74b721; font-weight: 700; }

/* ---------- conta restrita à Fila de Pedidos: o menu mostra só a Fila de pedidos ---------- */
.v4-restrito-fila #v4-nav .v4-item:not(#sales-queue-btn), .v4-restrito-fila #v4-nav .v4-section:not(#v4-sec-pedidos) { display: none !important; }

/* ---------- responsivo (mesmos pontos de quebra do protótipo) ---------- */
@media (max-width: 1200px) {
  .v4-cardgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --v4-top: 60px; }
  .shell .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw) !important; height: 100dvh; transform: translateX(0);
    transition: transform .2s; box-shadow: 0 8px 30px #0004; z-index: 80;
  }
  .shell.sidebar-collapsed .sidebar { transform: translateX(-105%); box-shadow: none; visibility: hidden; transition: transform .2s, visibility 0s linear .2s; }
  .v4-drawer-close { display: grid; }
  /* Configurações no celular: ocupa o lugar da gaveta, por cima do menu, com "voltar" */
  .v4-sub { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); height: 100dvh; z-index: 85; border-left: 0; box-shadow: 0 8px 30px #0004; }
  .v4-sub-back { display: grid; }
  .v4-sub-head { padding-left: 8px; }
  .shell:not(.sidebar-collapsed) .v4-backdrop, .shell.v4-cfg-open .v4-backdrop { display: block; position: fixed; inset: 0; background: #0007; z-index: 70; }
  .v4-burger { display: inline-flex; }
  .v4-topbar { padding: 10px 16px; }
  .content { padding: 18px; }
  .shell.sidebar-collapsed .content { padding-top: 18px; }
  .v4-orders-head .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .vendor-shell:not([data-embedded="1"]) { grid-template-columns: 200px minmax(0, 1fr); }
  .content[data-view="chat"] .c2-shell { height: calc(100dvh - var(--v4-top)); }
}
@media (max-width: 650px) {
  .v4-topbar { gap: 8px; padding: 9px 12px; }
  .v4-topbar h1 { font-size: 15px; }
  .v4-subtitle { font-size: 10px; }
  .v4-topright { gap: 5px; }
  .v4-topbar .operation-select, .v4-opname { max-width: 108px; min-width: 0; font-size: 10px; padding: 8px 4px; }
  .v4-conn { font-size: 0; padding: 7px; }
  .v4-conn::before { content: "●"; font-size: 13px; }
  .v4-avatar { width: 31px; height: 31px; }
  .content { padding: 14px; }
  .shell.sidebar-collapsed .content { padding-top: 14px; }
  .v4-pagehead h2 { font-size: 19px; }
  .v4-cardgrid { grid-template-columns: 1fr; }
  /* vendedor no celular: menu vira uma faixa de abas abaixo da barra de cima */
  .vendor-shell:not([data-embedded="1"]) { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--v4-top) auto minmax(0, 1fr); }
  .vendor-shell:not([data-embedded="1"]) .vendor-brand { display: none; }
  .vendor-shell:not([data-embedded="1"]) .vendor-topbar { grid-column: 1; padding: 9px 12px; flex-wrap: nowrap; }
  .vendor-shell:not([data-embedded="1"]) .vendor-tabs { grid-column: 1; grid-row: 2; flex-direction: row; overflow-x: auto; padding: 8px 10px; }
  .vendor-shell:not([data-embedded="1"]) .vendor-tab-btn { width: auto; flex: none; font-size: 13px; padding: 8px 11px; text-align: left; }
  .vendor-shell:not([data-embedded="1"]) .vendor-tab-btn.active::before { display: none; }
  .vendor-shell:not([data-embedded="1"]) .vendor-tab-btn .chat-badge { position: static; margin-left: 6px; }
  .vendor-shell:not([data-embedded="1"]) .vendor-content { grid-column: 1; grid-row: 3; padding: 14px; }
}
