/* ==========================================================================
   Componentes reutilizáveis: cards, botões, segmented, menu, modal, badges.
   ========================================================================== */

.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 22px var(--shadow);
}

/* ---------- Botões ---------- */
.btn {
  font-family: inherit; font-size: 14px; font-weight: 700; border-radius: var(--radius-sm);
  padding: 10px 16px; cursor: pointer; border: 1px solid transparent; transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--brand-d); border-color: var(--brand-l); }
.btn-refresh {
  font-family: inherit; font-size: 13px; font-weight: 700; color: #fff; background: var(--brand);
  border: none; padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-refresh:hover { background: var(--brand-d); }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  font-weight: 700; color: var(--text-muted);
}
.input {
  font-family: inherit; font-weight: 600; color: var(--text-main);
  padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card-bg-2); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--teal-l); box-shadow: 0 0 0 3px rgba(79, 179, 164, .18); }
[data-theme="dark"] .input { color-scheme: dark; }
/* Selects: seta própria com respiro da borda (a nativa fica colada). */
select.input {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237c7c7c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
}
[data-theme="dark"] select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; background: var(--seg-bg); border-radius: 7px; padding: 3px; }
.seg-btn {
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-muted);
  border: none; background: transparent; padding: 7px 16px; border-radius: 5px; cursor: pointer;
  transition: all .15s;
}
.seg-btn.active { background: var(--card-bg); color: var(--teal-d); box-shadow: 0 2px 6px var(--shadow); }
.seg-btn:hover:not(.active) { color: var(--teal-d); }

/* ---------- Menu dropdown (engrenagem / usuário) ---------- */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 14px 40px var(--shadow); padding: 6px; min-width: 220px;
  display: flex; flex-direction: column; gap: 2px;
}
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-main);
  background: transparent; border: none; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; text-decoration: none; transition: background .12s;
}
.menu-item:hover { background: var(--card-bg-2); }
.menu-item.danger { color: var(--neg); }
.menu-check { cursor: pointer; }
.menu-check input { accent-color: var(--teal); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.menu-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); padding: 6px 12px 3px; }
/* Seção que só aparece dentro do menu do usuário no mobile (empresa + tema). */
.menu-mob { display: none; }
@media (max-width: 640px) {
  .menu-mob { display: block; }
  .topbar-actions .empresa-wrap { display: none; }
  .topbar-actions #btnTema { display: none; }
}
.menu-head { padding: 10px 12px 8px; }
.menu-head .mh-name { font-size: 14px; font-weight: 800; color: var(--text-main); }
.menu-head .mh-mail { font-size: 12px; color: var(--text-muted); word-break: break-all; }

