/* ==========================================================
   AS.GEST – Tema claro + Módulo Comercial (Produtos)
   Versão compacta de tipografia e espaçamento
   ========================================================== */

/* 🔄 Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 🌈 Tema geral */
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f9fafb;
  color: #111827;
  font-size: 14px;
  line-height: 1.4;
}

/* 🧭 Layout */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 📚 Menu lateral */
#menuLateral {
  width: 220px;
  background-color: #1f2937;
  color: white;
  padding: 1.2rem 1rem;
  display: none;
  flex-direction: column;
  justify-content: space-between;
}
#menuLateral li {
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}
#menuLateral li:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 📋 Conteúdo principal */
main {
  flex: 1;
  padding: 1.2rem 1.6rem;
  overflow-y: auto;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

/* 🧱 Painéis */
.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

/* Painéis do módulo Comercial */
#comercial .panel,
#comercial-importar .panel,
#comercial-config .panel {
  background: #f8fafc;
  border-color: #dbeafe;
}

/* Títulos */
h1, h2, h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.7rem;
  font-size: 1rem;
}

/* 🧰 Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.8rem;
}

.toolbar-buttons {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 💬 Texto pequeno */
.mini {
  font-size: 0.8rem;
  color: #475569;
  opacity: 0.9;
}

/* ⚙️ Botões */
button, .btn, .btn-sec, .btn-warn {
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.1s;
  font-size: 0.85rem;
}
button:hover, .btn:hover, .btn-sec:hover, .btn-warn:hover {
  transform: scale(1.03);
}

.btn {
  background-color: #059669; /* verde azulado */
  color: #fff;
}
.btn:hover { background-color: #047857; }

.btn-sec {
  background-color: #e0f2fe;
  color: #0c4a6e;
}
.btn-sec:hover { background-color: #bae6fd; }

.btn-warn {
  background-color: #dc2626;
  color: white;
}
.btn-warn:hover { background-color: #b91c1c; }

/* 🔳 Cards */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.card {
  flex: 1 1 200px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.05);
  text-align: center;
  padding: 0.8rem;
}
.card span {
  display: block;
  font-size: 1.1rem;
  font-weight: bold;
  color: #0f766e;
}

/* 🧩 Grid */
.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

/* 🧾 Tabelas */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.85rem;
}

table th, table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

table th {
  background-color: #e0f2fe;
  color: #0c4a6e;
  text-transform: uppercase;
  font-size: 0.75rem;
}

table tr:hover {
  background-color: #f1f5f9;
}

/* Linhas destacadas */
tr.linha-erro { background: #fee2e2; }
tr.linha-alerta { background: #fef3c7; }

/* 🧾 Pré-visualização */
#import-preview-wrap table {
  background: #f8fafc;
}
#previewMeta {
  font-size: 0.8rem;
  color: #475569;
}

/* 🧭 Inputs e selects */
input, select {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  background: white;
  color: #0f172a;
  width: 100%;
}
input:focus, select:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2,132,199,0.25);
}

/* 🪟 Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.modal-content {
  background: #fff;
  padding: 1.4rem;
  border-radius: 10px;
  width: 90%;
  max-width: 550px;
  box-shadow: 0 0 15px rgba(0,0,0,0.15);
  position: relative;
}
.modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #64748b;
  cursor: pointer;
}
.modal-close:hover { color: #0f172a; }

/* 📱 Responsividade */
@media (max-width: 992px) {
  main { padding: 1rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-buttons { width: 100%; justify-content: flex-end; }
  .grid2 { grid-template-columns: 1fr; }
  .cards { flex-direction: column; }
  .panel { padding: 0.8rem; }
}

@media (max-width: 600px) {
  body { font-size: 13px; }
  h2, h3 { font-size: 0.95rem; }
  button, .btn, .btn-sec, .btn-warn {
    font-size: 0.8rem;
    padding: 0.45rem 0.8rem;
  }
  input, select {
    font-size: 0.85rem;
    padding: 0.45rem 0.6rem;
  }
  table th, table td {
    font-size: 0.8rem;
    padding: 0.45rem 0.6rem;
  }
  .card span {
    font-size: 1rem;
  }
}
/* Navegação interna (submódulos Comerciais) */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.subnav-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background-color: #2563eb;
  color: white;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.subnav-btn:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
}

