/* =========================
   VARIÁVEIS GLOBAIS
========================= */
:root{
  /* Fundos */
  --gmetal-bg-body: #c7c7c7;
  --gmetal-card-bg: #111827;
  --gmetal-card-bg-alt: #020617;

  /* Bordas & sombras */
  --gmetal-border-soft: rgba(148,163,184,0.35);
  --gmetal-border-strong: rgba(15,23,42,0.9);
  --gmetal-shadow-strong: 0 18px 40px rgba(0,0,0,0.45);
  --gmetal-shadow-soft: 0 10px 24px rgba(0,0,0,0.35);

  /* Textos */
  --gmetal-text-main: #f9fafb;
  --gmetal-text-muted: #e5e5e5;
  --gmetal-text-soft: #b0b0b0;

  /* Marca */
  --gmetal-brand: #f97316;
  --gmetal-brand-soft: rgba(249,115,22,0.12);

  /* Raio e transição */
  --gmetal-radius-card: 14px;
  --gmetal-radius-soft: 8px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;

  /* Botões */
  --btn-radius: 10px;
  --btn-h: 40px;
  --btn-pad-x: 14px;
  --btn-font: 600 14px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --btn-shadow: 0 8px 18px rgba(0,0,0,.14);
  --btn-shadow-hover: 0 10px 22px rgba(0,0,0,.18);
  --btn-border: rgba(255,255,255,.12);

  /* Cores botões */
  --btn-primary: #f97316;
  --btn-primary-hover: #ea580c;

  --btn-dark: #111827;
  --btn-dark-hover: #0b1220;

  --btn-ghost: rgba(255,255,255,.06);
  --btn-ghost-hover: rgba(255,255,255,.10);

  --btn-danger: #dc2626;
  --btn-danger-hover: #b91c1c;

  --btn-success: #22c55e;          /* CONCLUIR */
  --btn-success-hover: #16a34a;

  --btn-pause: #1d4ed8;            /* PAUSAR */
  --btn-pause-hover: #1e40af;

  --btn-info: #2563eb;
  --btn-info-hover: #1d4ed8;
}