/* ---------- Badges de variação ---------- */
.var { font-size: 13px; font-weight: 700; }
.var.pos { color: var(--pos); }
.var.neg { color: var(--neg); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8, 22, 20, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60;
}
.modal {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  width: min(720px, 100%); max-height: 88vh; overflow: auto; padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { font-size: 16px; font-weight: 800; color: var(--teal-d); text-transform: uppercase; letter-spacing: .4px; }
.modal-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.modal-lg { width: min(1100px, 100%); }

/* Linhas de tabela clicáveis (ex.: pedido → detalhe) */
.data-table tr.row-click { cursor: pointer; }

/* ==========================================================================
   Cards compactos de lista (mobile) — substituem a tabela empilhada.
   Alternância tabela↔cards via .tbl-desktop / .tbl-cards (breakpoint 640px).
   ========================================================================== */
.tbl-cards { display: none; }
@media (max-width: 640px) {
  .tbl-desktop { display: none; }
  .tbl-cards { display: flex; flex-direction: column; gap: 10px; }
}
.lc-card {
  display: block; width: 100%; text-align: left; font-family: inherit;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 15px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: background .12s;
}
button.lc-card { cursor: pointer; }
.lc-card.lc-click:active { background: var(--card-bg-2); }
.lc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lc-title { font-size: 15px; font-weight: 800; color: var(--text-main); line-height: 1.25; min-width: 0; }
.lc-badge { flex: none; }
.lc-sub { font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-top: 3px; }
.lc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; margin-top: 9px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.lc-mi { display: inline-flex; align-items: center; gap: 5px; }
.lc-mi b { color: var(--text-main); font-weight: 700; }
.lc-mi .ic { color: var(--text-muted); flex: none; }
.lc-mi .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.lc-mi .dot.cong { background: var(--cong); }
.lc-mi .dot.fres { background: var(--fres); }
.lc-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.lc-primary { font-size: 20px; font-weight: 800; color: var(--teal-d); }
.lc-primary .saldo-neg { color: var(--neg); }
.lc-primary .un-sfx { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.lc-extra { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-align: right; }
.lc-extra .btn { margin-left: 6px; }
.lc-rank { font-size: 13px; font-weight: 800; color: var(--cong); }
/* Cabeçalho de grupo entre cards (ex.: agrupar estoque por local) */
.lc-group { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 4px 2px; }
.lc-group-nome { font-size: 12.5px; font-weight: 800; color: var(--teal-d); text-transform: uppercase; letter-spacing: .3px; }
.lc-group-tot { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }

/* ---------- Detalhe de pedido (modal) ---------- */
.ped-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 18px; margin-bottom: 16px; }
.ped-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ped-k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.ped-v { font-size: 13.5px; font-weight: 700; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; }
.ped-tot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; background: var(--card-bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.ped-tcell { display: flex; flex-direction: column; gap: 2px; }
.ped-tv { font-size: 15px; font-weight: 800; color: var(--teal-d); }
.ped-itens-lbl { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .3px; }
.ped-itens { font-size: 12px; }
.ped-itens th, .ped-itens td { padding: 7px 8px; white-space: nowrap; }
.ped-itens td.desc { white-space: normal; min-width: 200px; }
.ped-cod { font-size: 10.5px; color: var(--text-muted); font-weight: 600; }
@media (max-width: 640px) {
  .ped-grid { grid-template-columns: 1fr 1fr; }
  .ped-tot { grid-template-columns: 1fr 1fr; }
  /* No mobile os itens viram cards rotulados (padrão da app); no desktop, tabela. */
}
.modal-chart { height: 240px; margin-bottom: 16px; }
.modal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal-table th, .modal-table td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.modal-table th:first-child, .modal-table td:first-child { text-align: left; }
.modal-table th { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.modal-table tfoot td { font-weight: 800; color: var(--text-main); border-top: 2px solid var(--border); }

/* ---------- Tabela de dados (reutilizável) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.data-table td.num, .data-table th.num { text-align: right; }
.data-table td.desc { white-space: normal; min-width: 220px; }
.data-table thead th {
  position: sticky; top: 0; background: var(--card-bg); z-index: 1;
  font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); font-weight: 700;
  cursor: pointer; user-select: none;
}
.data-table thead th .arrow { opacity: .5; font-size: 10px; }
.data-table tbody tr:hover { background: var(--card-bg-2); }
.data-table .saldo-zero { color: var(--text-muted); }
.data-table .saldo-pos { color: var(--pos); font-weight: 700; }
.data-table .saldo-neg { color: var(--neg); font-weight: 700; }
/* Margem (%) com cor: verde ≥0 / vermelho <0 (tabelas e KPIs) */
.mrg { font-weight: 700; }
.mrg.pos { color: var(--pos); }
.mrg.neg { color: var(--neg); }
.data-table .fam-tag {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px;
  background: var(--seg-bg); color: var(--text-muted);
}
.data-table .fam-tag.cong { background: rgba(14, 140, 122, .14); color: var(--cong); }
.table-empty { padding: 40px; text-align: center; color: var(--text-muted); font-weight: 600; }
.data-table .un-sfx { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

/* ---------- Tabelas no mobile: viram cards empilhados (sem rolagem lateral) ---------- */
@media (max-width: 640px) {
  .table-wrap { overflow-x: visible; }
  .data-table { font-size: 13px; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody { display: block; width: 100%; }
  .data-table tr {
    display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 13px; margin-bottom: 10px; background: var(--card-bg-2);
  }
  .data-table tbody tr:hover { background: var(--card-bg-2); }
  /* Mantém a ordem do DOM no desktop; no mobile a célula principal sobe ao topo. */
  .data-table td.cell-primary { order: -1; }
  .data-table td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
    padding: 5px 0; border: none; white-space: normal; text-align: right; min-width: 0;
  }
  .data-table td::before {
    content: attr(data-label); text-align: left; flex: none;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-muted); white-space: nowrap;
  }
  /* Célula principal: destaque no topo do card, sem rótulo. */
  .data-table td.cell-primary {
    display: block; text-align: left; font-size: 14.5px; font-weight: 800; color: var(--text-main);
    padding: 0 0 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); min-width: 0;
  }
  .data-table td.cell-primary::before { display: none; }
  .data-table td.desc { min-width: 0; }
  .data-table td.cell-acao { justify-content: flex-end; padding-top: 10px; }
  .data-table td.cell-acao::before { display: none; }
  .data-table td.cell-acao .btn { width: 100%; }
  .data-table td.table-empty { display: block; text-align: center; }
  .data-table td.table-empty::before { display: none; }
}

/* Badges de classe ABC */
.abc { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 5px; }
.abc-A { background: rgba(21, 160, 127, .16); color: var(--pos); }
.abc-B { background: rgba(245, 107, 27, .16); color: var(--brand-d); }
.abc-C { background: rgba(84, 84, 84, .14); color: var(--text-muted); }
.abc-resumo { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.abc-resumo .abc-cell { font-size: 12.5px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 7px; }

/* Menu do seletor de empresa: check + texto */
.empresa-item { display: flex; align-items: center; gap: 8px; }
.empresa-item .mi-check { width: 14px; color: var(--brand); font-weight: 800; }
.empresa-item .mi-txt em { color: var(--text-muted); font-style: normal; font-size: 11px; }

/* ---------- Botão pequeno + rodapé de modal ---------- */
.btn-sm { padding: 6px 12px; font-size: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- Alerta de pendências (produtos) ---------- */
.prod-alerta {
  display: flex; align-items: center; gap: 12px;
  background: rgba(245, 107, 27, .08); border: 1px solid rgba(245, 107, 27, .3);
  border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: 12px 16px;
}
.prod-alerta .pa-ico { display: inline-flex; color: var(--brand-d); flex: none; }
.prod-alerta .pa-txt { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.prod-alerta .pa-txt b { color: var(--brand-d); font-weight: 800; }
.prod-alerta .btn { flex: none; background: var(--brand); color: #fff; border: none; }
.prod-alerta .btn:hover { background: var(--brand-d); }

/* Badges de situação na tabela */
.st-badge { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 5px; }
.st-badge.st-warn { background: rgba(245, 107, 27, .16); color: var(--brand-d); }
.st-badge.st-ok { background: rgba(21, 160, 127, .16); color: var(--pos); }
.data-table tr.row-pend { background: rgba(245, 107, 27, .05); }

/* ==========================================================================
   Estoque — cabeçalho com abas (Resumo / Detalhado) e visão de Resumo
   ========================================================================== */
.est-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.est-tabs { display: inline-flex; gap: 4px; background: var(--card-bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.est-tab {
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 13.5px; font-weight: 700; color: var(--text-muted);
  padding: 8px 20px; border-radius: 7px; transition: background .15s, color .15s;
}
.est-tab:hover { color: var(--text-main); }
.est-tab.active { background: var(--card-bg); color: var(--teal-d); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.est-header-right { display: flex; align-items: center; gap: 12px; }
.est-header .est-atualizacao { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Espaçamento entre filtros, KPIs e tabela na aba Detalhado
   (:not([hidden]) para não sobrepor o display:none quando a aba está oculta). */
#estDetalhado:not([hidden]) { display: flex; flex-direction: column; gap: 18px; }

/* Tabela detalhada compacta: cabe sem rolagem lateral (fonte menor + ellipsis
   em Produto/Local, com texto completo no title/hover). */
.est-table { table-layout: fixed; font-size: 11.5px; }
.est-table th, .est-table td { padding: 8px 7px; overflow: hidden; text-overflow: ellipsis; }
.est-table td.desc { white-space: nowrap; min-width: 0; }
.est-table .est-cod { font-size: 10.5px; letter-spacing: -0.2px; color: var(--text-muted); font-weight: 700; }
.est-table .un-sfx { font-size: 9.5px; }
.est-table td.num .un-sfx { text-transform: none; }

/* Checkbox "Agrupar por local" na toolbar do Detalhado */
.est-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-main); cursor: pointer; white-space: nowrap; padding-bottom: 8px; }
.est-check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* Filtros do Detalhado: botão de alternância — só aparece no mobile. */
.est-filtros-toggle {
  display: none; align-items: center; justify-content: center; gap: 8px; width: 100%;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-main);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; cursor: pointer;
}
.est-filtros-toggle .ic { color: var(--text-muted); }
.est-filtros-toggle.tem-filtro { border-color: var(--brand); color: var(--brand-d); }
.est-filtros-toggle.tem-filtro .ic { color: var(--brand); }
@media (max-width: 640px) {
  .est-filtros-toggle { display: flex; }
  #estFiltros { display: none; }
  #estFiltros.aberto { display: flex; }
  /* Campos preenchem a largura da div (ignora os min-width inline do desktop). */
  #estFiltros .tb-group { flex: 1 1 100% !important; min-width: 0 !important; width: 100%; }
  #estFiltros .tb-group .input,
  #estFiltros #estProdutos,
  #estFiltros .ms-control { width: 100%; }
}

/* Toolbar de filtros que ocupa a largura total no mobile (reutilizável). */
@media (max-width: 640px) {
  .filtros-mob .tb-group { flex: 1 1 100% !important; min-width: 0 !important; width: 100%; }
  .filtros-mob .tb-group .input, .filtros-mob .ms-control, .filtros-mob .seg, .filtros-mob .btn-refresh { width: 100%; }
  .filtros-mob .seg { display: flex; }
  .filtros-mob .seg .seg-btn { flex: 1; }
  .filtros-mob .btn-refresh { justify-content: center; }
}

/* Campo de data: aparência unificada nas 3 plataformas (Android/iOS/desktop).
   Remove o widget nativo (ícone/seta/vazio inconsistentes) e usa um ícone de
   calendário próprio; o indicador nativo fica invisível cobrindo todo o campo,
   então tocar em qualquer lugar abre o seletor. */
input[type="date"].input {
  appearance: none; -webkit-appearance: none;
  position: relative; text-align: left; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c7c7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px 16px;
}
[data-theme="dark"] input[type="date"].input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}
input[type="date"].input::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
/* iOS: normaliza a altura interna do valor para não estourar/centralizar. */
input[type="date"].input::-webkit-date-and-time-value { text-align: left; }

/* Linha de grupo (agrupamento por local) na tabela detalhada */
.data-table tr.grp-row { background: var(--card-bg-2); }
.data-table tr.grp-row:hover { background: var(--card-bg-2); }
.data-table tr.grp-row td { padding: 8px 12px; border-bottom: 2px solid var(--border); }
.grp-inner { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.grp-nome { font-size: 12.5px; font-weight: 800; color: var(--teal-d); text-transform: uppercase; letter-spacing: .3px; }
.grp-count { color: var(--text-muted); font-weight: 600; text-transform: none; letter-spacing: 0; }
.grp-tot { font-size: 12px; font-weight: 700; color: var(--text-muted); }

/* Alerta de saldo negativo */
.estr-alerta {
  display: flex; align-items: center; gap: 12px;
  background: rgba(245, 107, 27, .08); border: 1px solid rgba(245, 107, 27, .3);
  border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 13.5px; font-weight: 600; color: var(--text-main);
}
.estr-alerta b { color: var(--brand-d); font-weight: 800; }
.estr-alerta-ico { display: inline-flex; color: var(--brand-d); flex: none; }

/* KPIs do resumo */
.estr-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.estr-kpis > * { min-width: 0; }
.estr-kpi { padding: 22px 26px; display: flex; flex-direction: column; }
.estr-kpi-top { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--text-muted); }
.estr-kpi-main { font-size: 34px; font-weight: 800; color: var(--teal-d); line-height: 1.15; margin-top: 6px; }
/* Saldo em caixas discreto ao lado do total em kg (Resumo e Detalhado) */
.kpi-cx { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.estr-kpi.accent .estr-kpi-main { color: var(--orange); }
.estr-kpi-sub { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-top: 4px; }
.estr-kpi-foot { font-size: 12.5px; color: var(--text-muted); margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.estr-kpi-foot b { color: var(--text-main); font-weight: 700; }

/* Grid de painéis 2 colunas */
.estr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.estr-row > * { min-width: 0; }
.estr-panel { padding: 22px 24px; }
.estr-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--text-main); margin: 0 0 18px; }
.estr-title-un { color: var(--text-muted); font-weight: 700; text-transform: none; letter-spacing: 0; }
.estr-vazio { color: var(--text-muted); font-size: 13px; font-weight: 600; padding: 12px 0; }

/* Estoque por tipo: donut + legenda */
.estr-tipo-wrap { display: flex; align-items: center; gap: 24px; }
.estr-donut-wrap { position: relative; width: 150px; height: 150px; flex: none; }
.estr-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.estr-donut-center b { font-size: 20px; font-weight: 800; color: var(--text-main); }
.estr-donut-center span { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); }
.estr-tipo-lista { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.estr-tipo-head { display: flex; align-items: baseline; gap: 8px; }
.estr-tipo-head .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; align-self: center; }
.estr-tipo-nome { font-size: 13px; font-weight: 800; color: var(--text-main); text-transform: uppercase; letter-spacing: .3px; }
.estr-tipo-kg { margin-left: auto; font-size: 13.5px; font-weight: 800; color: var(--text-main); }
.estr-tipo-pct { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.estr-tipo-sub { font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-left: 18px; }

/* Barras horizontais (local / classificação) */
.estr-bars { display: flex; flex-direction: column; gap: 13px; }
.estr-bar-row { display: flex; align-items: center; gap: 12px; }
.estr-bar-lbl { flex: none; width: 34%; font-size: 12px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.estr-bar-track { flex: 1; height: 14px; background: var(--card-bg-2); border-radius: 7px; overflow: hidden; }
.estr-bar-fill { height: 100%; background: var(--cong); border-radius: 7px; }
.estr-bar-val { flex: none; width: 52px; text-align: right; font-size: 12.5px; font-weight: 800; color: var(--text-main); }
.estr-bar-mais { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 4px; }

/* Ranking de maiores saldos */
.estr-rank { display: flex; flex-direction: column; gap: 4px; }
.estr-rank-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.estr-rank-row:last-child { border-bottom: none; }
.estr-rank-pos { flex: none; width: 22px; font-size: 15px; font-weight: 800; color: var(--cong); text-align: center; }
.estr-rank-main { flex: 1; min-width: 0; }
.estr-rank-desc { font-size: 13px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* No Top 10 de produtos o nome pode quebrar em 2 linhas (mais fácil de identificar). */
#prodTop .estr-rank-desc { white-space: normal; overflow: visible; }
.estr-rank-meta { font-size: 11px; font-weight: 600; color: var(--text-muted); margin: 2px 0 5px; }
.estr-rank-track { height: 5px; background: var(--card-bg-2); border-radius: 3px; overflow: hidden; }
.estr-rank-fill { height: 100%; background: var(--cong-l); border-radius: 3px; }
.estr-rank-val { flex: none; text-align: right; }
.estr-rank-kg { font-size: 13.5px; font-weight: 800; color: var(--text-main); }
.estr-rank-rs { font-size: 12px; font-weight: 700; color: var(--text-muted); }

/* Itens clicáveis do Resumo (drill-down → filtra a aba Detalhado) */
.estr-click { cursor: pointer; }
.estr-tipo-row.estr-click, .estr-rank-row.estr-click { border-radius: 8px; transition: background .12s; }
.estr-bar-row.estr-click { border-radius: 6px; padding: 3px 6px; margin: 0 -6px; transition: background .12s; }
.estr-tipo-row.estr-click:hover, .estr-rank-row.estr-click:hover, .estr-bar-row.estr-click:hover { background: var(--card-bg-2); }
.estr-bar-row.estr-click:hover .estr-bar-fill { filter: brightness(1.08); }
.estr-click:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 900px) {
  .estr-kpis { grid-template-columns: 1fr; }
  .estr-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .est-tabs { flex: 1; }
  .est-tab { flex: 1; text-align: center; padding: 8px 12px; }
  .estr-tipo-wrap { flex-direction: column; align-items: stretch; gap: 18px; }
  .estr-donut-wrap { align-self: center; }
  .estr-bar-lbl { width: 40%; }
  /* No mobile a tabela vira cards empilhados: desfaz o clip/ellipsis do compacto */
  .est-table { table-layout: auto; font-size: 13px; }
  .est-table th, .est-table td { overflow: visible; text-overflow: clip; }
  .est-table td.desc { white-space: normal; }
  /* Linha de grupo vira uma faixa simples no mobile (sem virar card) */
  .data-table tr.grp-row { display: block; padding: 0; margin: 10px 0 4px; border: none; background: none; }
  .data-table tr.grp-row td { display: block; padding: 8px 10px; background: var(--card-bg-2); border-radius: 7px; border: none; }
  .data-table tr.grp-row td::before { display: none; }
}

/* ---------- Formulário de edição de produto ---------- */
.prod-descr { font-size: 15px; font-weight: 800; color: var(--text-main); line-height: 1.35; margin-bottom: 4px; }
.prod-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 10px 0 16px; font-size: 12.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.prod-meta b { color: var(--text-main); font-weight: 700; }
.prod-meta em { font-style: normal; opacity: .7; }
.prod-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.prod-form .field { min-width: 0; }
.prod-form .input { width: 100%; min-width: 0; }
.prod-form .field-full { grid-column: 1 / -1; }
.prod-form .input-calc { background: var(--seg-bg); color: var(--text-muted); font-weight: 700; cursor: default; }
.prod-form .check-row { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.prod-form .switch-val { font-size: 13px; font-weight: 700; color: var(--text-main); }
.prod-form .radio-row { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 4px; }
.prod-form .radio { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-main); cursor: pointer; }
.prod-form .radio input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; flex: none; }
.prod-erro { margin-top: 14px; }
@media (max-width: 560px) { .prod-form { grid-template-columns: 1fr; } }

/* ---------- Multi-select pesquisável ---------- */
.ms { position: relative; }
.ms-control {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; cursor: pointer; text-align: left;
}
.ms-control .ms-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); font-weight: 700; }
.ms-control .ms-label.vazio { color: var(--text-muted); font-weight: 600; }
.ms-control .ms-caret { display: inline-flex; color: var(--text-muted); flex: none; }
.ms-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 45;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 14px 40px var(--shadow); padding: 8px; display: flex; flex-direction: column; gap: 8px;
}
.ms-input {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text-main);
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card-bg-2);
}
.ms-input:focus { outline: none; border-color: var(--brand-l); box-shadow: 0 0 0 3px rgba(245, 107, 27, .15); }
.ms-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; }
.ms-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-main);
}
.ms-item:hover { background: var(--card-bg-2); }
.ms-item input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.ms-vazio { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.ms-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 8px; }
.ms-count { font-size: 11px; color: var(--text-muted); font-weight: 700; }
.ms-clear { background: none; border: none; color: var(--brand-d); font-weight: 700; font-size: 12px; cursor: pointer; }
.ms-clear:hover { text-decoration: underline; }