.subnav-btn.active {
  background-color: #1e40af;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

/* Pequeno ajuste nos títulos */
h2 {
  color: #1e3a8a;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
/* Fundo azul/verde-água padrão comercial */
#comercial-config {
  background: linear-gradient(180deg, #e0f7fa 0%, #ffffff 80%);
  border-radius: 16px;
  padding: 1rem 1.5rem;
}

.subnav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.subnav-btn {
  padding: 0.5rem 1rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.subnav-btn:hover {
  background: #2563eb;
}

.subnav-btn.active {
  background: #059669;
}

.grid-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.input-delimitador {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  text-align: center;
}

.input-delimitador:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
}
/* === Botões do topo do módulo Comercial === */
.toolbar-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.toolbar-botoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-topo {
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  color: #fff;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.btn-topo:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Cores específicas */
.btn-topo.azul    { background-color: #3b82f6; }
.btn-topo.verde   { background-color: #10b981; }
.btn-topo.roxo    { background-color: #8b5cf6; }
.btn-topo.laranja { background-color: #f97316; }
.btn-topo.cinza   { background-color: #6b7280; }

/* Responsivo */
@media (max-width: 768px) {
  .toolbar-topo {
    flex-direction: column;
    align-items: flex-start;
  }
  .toolbar-botoes {
    width: 100%;
    justify-content: flex-start;
  }
  .btn-topo {
    flex: 1 1 auto;
    text-align: center;
  }
}
/* === Painel de botões no topo dos módulos comerciais === */
.painel-botoes-topo {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.5rem 0;
  align-items: center;
}

.btn-acao {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-acao:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Cores baseadas nos módulos */
.btn-acao.azul    { background-color: #3b82f6; }
.btn-acao.verde   { background-color: #10b981; }
.btn-acao.roxo    { background-color: #8b5cf6; }
.btn-acao.laranja { background-color: #f97316; }
.btn-acao.cinza   { background-color: #6b7280; }

/* Responsivo */
@media (max-width: 768px) {
  .painel-botoes-topo {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-acao {
    width: 100%;
    text-align: center;
  }
}
.btn-acao.ciano { background-color: #06b6d4; } /* azul esverdeado (verde-água) */
button.mini {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

button.danger {
  background-color: #dc2626;
}

button.danger:hover {
  background-color: #b91c1c;
}
/* 🔝 Subnavegação superior (usada em Comercial) */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.subnav .btn,
.subnav .btn-sec {
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
}

.subnav .btn {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff;
}

.subnav .btn-sec {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #111;
}

.subnav .btn:hover {
  background: linear-gradient(135deg, #0369a1, #0891b2);
}

.subnav .btn-sec:hover {
  background-color: rgba(0,0,0,0.05);
}

.subnav .ativo {
  box-shadow: 0 0 0 2px rgba(3,105,161,0.4);
}
/* >>> BEGIN FILE: css/comercial_produtos.css */

/* Card de status de comunicação */
.card-status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  min-height: 90px;
  text-align: center;
}

.card-status .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-bottom: 4px;
  background: #555;
  box-shadow: 0 0 6px rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}

.card-status .dot.on {
  background: #00ff99;
  box-shadow: 0 0 10px #00ff99aa;
}

.card-status .dot.wait {
  background: #ffaa00;
  box-shadow: 0 0 10px #ffaa00aa;
}

.card-status .dot.off {
  background: #ff4444;
  box-shadow: 0 0 10px #ff4444aa;
}

.card-status .status-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#statusLabel {
  font-weight: 600;
}

#statusUltima {
  font-size: 0.8rem;
  color: #9aa6b2;
}

/* ========================================
   MODAL CONTAGEM / BALANÇO
======================================== */

.modal-balanco {
  background: #121b2e;
  color: #eaf0ff;
}

.modal-balanco table {
  width: 100%;
  border-collapse: collapse;
  background: #0f1a33;
  color: #eaf0ff;
}

.modal-balanco thead {
  background: rgba(255,255,255,.04);
}

.modal-balanco th {
  text-align: left;
  padding: 8px;
  font-weight: 600;
  color: #9aa6c1;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.modal-balanco td {
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.modal-balanco tbody tr:hover {
  background: rgba(56,189,248,.08);
}

/* caixa rolável */
.modal-balanco-scroll {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
}
/* =========================================
   FIX GLOBAL — checkbox/radio não podem ter width:100%
   (se não, vira uma faixa gigante e o texto fica longe)
========================================= */
input[type="checkbox"],
input[type="radio"]{
  width: auto !important;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  vertical-align: middle;
}

/* Mantém o estilo dos inputs "normais" (texto, número etc.) */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea{
  width: 100%;
}

/* =========================================
   FIX DE LINHA (label com checkbox)
   — deixa checkbox colado no texto e a linha mais “curta”
========================================= */
label:has(input[type="checkbox"]),
label:has(input[type="radio"]){
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

/* Se preferir limitar a apenas modais do balanço/coletor */
.modal-balanco label{
  justify-content: flex-start;
}

.modal-balanco label input[type="checkbox"],
.modal-balanco label input[type="radio"]{
  margin-top: 0;
}
/* ==========================================================
   AS.GEST • COMERCIAL VIBE
   Escopo isolado: .comercial-vibe
   ========================================================== */

.comercial-vibe{

  --bg:#f6fbff;
  --card:rgba(255,255,255,.85);
  --line:rgba(15,23,42,.10);
  --text:#0f172a;
  --muted:#64748b;

  --primary:#2563eb;
  --cyan:#06b6d4;
  --green:#10b981;
  --warn:#f59e0b;
  --danger:#ef4444;

  --shadow:0 12px 35px rgba(2,6,23,.10);
  --radius:16px;

  padding:16px 18px;
  border-radius:18px;

  background:
  radial-gradient(900px 280px at 12% -10%, rgba(37,99,235,.18), transparent),
  radial-gradient(700px 260px at 80% 0%, rgba(6,182,212,.14), transparent),
  linear-gradient(180deg, var(--bg), #ffffff);

  border:1px solid rgba(2,6,23,.06);
}

/* HEADER */

.comercial-vibe .mod-header{
  margin-bottom:12px;
}

.comercial-vibe h2{
  font-weight:800;
  font-size:1.2rem;
  color:var(--text);
}

/* TABS */

.comercial-vibe .tabs{

  display:flex;
  flex-wrap:wrap;
  gap:8px;

  padding:10px;
  border-radius:var(--radius);

  background:var(--card);
  border:1px solid var(--line);

  box-shadow:var(--shadow);

}

.comercial-vibe .tab{

  display:flex;
  align-items:center;
  gap:8px;

  padding:10px 12px;

  border-radius:14px;

  font-weight:700;

  color:var(--text);
  text-decoration:none;

}

.comercial-vibe .tab:hover{

  background:rgba(37,99,235,.08);

}

.comercial-vibe .tab.active{

  background:linear-gradient(135deg,
  rgba(37,99,235,.14),
  rgba(6,182,212,.12));

}

/* TOOLBAR */

.comercial-vibe .mod-toolbar{

  display:flex;
  justify-content:space-between;
  gap:10px;
  margin:14px 0;

}

/* BOTÕES */

.comercial-vibe button{

  border-radius:14px;

  padding:10px 14px;

  font-weight:800;

  background:linear-gradient(135deg,#38bdf8,#22c55e);

  color:#03121f;

  border:none;

  box-shadow:var(--shadow);

}

.comercial-vibe button:hover{

  transform:translateY(-1px);

}

/* TABELA */

.comercial-vibe .table{

  background:var(--card);

  border:1px solid var(--line);

  border-radius:var(--radius);

  box-shadow:var(--shadow);

}

.comercial-vibe .table th{

  background:linear-gradient(
  180deg,
  rgba(37,99,235,.10),
  rgba(6,182,212,.08)
  );

}

.comercial-vibe .table td{

  padding:12px;

}

/* BOTÕES TABELA */

.comercial-vibe .table button{

  padding:6px 8px;
  border-radius:10px;

  background:rgba(37,99,235,.10);

}

/* COLUNA AÇÕES COMPACTA */

.comercial-vibe td:last-child{

  white-space:nowrap;

}

/* TEXTO MUTED */

.comercial-vibe .muted{

  color:var(--muted);

}

/* RESPONSIVO */

@media(max-width:780px){

  .comercial-vibe{

    padding:14px;

  }

  .comercial-vibe .tabs{

    flex-direction:column;

  }

  .comercial-vibe button{

    width:100%;

  }

}

/* ==========================================================
   COMERCIAL VIBE • Segmented Tabs (aba interna do Coletor)
   Escopo: .comercial-vibe
   ========================================================== */

.comercial-vibe .seg-tabs{
  display:flex;
  gap:8px;
  padding:8px;
  border-radius:16px;
  background: rgba(255,255,255,.70);
  border:1px solid rgba(15,23,42,.10);
  box-shadow: 0 10px 22px rgba(2,6,23,.08);
  flex-wrap:wrap;
}

.comercial-vibe .seg-tab{
  border:1px solid rgba(37,99,235,.18);
  background: rgba(37,99,235,.08);
  color: #0b1220;
  border-radius:14px;
  padding:10px 12px;
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  box-shadow:none;
  transform:none !important; /* neutraliza o scale global */
}

.comercial-vibe .seg-tab:hover{
  transform: translateY(-1px) !important;
  background: rgba(37,99,235,.12);
}

.comercial-vibe .seg-tab.active{
  background: linear-gradient(135deg, rgba(37,99,235,.16), rgba(6,182,212,.14));
  border-color: rgba(37,99,235,.28);
}

/* ==========================================================
   COMERCIAL VIBE • Ações compactas (Coletor)
   Só tabelas do coletor (não afeta outras)
   ========================================================== */

.comercial-vibe #tabelaColetores td:last-child,
.comercial-vibe #tabelaPerfis td:last-child{
  display:flex;
  align-items:center;
  gap:6px;
  justify-content:flex-start;
  white-space:nowrap;
}

.comercial-vibe #tabelaColetores td:last-child button,
.comercial-vibe #tabelaPerfis td:last-child button{
  padding:6px 8px;
  border-radius:12px;
  background:rgba(37,99,235,.10);
  border:1px solid rgba(37,99,235,.18);
  font-weight:900;
  font-size:.78rem;
  line-height:1;
  transform:none !important; /* mata o scale global */
}

.comercial-vibe #tabelaColetores td:last-child button:hover,
.comercial-vibe #tabelaPerfis td:last-child button:hover{
  transform:translateY(-1px) !important;
  background:rgba(37,99,235,.14);
}

/* Mobile: deixa quebrar sem “aumentar a caixa” */
@media (max-width: 780px){
  .comercial-vibe .seg-tabs{ flex-direction:column; }
  .comercial-vibe .seg-tab{ width:100%; justify-content:center; }

  .comercial-vibe #tabelaColetores td:last-child,
  .comercial-vibe #tabelaPerfis td:last-child{
    white-space:normal;
    flex-wrap:wrap;
  }

  .comercial-vibe #tabelaColetores td:last-child button,
  .comercial-vibe #tabelaPerfis td:last-child button{
    flex:1 1 auto;
    justify-content:center;
  }
}

/* ==========================================================
   COMERCIAL VIBE • Botões por módulo
   ========================================================== */

/* base */
.comercial-vibe .btn-modulo{
  border-radius:14px;
  padding:10px 14px;
  font-weight:900;
  border:none;
  cursor:pointer;
  color:#fff;
  box-shadow:0 10px 22px rgba(2,6,23,.12);
  transition:.15s;
}

.comercial-vibe .btn-modulo:hover{
  transform:translateY(-1px);
  filter:brightness(1.05);
}

/* COLETOR */
.comercial-vibe .btn-coletor{
  background:linear-gradient(135deg,#2563eb,#06b6d4);
}

/* CONTAGEM */
.comercial-vibe .btn-contagem{
  background:linear-gradient(135deg,#10b981,#22c55e);
}

/* VALIDADES */
.comercial-vibe .btn-validades{
  background:linear-gradient(135deg,#f59e0b,#f97316);
}

/* LISTA DE COMPRAS */
.comercial-vibe .btn-listas{
  background:linear-gradient(135deg,#8b5cf6,#6366f1);
}

/* PRODUTOS */
.comercial-vibe .btn-produtos{
  background:linear-gradient(135deg,#0ea5e9,#0284c7);
}

/* === FIX FINAL: modal de respostas sempre aparece quando backdrop abre === */
#respModal.backdrop.open { display: flex !important; }

#respModal.backdrop .resp-modal{
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;

  width: min(960px, 96vw);
  max-height: 90vh;
  overflow: auto;

  background: #fff;               /* tema claro */
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.20);
  padding: 12px;
}

/* Produtos > Análise */
.analise-lista {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.analise-card {
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 22px rgba(2,6,23,.08);
  display: grid;
  gap: 10px;
}

.analise-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.analise-produto {
  display: grid;
  gap: 3px;
}

.analise-produto strong {
  color: #0f172a;
  font-size: .95rem;
}

.analise-produto small,
.analise-meta {
  color: #64748b;
  font-size: .82rem;
}

.analise-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 800;
  font-size: .75rem;
}

.analise-info {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.analise-chip {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: .78rem;
  color: #334155;
}

.analise-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.analise-actions button {
  width: auto !important;
  transform: none !important;
}

.btn-analise-troca {
  background: linear-gradient(135deg,#2563eb,#06b6d4) !important;
  color: #fff !important;
}

.btn-analise-perda {
  background: linear-gradient(135deg,#f59e0b,#f97316) !important;
  color: #fff !important;
}

.btn-analise-excluir {
  background: #fff5f5 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
}
/* >>> END FILE */

#modalListaValidades #tabelaValidades {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

#modalListaValidades #tabelaValidades th,
#modalListaValidades #tabelaValidades td {
  vertical-align: middle;
  padding: 12px 10px;
  word-break: break-word;
}

#modalListaValidades #tabelaValidades th:nth-child(1),
#modalListaValidades #tabelaValidades td:nth-child(1) {
  width: 42px;
  text-align: center;
}

#modalListaValidades #tabelaValidades th:nth-child(2),
#modalListaValidades #tabelaValidades td:nth-child(2) {
  width: 125px;
}

#modalListaValidades #tabelaValidades td:nth-child(2) {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  min-width: 125px;
}

#modalListaValidades #tabelaValidades th:nth-child(3),
#modalListaValidades #tabelaValidades td:nth-child(3) {
  width: 250px;
}

#modalListaValidades #tabelaValidades th:nth-child(4),
#modalListaValidades #tabelaValidades td:nth-child(4) {
  width: 120px;
}

#modalListaValidades #tabelaValidades th:nth-child(5),
#modalListaValidades #tabelaValidades td:nth-child(5) {
  width: 110px;
}

#modalListaValidades #tabelaValidades th:nth-child(6),
#modalListaValidades #tabelaValidades td:nth-child(6),
#modalListaValidades #tabelaValidades th:nth-child(7),
#modalListaValidades #tabelaValidades td:nth-child(7) {
  width: 90px;
  text-align: center;
}

#modalListaValidades #tabelaValidades th:nth-child(8),
#modalListaValidades #tabelaValidades td:nth-child(8) {
  width: 130px;
  text-align: center;
}

#modalListaValidades #tabelaValidades th:nth-child(9),
#modalListaValidades #tabelaValidades td:nth-child(9) {
  width: 190px;
}

#modalListaValidades .acoes-validade-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

#modalListaValidades #tabelaValidades .validade-codigo {
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* ==========================================================
   VALIDADES — LAYOUT MOBILE EM CARDS
   ========================================================== */

@media (max-width: 760px) {

  /* Modal ocupa praticamente toda a tela */
  #modalListaValidades {
    padding: 0 !important;
  }

  #modalListaValidades > div {
    width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }

  /* Área da lista mais compacta */
  #modalListaValidades > div > div:last-child {
    padding: 10px !important;
  }

  /* Retira a largura mínima de desktop */
  #modalListaValidades #tabelaValidades {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: auto !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  #modalListaValidades #tabelaValidades thead {
    display: none;
  }

  #modalListaValidades #tabelaValidades,
  #modalListaValidades #tabelaValidades tbody,
  #modalListaValidades #tabelaValidades tr,
  #modalListaValidades #tabelaValidades td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  /* Card de cada produto */
  #modalListaValidades #tabelaValidades tbody tr.linha-validade {
    position: relative;
    margin: 0 0 12px;
    padding: 14px 12px 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.07);
    overflow: hidden;
    transform: none !important;
  }

  /* Mantém a cor lateral conforme a situação */
  #modalListaValidades #tabelaValidades tbody tr.linha-vencido {
    border-left: 5px solid #dc2626;
  }

  #modalListaValidades #tabelaValidades tbody tr.linha-30 {
    border-left: 5px solid #f59e0b;
  }

  #modalListaValidades #tabelaValidades tbody tr.linha-60 {
    border-left: 5px solid #eab308;
  }

  #modalListaValidades #tabelaValidades tbody tr.linha-ok {
    border-left: 5px solid #22c55e;
  }

  #modalListaValidades #tabelaValidades tbody tr.linha-resolvido {
    border-left: 5px solid #2563eb;
  }

  /* Todas as células deixam de herdar larguras de desktop */
  #modalListaValidades #tabelaValidades tbody td,
  #modalListaValidades #tabelaValidades tbody td:nth-child(n) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 5px 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: left !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word;
  }

  /* Layout padrão: rótulo e informação */
  #modalListaValidades #tabelaValidades tbody td:not(:nth-child(1)):not(:nth-child(3)):not(:nth-child(9)) {
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1fr) !important;
    align-items: center;
    gap: 8px;
  }

  #modalListaValidades #tabelaValidades tbody td::before {
    content: attr(data-label);
    min-width: 0;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  /* Checkbox no canto superior direito */
  #modalListaValidades #tabelaValidades tbody td:nth-child(1) {
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto !important;
    padding: 0 !important;
    z-index: 2;
  }

  #modalListaValidades #tabelaValidades tbody td:nth-child(1)::before {
    display: none;
  }

  #modalListaValidades #tabelaValidades .chk-validade-grupo {
    width: 20px !important;
    height: 20px !important;
  }

  /* Nome do produto vira a informação principal */
  #modalListaValidades #tabelaValidades tbody td:nth-child(3) {
    display: block !important;
    padding: 0 34px 9px 0 !important;
    margin-bottom: 5px;
    border-bottom: 1px solid #eef2f7 !important;
  }

  #modalListaValidades #tabelaValidades tbody td:nth-child(3)::before {
    display: none;
  }

  #modalListaValidades #tabelaValidades tbody td:nth-child(3) strong {
    display: block;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 800;
    color: #0f172a;
    overflow-wrap: anywhere;
  }

  #modalListaValidades #tabelaValidades tbody td:nth-child(3) small {
    font-size: 11px;
    line-height: 1.35;
  }

  /* Código de barras compacto e sempre horizontal */
  #modalListaValidades #tabelaValidades .validade-codigo {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    color: #475569;
    letter-spacing: 0;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Validade em destaque */
  #modalListaValidades #tabelaValidades tbody td:nth-child(5) {
    font-weight: 800;
    color: #0f172a;
  }

  /* Saldo em destaque */
  #modalListaValidades #tabelaValidades tbody td:nth-child(7) strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 28px;
    padding: 3px 9px;
    border-radius: 9px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 14px;
  }

  /* Ações no rodapé do card */
  #modalListaValidades #tabelaValidades tbody td:nth-child(9) {
    display: block !important;
    padding-top: 10px !important;
    margin-top: 5px;
    border-top: 1px solid #eef2f7 !important;
  }

  #modalListaValidades #tabelaValidades tbody td:nth-child(9)::before {
    display: none;
  }

  #modalListaValidades .acoes-validade-cell {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
  }

  #modalListaValidades .acoes-validade-cell button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px;
    margin: 0;
    padding: 7px 8px !important;
    font-size: 11px !important;
    white-space: normal;
    transform: none !important;
  }

  /* Barra de seleção */
  #barraAcoesLoteValidades {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 0 10px !important;
    padding: 9px !important;
  }

  #barraAcoesLoteValidades button {
    width: auto !important;
  }
}