/* =========================
   RESET + BASE GLOBAL
========================= */
*{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body{
  min-height: 100vh;
  background: radial-gradient(circle at top, #020617 0, #020617 45%, #000 100%);
  color: var(--gmetal-text-main);
  padding: 4px;
}

body.portal{
  display: flex;
  align-items: center;
  justify-content: center;
}

.container{
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: var(--gmetal-card-bg);
  padding: 14px;
  border-radius: var(--gmetal-radius-card);
  box-shadow: var(--gmetal-shadow-strong);
  border: 1px solid rgba(148,163,184,0.4);
}

.container hr{
  border: none;
  border-top: 1px solid rgba(55,65,81,0.9);
  margin: 12px 0 14px;
}

/* =========================
   CABEÇALHO PADRÃO
========================= */
.header{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  border-bottom: 1px solid rgba(148,163,184,0.4);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.header h1{
  font-size: 20px;
  font-weight: 600;
  color: var(--gmetal-brand);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

.subtitle{
  font-size: 13px;
  color: var(--gmetal-text-muted);
  margin-bottom: 14px;
}

/* =========================
   LOGO GMETAL (imagens)
========================= */
/* ✅ gmetal-logo é a IMAGEM (no index ela é um <img>) */
img.gmetal-logo{
  display: block;
  height: 56px;        /* ajuste se quiser maior/menor */
  max-width: 100%;
  object-fit: contain;
}


/* Logo "texto" (novo pedido) */
.logo{
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(249,115,22,0.55);
}

.logo-text{
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text span:first-child{
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #e5e7eb;
}

.logo-text span:last-child{
  font-size: 11px;
  color: var(--gmetal-text-soft);
}

/* =========================
   TÍTULOS / SUBTÍTULOS
========================= */
.titulo-pagina{
  font-size: 20px;
  font-weight: 600;
  color: var(--gmetal-brand);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.subtitulo-pagina{
  font-size: 13px;
  color: var(--gmetal-text-muted);
  margin-top: 2px;
}

/* Link “voltar ao início” */
.link-voltar-inicio{
  font-size: 13px;
  color: #e5e7eb;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  background: rgba(15,23,42,0.9);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-normal);
}

.link-voltar-inicio:hover{
  background: #020617;
  border-color: var(--gmetal-brand);
  color: var(--gmetal-brand);
  transform: translateY(-1px);
}

/* =========================
   PORTAL (index.html)
========================= */
.portal-titulo{
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gmetal-brand);
}

.portal-subtitulo{
  font-size: 14px;
  color: var(--gmetal-text-muted);
  margin-top: 4px;
}

.setor-info{
  font-size: 13px;
  color: var(--gmetal-text-muted);
  text-align: right;
}

.setor-info strong{ color: #e5e7eb; }

.menu-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.card-link{ text-decoration: none; color: inherit; }

.card{
  background: #020617;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--gmetal-border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  height: 100%;
  position: relative;
  overflow: hidden;
}

.card::before{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, var(--gmetal-brand-soft), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.card:hover{
  transform: translateY(-2px);
  box-shadow: var(--gmetal-shadow-soft);
  border-color: var(--gmetal-brand);
  background: #111827;
}

.card:hover::before{ opacity: 1; }

.card-icon{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--gmetal-brand-soft);
  color: var(--gmetal-brand);
}

.card-titulo{
  font-size: 15px;
  font-weight: 600;
  color: var(--gmetal-text-main);
}

.card-descricao{
  font-size: 13px;
  color: var(--gmetal-text-muted);
  line-height: 1.4;
}

.card-tag{
  margin-top: auto;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gmetal-text-soft);
}

.rodape{
  margin-top: 18px;
  font-size: 11px;
  color: var(--gmetal-text-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.rodape strong{ color: #9ca3af; }

/* =========================
   WRAPPER DE TABELAS
========================= */
.tabela-wrapper{
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--gmetal-border-strong);
  background: #020617;
  box-shadow: 0 10px 22px rgba(0,0,0,0.6);
}

/* base tables */
table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

th, td{
  padding: 8px 10px;
  border-bottom: 1px solid #111827;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th{
  background: #020617;
  color: var(--gmetal-text-main);
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
}

tr:nth-child(even) td{ background: var(--gmetal-card-bg); }
tr:nth-child(odd)  td{ background: var(--gmetal-card-bg-alt); }
tr:hover td{ background: #111827; }

/* =========================
   STATUS PILL
========================= */
.status-pill{
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(248,250,252,0.08);
}

.status-aberto{
  background: #451a03;
  color: #fed7aa;
}

.status-emproducao{
  background: #0b1120;
  color: #bfdbfe;
}

.status-finalizado{
  background: #022c22;
  color: #bbf7d0;
}

/* =========================
   LISTA DE PEDIDOS / FILTROS
========================= */
.filtros{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.filtros input,
.filtros select{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  min-width: 160px;
  background: #020617;
  color: #e5e7eb;
  font-size: 13px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.filtros input::placeholder{ color: #6b7280; }

.filtros input:focus,
.filtros select:focus{
  border-color: var(--gmetal-brand);
  box-shadow: 0 0 0 1px rgba(249,115,22,0.4);
  outline: none;
  background: #020617;
}

.sem-registros{
  margin-top: 10px;
  font-size: 13px;
  color: var(--gmetal-text-muted);
}

/* =========================
   DETALHES DO PEDIDO
========================= */
.cabecalho{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px;
  border-radius: 8px;
  background: #020617;
  border: 1px solid rgba(55,65,81,0.8);
  font-size: 13px;
}

.cabecalho-item strong{
  display: block;
  margin-bottom: 2px;
  color: #e5e7eb;
}

.cabecalho-item span{ color: #d1d5db; }

.total-geral{
  margin-top: 15px;
  text-align: right;
  font-size: 15px;
  font-weight: 600;
  color: var(--gmetal-text-main);
}

.botoes{
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mensagem-erro{
  margin-top: 12px;
  color: #fecaca;
  font-size: 13px;
}

/* =========================
   ALERTAS (SUCESSO / ERRO)
========================= */
.alerta{
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
}

.alerta-sucesso{
  display: block;
  background: rgba(22,163,74,0.14);
  border: 1px solid rgba(34,197,94,0.8);
  color: #bbf7d0;
}

.alerta-erro{
  display: block;
  background: rgba(185,28,28,0.18);
  border: 1px solid rgba(248,113,113,0.9);
  color: #fecaca;
}

/* =========================
   NOVO PEDIDO – FORM
========================= */
.form-section{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.form-group{
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

label{
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

.required{
  color: #fca5a5;
  margin-left: 2px;
}

.form-section input[type="text"],
.form-section select{
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #4b5563;
  font-size: 13px;
  outline: none;
  background: #020617;
  color: #e5e7eb;
  transition: var(--transition-fast);
}

.form-section input::placeholder{ color: #6b7280; }

.form-section input:focus,
.form-section select:focus{
  border-color: var(--gmetal-brand);
  box-shadow: 0 0 0 1px rgba(249,115,22,0.4);
}

.linha-cliente{
  display: flex;
  gap: 8px;
  align-items: center;
}

.linha-cliente input[type="text"]{ flex: 1; }

.footer-actions{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* Tag "Criar pedido" */
.tag{
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #020617;
  color: #bfdbfe;
  font-weight: 600;
  border: 1px solid #1d4ed8;
}

/* =========================
   AUTOCOMPLETE CLIENTE
========================= */
.sugestoes-container{ position: relative; }

.lista-sugestoes{
  position: absolute;
  z-index: 10;
  background: #020617;
  border: 1px solid #4b5563;
  width: 100%;
  max-height: 150px;
  overflow-y: auto;
  list-style: none;
  margin-top: 4px;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(0,0,0,0.7);
  padding: 4px 0;
}

.item-sugestao{
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  color: #e5e7eb;
}

.item-sugestao:hover{ background: #111827; }

.erro-cliente{
  font-size: 12px;
  color: #fecaca;
  margin-top: 2px;
  min-height: 16px;
}

#mensagem-retorno{
  margin-top: 10px;
  font-size: 13px;
  color: #e5e7eb;
}

/* =========================
   TABELA DO NOVO PEDIDO (.tabela-produto)
   - permite quebra na descrição
========================= */

/* =========================
   TABELA DO NOVO PEDIDO (.tabela-produto)
   FIX: colunas estáveis (não "dançam") + quebra só no produto/descrição
========================= */
.tabela-produto{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #020617;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,0.35);
  box-shadow: 0 12px 24px rgba(0,0,0,0.6);

  /* ✅ ESSENCIAL: trava o layout das colunas */
  table-layout: fixed;
}

.tabela-produto thead{ background: #020617; }
.tabela-produto tbody tr:nth-child(even) td{ background: #020617; }
.tabela-produto tbody tr:nth-child(odd)  td{ background: #070f1c; }
.tabela-produto tbody tr:last-child td{ border-bottom: none; }

.tabela-produto th,
.tabela-produto td{
  padding: 10px 10px;
  border-bottom: 1px solid #111827;
  vertical-align: middle;

  /* padrão: não quebrar e não estourar */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cabeçalho não quebra */
.tabela-produto th{
  font-weight: 700;
}

/* ✅ Coluna do PRODUTO/DESCRIÇÃO (normalmente a 2ª) pode quebrar */
.tabela-produto td:nth-child(2),
.tabela-produto th:nth-child(2){
  white-space: normal;
  word-break: break-word;
}

/* ✅ Larguras "ERP" (ajuste fino se quiser) */
.tabela-produto th:nth-child(1),
.tabela-produto td:nth-child(1){
  width: 110px; /* código */
}

.tabela-produto th:nth-child(3),
.tabela-produto td:nth-child(3){
  width: 90px;  /* UN ou SIZE (se existir) */
  text-align: center;
}

.tabela-produto th:nth-child(4),
.tabela-produto td:nth-child(4){
  width: 90px;  /* QTD */
  text-align: center;
}

.tabela-produto th:nth-child(5),
.tabela-produto td:nth-child(5){
  width: 130px; /* VLR UNIT */
  text-align: right;
}

.tabela-produto th:nth-child(6),
.tabela-produto td:nth-child(6){
  width: 130px; /* TOTAL */
  text-align: right;
}

/* inputs dentro da tabela (quantidade) */
.tabela-produto .input-quantidade{
  width: 78px;
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #4b5563;
  font-size: 13px;
  background: #020617;
  color: #e5e7eb;
}

.tabela-produto .input-quantidade:focus{
  border-color: var(--gmetal-brand);
  box-shadow: 0 0 0 1px rgba(249,115,22,0.4);
}

/* =========================
   PREVIEW DO PRODUTO (centralizado)
========================= */
.produto-preview{
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
  margin-bottom: 10px;
  clear: both;
}

.produto-preview img{
  max-width: 180px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

/* =========================
   BARRAS DE PROGRESSO (produção)
========================= */
.prod-titulo{
  margin: 18px 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.progress-wrap{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 14px;
}

.progress-wrap.item-progress{ margin-top: 6px; }

.progress-bar{
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.progress-bar.small{
  width: 140px;
  flex: 0 0 140px;
  height: 8px;
}

.progress-fill{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #22c55e);
  border-radius: 999px;
  transition: width .25s ease;
}

.progress-text{
  font-size: 12px;
  opacity: 0.85;
  white-space: nowrap;
}

/* =========================
   CARDS RESUMO (produção/ERP)
========================= */
.cards-resumo{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card-resumo{
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 16px;
}

.card-resumo .card-titulo{
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.card-resumo .card-valor{
  font-size: 22px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 10px;
}

.cards-resumo .progress-bar{
  background: #1f2937;
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
}

.cards-resumo .progress-fill{
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #22b55e);
  width: 0%;
  transition: width 0.3s ease;
}

/* =========================
   BOTÕES – PADRÃO GMETAL (FINAL)
   Estilo: dark + accent (portal)
========================= */

.btn{
  appearance: none;
  height: 34px;
  padding: 0 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.22);

  background: #0b1120;
  color: #e5e7eb;

  font: 600 12px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  cursor: pointer;
  user-select: none;

  transition:
    background-color .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    transform .1s ease;
}

.btn:hover{
  background: #111827;
  border-color: rgba(148,163,184,.35);
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}

.btn:active{
  transform: translateY(1px);
}

.btn:disabled{
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== VARIAÇÕES ===== */

/* Laranja GMETAL */
.btn--primary{
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #0b1220;
  border-color: rgba(0,0,0,.18);
}
.btn--primary:hover{
  filter: brightness(1.03);
}

/* Neutro escuro */
.btn--dark{
  background: #0b1120;
}
.btn--dark:hover{
  background: #111827;
}

/* Fantasma (discreto) */
.btn--ghost{
  background: rgba(255,255,255,.06);
}
.btn--ghost:hover{
  background: rgba(255,255,255,.10);
}

/* 🔵 PAUSAR – azul suave (portal) */
.btn--pause{
  background: rgba(59,130,246,.12);
  color: #dbeafe;
  border-color: rgba(59,130,246,.35);
}
.btn--pause:hover{
  background: rgba(59,130,246,.18);
  border-color: rgba(59,130,246,.55);
}

/* 🟢 CONCLUIR – verde suave (portal) */
.btn--success{
  background: rgba(34,197,94,.12);
  color: #bbf7d0;
  border-color: rgba(34,197,94,.35);
}
.btn--success:hover{
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.55);
}

/* 🔴 Ação crítica / retrabalho */
.btn--danger{
  background: rgba(248,113,113,.14);
  color: #fecaca;
  border-color: rgba(248,113,113,.35);
}
.btn--danger:hover{
  background: rgba(248,113,113,.20);
  border-color: rgba(248,113,113,.55);
}

/* =========================
   INPUT DATA – ESTILO BOTÃO
========================= */
.input-date-btn{
  appearance: none;
  -webkit-appearance: none;

  height: 44px; /* mesmo height visual do btn--lg */
  padding: 0 14px;
  border-radius: 10px;

  background: #0b1120;
  color: #e5e7eb;

  border: 1px solid rgba(148,163,184,0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);

  font-size: 14px;
  font-weight: 500;

  cursor: pointer;
}

.input-date-btn:hover{
  background: #111827;
  border-color: rgba(148,163,184,0.45);
}

.input-date-btn:focus{
  outline: none;
  border-color: rgba(148,163,184,0.6);
  box-shadow: 0 0 0 2px rgba(148,163,184,0.18);
}

/* placeholder visual */
.input-date-btn:empty::before{
  content: "📅 Data de entrega";
  color: #9ca3af;
}

/* ===== TAMANHOS ===== */
.btn--sm{
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.btn--lg{
  height: 46px;
  padding: 0 16px;
  font-size: 14px;
}

/* ===== GRUPO DE BOTÕES ===== */
.btn-group{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* =========================
   PRODUÇÃO – CARDS POR ITEM + TABELA ETAPAS
========================= */
#secaoProducao h2{
  margin: 10px 0 14px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .02em;
}

/* Card do título do item */
#producaoContainer .prod-titulo{
  margin: 18px 0 8px;
  padding: 12px 14px;
  background: #020617;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(0,0,0,.45);
}

/* Progresso colado no título */
#producaoContainer .progress-wrap.item-progress{
  margin: -4px 0 10px;
  padding: 10px 14px 12px;
  background: #020617;
  border: 1px solid rgba(148,163,184,0.18);
  border-top: none;
  border-radius: 0 0 12px 12px;
}

/* Tabela etapas */
#producaoContainer .tabela-etapas{
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.25);
  background: #020617;
  box-shadow: 0 10px 22px rgba(0,0,0,.45);
  margin-bottom: 14px;
}

#producaoContainer .tabela-etapas th{
  background: #0b1120;
  color: #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1;
}

#producaoContainer .tabela-etapas td{ vertical-align: middle; }

/* Coluna ações */
#producaoContainer .tabela-etapas th:last-child,
#producaoContainer .tabela-etapas td:last-child{
  text-align: right;
  white-space: nowrap;
  width: 220px;
  padding-right: 14px;
  vertical-align: middle;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* >>> ALINHAMENTO FIXO DOS 4 BOTÕES (grid 2x2) <<< */
#producaoContainer .tabela-etapas .btn-group{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 210px;
  align-content: center;
  justify-items: stretch;
}

/* botões compactos dentro da tabela etapas */
#producaoContainer .tabela-etapas .btn{
  width: 100%;
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
  gap: 6px;
}

/* Coluna etapa maior (seu nth-child(4)) */
#producaoContainer .tabela-etapas td:nth-child(4){
  min-width: 320px;
}

/* =========================
   TOGGLE / TIMELINE (modo alternativo)
========================= */
.view-toggle{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 6px 0 10px;
}

.timeline{
  display: none;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.25);
  background: #020617;
  box-shadow: 0 10px 22px rgba(0,0,0,.45);
  margin-bottom: 14px;
}

.timeline-steps{
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  list-style: none;
}

.timeline-step{
  flex: 0 0 220px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.20);
  background: #0b1120;
  padding: 10px 10px 8px;
}

.timeline-top{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.timeline-etapa{
  font-size: 13px;
  font-weight: 700;
  color: #e5e7eb;
  line-height: 1.2;
}

.timeline-meta{
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

.timeline-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  color: #e5e7eb;
  background: rgba(255,255,255,0.06);
}

.timeline-step.is-pendente{ opacity: .85; }
.timeline-step.is-andamento{ border-color: rgba(249,115,22,0.50); }
.timeline-step.is-concluido{ border-color: rgba(34,197,94,0.55); }

.timeline-step.is-andamento .timeline-badge{
  background: rgba(249,115,22,0.12);
  border-color: rgba(249,115,22,0.40);
  color: #fed7aa;
}

.timeline-step.is-concluido .timeline-badge{
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.40);
  color: #bbf7d0;
}

/* =========================
   TOAST (mensagem inline)
========================= */
.toast-host{
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast{
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0b1120;
  border: 1px solid rgba(148,163,184,0.28);
  box-shadow: 0 14px 30px rgba(0,0,0,.45);
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1.35;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-show{
  opacity: 1;
  transform: translateY(0);
}

.toast--success{ border-color: rgba(34,197,94,0.55); }
.toast--error{ border-color: rgba(248,113,113,0.65); }
.toast--info{ border-color: rgba(59,130,246,0.55); }

.toast-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.toast-title{
  font-weight: 800;
  letter-spacing: .02em;
}

.toast-close{
  border: 0;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 8px;
}

.toast-close:hover{ background: rgba(255,255,255,.06); }

/* =========================
   RESPONSIVO
========================= */
@media (max-width: 600px){
  body{ padding: 12px; }

  .container{
    padding: 16px;
    border-radius: 12px;
  }

  .portal-titulo{
    font-size: 22px;
    letter-spacing: 0.14em;
  }

  .portal-subtitulo{ font-size: 13px; }
  .titulo-pagina{ font-size: 18px; }

  .header{ align-items: flex-start; }
  .setor-info{ text-align: left; }

  /* ações no mobile: não estourar */
  #producaoContainer .tabela-etapas th:last-child,
  #producaoContainer .tabela-etapas td:last-child{
    width: auto;
    white-space: normal;
  }

  #producaoContainer .tabela-etapas .btn-group{
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }
}
/* ============================
   PRODUÇÃO - NOVO LAYOUT (CARDS)
   (Tabela substituída)
============================ */

/* Card do produto/item */
.prod-card {
  background: var(--gmetal-card-bg, #111827);
  border: 1px solid var(--gmetal-border-soft, rgba(148,163,184,0.25));
  border-radius: 14px;
  box-shadow: var(--gmetal-shadow-soft, 0 10px 24px rgba(0,0,0,0.35));
  overflow: hidden;
  margin: 14px 0 22px;
}

.prod-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--gmetal-border-soft, rgba(148,163,184,0.2));
}

.prod-card__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.prod-card__pct {
  font-weight: 800;
  opacity: 0.95;
}

/* Barra grande */
.prod-progress {
  padding: 0 16px 14px;
}

.prod-progress .progress-bar {
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.prod-progress .progress-fill {
  height: 100%;
  border-radius: 999px;
}

/* Lista de etapas (substitui tabela) */
.etapas-list {
  padding: 12px 10px 8px;
}

.etapa-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.12);
  background: rgba(2,6,23,0.35);
  margin: 10px 6px;
}

.etapa-left {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
}

.etapa-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}

.etapa-name {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.15;
}

.etapa-meta {
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.75;
}

/* Badge status (direita) */
.etapa-status {
  align-self: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(255,255,255,0.06);
  white-space: nowrap;
}

/* Estados visuais */
.etapa-row.is-concluido .etapa-icon {
  background: rgba(34,197,94,0.18);
  border-color: rgba(34,197,94,0.45);
}
.etapa-row.is-andamento .etapa-icon {
  background: rgba(255,140,0,0.18);
  border-color: rgba(255,140,0,0.45);
}
.etapa-row.is-pendente .etapa-icon {
  background: rgba(148,163,184,0.10);
  border-color: rgba(148,163,184,0.22);
}

.etapa-row.is-concluido .etapa-status {
  background: rgba(34,197,94,0.18);
  border-color: rgba(34,197,94,0.45);
}
.etapa-row.is-andamento .etapa-status {
  background: rgba(255,140,0,0.18);
  border-color: rgba(255,140,0,0.45);
}
.etapa-row.is-pendente .etapa-status {
  background: rgba(148,163,184,0.10);
  border-color: rgba(148,163,184,0.22);
}

/* Ações 2x2  */
.acoes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px 16px;
}

.acoes-grid .btn {
  width: 100%;
  justify-content: center;
}

/* Etapa selecionada (clique) */
.etapa-row.is-selected {
  outline: 2px solid rgba(255, 140, 0, 0.65);
  outline-offset: -2px;
  background: rgba(255, 140, 0, 0.08);
}

/* Cursor de clique para indicar seleção */
.etapa-row {
  cursor: pointer;
}
/* ===== Carrinho: descrição cortada + modal ver completo ===== */
#tabela-itens-container td.desc-curta{
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* só quando for clicável */
#tabela-itens-container td.desc-curta.is-clickable{
  cursor: pointer;
}
#tabela-itens-container td.desc-curta.is-clickable:hover{
  outline: 1px solid rgba(249,115,22,0.45);
  outline-offset: -2px;
  border-radius: 6px;
}

/* Modal */
.desc-modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.desc-modal{
  width: min(760px, 100%);
  background: #0b1120;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
  padding: 14px;
}

.desc-modal-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.desc-modal-title{
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .02em;
  color: #e5e7eb;
}

.desc-modal-close{
  border: 0;
  background: rgba(255,255,255,.06);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.desc-modal-close:hover{ background: rgba(255,255,255,.10); }

.desc-modal-body{
  font-size: 13px;
  line-height: 1.45;
  color: #e5e7eb;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow: auto;
  padding-right: 6px;
}
/* =========================
   DETALHES DO PRODUTO (NOVO PEDIDO)
   Tabelas do seletor (com SIZE / sem SIZE)
========================= */

#detalhes-produto .tabela-produto{
  table-layout: fixed;
  width: 100%;
}

/* garante controles 100% da célula (select / input) */
#detalhes-produto .tabela-produto select,
#detalhes-produto .tabela-produto input{
  width: 100%;
  max-width: 100%;
}

/* ---------- COM SIZE (3 colunas) ---------- */
/* Size | Medidas | Quantidade */
#detalhes-produto .tabela-produto--size th:nth-child(1),
#detalhes-produto .tabela-produto--size td:nth-child(1){
  width: 30%;
}

#detalhes-produto .tabela-produto--size th:nth-child(2),
#detalhes-produto .tabela-produto--size td:nth-child(2){
  width: 50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#detalhes-produto .tabela-produto--size th:nth-child(3),
#detalhes-produto .tabela-produto--size td:nth-child(3){
  width: 20%;
  text-align: right;
}

#detalhes-produto .tabela-produto--size td:nth-child(3) .input-quantidade{
  max-width: 110px;
  margin-left: auto;
}

/* ---------- SEM SIZE (2 colunas) ---------- */
/* Medidas | Quantidade */
#detalhes-produto .tabela-produto--no-size th:nth-child(1),
#detalhes-produto .tabela-produto--no-size td:nth-child(1){
  width: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#detalhes-produto .tabela-produto--no-size th:nth-child(2),
#detalhes-produto .tabela-produto--no-size td:nth-child(2){
  width: 160px;
  text-align: right;
}

#detalhes-produto .tabela-produto--no-size td:nth-child(2) .input-quantidade{
  max-width: 120px;
  margin-left: auto;
}

/* ===============================
   TOPBAR GMETAL – MINI (HAMBURGER)
   =============================== */

/* Container do topbar */
#gmetalTopbar{
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  position: relative;
  z-index: 2000;
}

/* Botão hamburger */
.gmetal-burger{
  width: 42px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: linear-gradient(
    180deg,
    rgba(17,24,39,0.95),
    rgba(2,6,23,0.95)
  );
  color: #f97316; /* laranja GMetal */
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .18s ease;
}

/* Hover */
.gmetal-burger:hover{
  background: rgba(249,115,22,0.12);
  border-color: rgba(249,115,22,0.55);
  box-shadow: 0 0 0 2px rgba(249,115,22,0.25);
}

/* Active / click */
.gmetal-burger:active{
  transform: scale(0.96);
}

/* Menu dropdown */
.gmetal-menu{
  position: absolute;
  top: 46px;
  left: 0;
  min-width: 140px;
  background: linear-gradient(
    180deg,
    #020617,
    #020617
  );
  border: 1px solid rgba(249,115,22,0.35);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.6);
}

/* Itens do menu */
.gmetal-menu-item{
  width: 100%;
  background: transparent;
  border: none;
  color: #f9fafb;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

/* Hover item */
.gmetal-menu-item:hover{
  background: rgba(249,115,22,0.15);
  color: #f97316;
}

/* Item perigoso (logout) */
.gmetal-menu-item #gmetalLogout,
.gmetal-menu-item.logout{
  color: #fca5a5;
}

.gmetal-menu-item #gmetalLogout:hover,
.gmetal-menu-item.logout:hover{
  background: rgba(220,38,38,0.2);
  color: #fecaca;
}
/* Header do index como grid alinhado */
.header.header-index{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

/* Slot do botão hambúrguer */
#topbar-slot{
  display: flex;
  align-items: center;
  margin-top: 2px;
}

/* Garante que o topbar não force altura */
#gmetalTopbar{
  height: auto;
}
/* slot do menu dentro do header */
#topbar-slot{
  display: flex;
  align-items: center;
}

/* garante que o topbar mini não empurre o header */
#gmetalTopbar{
  display: inline-flex;
  align-items: center;
  margin: 0;
}


/* =========================================================
   LAYOUT 2 COLUNAS (Master-Detail) — Desktop/Notebook/Tablet
   - Desktop/Notebook: 62% / 38%
   - Tablet: alterna "Lista" <-> "Painel" via .is-panel-open
========================================================= */

.layout-2col{
  display: grid;
  grid-template-columns: 62% 38%;
  gap: 14px;
  align-items: start;
}

.layout-2col .col-left,
.layout-2col .col-right{
  min-width: 0;
}

/* Painel direito com cara de "card" */
.layout-2col .col-right{
  background: #020617;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 10px 22px rgba(0,0,0,.45);

  position: sticky;
  top: 12px;
  align-self: start;
  max-height: calc(100vh - 24px);
  overflow: auto;
}

/* Botão voltar (tablet) */
.btn-voltar-painel{
  display: none;
  width: 100%;
  margin-bottom: 10px;
}

/* =========================
   TABLET (<= 1023px)
   - Uma coluna
   - Alternância por classe: .is-panel-open
========================= */
@media (max-width: 1023px){
  .layout-2col{
    grid-template-columns: 1fr;
  }

  .layout-2col .col-right{
    display: none;
    position: static;
    max-height: none;
    overflow: visible;
  }

  .layout-2col.is-panel-open .col-left{
    display: none;
  }
  .layout-2col.is-panel-open .col-right{
    display: block;
  }

  .layout-2col.is-panel-open .btn-voltar-painel{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
}

/* Container wide (para telas grandes) */
.container.container--wide{
  max-width: 98vw;      /* ocupa quase tudo */
  margin: 0 auto;
}

/* =========================
   Produção: Item colapsável (accordion)
========================= */
.prod-card__head{
  cursor: pointer;
  user-select: none;
}

.prod-card__head:hover{
  background: rgba(255,255,255,0.03);
}

.prod-card__toggle{
  opacity: .75;
  font-weight: 900;
  margin-left: 10px;
}

.prod-card__status{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  opacity: .95;
}

.prod-card__body{
  display: none;
}

.prod-card.is-open .prod-card__body{
  display: block;
}
.prod-card__body{ display:none; }
.prod-card.is-open .prod-card__body{ display:block; }
.prod-card__head{ cursor:pointer; user-select:none; }

.hist-retrabalho{
  margin-top: 6px;
  padding: 10px;
  border: 1px solid rgba(255,140,0,0.35);
  border-radius: 10px;
  background: rgba(255,140,0,0.08);
}
/* Topo: alertas gerais do pedido (no painel direito) */
.producao-alerts-top{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin: 10px 0 2px;
}

.alert-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(2,6,23,0.35);
  color: #e5e7eb;
}

.alert-badge--retrabalho{
  border-color: rgba(220,38,38,0.65);
  background: rgba(220,38,38,0.14);
}

.alert-badge--pausado{
  border-color: rgba(245,158,11,0.65);
  background: rgba(245,158,11,0.14);
}

.alert-badge--ok{
  border-color: rgba(34,197,94,0.55);
  background: rgba(34,197,94,0.12);
}

/* Ícone no cabeçalho do card do item (lado do status) */
.prod-card__alert{
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-right: 6px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(2,6,23,0.35);
  color: #e5e7eb;
}

/* Variantes do ícone */
.prod-card__alert.is-retrabalho{
  border-color: rgba(220,38,38,0.65);
  background: rgba(220,38,38,0.14);
}

.prod-card__alert.is-pausado{
  border-color: rgba(245,158,11,0.65);
  background: rgba(245,158,11,0.14);
}

/* Destaque no CARD inteiro quando estiver crítico */
.prod-card--retrabalho{
  border: 2px solid rgba(220, 38, 38, 0.9);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}

.prod-card--pausado{
  border: 2px solid rgba(245, 158, 11, 0.9);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

/* Destaque na LINHA da etapa crítica */
.etapa-row--retrabalho{
  background: rgba(220, 38, 38, 0.12);
}

.etapa-row--pausado{
  background: rgba(245, 158, 11, 0.12);
}

/* célula que contém observações */
.td-observacoes,
.col-observacoes {
  position: relative;
  padding-right: 14px;
}

/* balão principal */
.observacao-balao {
  position: relative;
  display: inline-block;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(148,163,184,0.25);
  color: #e5e7eb;
}

/* seta do balão */
.observacao-balao::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 14px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-left: inherit;
  border-bottom: inherit;
  transform: rotate(45deg);
}

/* ================================
   VARIAÇÕES POR TIPO
================================ */

/* 🔴 RETRABALHO */
.observacao-balao.retrabalho {
  background: rgba(220,38,38,0.18);
  border-color: rgba(220,38,38,0.55);
  color: #fecaca;
}

/* 🟠 PAUSA */
.observacao-balao.pausa {
  background: rgba(245,158,11,0.18);
  border-color: rgba(245,158,11,0.55);
  color: #fde68a;
}

/* 🟢 INFO / NEUTRO */
.observacao-balao.info {
  background: rgba(59,130,246,0.18);
  border-color: rgba(59,130,246,0.45);
  color: #bfdbfe;
}

/* ================================
   TEXTO INTERNO
================================ */
.observacao-balao strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.observacao-balao .muted {
  opacity: .85;
  font-size: 12px;
}

/* =========================
   CARRINHO (Criar Pedido)
   alvo: #tabela-itens-container .tabela-carrinho
   FIX FINAL:
   - Nome em cima, imagem embaixo
   - Cabeçalho NÃO quebra
   - Descrição com ...
   - Unidade/Qtd compactas
   - Preço unitário menor
========================= */

#tabela-itens-container .tabela-carrinho{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* garante cabeçalho visível */
#tabela-itens-container .tabela-carrinho thead{
  display: table-header-group;
}