/* ---------- Toggle / switch ---------- */
.switch { position: relative; display: inline-flex; align-items: center; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 40px; height: 22px; border-radius: 999px; background: var(--border);
  transition: background .15s; position: relative; flex: none; cursor: pointer;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(245, 107, 27, .3); }
.switch input:disabled + .track { opacity: .45; cursor: not-allowed; }

/* ---------- Configurações: administração de permissões ---------- */
.cfg { display: flex; flex-direction: column; gap: 18px; }
.cfg-sec-title {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); display: flex; align-items: center; gap: 8px; margin: 6px 2px 0;
}
.cfg-sec-title .ic { width: 17px; height: 17px; }
.cfg-hint { font-size: 12.5px; color: var(--text-muted); margin: -6px 2px 2px; line-height: 1.5; }

.acct-card { padding: 18px 22px; display: flex; align-items: center; gap: 14px; }
.acct-card .acct-nome { font-size: 16px; font-weight: 800; color: var(--text-main); }
.acct-card .acct-mail { font-size: 13px; color: var(--text-muted); word-break: break-all; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.perm-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.perm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.perm-head .ph-nome { font-size: 15px; font-weight: 800; color: var(--text-main); }
.perm-head .ph-mail { font-size: 12px; color: var(--text-muted); word-break: break-all; }
.perm-head .ph-ativo { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.perm-head .ph-ativo .lab { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }

.role-badge {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  padding: 2px 8px; border-radius: 5px; background: var(--seg-bg); color: var(--text-muted); margin-left: 8px;
}
.role-badge.admin { background: rgba(245, 107, 27, .16); color: var(--brand-d); }

.perm-rows { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 4px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.perm-row .pr-lbl { font-size: 13.5px; font-weight: 700; color: var(--text-main); }
.perm-row.master .pr-lbl { color: var(--brand-d); }
.perm-sub { padding-left: 14px; border-left: 2px solid var(--border); margin-left: 2px; }
.perm-sub .perm-row { padding: 7px 0; }
.perm-sub .pr-lbl { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.perm-sub.off { opacity: .5; }

.perm-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.perm-foot .pf-status { font-size: 12px; font-weight: 700; margin-right: auto; }
.perm-foot .pf-status.ok { color: var(--pos); }
.perm-foot .pf-status.err { color: var(--neg); }
.perm-self-note { font-size: 11.5px; color: var(--text-muted); font-style: italic; }

@media (max-width: 520px) { .perm-grid { grid-template-columns: 1fr; } }

/* Config global (empresas/famílias visíveis) */
.cfg-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; }
.chk-item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.chk-item input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; flex: none; }
.chk-item em { font-style: normal; font-weight: 600; color: var(--text-muted); font-size: 12px; }
.cfg-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--border); padding-top: 14px; }
.cfg-foot .pf-status { margin-right: auto; font-size: 12px; font-weight: 700; }

