:root {
  --primary: #0a66c2;
  --muted: #f2f6fb;
  --accent: #fff8dc;
  --green-load: #28a745;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 6px 12px;
  background: var(--muted);
  color: #222;
}

/* ===== BARRA ÚNICA NO TOPO ===== */
/* Tudo numa linha só: Abrir Arquivo/Salvo + MARGEM/FRETE/NOTA +
   Recalcular/Exportar/Salvar + BUSCAR + MARGEM MANUAL.
   Quebra para a próxima linha em telas estreitas (flex-wrap). */
#topBar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
#appBrandLine {
  display: flex;
  flex: 1 1 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#appBrandLine h1 { width: auto; flex: 1 1 auto; }
.app-version {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border: 1px solid #cfe0f2;
  border-radius: 999px;
  background: #eaf3fc;
  color: #315b83;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.connection-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
  padding: 10px 14px;
  border: 1px solid #f1d48a;
  border-radius: 10px;
  background: #fff8df;
  color: #71520a;
  font-size: 13px;
  font-weight: 650;
}
.connection-status > span { flex: 1 1 240px; min-width: 0; }
.connection-status-action {
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: #0a66c2;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.connection-status.is-success {
  border-color: #b6e4c4;
  background: #eaf8ee;
  color: #176638;
}
.connection-status.is-error {
  border-color: #f0c1bb;
  background: #fff0ee;
  color: #9c2c22;
}
.connection-status.is-offline {
  border-color:#fca5a5;
  background:#fff1f2;
  color:#991b1b;
}
#appClock {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.network-status { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; width:15px; height:15px; }
.network-status i { display:block; width:10px; height:10px; border-radius:50%; background:#9ca3af; box-shadow:0 0 0 2px #ffffff,0 0 0 3px #cbd5e1; }
.network-status[data-state="online"] i { background:#22c55e; box-shadow:0 0 0 2px #fff,0 0 0 3px #86efac; }
.network-status[data-state="slow"] i { background:#9ca3af; box-shadow:0 0 0 2px #fff,0 0 0 3px #cbd5e1; }
.network-status[data-state="offline"] i { background:#ef4444; box-shadow:0 0 0 2px #fff,0 0 0 3px #fca5a5; }
.offline-notice { position:fixed; z-index:18000; top:50%; left:50%; width:min(440px,calc(100vw - 32px)); padding:16px 20px; border:1px solid #fca5a5; border-radius:14px; background:#fff1f2; color:#991b1b; box-shadow:0 14px 44px #7f1d1d33; text-align:center; font-size:14px; font-weight:800; transform:translate(-50%,-50%); pointer-events:none; }
.offline-notice[hidden] { display:none; }
.nav-logout-btn { color:#b91c1c !important; }
#appNav .nav-btn[hidden], #appNav .nav-action[hidden] { display:none !important; }

/* Barra de ferramentas do Visualizador — fica logo abaixo do menu e só
   aparece quando a tela "Visualizador" está ativa (menos poluição). */
#viewerToolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.08);
}
#viewerToolbar.toolbar-hidden { display: none !important; }

h1 {
  font-size: 15px;
  margin: 0;
  color: var(--primary);
  width: 100%;
  order: -1;
}

input[type=file] { padding: 4px; }
/* Inputs file escondidos — usamos opacity:0 + position:absolute em vez de
   display:none, pois alguns navegadores bloqueiam .click() em elementos
   com display:none, impedindo a abertura do seletor de arquivos. */
#xmlFile, #jsonFile {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
label { font-size: 12px; color: #333; }

/* Inputs compactos — MARGEM, FRETE, NOTA ficam menores */
.input-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.input-group span { font-size: 11px; white-space: nowrap; }
.input-group input[type=number] {
  width: 52px;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Grupo de busca compacto no topo */
.search-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.search-group label { font-weight: 600; color: var(--primary); font-size: 11px; white-space: nowrap; }
.search-group input[type=text] {
  width: 160px;
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

input[type=number], input[type=text] {
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
}

/* ===== BOTÕES ESTILIZADOS E ANIMADOS ===== */
button {
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0a66c2, #0d8bd9);
  color: white;
  box-shadow: 0 2px 6px rgba(10, 102, 194, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}

button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}

button:hover::after { left: 120%; }

button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(10, 102, 194, 0.45), 0 3px 8px rgba(0,0,0,0.1);
  filter: brightness(1.08);
}

button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 4px rgba(10, 102, 194, 0.3);
}

button:disabled {
  background: linear-gradient(135deg, #b0b0b0, #c0c0c0) !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
  opacity: 0.7;
}

button:disabled:hover::after { left: -60%; }

.btn-green {
  background: linear-gradient(135deg, #28a745, #34d058) !important;
  box-shadow: 0 2px 6px rgba(40, 167, 69, 0.35), inset 0 1px 0 rgba(255,255,255,0.2) !important;
}
.btn-green:hover { box-shadow: 0 6px 20px rgba(40, 167, 69, 0.45), 0 3px 8px rgba(0,0,0,0.1) !important; }
.btn-green:active { box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3) !important; }

.btn-red {
  background: linear-gradient(135deg, #dc3545, #e04b5a) !important;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.35), inset 0 1px 0 rgba(255,255,255,0.2) !important;
}
.btn-red:hover { box-shadow: 0 6px 20px rgba(220, 53, 69, 0.45), 0 3px 8px rgba(0,0,0,0.1) !important; }
.btn-red:active { box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3) !important; }

#btnMargemManual {
  background: linear-gradient(135deg, #f0f0f0, #e8e8e8) !important;
  color: #333 !important;
  border: 1px solid #ccc !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
  font-size: 11px !important;
  padding: 7px 12px !important;
  border-radius: 8px !important;
}
#btnMargemManual:hover {
  background: linear-gradient(135deg, #e8e8e8, #ddd) !important;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}
#btnMargemManual.active {
  background: linear-gradient(135deg, #0a66c2, #0d8bd9) !important;
  color: white !important;
  border-color: #0a66c2 !important;
  box-shadow: 0 3px 10px rgba(10, 102, 194, 0.4) !important;
}

#languageSelector button {
  padding: 5px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  background: linear-gradient(135deg, #f0f0f0, #e8e8e8) !important;
  color: #333 !important;
  border: 1px solid #ccc !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
}
#languageSelector button:hover {
  background: linear-gradient(135deg, #e8e8e8, #ddd) !important;
  transform: translateY(-1px) !important;
}
#languageSelector button.active {
  background: linear-gradient(135deg, #0a66c2, #0d8bd9) !important;
  color: white !important;
  border-color: #0a66c2 !important;
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.4) !important;
}

.search-type-btn {
  padding: 6px 12px !important;
  font-size: 11px !important;
  background: linear-gradient(135deg, #f0f0f0, #e8e8e8) !important;
  color: #333 !important;
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
  transition: all 0.25s ease !important;
}
.search-type-btn:hover {
  background: linear-gradient(135deg, #e8e8e8, #ddd) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12) !important;
}
.search-type-btn.active {
  background: linear-gradient(135deg, #0a66c2, #0d8bd9) !important;
  color: white !important;
  border-color: #0a66c2 !important;
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.4) !important;
}

#btnCancelImage {
  background: linear-gradient(135deg, #888, #999) !important;
  box-shadow: 0 2px 6px rgba(136, 136, 136, 0.35), inset 0 1px 0 rgba(255,255,255,0.2) !important;
}
#btnCancelImage:hover { box-shadow: 0 6px 20px rgba(136, 136, 136, 0.45), 0 3px 8px rgba(0,0,0,0.1) !important; }
#btnRemoveImage {
  background: linear-gradient(135deg, #dc3545, #e04b5a) !important;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.35), inset 0 1px 0 rgba(255,255,255,0.2) !important;
}
#btnRemoveImage:hover { box-shadow: 0 6px 20px rgba(220, 53, 69, 0.45), 0 3px 8px rgba(0,0,0,0.1) !important; }

#btnBuscarImagem { padding: 8px 16px !important; white-space: nowrap !important; }

/* ===== EDIÇÃO INLINE ===== */
.inline-edit-input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  border: 2px solid #0a66c2;
  border-radius: 4px;
  padding: 3px 2px;
  font-size: 13px;
  text-align: center;
  outline: none;
  background: #fff8dc;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 600;
  color: #222;
}
.editable { overflow: hidden; }
.loja-inline-edit-input {
  border-color: #28a745 !important;
  background: #d4edda !important;
}

table { width: 100%; border-collapse: collapse; background: white; overflow: visible; }
th, td { border: 1px solid #e2e8f0; padding: 6px; font-size: 13px; text-align: center; }
th { background: var(--primary); color: white; text-transform: uppercase; }
.align-left { text-align: left !important; }
.text-center { text-align: center !important; }
tr:nth-child(even) { background: #fbfdff; }
.editable { background: var(--accent); cursor: pointer; }
#statusText, #totalsText { margin-top: 4px; font-size: 12px; }
#itemsTable tbody td { text-transform: uppercase; }

#notaResumoFixedContainer {
  position: sticky; top: 0; z-index: 1000; background: var(--muted);
  padding: 3px 12px; box-shadow: 0 4px 6px -6px #333;
}
#notaResumo { padding: 10px; background: #fff; border: 1px solid #ccc; border-radius: 6px; margin-top: 8px; }

/* ===== Resumo da nota: emitente/destinatário + dividir por lojas ===== */
.resumo-wrap { display: flex; flex-direction: column; gap: 4px; }
.resumo-detalhes { display: flex; gap: 12px; line-height: 1.15; font-size: 11px; }
.resumo-col { flex: 1; }
.resumo-col-right { border-left: 1px solid #ddd; padding-left: 12px; }
.resumo-col-title { font-size: 12px; color: var(--primary); display: block; margin-bottom: 3px; }
.resumo-lojas { border-top: 1px solid #eee; padding-top: 4px; margin-top: 4px; }
.resumo-lojas-title { font-size: 10px; color: #666; display: block; margin-bottom: 3px; }
/* Botão "Mostrar dados" — só aparece no celular (ver media query) */
.resumo-toggle { display: none; }
.msg-success {
  position: fixed; right: 20px; bottom: 20px; background: #28a745; color: white;
  padding: 10px 14px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  font-weight: 600; z-index: 9999; animation: fadeInUp 0.4s ease-out;
}
.msg-success.msg-erro { background: #dc3545; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.small { font-size: 12px; color: #666; }

/* ===== SALVAMENTO AUTOMÁTICO (indicador + botão) ===== */
.autosave-indicator {
  position: fixed; left: 20px; bottom: 20px; z-index: 9999;
  background: var(--primary); color: #fff; padding: 8px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.autosave-indicator.visible { opacity: 1; transform: translateY(0); }
.autosave-indicator.erro { background: #dc3545; }

#btnAutoSave.autosave-on { background: #28a745; color: #fff; border-color: #1e7e34; }
#btnAutoSave.autosave-off { background: #dc3545; color: #fff; border-color: #a71d2a; }

#loadingModal {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  justify-content: center; align-items: center; z-index: 99999;
}
#loadingModal .box {
  background: white; padding: 20px; border-radius: 10px; text-align: left;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4); border: 1px solid #ddd;
}
#progressBarContainer { height: 10px; background-color: #e9ecef; border-radius: 5px; margin-top: 10px; overflow: hidden; }
#progressBar { width: 0%; height: 100%; background-color: var(--green-load); transition: width 3s ease-in-out; }

#searchInput { padding: 4px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 12px; }
.preco-final-verde { color: #28a745; font-weight: 600; }
.font-bold { font-weight: 700; }
.preco-final-azul { color: #0066cc; font-weight: 600; }
/* ===== Segunda margem (MARGEM 2) ===== */
.preco-real-2 { color: #6a1b9a; font-weight: 600; }
.preco-final-2-verde { color: #7b1fa2; font-weight: 700; }
.preco-final-2-azul { color: #0066cc; font-weight: 600; }
.quant-unt-vermelho { color: #dc3545; font-weight: 600; }
.quant-unt-azul { color: #0066cc; font-weight: 600; }
.highlight-search { background-color: #ffeb3b; padding: 1px 2px; border-radius: 2px; }

#totalsText { font-size: 12px; color: #666; }

.figura-cell { width: 70px; height: 70px; padding: 2px !important; vertical-align: middle; cursor: pointer; position: relative; overflow: visible !important; }
.figura-cell img {
  width: 70px; height: 70px; object-fit: contain; border-radius: 4px; cursor: pointer;
  border: 2px solid #e2e8f0; transition: border-color 0.2s, box-shadow 0.2s; position: relative; z-index: 1;
}
.figura-cell img:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(10,102,194,0.3); }

#imagemZoomOverlay {
  display: none; position: fixed; inset: 0; z-index: 999999; pointer-events: none;
  align-items: center; justify-content: center; background: transparent;
}
#imagemZoomOverlay.ativo { display: flex; }
#imagemZoomOverlay img { max-width: 70vw; max-height: 75vh; object-fit: contain; border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,0.7); border: 3px solid #fff; }

.figura-cell .no-image {
  width: 70px; height: 70px; display: flex; align-items: center; justify-content: center;
  background: #f0f0f0; border-radius: 4px; cursor: pointer; font-size: 20px; color: #999;
  border: 2px dashed #ccc; transition: all 0.2s;
}
.figura-cell .no-image:hover { background: #e0e0e0; border-color: var(--primary); color: var(--primary); transform: scale(1.05); }

#imageModal {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  justify-content: center; align-items: center; z-index: 99999;
}
#imageModal .box {
  background: white; padding: 20px; border-radius: 10px; text-align: left;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4); border: 1px solid #ddd;
  max-width: 550px; width: 95%; max-height: 90vh; overflow-y: auto;
}
#imageModal .preview-container {
  width: 180px; height: 180px; margin: 10px auto; border: 2px solid #ccc; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; background: #f9f9f9;
}
#imageModal .preview-container img { max-width: 100%; max-height: 100%; object-fit: contain; }
#imageModal .search-info { font-size: 11px; color: #666; margin-top: 8px; padding: 8px; background: #f5f5f5; border-radius: 4px; }
#imageModal .search-info a { color: var(--primary); text-decoration: none; }
#imageModal .search-info a:hover { text-decoration: underline; }

/* Seletor de idioma fixo ao lado do AUTO-SAVE, tudo na mesma linha */
#languageSelector {
  display: inline-flex; gap: 3px; align-items: center; flex: 0 0 auto;
  background: white; padding: 2px 4px; border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10); border: 1px solid #e2e8f0;
  order: 100;
}

.lojas-container { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.loja-option { display: inline-flex; align-items: center; gap: 4px; }
.loja-option input[type="color"], .loja-add-control input[type="color"] {
  width: 30px; height: 30px; min-width: 30px; padding: 2px; border: 1px solid #cbd5e1; border-radius: 6px;
  cursor: pointer; background: #fff;
}
.loja-add-control { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.loja-add-control input[type="text"] { flex: 1 1 150px; min-width: 130px; }
.loja-add-control button {
  border: 0; border-radius: 6px; padding: 7px 10px; background: var(--primary); color: #fff; cursor: pointer;
}
.loja-checkbox {
  display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: #f5f5f5;
  border: 1px solid #ddd; border-radius: 4px; cursor: pointer; transition: all 0.2s; font-size: 12px; font-weight: 500;
}
.loja-checkbox:hover { background: #e8e8e8; border-color: var(--primary); }
.loja-checkbox input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.loja-checkbox.checked { background: #e3f2fd; border-color: var(--primary); color: var(--primary); }
.resumo-detalhes { gap: 24px; }
.resumo-col-right { padding-left: 24px; }
.resumo-lojas { margin-top: 7px; padding-top: 6px; }
.lojas-container { gap: 6px; margin-top: 7px; }
.loja-checkbox { padding: 4px 6px; font-size: 11px; }
.loja-checkbox input[type="checkbox"] { width: 14px; height: 14px; }
.loja-option { gap: 0; }
.loja-edit-control { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.loja-edit-control select, .loja-edit-control input {
  min-width: 150px; flex: 1 1 150px; padding: 7px 8px; border: 1px solid #cbd5e1;
  border-radius: 6px; font-size: 12px;
}
.loja-edit-control button {
  border: 0; border-radius: 6px; padding: 7px 10px; background: #475569; color: #fff; cursor: pointer;
}
.loja-edit-control button:last-child { background: #b91c1c; }

/* Resumo compacto da NF-e: divisão de lojas ocupa menos altura. */
#notaResumo { padding: 5px 8px; margin-top: 5px; }
.resumo-lojas .lojas-container { gap: 4px; margin-top: 3px; }
.resumo-lojas .loja-checkbox { gap: 3px; padding: 2px 5px; font-size: 10px; }
.resumo-lojas .loja-checkbox input[type="checkbox"] { width: 12px; height: 12px; }
.resumo-lojas .loja-add-control,
.resumo-lojas .loja-edit-control { flex-wrap: nowrap; gap: 4px; margin-top: 4px; }
.resumo-lojas .loja-add-control input[type="text"],
.resumo-lojas .loja-edit-control select,
.resumo-lojas .loja-edit-control input { min-width: 0; padding: 4px 6px; font-size: 10px; }
.resumo-lojas .loja-add-control input[type="color"] { width: 24px; height: 24px; min-width: 24px; }
.resumo-lojas .loja-add-control button,
.resumo-lojas .loja-edit-control button { flex: 0 0 auto; padding: 5px 7px; font-size: 10px; white-space: nowrap; }
@media (max-width: 900px) {
  .resumo-lojas .loja-add-control,
  .resumo-lojas .loja-edit-control { flex-wrap: wrap; }
  .resumo-col-right { padding-left: 10px; }
}

.loja-col { background: #e8f4e8 !important; }
.loja-col-header { background: #28a745 !important; }
.loja-col.editable { background: #d4edda !important; cursor: pointer; }

.search-type-selector { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.image-gallery {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 280px;
  overflow-y: auto; padding: 8px; background: #f7f9fc; border-radius: 6px; border: 1px solid #e2e8f0;
}
.image-gallery-item {
  position: relative; aspect-ratio: 1; border: 2px solid transparent; border-radius: 6px;
  overflow: hidden; cursor: pointer; transition: all 0.2s; background: white;
}
.image-gallery-item:hover { border-color: var(--primary); transform: scale(1.02); }
.image-gallery-item.selected { border-color: #28a745; box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3); }
.image-gallery-item img { width: 100%; height: 100%; object-fit: contain; }
.image-gallery-item .source-badge {
  position: absolute; bottom: 2px; right: 2px; background: rgba(0,0,0,0.7);
  color: white; font-size: 8px; padding: 2px 4px; border-radius: 3px;
}
.gallery-loading { grid-column: 1 / -1; text-align: center; padding: 20px; color: #666; }

/* (seção de abertura de arquivos movida para o topo do arquivo — ver #fileActions acima) */

/* ===== CORES POR LOJA ===== */
/* Mapa de cores por loja. Cada loja pode ter sua própria cor de destaque.
   - LOJA D: rosa pink claro
   - LOJA B, LOJA F, LOJA C: verde meio azul claro (teal claro)
   - Demais lojas usam a cor padrão (verde) definida em .loja-col / .loja-col-header
   As classes .loja-cor-{NOME} são aplicadas dinamicamente no header (th),
   nas células (td), nos checkboxes do resumo e no export Excel. */

/* Cabeçalho da coluna da loja — texto branco sobre cor sólida */
th.loja-cor-LOJA-D { background: #ff69b4 !important; }       /* rosa pink */
td.loja-cor-LOJA-D { background: #ffe0ef !important; }       /* rosa pink claro */
td.loja-cor-LOJA-D.editable { background: #ffd0e6 !important; cursor: pointer; }
.loja-checkbox.loja-cor-LOJA-D.checked { background: #ffe0ef !important; border-color: #ff69b4 !important; color: #c2185b !important; }

/* LOJA B, LOJA F, LOJA C — verde meio azul claro (teal claro) */
th.loja-cor-LOJA-B { background: #20b2aa !important; }       /* light sea green */
td.loja-cor-LOJA-B { background: #d4f1ee !important; }
td.loja-cor-LOJA-B.editable { background: #c4ebe6 !important; cursor: pointer; }
.loja-checkbox.loja-cor-LOJA-B.checked { background: #d4f1ee !important; border-color: #20b2aa !important; color: #00695c !important; }

th.loja-cor-LOJA-F { background: #20b2aa !important; }
td.loja-cor-LOJA-F { background: #d4f1ee !important; }
td.loja-cor-LOJA-F.editable { background: #c4ebe6 !important; cursor: pointer; }
.loja-checkbox.loja-cor-LOJA-F.checked { background: #d4f1ee !important; border-color: #20b2aa !important; color: #00695c !important; }

th.loja-cor-LOJA-C { background: #20b2aa !important; }
td.loja-cor-LOJA-C { background: #d4f1ee !important; }
td.loja-cor-LOJA-C.editable { background: #c4ebe6 !important; cursor: pointer; }
.loja-checkbox.loja-cor-LOJA-C.checked { background: #d4f1ee !important; border-color: #20b2aa !important; color: #00695c !important; }

/* =====================================================================
   PWA / MOBILE — melhorias para uso como app instalável no celular
   ===================================================================== */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

/* Wrapper da tabela: permite rolagem horizontal no celular sem quebrar o layout */
#tableScroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
}

/* ===== Botão "Instalar App" no topo ===== */
.btn-install {
  background: linear-gradient(135deg, #7b1fa2, #9c27b0) !important;
  box-shadow: 0 2px 6px rgba(123, 31, 162, 0.4), inset 0 1px 0 rgba(255,255,255,0.2) !important;
  animation: pulseInstall 2s ease-in-out infinite;
}
@keyframes pulseInstall {
  0%, 100% { box-shadow: 0 2px 6px rgba(123,31,162,0.4), inset 0 1px 0 rgba(255,255,255,0.2); }
  50%      { box-shadow: 0 2px 18px rgba(123,31,162,0.75), inset 0 1px 0 rgba(255,255,255,0.2); }
}

/* ===== Banner de instalação (Android / Desktop) ===== */
.install-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(160%);
  width: min(560px, calc(100% - 24px));
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.22);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 99998;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.install-banner.show { transform: translateX(-50%) translateY(0); }
.install-banner-icon { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.install-banner-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.install-banner-text strong { font-size: 13px; color: #0a66c2; }
.install-banner-text span { font-size: 11px; color: #666; line-height: 1.35; }
.btn-ghost {
  background: transparent !important; color: #999 !important; box-shadow: none !important;
  padding: 6px 10px !important; font-size: 15px !important; min-width: auto !important;
}
.btn-ghost:hover { background: #f0f0f0 !important; transform: none !important; }

/* ===== Dica de instalação no iOS (Safari) ===== */
.ios-hint {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 99999;
  align-items: flex-end;
  justify-content: center;
}
.ios-hint.show { display: flex; }
.ios-hint-box {
  background: #fff;
  width: 100%; max-width: 520px;
  border-radius: 18px 18px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  animation: slideUp 0.35s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.ios-hint-box h3 { margin: 0 0 10px; color: #0a66c2; font-size: 17px; }
.ios-hint-box p { font-size: 14px; color: #444; line-height: 1.5; margin: 0 0 6px; }
.ios-hint-icons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0 18px; }
.ios-hint-icons span { background: #f2f6fb; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; font-size: 12px; }

/* ===== Ajustes responsivos para celular / tablet ===== */
@media (max-width: 820px) {
  body {
    margin: 4px 8px;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  h1 { font-size: 14px; }
  #appClock { font-size: 14px; }

  #topBar { gap: 5px; }
  #viewerToolbar { gap: 5px; padding: 6px 8px; }

  /* Inputs com fonte >= 16px evitam o zoom automático do iOS ao focar */
  input[type=number], input[type=text],
  .input-group input[type=number],
  .search-group input[type=text] { font-size: 16px; }
  .input-group input[type=number] { width: 66px; }
  .search-group { margin-left: 0; width: 100%; }
  .search-group input[type=text] { width: 100%; flex: 1; }

  /* Alvos de toque maiores */
  button { padding: 9px 14px; font-size: 13px; min-height: 40px; }
  .search-type-btn { min-height: 38px; }

  /* Itens da nota em cartões compactos, sem rolagem horizontal. */
  #tableScroll { overflow: visible; }
  #itemsTable {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }
  #itemsTable thead { display: none; }
  #itemsTable tbody { display: block; width: 100%; }
  #itemsTable tbody tr {
    display: grid;
    grid-template-columns: 58px repeat(3, minmax(0, 1fr));
    gap: 1px 5px;
    width: 100%;
    margin: 0 0 10px;
    padding: 8px;
    border: 1px solid #dbe4ee;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .05);
  }
  #itemsTable tbody td {
    display: none;
    min-width: 0;
    width: auto;
    padding: 4px 2px;
    border: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    background: transparent;
  }
  #itemsTable tbody td[data-column="FIGURA"],
  #itemsTable tbody td[data-column="Produto"],
  #itemsTable tbody td[data-column="CÓDIGO BARRA"],
  #itemsTable tbody td[data-column="Código"],
  #itemsTable tbody td[data-column="CFOP"],
  #itemsTable tbody td[data-column="NCM"],
  #itemsTable tbody td[data-column="UND"],
  #itemsTable tbody td[data-column="QUANT"],
  #itemsTable tbody td[data-column="QUANT UNT"],
  #itemsTable tbody td[data-column="QUANT TOTAL"],
  #itemsTable tbody td[data-column="Valor Total"] {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  #itemsTable tbody td[data-column="FIGURA"] { grid-column: 1; grid-row: 1 / 6; align-items: center; }
  #itemsTable tbody td[data-column="Produto"] { grid-column: 2 / 5; grid-row: 1; font-weight: 800; font-size: 13px; }
  #itemsTable tbody td[data-column="CÓDIGO BARRA"] { grid-column: 2 / 4; grid-row: 2; }
  #itemsTable tbody td[data-column="Código"] { grid-column: 4; grid-row: 2; }
  #itemsTable tbody td[data-column="CFOP"] { grid-column: 2; grid-row: 3; }
  #itemsTable tbody td[data-column="NCM"] { grid-column: 3; grid-row: 3; }
  #itemsTable tbody td[data-column="UND"] { grid-column: 4; grid-row: 3; }
  #itemsTable tbody td[data-column="QUANT"] { grid-column: 2; grid-row: 4; }
  #itemsTable tbody td[data-column="QUANT UNT"] { grid-column: 3 / 5; grid-row: 4; }
  #itemsTable tbody td[data-column="QUANT TOTAL"] { grid-column: 2; grid-row: 5; }
  #itemsTable tbody td[data-column="Valor Total"] { grid-column: 3 / 5; grid-row: 5; font-weight: 800; }
  #itemsTable tbody td::before {
    content: attr(data-mobile-label);
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
  }
  #itemsTable tbody td[data-column="FIGURA"]::before { content: none; }
  .figura-cell, .figura-cell img, .figura-cell .no-image { width: 54px; height: 54px; }
  th, td { font-size: 12px; padding: 5px; }

  #notaResumoFixedContainer { padding: 3px 8px; }
  #notaResumo { font-size: 12px; }

  /* No celular, emitente/destinatário ficam ocultos; o botão "Mostrar dados" revela */
  .resumo-detalhes { display: none; }
  .resumo-detalhes.show { display: flex; flex-direction: column; gap: 14px; }
  .resumo-col-right { border-left: none; padding-left: 0; }
  .resumo-toggle {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    background: #eef4fb; border: 1px solid #cfe0f3; color: var(--primary);
    padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
    cursor: pointer; min-height: 0;
  }
  .resumo-toggle.open { background: var(--primary); color: #fff; border-color: var(--primary); }

  #languageSelector { padding: 3px 6px; }
  #languageSelector button { padding: 6px 9px !important; font-size: 12px !important; min-height: 34px; }

  #imageModal .box { padding: 16px; }
  .image-gallery { grid-template-columns: repeat(3, 1fr); max-height: 240px; }

  .install-banner { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}

/* Telas muito estreitas */
@media (max-width: 420px) {
  .image-gallery { grid-template-columns: repeat(2, 1fr); }
  .input-group input[type=number] { width: 58px; }
  .install-banner-text span { display: none; }
}

/* Modo paisagem em celular: barra de topo mais compacta */
@media (max-width: 900px) and (orientation: landscape) {
  #topBar { gap: 4px; }
  #viewerToolbar { gap: 4px; padding: 6px 8px; }
  h1 { font-size: 13px; }
  #appClock { font-size: 13px; }
}
/* =====================================================================
   TELAS NOVAS — Banco de Dados / Notas / Produtos / Relatório
   (menu de navegação + tabelas + cartões + gráficos + modal)
   ===================================================================== */

/* ---- Barra de navegação (menu principal) ---- */
#appNav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
  padding: 6px;
  background: #fff;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.08);
  position: sticky;
  top: 0;
  z-index: 1300;
}
/* Teclas de atalho mostradas nos botões do menu */
#appNav kbd {
  background: #fff; border: 1px solid #cbd7e6; border-bottom-width: 2px;
  border-radius: 5px; padding: 0 5px; font-size: 10.5px; font-family: inherit;
  font-weight: 700; color: #5a6b7d; margin-left: 2px; line-height: 16px;
}
#appNav .nav-btn.active kbd { background: rgba(255,255,255,.25); color: #fff; border-color: rgba(255,255,255,.5); }
#appNav .nav-btn {
  background: #eef3f9 !important;
  color: #2b3a4a !important;
  border: 1px solid #dbe4ee !important;
  box-shadow: none !important;
  padding: 8px 12px !important;
  font-size: 12.5px !important;
  border-radius: 8px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
#appNav .nav-btn:hover {
  transform: none !important;
  background: #e2ecf7 !important;
  box-shadow: none !important;
  filter: none !important;
}
#appNav .nav-btn.active {
  background: linear-gradient(135deg, #0a66c2, #1e7fe0) !important;
  color: #fff !important;
  border-color: #0a66c2 !important;
  box-shadow: 0 3px 10px rgba(10, 102, 194, 0.35) !important;
}
#appNav .nav-btn.active::after { display: none; }
.nav-badge {
  background: #e8590c;
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: bold;
  min-width: 16px;
  text-align: center;
}
#appNav .nav-btn.active .nav-badge { background: rgba(255,255,255,0.28); }

/* ---- Telas (só a ativa aparece) ---- */
.app-screen { display: none; }
.app-screen.active { display: block; }

/* ---- Cabeçalho de tela + ferramentas ---- */
.screen-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 12px;
}
.screen-head h2 { margin: 0; font-size: 18px; color: var(--primary); }
.screen-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.screen-tools input[type=text],
.screen-tools select {
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #ccd6e0;
  border-radius: 8px;
  background: #fff;
  min-width: 200px;
}
.screen-tools input[type=text]:focus,
.screen-tools select:focus { outline: 2px solid rgba(10,102,194,0.35); border-color: var(--primary); }

/* ---- Botões utilitários ---- */
.btn-primary {
  background: linear-gradient(135deg, #0a66c2, #1e7fe0) !important;
  color: #fff !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
}
.btn-danger {
  background: linear-gradient(135deg, #dc3545, #e04b5a) !important;
  color: #fff !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
}
.mini {
  padding: 4px 9px !important;
  font-size: 11.5px !important;
  border-radius: 6px !important;
  background: #eef3f9 !important;
  color: #0a66c2 !important;
  border: 1px solid #cfe0f2 !important;
  box-shadow: none !important;
}
.mini:hover { transform: none !important; background: #e2ecf7 !important; box-shadow: none !important; filter: none !important; }
.mini::after { display: none; }
.mini-danger { background: #fdecee !important; color: #c0202f !important; border-color: #f6c9cf !important; }
.mini-danger:hover { background: #fadadd !important; }

/* ---- Cartões de resumo ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}
.card {
  background: #fff;
  border: 1px solid #e2e9f1;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 1px 4px rgba(10,102,194,0.06);
}
.card-num { font-size: 20px; font-weight: bold; color: var(--primary); }
.card-lbl { font-size: 11.5px; color: #667; text-transform: uppercase; letter-spacing: .3px; }

/* ---- Tabelas de relatório ---- */
.rep-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
.rep-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
  box-shadow: 0 1px 4px rgba(10,102,194,0.06);
}
.rep-table th {
  background: #f4f8fc;
  color: #2b3a4a;
  text-align: left;
  padding: 9px 10px;
  border-bottom: 2px solid #e2e9f1;
  font-size: 12px;
  white-space: nowrap;
}
.rep-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}
.rep-table tbody tr:hover { background: #f7fbff; }
.rep-table .num { text-align: right; white-space: nowrap; }
.rep-table .acoes { white-space: nowrap; display: flex; gap: 6px; }
.rep-table .clicavel { cursor: pointer; }
.rep-table small { color: #889; font-size: 11px; }
.rep-table tfoot th { background: #eef4fb; color: #123; font-weight: 700; text-align: left; padding: 8px 10px; border-top: 2px solid #cdd8e5; }
.rep-table tfoot th.num { text-align: right; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 12px; }

/* ---- Variação (badges) ---- */
.var-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: bold;
  white-space: nowrap;
}
.var-alta { color: #c0202f; }
.var-badge.var-alta { background: #fdecee; }
.var-baixa { color: #1a7f37; }
.var-badge.var-baixa { background: #e7f6ec; }
.var-neutro { color: #667; }
.var-badge.var-neutro { background: #eef2f7; }

/* ---- Avisos / dicas ---- */
.empty {
  background: #fff;
  border: 1px dashed #ccd6e0;
  border-radius: 10px;
  padding: 26px 18px;
  text-align: center;
  color: #778;
  font-size: 13.5px;
}
.hint { color: #556; font-size: 12.5px; line-height: 1.5; margin: 6px 0 12px; }

/* ---- Relatório: seleção de notas ---- */
.rel-pick-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: #334;
}
#relContador { font-size: 12px; color: #0a66c2; font-weight: bold; }
.rel-pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.rel-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e2e9f1;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.rel-pick:hover { border-color: #b9d4ef; }
.rel-pick.sel { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(10,102,194,0.15); }
.rel-pick input { width: 18px; height: 18px; }
.rel-pick-info { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.rel-pick-info span { color: #667; font-size: 11.5px; }

/* ---- Modal do produto ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 50, 0.55);
  z-index: 2000;
  padding: 20px;
  overflow-y: auto;
}
.modal-overlay.show { display: flex; align-items: flex-start; justify-content: center; }
.modal-box {
  position: relative;
  background: var(--muted);
  border-radius: 14px;
  max-width: 860px;
  width: 100%;
  margin: 30px auto;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #eef2f7 !important;
  color: #556 !important;
  border-radius: 50% !important;
  width: 34px;
  height: 34px;
  padding: 0 !important;
  font-size: 15px !important;
  box-shadow: none !important;
}
.modal-close:hover { transform: none !important; background: #e2e9f1 !important; }
.modal-close::after { display: none; }
#produtoModalBody h3 { margin: 4px 0 10px; color: var(--primary); font-size: 17px; }
.prod-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: #445; margin-bottom: 12px; }
.prod-edit-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; padding: 9px; margin-bottom: 12px; border: 1px solid #dbe3ee; border-radius: 8px; background: #f8fafc; }
.prod-edit-tools label { display: grid; gap: 4px; color: #475569; font-size: 11px; }
.prod-edit-tools input:not([type="color"]) { min-width: 180px; padding: 6px; border: 1px solid #cbd5e1; border-radius: 5px; }
.prod-edit-tools input[type="color"] { width: 52px; height: 32px; padding: 2px; border: 1px solid #cbd5e1; border-radius: 5px; }
.prod-edit-tools button { padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; cursor: pointer; }
.prod-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }

/* ---- Gráficos ---- */
.chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  background: #fff;
  border: 1px solid #e2e9f1;
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0 16px;
}
.chart-wrap.tall { height: 360px; }

/* =====================================================================
   v1.2 — Novos estilos
   ===================================================================== */

/* Coluna de fornecedor sempre alinhada à ESQUERDA (não centralizada) */
.rep-table td.forn-col, .rep-table th.forn-col { text-align: left !important; }

/* Coluna / célula de Preço Final */
.rep-table td.preco-final-cell { color: #1a7f37; font-weight: 700; white-space: nowrap; }
/* Cor do "último preço"/"preço anterior" só quando o valor muda (sobe = vermelho, desce = verde) */
.rep-table td.preco-sobe { color: #c0202f; font-weight: 700; }
.rep-table td.preco-desce { color: #1a7f37; font-weight: 700; }

/* Célula de anexo (link para abrir o arquivo em nova janela) */
.rep-table td.anexo-cell { white-space: nowrap; }
.anexo-box { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; }
.anexo-link {
  color: #0a66c2;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px dashed #9cc2e8;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.anexo-link:hover { color: #084a8f; border-bottom-style: solid; }
.mini-x { padding: 2px 6px !important; font-size: 11px !important; }

/* Título de seção dentro de uma tela */
.sec-title { margin: 22px 0 4px; font-size: 15px; color: var(--primary); }

/* ---- Tela Empresas (cadastro) ---- */
.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}
.emp-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  background: #fff;
  border: 1px solid #e2e9f1;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(10,102,194,0.06);
  transition: border-color .15s, box-shadow .15s;
  font: inherit;
}
.emp-card:hover { border-color: #b9d4ef; transform: none !important; }
.emp-card.sel { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(10,102,194,0.15); }
.emp-card::after { display: none; }
.emp-nome { font-weight: 700; color: #223; font-size: 13.5px; }
.emp-cnpj { color: #556; font-size: 12px; }
.emp-meta { color: #889; font-size: 11.5px; }

.emp-detail {
  background: #fff;
  border: 1px solid #e2e9f1;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(10,102,194,0.06);
  margin-top: 6px;
}
.emp-detail h3 { margin: 0 0 2px; color: var(--primary); font-size: 16px; }
.emp-detail h4 { margin: 16px 0 6px; color: #334; font-size: 13.5px; }
.emp-detail-nome { font-size: 18px; font-weight: 700; color: #1b2a3a; margin-bottom: 12px; }
.emp-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px 22px;
  margin-bottom: 14px;
}
.emp-row { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px dashed #eef2f7; font-size: 13px; }
.emp-lbl { min-width: 110px; color: #667; font-weight: 600; }
.emp-val { color: #223; }

/* ---- Campos editáveis do cadastro de empresa (telefone, e-mail, CEP...) ---- */
.emp-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
  margin: 8px 0 12px;
}
.emp-edit-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #556; font-weight: 600; }
.emp-edit-field input {
  padding: 7px 9px; border: 1px solid #ccd6e0; border-radius: 6px; font-size: 13px; font-weight: 400;
  color: #223; width: 100%; box-sizing: border-box;
}
.emp-edit-field input:focus { outline: 2px solid rgba(10,102,194,0.35); border-color: var(--primary); }

/* ---- Filtro por data (menu Empresas, antes da busca) ---- */
.emp-filtro-data {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  background: #fff; border: 1px solid #e2e9f1; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 10px;
}
.emp-filtro-data label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #556; font-weight: 600; }
.emp-filtro-data input[type="date"] { padding: 6px 8px; border: 1px solid #ccd6e0; border-radius: 6px; font-size: 13px; color: #223; }
.emp-filtro-data .btn-limpar-data { padding: 7px 12px; border: 1px solid #ccd6e0; background: #f2f6fb; color: #334; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.emp-filtro-data .btn-limpar-data:hover { background: #e3ebf5; border-color: var(--primary); color: var(--primary); }

/* ---- Cadastro de empresa: botão ✏️ e linhas de contato (+) ---- */
.emp-edit-btn { margin-left: 10px; font-size: 12px; font-weight: 600; padding: 4px 10px; border: 1px solid var(--primary); background: #eef4fb; color: var(--primary); border-radius: 6px; cursor: pointer; }
.emp-edit-btn:hover { background: var(--primary); color: #fff; }
.emp-edit-lbl { display: flex; align-items: center; gap: 6px; }
.emp-add { width: 22px; height: 22px; line-height: 1; border-radius: 50%; border: 1px solid #1a7f37; background: #e8f6ec; color: #1a7f37; font-weight: 700; cursor: pointer; font-size: 15px; padding: 0; }
.emp-add:hover { background: #1a7f37; color: #fff; }
.emp-edit-row { display: flex; gap: 6px; margin-bottom: 6px; }
.emp-edit-row input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid #ccd6e0; border-radius: 6px; font-size: 13px; font-weight: 400; color: #223; }
.emp-edit-row input:focus { outline: 2px solid rgba(10,102,194,0.35); border-color: var(--primary); }
.emp-row-remove { border: 1px solid #e0b4b4; background: #fdecee; color: #c0202f; border-radius: 6px; cursor: pointer; padding: 0 9px; font-weight: 700; }
.emp-row-remove:hover { background: #c0202f; color: #fff; }

.rep-table tr.emp-inativa { background: #fff6f6; }
.rep-table tr.emp-inativa:hover { background: #fdecee; }

/* ---- Modal compacto (anexo / senha) ---- */
.modal-box.modal-sm { max-width: 460px; }
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-row label { font-size: 12.5px; font-weight: 600; color: #445; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=file], .form-row select {
  padding: 9px 10px;
  font-size: 13px;
  border: 1px solid #ccd6e0;
  border-radius: 8px;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}
.form-row input:focus { outline: 2px solid rgba(10,102,194,0.35); border-color: var(--primary); }
.form-row select:focus { outline: 2px solid rgba(10,102,194,0.35); border-color: var(--primary); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.senha-msg { font-size: 12.5px; margin: 2px 0 8px; min-height: 16px; color: #556; }
.senha-msg.senha-erro { color: #c0202f; font-weight: 600; }

/* ---- Botão de ação na barra de navegação (Limpar página) ---- */
.nav-action {
  background: #fff3f3 !important; color: #c0202f !important; border: 1px solid #f2c6cb !important;
  font-weight: 700 !important;
}
.nav-action:hover { background: #ffe3e6 !important; }

/* ---- Tela Instalar App ---- */
.instalar-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 14px 0; }
.instalar-card {
  background: #fff; border: 1px solid #e2e9f1; border-radius: 12px; padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(10,102,194,0.06);
}
.instalar-card h3 { margin: 8px 0 6px; color: var(--primary); font-size: 15px; }
.instalar-card p { margin: 0; font-size: 13px; color: #445; line-height: 1.5; }
.instalar-ico { font-size: 30px; }
.instalar-ok { background: #e8f6ec; border: 1px solid #bfe6c9; color: #1e7e34; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.instalar-info { background: #eef4fb; border: 1px solid #cfe0f3; color: #0a66c2; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.instalar-card .instalar-dl { display: inline-block; margin-top: 10px; text-decoration: none; }
.instalar-link-row { display: flex; gap: 8px; margin-top: 10px; }
.instalar-link-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #cdd8e5; border-radius: 8px; font-size: 12px; background: #f7fafd; }
.instalar-link-row button { white-space: nowrap; }

/* ---- Backup do banco de dados ---- */
.backup-info { background: #fff; border: 1px solid #e2e9f1; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #334; margin: 8px 0; }
.backup-info .backup-ok { color: #1e7e34; font-weight: 600; }
.backup-info .backup-pendente { color: #b26a00; font-weight: 600; }
.backup-info .backup-export { color: #0a66c2; font-weight: 600; }
.backup-info .backup-line { margin: 3px 0; }

/* ---- Responsivo ---- */
@media (max-width: 700px) {
  #appNav .nav-btn { font-size: 11.5px !important; padding: 7px 9px !important; }
  .screen-head h2 { font-size: 16px; }
  .screen-tools input[type=text], .screen-tools select { min-width: 140px; flex: 1; }
  .card-num { font-size: 17px; }
  .modal-box { padding: 14px; margin: 10px auto; }
  .chart-wrap { height: 240px; }
}

/* =====================================================================
   v1.6 — NOVOS COMPONENTES
   ===================================================================== */

/* ---- Carregador de página (barra + %) ---- */
.app-loader {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f2f6fb, #e4edfb);
  transition: opacity .28s ease;
}
.app-loader-hidden { opacity: 0; pointer-events: none; }
.app-loader-box { width: min(440px, 86vw); text-align: center; }
.app-loader-logo { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 10px 30px rgba(10,102,194,.25); }
.app-loader-title { color: #0a66c2; font-size: 19px; margin: 16px 0 22px; }
.app-loader-bar { height: 12px; background: #dbe6f3; border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.08); }
.app-loader-bar-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #0a66c2, #34a853); transition: width .18s ease; }
.app-loader-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: #556; }
.app-loader-pct { font-weight: 700; color: #0a66c2; }

/* ---- Submenus do menu principal (Abrir / Configuração) ---- */
.nav-dropdown { position: relative; display: inline-block; }
.nav-drop-toggle { cursor: pointer; }
.nav-dropdown.open .nav-drop-toggle { background: #e2ecf7 !important; }
.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 232px;
  background: #fff;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  box-shadow: 0 12px 34px rgba(10,102,194,.18);
  padding: 6px;
  z-index: 1200;
}
.nav-dropdown.open .nav-drop-menu { display: block; }
.nav-drop-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  background: transparent !important; border: none !important;
  box-shadow: none !important; filter: none !important;
  padding: 9px 10px !important; border-radius: 8px !important;
  font-size: 13px !important; color: #2b3a4a !important; cursor: pointer;
  white-space: nowrap;
}
.nav-drop-item:hover { background: #eef3f9 !important; transform: none !important; }
.nav-drop-item.nav-item-maintenance:disabled {
  color: #64748b !important;
  cursor: not-allowed !important;
  opacity: .8;
}
.nav-drop-sep { height: 1px; background: #e7eef6; margin: 6px 4px; }
.nav-drop-lang { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12.5px; color: #445; }
.nav-drop-lang-label { font-weight: 600; }
.nav-drop-lang #languageSelector { margin: 0; }

/* ---- Janela BUSCA PREÇO (F9) ---- */
.bp-overlay {
  position: fixed; inset: 0; z-index: 4000;
  display: none; align-items: center; justify-content: center;
  background: rgba(10,25,45,.55); padding: 16px;
}
.bp-overlay.show { display: flex; }
body.bp-aberto { overflow: hidden; }
.bp-window {
  width: min(720px, 96vw); background: #fff; border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.4); overflow: hidden;
  display: flex; flex-direction: column;
}
.bp-topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #eef2f7; }
.bp-title { font-weight: 700; color: #0a66c2; font-size: 15px; }
.bp-close {
  background: #f2f6fb !important; border: 1px solid #dbe4ee !important; color: #c0202f !important;
  border-radius: 8px !important; width: 34px; height: 34px; font-size: 16px; font-weight: 700;
  cursor: pointer; padding: 0 !important; box-shadow: none !important;
}
.bp-close:hover { background: #fdecee !important; transform: none !important; }
.bp-input-row { display: flex; gap: 8px; padding: 14px 16px; }
.bp-input-row input {
  flex: 1; min-width: 0; padding: 12px 14px; border: 2px solid #cdd8e5;
  border-radius: 10px; font-size: 17px; letter-spacing: .5px;
}
.bp-input-row input:focus { outline: none; border-color: #0a66c2; box-shadow: 0 0 0 3px rgba(10,102,194,.15); }
.bp-display { padding: 10px 20px 22px; text-align: center; }
.bp-valor { font-size: clamp(40px, 11vw, 76px); font-weight: 800; color: #1a7f37; line-height: 1.05; letter-spacing: -1px; }
.bp-linha { height: 3px; background: #0a66c2; border-radius: 3px; margin: 14px auto; width: 100%; }
.bp-descricao { font-size: clamp(15px, 3.4vw, 22px); font-weight: 700; color: #223; text-transform: uppercase; line-height: 1.3; min-height: 28px; }
.bp-store-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-top: 12px; text-align: left; }
.bp-store-prices[hidden] { display: none; }
.bp-store-price { display: flex; justify-content: space-between; gap: 8px; padding: 7px 9px; border: 1px solid #dbe3ee; border-radius: 7px; color: #334155; font-size: 12px; }
.bp-store-price b { color: #15803d; white-space: nowrap; }
.bp-msg { text-align: center; font-size: 15px; font-weight: 700; min-height: 20px; padding: 0 16px 8px; }
.bp-msg-erro { color: #c0202f; }
.bp-foot { text-align: center; font-size: 12px; color: #889; padding: 10px 16px 16px; border-top: 1px solid #eef2f7; }
.bp-foot kbd { background: #eef3f9; border: 1px solid #cdd8e5; border-radius: 5px; padding: 1px 6px; font-size: 11px; }

/* ---- Backup Online ---- */
.backup-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.backup-tab {
  background: #eef3f9 !important; color: #2b3a4a !important; border: 1px solid #dbe4ee !important;
  border-radius: 8px !important; padding: 9px 14px !important; font-size: 13px !important;
  cursor: pointer; box-shadow: none !important;
}
.backup-tab:hover { background: #e2ecf7 !important; transform: none !important; }
.backup-tab.active { background: linear-gradient(135deg,#0a66c2,#1e7fe0) !important; color: #fff !important; border-color: #0a66c2 !important; }
.backup-panel { display: none; }
.backup-panel.active { display: block; }
.backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.backup-col { background: #fff; border: 1px solid #e2e9f1; border-radius: 12px; padding: 16px; }
.backup-steps { margin: 6px 0 0; padding-left: 20px; color: #334; font-size: 13px; line-height: 1.6; }
.backup-steps li { margin-bottom: 6px; }
.backup-code {
  background: #0f1b2a; color: #d7e3f4; border-radius: 10px; padding: 12px 14px;
  font-size: 12px; overflow-x: auto; white-space: pre; margin: 8px 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.backup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.backup-log {
  background: #0f1b2a; color: #cfe0f3; border-radius: 10px; padding: 10px 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px; max-height: 180px; overflow-y: auto; margin-top: 10px;
}
.backup-log:empty { display: none; }
.backup-log-line { padding: 2px 0; }
.backup-log-ok { color: #7ee2a8; }
.backup-log-erro { color: #ff9aa6; }
.backup-log-info { color: #9ec5ff; }
.backup-status {
  font-size: 13px; font-weight: 600; color: #556; margin-bottom: 10px;
  padding: 10px 12px; border-radius: 8px; background: #f2f6fb; border: 1px solid #e2e9f1;
}
.backup-status-ok { background: #e8f6ec; border-color: #bfe6c9; color: #1e7e34; }
.backup-status-erro { background: #fdecee; border-color: #f6c9cf; color: #c0202f; }
@media (max-width: 760px) { .backup-grid { grid-template-columns: 1fr; } }

/* ---- Legenda e cores de custo (Relatório de Preços) ---- */
.leg-menor { color: #0a66c2; }
.leg-maior { color: #c0202f; }
.rep-table td.custo-menor { color: #0a66c2; font-weight: 700; }
.rep-table td.custo-maior { color: #c0202f; font-weight: 700; }

/* ---- Descrição à esquerda (Produtos / Relatório) ---- */
.rep-table td.desc-col, .rep-table th.desc-col { text-align: left; min-width: 220px; }
.rep-table td.desc-col { font-weight: 600; color: #223; }

/* ---- Instalar App: seletor de versões ---- */
.instalar-versao-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.instalar-versao-row select {
  flex: 1; min-width: 140px; padding: 9px 10px; border: 1px solid #cdd8e5;
  border-radius: 8px; font-size: 13px; background: #f7fafd; color: #223;
}
.instalar-versao-info { font-size: 12px; color: #667; margin-top: 8px; line-height: 1.5; }
.instalar-versao-info b { color: #334; }
.instalar-versao-info .versao-atual { color: #1e7e34; font-weight: 700; }

/* =====================================================================
   v1.7 — Barra de carregamento (Produtos), alerta de inatividade e
   barra de ferramentas do Visualizador
   ===================================================================== */

/* ---- Barra de carregamento da tela Produtos ---- */
.prod-loader {
  margin: 6px 0 12px; padding: 12px 14px; background: #fff;
  border: 1px solid #dbe4ee; border-radius: 10px;
  box-shadow: 0 2px 8px rgba(10,102,194,.08);
}
.prod-loader-msg { font-size: 13px; font-weight: 600; color: #2b3a4a; margin-bottom: 8px; }
.prod-loader-bar { height: 14px; background: #e7eef6; border-radius: 8px; overflow: hidden; }
.prod-loader-fill {
  height: 100%; width: 0%; border-radius: 8px;
  background: linear-gradient(90deg, #1a7f37, #2fb457);
  transition: width .25s ease;
}
.prod-loader.is-loading .prod-loader-fill {
  width: 32%; animation: prod-loader-indeterminate 1.15s ease-in-out infinite alternate;
}
@keyframes prod-loader-indeterminate { from { transform: translateX(0); } to { transform: translateX(210%); } }
.prod-loader-pct { text-align: right; font-size: 12px; font-weight: 700; color: #1a7f37; margin-top: 4px; }

/* ---- Tempo sem compra: cores (verde/cinza/vermelho) ---- */
.rep-table td.tempo-verde, .tempo-verde { color: #1e7e34; font-weight: 700; }
.rep-table td.tempo-cinza, .tempo-cinza { color: #6b7280; font-weight: 700; }
.rep-table td.tempo-vermelho, .tempo-vermelho { color: #c0202f; font-weight: 700; }

/* ---- Alerta: faz muito tempo que não compra ---- */
.alerta-sem-compra {
  margin: 10px 0; padding: 12px 14px; border-radius: 10px;
  background: #fff4f4; border: 1px solid #f3c2c2; color: #8a1f1f;
  font-size: 13px; line-height: 1.5;
}
.alerta-sem-compra .alerta-titulo { font-weight: 700; display: block; margin-bottom: 6px; color: #c0202f; font-size: 13.5px; }
.alerta-sem-compra ul { margin: 0; padding-left: 18px; }
.alerta-sem-compra li { margin: 2px 0; }
.alerta-sem-compra .alerta-emp { font-weight: 600; }

/* ===== v1.7.1 — Guia de instalação no computador ===== */
.instalar-guia {
  background: #fff;
  border: 1px solid #d9e4f2;
  border-left: 4px solid var(--primary, #0a66c2);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 12px 0;
  box-shadow: 0 6px 18px rgba(10,102,194,.08);
}
.instalar-guia h4 { margin: 0 0 8px; color: var(--primary, #0a66c2); font-size: 16px; }
.instalar-guia p { margin: 6px 0; font-size: 13.5px; color: #334; line-height: 1.55; }
.instalar-guia ol { margin: 8px 0 10px; padding-left: 22px; }
.instalar-guia ol li { margin: 5px 0; font-size: 13.5px; color: #334; line-height: 1.55; }
.instalar-guia code { background: #eef4fb; color: #0a66c2; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.instalar-guia .instalar-link-row { display: flex; gap: 8px; margin: 10px 0 6px; flex-wrap: wrap; }
.instalar-guia .instalar-link-row input {
  flex: 1 1 240px; min-width: 0; padding: 9px 11px; border: 1px solid #cdd9e8;
  border-radius: 8px; font-size: 13px; background: #f7fafd; color: #0a66c2;
}
.instalar-guia .instalar-link-row button {
  flex: 0 0 auto; padding: 9px 16px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--primary, #0a66c2); color: #fff; font-weight: 700; font-size: 13px;
}
.instalar-guia .instalar-link-row button:hover { filter: brightness(1.08); }
.instalar-guia .hint { font-size: 12.5px; color: #667; margin-top: 6px; }

/* =====================================================================
   v1.8 — Menu "Abrir" na barra de ferramentas + tela AJUDA
   ===================================================================== */

/* Botão do submenu "Abrir" dentro da barra de ferramentas */
#viewerToolbar .nav-drop-toggle {
  background: #eef3f9; color: #2b3a4a; border: 1px solid #dbe4ee;
  padding: 8px 12px; font-size: 12.5px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  cursor: pointer; font-weight: 600; box-shadow: none;
}
#viewerToolbar .nav-drop-toggle:hover { background: #e2ecf7; }
#viewerToolbar .nav-dropdown.open .nav-drop-toggle { background: #e2ecf7; }

/* ---- Tela AJUDA ---- */
.ajuda-tabs { display: flex; gap: 8px; margin: 4px 0 14px; flex-wrap: wrap; }
.ajuda-tab {
  background: #eef3f9; color: #2b3a4a; border: 1px solid #dbe4ee;
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  cursor: pointer; box-shadow: none;
}
.ajuda-tab:hover { background: #e2ecf7; }
.ajuda-tab.active {
  background: linear-gradient(135deg, #0a66c2, #1e7fe0); color: #fff; border-color: #0a66c2;
  box-shadow: 0 3px 10px rgba(10,102,194,.28);
}
.ajuda-panel { display: none; }
.ajuda-panel.active { display: block; }

.ajuda-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px; margin: 6px 0 10px;
}
.ajuda-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid #e2e9f1; border-left: 4px solid #0a66c2;
  border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(10,102,194,.06);
}
.ajuda-ico { font-size: 26px; line-height: 1.1; flex: 0 0 auto; }
.ajuda-body h4 { margin: 0 0 5px; color: #0a66c2; font-size: 15px; }
.ajuda-body h4 kbd {
  background: #fff; border: 1px solid #cbd7e6; border-bottom-width: 2px;
  border-radius: 5px; padding: 0 5px; font-size: 10.5px; font-family: inherit;
  font-weight: 700; color: #5a6b7d; margin-left: 2px; line-height: 16px;
}
.ajuda-body p { margin: 0; font-size: 13px; color: #3a4756; line-height: 1.55; }
.ajuda-body .tempo-verde { color: #1a7f37; font-weight: 700; }
.ajuda-body .tempo-cinza { color: #667; font-weight: 700; }
.ajuda-body .tempo-vermelho { color: #c0202f; font-weight: 700; }

/* Linha do tempo de versões */
.ajuda-timeline { position: relative; margin: 8px 0 10px; padding-left: 8px; }
.ajuda-ver {
  position: relative; display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border: 1px solid #e2e9f1; border-radius: 12px;
  padding: 14px 16px; margin: 0 0 12px;
  box-shadow: 0 1px 4px rgba(10,102,194,.06);
}
.ajuda-ver.atual { border-color: #bfe6c9; background: #f6fdf8; }
.ajuda-ver-tag {
  flex: 0 0 auto; min-width: 58px; text-align: center;
  background: linear-gradient(135deg, #0a66c2, #1e7fe0); color: #fff;
  border-radius: 8px; padding: 6px 10px; font-weight: 800; font-size: 14px;
}
.ajuda-ver.atual .ajuda-ver-tag { background: linear-gradient(135deg, #1a7f37, #2e9e4f); }
.ajuda-ver-body h4 { margin: 0 0 6px; color: #1f2d3d; font-size: 15px; }
.ajuda-ver-body ul { margin: 0; padding-left: 20px; }
.ajuda-ver-body li { font-size: 13px; color: #3a4756; line-height: 1.6; margin: 3px 0; }
.versao-atual { color: #1a7f37; font-weight: 700; font-size: 12.5px; }

@media (max-width: 700px) {
  .ajuda-grid { grid-template-columns: 1fr; }
  .ajuda-ver { flex-direction: column; gap: 8px; }
  .ajuda-ver-tag { align-self: flex-start; }
}

/* ===== v2.2 — Tabela de serviços gratuitos de backup ===== */
.backup-free-table { display:flex; flex-direction:column; border:1px solid #dbe4f0; border-radius:10px; overflow:hidden; font-size:13px; }
.bft-row { display:grid; grid-template-columns: 1.1fr .6fr 2fr; gap:8px; padding:8px 10px; border-bottom:1px solid #eef2f8; }
.bft-row:last-child { border-bottom:none; }
.bft-row:nth-child(even) { background:#f8fafd; }
.bft-head { background:#0a66c2; color:#fff; font-weight:700; }
.bft-head span { color:#fff; }
@media (max-width:700px) {
  .bft-row { grid-template-columns: 1fr; gap:2px; }
  .bft-head { display:none; }
}

/* ===== v2.3 — Login na página inicial (gate global) ===== */
.login-gate {
  position: fixed; inset: 0; z-index: 10050;
  display: none; align-items: center; justify-content: center;
  padding: 20px; overflow: auto;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(10,102,194,.35), transparent 60%),
    radial-gradient(900px 500px at 85% 90%, rgba(13,148,136,.30), transparent 60%),
    linear-gradient(135deg, #0b1b2b 0%, #0a2a46 55%, #072033 100%);
}
.login-gate.show { display: flex; }
.login-gate-card {
  width: 100%; max-width: 430px; background: #fff; border-radius: 22px;
  padding: 30px 28px 24px; box-shadow: 0 30px 80px rgba(2, 12, 27, .55);
  animation: lgPop .32s ease both;
}
@keyframes lgPop { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.login-gate-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; text-align: center; }
.login-gate-logo {
  width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center;
  font-size: 26px; background: linear-gradient(135deg, #0a66c2, #0d8bd9);
  box-shadow: 0 10px 24px rgba(10,102,194,.35); flex: 0 0 auto;
}
.login-gate-logo-img {
  width: min(320px, 100%);
  height: 160px;
  max-height: 120px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}
.login-gate-brand h2 { margin: 0; font-size: 20px; font-weight: 800; color: #12263a; }
.login-gate-brand p { margin: 2px 0 0; font-size: 12px; color: #5b6b7d; }
.login-gate-card .pd-field { margin-bottom: 12px; }
.login-gate-card .pd-field label { display: block; margin-bottom: 5px; font-weight: 700; color: #334155; }
.login-gate-card input {
  width: 100%; font-family: inherit; font-size: 14px; color: #12263a;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; padding: 11px 12px; outline: none;
}
.login-gate-card input:focus { border-color: #0a66c2; box-shadow: 0 0 0 3px rgba(10,102,194,.14); }
.login-gate-msg { min-height: 18px; font-size: 12px; color: #c0202f; margin: 2px 0 8px; font-weight: 600; }
.login-gate-btn {
  width: 100%; border: 0; border-radius: 11px; padding: 12px 16px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 800; letter-spacing: .4px; color: #fff;
  background: linear-gradient(135deg, #0a66c2, #0d8bd9);
  box-shadow: 0 10px 22px rgba(10,102,194,.32);
}
.login-gate-btn:hover { filter: brightness(1.05); }
.login-gate-btn:disabled { opacity: .65; cursor: wait; }
.login-gate-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 2px; }
.login-gate-row .pd-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #334155; cursor: pointer; }
.login-gate-row .pd-check input { width: 16px; height: 16px; }
.login-gate-row a { font-size: 12.5px; font-weight: 700; color: #0a66c2; text-decoration: none; }
.login-gate-row a:hover { text-decoration: underline; }
.login-gate-foot { text-align: center; font-size: 10.5px; color: #94a3b8; margin-top: 18px; }
.login-gate-hint { text-align: center; font-size: 11px; color: #64748b; margin-top: 10px; }
body.pd-logged-out { overflow: hidden; }

/* ===== v2.3 — Menu superior auto-oculto ao rolar ===== */
#appNav { transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s ease; will-change: transform; }
#appNav.nav-hidden { transform: translateY(calc(-100% - 14px)); opacity: 0; pointer-events: none; }
#navRevealZone { position: fixed; top: 0; left: 0; right: 0; height: 16px; z-index: 1099; pointer-events: auto; }

/* ===== v2.3 — Tela de Reset do sistema ===== */
.reset-wrap { max-width: 860px; }
.reset-hero {
  display: flex; gap: 16px; align-items: flex-start; background: #fff7ed;
  border: 1px solid #fed7aa; border-left: 5px solid #ea580c; border-radius: 14px;
  padding: 16px 18px; margin: 6px 0 16px;
}
.reset-hero-ico { font-size: 30px; line-height: 1; }
.reset-hero h3 { margin: 0 0 4px; font-size: 16px; color: #9a3412; }
.reset-hero p { margin: 0; font-size: 13px; color: #7c2d12; line-height: 1.5; }
.reset-keep {
  display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 16px;
}
.reset-keep .chip {
  display: inline-flex; align-items: center; gap: 7px; background: #ecfdf5;
  border: 1px solid #a7f3d0; color: #047857; border-radius: 999px;
  padding: 6px 12px; font-size: 12px; font-weight: 700;
}
.reset-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin: 8px 0 18px; }
.reset-opt {
  display: flex; gap: 10px; align-items: flex-start; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.reset-opt:hover { border-color: #bfdbfe; box-shadow: 0 2px 10px rgba(10,102,194,.08); }
.reset-opt input { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; accent-color: #0a66c2; }
.reset-opt-ico { font-size: 18px; line-height: 1.2; flex: 0 0 auto; }
.reset-opt-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reset-opt-txt b { font-size: 13px; font-weight: 700; color: #1e293b; }
.reset-opt-txt small { font-size: 11.5px; color: #64748b; line-height: 1.4; }
.reset-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; }
.reset-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.reset-actions .danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; border: 0;
  border-radius: 10px; padding: 11px 18px; font-family: inherit; font-size: 13px;
  font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(220,38,38,.28);
}
.reset-actions .danger:hover { filter: brightness(1.05); }
.reset-status { flex: 1 1 100%; font-size: 13px; font-weight: 700; }
.reset-status.ok { color: #047857; }
.reset-status.err { color: #b91c1c; }
@media (max-width: 640px) {
  .login-gate-card { padding: 24px 20px 20px; }
  .reset-list { grid-template-columns: 1fr; }
}

/* =====================================================================
   v2.6 — Login centralizado, campos menores, menu responsivo
   ===================================================================== */

/* ---- Login: caixa realmente centralizada ---- */
.login-gate {
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px;
}
.login-gate-card {
  max-width: 360px !important;
  margin: auto !important;
  padding: 28px 26px 22px !important;
  display: flex;
  flex-direction: column;
  align-self: center;
  justify-self: center;
}
.login-gate-card .pd-field { display: flex; flex-direction: column; align-items: center; }
.login-gate-card .pd-field label { width: 100%; max-width: 270px; text-align: left; }
.login-gate-card input {
  max-width: 270px !important;
  font-size: 13px !important;
  padding: 9px 11px !important;
  border-radius: 9px !important;
}
.login-gate-btn {
  max-width: 270px !important;
  margin: 0 auto !important;
  padding: 11px 16px !important;
  font-size: 13px !important;
}
.login-gate-row { max-width: 270px; margin-left: auto; margin-right: auto; }
.login-gate-brand { justify-content: center; text-align: center; }

/* ---- Menu principal v2.6: itens quadrados, ícone grande, texto pequeno ---- */
#appNav {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)) !important;
  align-items: stretch !important;
  gap: 6px !important;
  padding: 7px !important;
}
#appNav .nav-btn,
#appNav .nav-action {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  text-align: center !important;
  padding: 7px 5px !important;
  min-height: 62px;
  border-radius: 10px !important;
  white-space: normal !important;
  line-height: 1.1 !important;
}
#appNav .nav-ico { font-size: 21px !important; line-height: 1 !important; }
#appNav .nav-txt {
  font-size: 9.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
#appNav kbd { display: none !important; }
#appNav .nav-dropdown { display: flex; }
#appNav .nav-dropdown > .nav-btn { width: 100%; }
#appNav .nav-badge {
  position: absolute; top: 4px; right: 5px;
  font-size: 9px !important; padding: 0 4px !important; min-width: 14px;
}
#appNav .nav-btn { position: relative; }

@media (max-width: 900px) {
  #appNav {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)) !important;
    gap: 5px !important;
    justify-items: stretch;
    position: sticky;
    top: 0;
  }
  #appNav .nav-btn,
  #appNav .nav-action { min-height: 58px; aspect-ratio: 1 / 1; padding: 4px 3px !important; }
  #appNav .nav-ico { font-size: 22px !important; }
  #appNav .nav-txt { font-size: 8.5px !important; }
  /* dropdown abre centralizado, não estourando a tela */
  #appNav .nav-drop-menu {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    max-width: min(94vw, 360px) !important;
  }
}
@media (max-width: 560px) {
  #appNav { grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)) !important; }
  #appNav .nav-btn, #appNav .nav-action { min-height: 52px; }
  #appNav .nav-ico { font-size: 19px !important; }
  #appNav .nav-txt { font-size: 7.5px !important; }
}

/* ---- Notas NFe: moldura do iframe ---- */
.nfe-embed-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.nfe-embed-head h2 { margin: 0; font-size: 16px; font-weight: 800; color: #12263a; }
.nfe-embed-actions { display: flex; gap: 8px; }
.nfe-embed-frame {
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 560px;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(10,102,194,.07);
}
.nfe-build-wrap { min-height: min(60vh,520px); display:grid; place-items:center; padding:24px; }
.nfe-build-card { width:min(560px,100%); text-align:center; padding:34px 26px; border:1px solid #dbe7f4; border-radius:18px; background:linear-gradient(145deg,#fff,#f2f8ff); box-shadow:0 12px 35px rgba(16,65,112,.08); }
.nfe-build-icon { width:64px; height:64px; display:grid; place-items:center; margin:0 auto 14px; border-radius:18px; background:#e5f1ff; font-size:30px; }
.nfe-build-card h3 { margin:0 0 8px; color:#164776; font-size:21px; }
.nfe-build-card p { margin:0; color:#62758b; font-size:14px; line-height:1.6; }

/* =====================================================================
   v2.6 — Tela Instalar: destaque da versão mais recente + iOS
   ===================================================================== */
.instalar-ultima { margin: 14px 0 4px; }
.instalar-ultima .iu-box {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #e9f9ee; border: 2px solid #35b558; border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 2px 10px rgba(53,181,88,.12);
}
.instalar-ultima .iu-ico { font-size: 30px; line-height: 1; }
.instalar-ultima .iu-body { flex: 1 1 220px; min-width: 180px; display: flex; flex-direction: column; gap: 3px; }
.instalar-ultima .iu-tit { color: #146c2e; font-size: 15px; }
.instalar-ultima .iu-tag {
  align-self: flex-start; background: #35b558; color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
}
.instalar-ultima .iu-data { font-size: 11.5px; color: #4a7a58; }
.instalar-ultima .iu-notas { margin: 4px 0 0; font-size: 12px; color: #3d5c46; line-height: 1.45; }
.instalar-ultima .iu-btn { flex: 0 0 auto; white-space: nowrap; text-decoration: none; }
.instalar-card-ios { border-color: #d9d2f0; }
.instalar-passos { margin: 8px 0 0; padding-left: 20px; font-size: 12.5px; color: #445; line-height: 1.55; }
.instalar-passos li { margin-bottom: 4px; }
.instalar-passos code {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom; background: #f1f3f7;
  padding: 1px 6px; border-radius: 5px; font-size: 11.5px;
}
@media (max-width: 560px) {
  .instalar-ultima .iu-box { gap: 10px; padding: 12px; }
  .instalar-ultima .iu-btn { width: 100%; text-align: center; }
}

/* v2.6 — modal iOS (instalar) */
.ios-modal-v26 {
  position: fixed; inset: 0; z-index: 9999; display: flex;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(15,23,42,.55); opacity: 0; transition: opacity .2s;
}
.ios-modal-v26.show { opacity: 1; }
.ios-modal-box {
  background: #fff; border-radius: 14px; width: min(520px, 100%);
  max-height: 88vh; overflow: auto; box-shadow: 0 18px 50px rgba(0,0,0,.3);
}
.ios-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e6e9ef;
}
.ios-modal-head h3 { margin: 0; font-size: 16px; color: #1e293b; }
.ios-modal-x {
  border: 0; background: #f1f5f9; border-radius: 8px; width: 30px; height: 30px;
  font-size: 14px; cursor: pointer; color: #475569;
}
.ios-modal-body { padding: 14px 16px 18px; font-size: 13.5px; color: #334155; line-height: 1.55; }
.ios-modal-body p { margin: 0 0 8px; }

/* Navegação manual e tabelas em cartões em telas pequenas. */
#btnMobileNavToggle { display: none; }
@media (max-width: 1024px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .app-screen, .sc-layout, .pd-main, .pd-content, .rep-card { min-width: 0; max-width: 100%; }
  #screen-pedidos, .pd-app, .pd-main, .pd-content {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .pd-page-head > div { min-width: 0; max-width: 100%; }
  .pd-page-title, .pd-page-sub { overflow-wrap: anywhere; word-break: break-word; }
  #btnMobileNavToggle {
    position: sticky;
    top: 0;
    z-index: 1310;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    margin: 4px 0;
    padding: 8px 12px;
    border: 1px solid #cbd9e8;
    border-radius: 9px;
    background: #f3f8ff;
    color: #174875;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
  }
  #appNav {
    display: none !important;
    position: relative;
    top: auto;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  body.mobile-nav-open #appNav { display: grid !important; }
  #navRevealZone { display: none; }

  .rep-scroll, .pd-table-wrap, .pd-prod-table-wrap, .pdv-table-wrap, .sc-table-wrap,
  .sc-shop-config-wrap, .pd-nfe-inspector-table {
    max-width: 100%;
    overflow: visible !important;
  }
  .pd-stats, .pd-chegou-resumo {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
  }
  .pd-stat, .pd-chegou-resumo > div { min-width: 0 !important; }
  .pd-chegou-tabs, .pd-store-chat-tools, .pdv-category-strip, .pdv-pos-status {
    flex-wrap: wrap !important;
    overflow: visible !important;
  }
  .pd-chegou-tabs .pd-tab { flex: 1 1 auto !important; white-space: normal !important; }
  .pd-store-chat-tools > button, .pd-store-chat-tools > .pd-store-chat-file,
  .pd-store-chat-tools > label, .pdv-category-strip button, .pdv-pos-status > span {
    flex: 0 1 auto !important;
    max-width: 100%;
    white-space: normal;
  }
  table[data-mobile-cards] {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }
  table[data-mobile-cards] thead { display: none !important; }
  table[data-mobile-cards] tbody { display: block !important; width: 100% !important; }
  table[data-mobile-cards] tbody tr {
    display: block !important;
    width: 100% !important;
    margin: 0 0 10px !important;
    padding: 5px 9px !important;
    border: 1px solid #dbe4ee !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .05);
  }
  table[data-mobile-cards] tbody td {
    display: grid !important;
    grid-template-columns: minmax(88px, 36%) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    width: 100% !important;
    min-width: 0 !important;
    padding: 7px 2px !important;
    border: 0 !important;
    border-bottom: 1px solid #edf1f5 !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    color: #263648;
  }
  table[data-mobile-cards] tbody td:last-child { border-bottom: 0 !important; }
  table[data-mobile-cards] tbody td::before {
    content: attr(data-mobile-label);
    min-width: 0;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.4;
  }
  table[data-mobile-cards] tbody td[data-mobile-label=""] { display: flex !important; }
  table[data-mobile-cards] tbody td[colspan] { display: block !important; }
  table[data-mobile-cards] tbody td[hidden],
  table[data-mobile-cards] tbody td[style*="display:none"],
  table[data-mobile-cards] tbody td[style*="display: none"] { display: none !important; }
}

@media (max-width: 1024px) {
  #appNav { gap:4px !important; padding:5px !important; grid-template-columns:repeat(auto-fit,minmax(58px,1fr)) !important; }
  #appNav .nav-btn, #appNav .nav-action { min-height:44px !important; aspect-ratio:auto !important; padding:3px 4px !important; gap:2px !important; }
  #appNav .nav-ico { font-size:16px !important; }
  #appNav .nav-txt { font-size:7px !important; line-height:1.05 !important; }
  #btnMobileNavToggle { min-height:36px !important; padding:5px 8px !important; font-size:11px !important; }
  #viewerToolbar { gap:4px; }
  #viewerToolbar > button, #viewerToolbar .nav-btn { min-height:32px; padding:4px 7px; font-size:11px; }
}
@media (max-width: 560px) {
  #appNav { grid-template-columns:repeat(auto-fit,minmax(50px,1fr)) !important; }
  #appNav .nav-btn, #appNav .nav-action { min-height:44px !important; }
  #appNav .nav-ico { font-size:15px !important; }
  #appNav .nav-txt { font-size:6.5px !important; }
  #btnMobileNavToggle { min-height:34px !important; padding:4px 7px !important; font-size:10px !important; }
  #viewerToolbar > button, #viewerToolbar .nav-btn { min-height:30px; padding:3px 6px; font-size:10px; }
}

@media (max-width: 1024px) {
  #tableScroll { max-width:100% !important; overflow-x:auto !important; overflow-y:auto !important; }
  #itemsTable {
    display:table !important; width:max-content !important; min-width:1500px !important;
    border-collapse:collapse !important; border-spacing:0 !important;
  }
  #itemsTable thead { display:table-header-group !important; }
  #itemsTable tbody { display:table-row-group !important; width:auto !important; }
  #itemsTable tbody tr {
    display:table-row !important; width:auto !important; margin:0 !important; padding:0 !important;
    border:0 !important; border-radius:0 !important; box-shadow:none !important;
  }
  #itemsTable th, #itemsTable tbody td {
    display:table-cell !important; width:auto !important; min-width:0 !important;
    padding:5px 6px !important; border:1px solid #dbe4ee !important;
    white-space:nowrap !important; text-align:center !important; vertical-align:middle !important;
    overflow-wrap:normal !important;
  }
  #itemsTable tbody td::before { display:none !important; content:none !important; }
  #itemsTable tbody td[data-column="Produto"] {
    min-width:190px !important; max-width:240px !important; white-space:normal !important; text-align:left !important;
  }
  #itemsTable tbody td[data-column="FIGURA"],
  #itemsTable tbody td[data-column="FIGURA"] img,
  #itemsTable tbody td[data-column="FIGURA"] .no-image { width:44px !important; height:44px !important; }

  .pd-prod-table-wrap { max-width:100% !important; overflow-x:auto !important; overflow-y:visible !important; }
  table.pd-prod-table[data-mobile-cards] {
    display:table !important; width:max-content !important; min-width:1050px !important;
    border-collapse:collapse !important; border-spacing:0 !important;
  }
  table.pd-prod-table[data-mobile-cards] thead { display:table-header-group !important; }
  table.pd-prod-table[data-mobile-cards] tbody { display:table-row-group !important; width:auto !important; }
  table.pd-prod-table[data-mobile-cards] tbody tr {
    display:table-row !important; width:auto !important; margin:0 !important; padding:0 !important;
    border:0 !important; border-radius:0 !important; box-shadow:none !important;
  }
  table.pd-prod-table[data-mobile-cards] th,
  table.pd-prod-table[data-mobile-cards] tbody td {
    display:table-cell !important; width:auto !important; min-width:0 !important;
    padding:5px 6px !important; border:1px solid #e2e8f0 !important;
    white-space:nowrap !important; text-align:left !important; vertical-align:middle !important;
  }
  table.pd-prod-table[data-mobile-cards] tbody td::before { display:none !important; content:none !important; }
  table.pd-prod-table[data-mobile-cards] .pd-prod-desc { min-width:180px !important; max-width:220px !important; white-space:normal !important; }
}