#tabela-itens-container .tabela-carrinho th,
#tabela-itens-container .tabela-carrinho td{
  padding: 10px 10px;
  border-bottom: 1px solid #111827;
  font-size: 13px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tabela-itens-container .tabela-carrinho th{
  background: #0b1120;
  color: #e5e7eb;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 12px;
  padding: 12px 10px;

  /* ✅ cabeçalho nunca quebra */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tabela-itens-container .tabela-carrinho tbody tr:nth-child(odd) td{ background: #070f1c; }
#tabela-itens-container .tabela-carrinho tbody tr:nth-child(even) td{ background: #020617; }
#tabela-itens-container .tabela-carrinho tbody tr:hover td{ background: #111827; }

/* -------------------------
   LARGURAS (compacta onde dá)
   1 Produto | 2 Código | 3 Desc | 4 Un | 5 Qtd | 6 Vlr Unit | 7 Total | 8 Ações
------------------------- */
#tabela-itens-container .tabela-carrinho th:nth-child(1),
#tabela-itens-container .tabela-carrinho td:nth-child(1){
  width: 260px;
}

#tabela-itens-container .tabela-carrinho th:nth-child(2),
#tabela-itens-container .tabela-carrinho td:nth-child(2){
  width: 110px;
}

#tabela-itens-container .tabela-carrinho th:nth-child(4),
#tabela-itens-container .tabela-carrinho td:nth-child(4){
  width: 70px;
  text-align: center;
}