/* ---------- Meu perfil ---------- */
.perfil-id { padding: 20px 22px; display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; }
.perfil-foto { display: flex; align-items: center; gap: 16px; }
.perfil-foto img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; background: var(--seg-bg); border: 2px solid var(--border); }
.perfil-foto-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.perfil-hint { font-size: 11.5px; color: var(--text-muted); }
.perfil-campos { flex: 1 1 260px; min-width: 240px; display: flex; flex-direction: column; gap: 14px; }
.perfil-acts { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 2px; }
.perfil-acts .pf-status { margin-right: auto; font-size: 12px; font-weight: 700; }
.perfil-senha { padding: 20px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.perfil-senha .perfil-acts { grid-column: 1 / -1; }
@media (max-width: 560px) { .perfil-senha { grid-template-columns: 1fr; } }

/* ---------- Calculadora de vendas ---------- */
.calc { display: flex; flex-direction: column; gap: 16px; max-width: 560px; width: 100%; margin: 0 auto; }
.calc-selecionar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 15px 18px; font-family: inherit; font-size: 15px; font-weight: 700; color: var(--text-main);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 22px var(--shadow); cursor: pointer; text-align: left;
}
.calc-selecionar #calcSelLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-selecionar .cs-caret { display: inline-flex; color: var(--text-muted); flex: none; }
.calc-vazio { padding: 56px 20px; }