#tabela-itens-container .tabela-carrinho th:nth-child(5),
#tabela-itens-container .tabela-carrinho td:nth-child(5){
  width: 70px;
  text-align: center;
}

#tabela-itens-container .tabela-carrinho th:nth-child(6),
#tabela-itens-container .tabela-carrinho td:nth-child(6){
  width: 120px;
  text-align: right;
}

#tabela-itens-container .tabela-carrinho th:nth-child(7),
#tabela-itens-container .tabela-carrinho td:nth-child(7){
  width: 110px;
  text-align: right;
}

#tabela-itens-container .tabela-carrinho th:nth-child(8),
#tabela-itens-container .tabela-carrinho td:nth-child(8){
  width: 120px;
  text-align: right;
}

/* -------------------------
   DESCRIÇÃO: sempre com "..."
   (seu modal já abre no clique)
------------------------- */
#tabela-itens-container .tabela-carrinho td:nth-child(3),
#tabela-itens-container .tabela-carrinho th:nth-child(3){
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* mantém seu comportamento de clique */
#tabela-itens-container td.desc-curta{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#tabela-itens-container td.desc-curta.is-clickable{
  cursor: pointer;
}
#tabela-itens-container td.desc-curta.is-clickable:hover{
  outline: 1px solid rgba(249,115,22,0.45);
  outline-offset: -2px;
  border-radius: 6px;
}

/* -------------------------
   PRODUTO (NOME EM CIMA + IMAGEM EMBAIXO)
------------------------- */
#tabela-itens-container .produto-cell{
  display: flex;
  flex-direction: column;   /* ✅ empilha */
  align-items: flex-start;
  gap: 8px;                 /* ✅ espaço entre nome e imagem */
}

#tabela-itens-container .produto-nome{
  font-weight: 900;
  line-height: 1.2;

  /* pode quebrar só no nome, sem estourar */
  white-space: normal;
  word-break: break-word;
}

#tabela-itens-container .thumb-carrinho{
  width: 140px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(148,163,184,0.18);
}

/* -------------------------
   INPUT PREÇO UNITÁRIO (MENOR)
------------------------- */
#tabela-itens-container .tabela-carrinho .campo-preco-unitario{
  width: 92px;        /* ✅ menor */
  max-width: 92px;
  text-align: right;
  padding: 6px 8px;
}
/* =========================================================
   NOVO PEDIDO – AJUSTE FINO DE LARGURA (VERSÃO FINAL)
========================================================= */

/* Container mais largo, mas sem exagero */
body:has(#tabela-itens-container) .container{
  max-width: 1400px;   /* largura de ERP */
  width: 100%;
  padding: 16px 20px;
  margin: 0 auto;
}