.calc-produto { padding: 20px 22px; }
.calc-produto .cp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.calc-produto .cp-acoes { display: flex; align-items: center; gap: 6px; flex: none; }
.calc-produto .cp-titulo {
  font-family: inherit; text-align: left; background: none; border: none; padding: 0; cursor: pointer;
  font-size: 15px; font-weight: 800; color: var(--teal-d); line-height: 1.3;
}
.calc-produto .cp-titulo:hover { text-decoration: underline; }
.calc-produto .cp-sub { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin: 5px 0 16px; }
.calc-vars { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc-vars .field { min-width: 0; }
.calc-vars .input { width: 100%; min-width: 0; font-size: 16px; font-weight: 700; }
/* Rodapé: Custo (R$/Kg) read-only + Custo total, lado a lado. */
.calc-rodape { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.calc-rodape .rod-item { display: flex; flex-direction: column; gap: 3px; }
.calc-rodape .rod-k { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--text-muted); }
.calc-rodape .rod-v { font-size: 18px; font-weight: 800; color: var(--text-main); }
.calc-rodape .rod-item:last-child .rod-v { color: var(--brand-d); }

/* Detalhe de custo (vw_custo_produtos) — blocos separados por seção. */
.custo-bloco { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.custo-bloco:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.custo-bloco-tit { font-size: 16px; font-weight: 800; color: var(--teal-d); margin-bottom: 12px; }
.custo-linha { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; align-items: start; }
.custo-item { display: flex; flex-direction: column; gap: 3px; text-align: left; min-width: 0; }
.custo-item .ci-lbl { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.custo-item .ci-val { font-size: 17px; font-weight: 800; color: var(--text-main); }
.custo-item .ci-val em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--text-muted); }
.custo-item .ci-sub { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.custo-item.total .ci-val { color: var(--brand); }
/* Subtotal em faixa (largura total do bloco): rótulo à esquerda, valor à direita. */
.custo-item.full {
  grid-column: 1 / -1; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px;
  background: var(--card-bg-2); border-radius: 9px; padding: 11px 14px;
}
.custo-item.full .ci-lbl { font-size: 13px; font-weight: 800; color: var(--text-main); }
.custo-item.full .ci-val { color: var(--brand); }

/* "Informações do produto" continua em grade rótulo:valor. */
.custo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.custo-cell { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.custo-cell .cc-k { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.custo-cell .cc-v { font-size: 13.5px; font-weight: 700; color: var(--text-main); text-align: right; }
.custo-cell.full { grid-column: 1 / -1; flex-direction: column; align-items: flex-start; gap: 2px; }
.custo-cell.full .cc-v { text-align: left; }
@media (max-width: 520px) { .custo-grid { grid-template-columns: 1fr; } }

.calc-result { padding: 20px 18px; text-align: center; }
.calc-result .cr-lbl { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 10px; }
.calc-result .cr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calc-result .cr-mid { flex: 1; min-width: 0; }
.calc-result .cr-big { font-size: 26px; font-weight: 800; color: var(--teal-d); line-height: 1.1; cursor: pointer; }
.calc-result .cr-big:hover { opacity: .82; }
.calc-result .cr-un { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.calc-result.accent .cr-big { color: var(--brand); }
.calc-result .cr-input {
  width: 100%; max-width: 190px; display: inline-block; text-align: center; font-family: inherit;
  font-size: 26px; font-weight: 800; color: var(--teal-d); background: var(--card-bg);
  border: 1px solid var(--brand-l); border-radius: var(--radius-sm); padding: 3px 8px;
}
.calc-result .cr-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(245, 107, 27, .18); }
.calc-result.accent .cr-input { color: var(--brand); }
.calc-result .cr-sub { font-size: 15px; font-weight: 700; color: var(--text-main); margin-top: 4px; }
.calc-result .cr-sub2 { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.calc-result .cr-arrow {
  flex: none; width: 46px; height: 46px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.calc-result .cr-arrow:hover { background: var(--brand-d); }
.calc-result .cr-arrow:active { transform: scale(.95); }

/* Picker de produto (modal) */
.calc-picker .calc-filtros { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.calc-picker .calc-filtros .full { grid-column: 1 / -1; }
.calc-picker .pick-count { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.calc-lista { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; }
.calc-item {
  display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--border); padding: 11px 6px; cursor: pointer;
  font-family: inherit;
}
.calc-item:hover { background: var(--card-bg-2); }
.calc-item .ci-cod { font-size: 11px; font-weight: 800; color: var(--brand-d); }
.calc-item .ci-desc { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.calc-item .ci-meta { font-size: 11px; color: var(--text-muted); font-weight: 600; }
/* Filtros do picker não podem estourar a largura do modal (evita rolagem lateral
   em telas estreitas — os selects precisam poder encolher abaixo do conteúdo). */
.calc-picker .modal { overflow-x: hidden; }
.calc-picker .calc-filtros > .input { width: 100%; min-width: 0; max-width: 100%; }

/* Telas estreitas (ex.: iPhone 13): mantém a grade 2×3 dos campos e reduz o
   título do produto. Inputs seguem em 16px (base.css) — sem zoom no iOS. */
@media (max-width: 480px) {
  .calc-produto { padding: 18px 16px; }
  .calc-produto .cp-titulo { font-size: 13.5px; }
  .calc-vars { gap: 12px; }
}

/* ---------- Tabela de preços: modal de alteração ---------- */
.prc-atual { font-size: 14px; color: var(--text-muted); font-weight: 600; margin-bottom: 16px; }
.prc-atual b { color: var(--text-main); font-size: 16px; }
.prc-atual span { font-size: 12px; }
#prcModalBody .cfg-hint { margin-top: 12px; }
.prc-status { margin-top: 12px; font-size: 13px; font-weight: 700; min-height: 18px; }
.prc-status.ok { color: var(--pos); }
.prc-status.err { color: var(--neg); }

/* Valor vigente em destaque na tabela de preços */
.prc-valor { font-size: 18px; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; white-space: nowrap; }
.prc-valor-moeda { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-right: 2px; }
@media (max-width: 640px) {
  .prc-valor { font-size: 20px; }
}

/* ---------- Estado "em breve" (telas futuras) ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 12px; padding: 80px 20px; color: var(--text-muted);
}
.empty-state .es-ico { color: var(--text-muted); opacity: .8; }
.empty-state .es-ico .ic { width: 44px; height: 44px; }
.empty-state h2 { font-size: 22px; font-weight: 800; color: var(--text-main); }
.empty-state p { font-size: 14px; max-width: 440px; line-height: 1.55; }
.empty-state .es-fonte { font-size: 12.5px; color: var(--text-muted); }
.empty-state .es-fonte code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: var(--seg-bg); color: var(--brand-d); padding: 2px 7px; border-radius: 6px;
}
.empty-state .es-badge {
  margin-top: 4px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
  color: #fff; background: var(--brand); padding: 4px 12px; border-radius: 5px;
}