/* Fundo mais neutro apenas no novo pedido */
body:has(#tabela-itens-container){
  background: linear-gradient(
    180deg,
    #020617 0%,
    #020617 65%,
    #000 100%
  );
}
/* =========================
   PRODUÇÃO – BOTÃO COMENTÁRIO POR ETAPA
========================= */
.etapa-coment-btn{
  background: transparent;
  border: 1px solid rgba(255,140,0,0.75);
  color: rgba(255,140,0,0.95);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.etapa-coment-btn:hover{
  filter: brightness(1.08);
}

.etapa-coment-btn:active{
  transform: translateY(1px);
}

/* quando já tem comentário (💬) fica mais destacado */
.etapa-coment-btn.is-has{
  border-color: rgba(34,197,94,0.75);
  color: rgba(34,197,94,0.95);
}
/* =========================
   PRODUÇÃO – CAIXA DE COMENTÁRIO INLINE
========================= */
.etapa-coment-box{
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(2,6,23,0.35);
}

.etapa-coment-head{
  font-weight: 800;
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 6px;
}

.etapa-coment-body{
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
}
.etapa-coment-actions{
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.etapa-coment-edit{
  width: 100%;
  min-height: 72px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(2,6,23,0.25);
  color: var(--gmetal-text-main, #f9fafb);
  outline: none;
}
.item-pdfs-box{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;

  /* destaque */
  background: rgba(249, 115, 22, 0.12); /* laranja GMetal suave */
  border: 1px solid rgba(249, 115, 22, 0.45);

  display: flex;
  flex-direction: column;
  gap: 6px;
}
.item-pdfs-link{
  font-size: 13px;
  font-weight: 600;
  color: #fde68a; /* amarelo claro, destaca no dark */
  text-decoration: none;
}

.item-pdfs-link:hover{
  text-decoration: underline;
  color: #fff;
}
.prod-card__title .btn{
  padding: 2px 8px;
  font-size: 12px;
}
.gmetal-menu{
  position: absolute;
  top: 100%;
  left: 0;
  background: #020617;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 10px;
  min-width: 220px;
  padding: 6px;
  z-index: 9999;
}

.gmetal-menu-item{
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: 0;
  color: #e5e7eb;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
}

.gmetal-menu-item:hover{
  background: rgba(255,255,255,0.06);
}

.gmetal-menu-separator{
  height: 1px;
  margin: 6px 4px;
  background: rgba(148,163,184,.25);
}

.gmetal-menu-logout{
  color: #fca5a5;
}
/* =========================
   TABELA DE PEDIDOS – BORDA ARREDONDADA GLOBAL
   Vale para TODAS as roles
========================= */

#tabelaPedidos {
  border-collapse: separate;      /* necessário p/ radius funcionar */
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;               /* corta cantos internos */
  background: var(--gmetal-card-bg);
  box-shadow: var(--gmetal-shadow-soft);
}

/* bordas das células */
#tabelaPedidos th,
#tabelaPedidos td {
  border-bottom: 1px solid var(--gmetal-border-soft);
}

/* remove borda extra no final */
#tabelaPedidos tbody tr:last-child td {
  border-bottom: none;
}

/* arredonda cantos superiores */
#tabelaPedidos thead tr:first-child th:first-child {
  border-top-left-radius: 12px;
}
#tabelaPedidos thead tr:first-child th:last-child {
  border-top-right-radius: 12px;
}

/* arredonda cantos inferiores */
#tabelaPedidos tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}
#tabelaPedidos tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}
/* =========================
   STATUS COMERCIAL
========================= */

.status-comercial-PENDENTE{
  background: #451a03;
  color: #fed7aa;
}

.status-comercial-PROJETO{
  background: #1e1b4b;
  color: #c7d2fe;
}

.status-comercial-EM_PRODUCAO{
  background: #0b1120;
  color: #bfdbfe;
}

.status-comercial-CONCLUIDO{
  background: #022c22;
  color: #bbf7d0;
}
/* 🗓️ Calendário – neutro destacado */
.btn--calendar{
  background: rgba(148,163,184,.18);
  color: #e5e7eb;
  border-color: rgba(148,163,184,.38);
}
.btn--calendar:hover{
  background: rgba(148,163,184,.26);
  border-color: rgba(148,163,184,.55);
}
/* input invisível que serve de âncora pro datepicker nativo */
.date-anchor{
  position: fixed;      /* vamos reposicionar via JS */
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
}
/* Toast */
.toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: var(--gmetal-shadow-strong);
}
.toast.show{
  opacity: 1;
  transform: translateY(0);
}
.toast-ok{
  border: 1px solid rgba(34,197,94,.35);
  background: rgba(34,197,94,.16);
  color: #eafff2;
}