body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f3f3f1;
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 95vh;
  color: #1a1a1a;
}

/* Remove flash azul ao tocar em elementos no mobile */
button,
a,
input,
label,
select,
textarea,
[role="button"],
[onclick],
.card-conferente,
.item-selecao,
.btn-aba,
.card-tap-fix {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.container {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
}

/* === ESTILO LOGIN MINIMALISTA (BASEADO NA IMAGEM) === */
.login-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 440px;
  animation: loginAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-top-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.login-top-logo i {
  font-size: 28px;
  color: #2e7d32;
}

.login-card {
  background: #ffffff;
  width: 100%;
  padding: 48px;
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04);
  border: 1px solid #eeeeee;
}

.login-card h2 {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: left;
  margin: 0 0 32px 0;
  letter-spacing: -0.03em;
  display: block;
  /* Garante alinhamento à esquerda */
}

.form-field {
  margin-bottom: 24px;
}

.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.label-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.label-group label {
  margin-bottom: 0;
}

.forgot-password {
  font-size: 0.75rem;
  color: #1a1a1a;
  text-decoration: underline;
  opacity: 0.7;
}

.form-field input {
  width: 100%;
  padding: 14px 16px;
  background-color: #f0f0f0;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 1rem;
  color: #1a1a1a;
  transition: all 0.2s;
  box-sizing: border-box;
}

.input-relative {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-relative input {
  padding-right: 48px !important;
  /* Espaço para o ícone */
}

.btn-toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: color 0.2s;
  z-index: 10;
}

.btn-toggle-password:hover {
  color: #1a1a1a;
}

.form-field input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: #1a1a1a;
}

/* Modal de Seleção Mobile */
.modal-global-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-global-content {
  background: white;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.item-selecao {
  padding: 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 16px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-selecao:hover {
  background: #f0f7ff;
}

.item-selecao:active {
  background: #e1efff;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Centralizar Flatpickr no Mobile */
@media (max-width: 768px) {
  .flatpickr-calendar {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5), 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    z-index: 10002 !important;
  }

  .flatpickr-calendar.arrowTop:before,
  .flatpickr-calendar.arrowTop:after,
  .flatpickr-calendar.arrowBottom:before,
  .flatpickr-calendar.arrowBottom:after {
    display: none !important;
  }
}

.btn-main-login {
  width: 100%;
  padding: 14px;
  background-color: #1a1a1a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  margin-top: 8px;
}

.btn-main-login:hover {
  opacity: 0.9;
}

.btn-main-login:active {
  transform: scale(0.98);
}

.card-footer-divider {
  height: 1px;
  background: #eeeeee;
  margin: 32px 0;
}

.card-footer-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-footer-action span {
  font-size: 0.9rem;
  color: #666;
}

.btn-secondary-outline {
  padding: 8px 16px;
  border: 1px solid #eeeeee;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary-outline:hover {
  background: #f9f9f9;
}

@keyframes loginAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#msgLogin {
  font-family: inherit;
  margin-top: 15px;
}

/* === FIM LOGIN === */

#mainContainer {
  max-width: 650px;
  display: none;
  align-self: flex-start;
  transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#mainContainer.modo-tabela {
  max-width: 98%;
}

@media (max-width: 480px) {
  body {
    padding: 24px;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #f8f9fa;
    /* Um tom levemente diferente para destacar o card */
  }

  .login-wrapper {
    gap: 12px !important;
    width: 100%;
    max-width: 340px;
    /* Garante que não encoste nas bordas */
  }

  .login-card {
    padding: 24px 20px !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05) !important;
  }

  .login-card h2 {
    font-size: 1.6rem !important;
    margin-bottom: 20px !important;
  }

  .form-field {
    margin-bottom: 16px !important;
  }

  .form-field input {
    font-size: 16px !important;
    /* Evita zoom automático no iOS */
    padding: 12px 14px !important;
  }

  .btn-main-login {
    padding: 16px !important;
    font-size: 1.1rem !important;
    border-radius: 12px !important;
  }

  .login-top-logo {
    font-size: 1.5rem !important;
    gap: 8px !important;
  }

  .login-top-logo i {
    font-size: 36px !important;
  }
}

/* Customização Flatpickr Airbnb */
.flatpickr-calendar.airbnb {
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  padding: 10px;
}

.flatpickr-day.selected {
  background: #2e7d32 !important;
  /* Cor principal do seu sistema */
  border-color: #2e7d32 !important;
}

.flatpickr-months .flatpickr-month {
  background: white !important;
  color: #333 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  background: white !important;
  font-weight: bold;
}

.flatpickr-day:hover {
  background: #e8f5e9 !important;
  color: #333 !important;
}

/* Footer Customizado Flatpickr */
/* Título Customizado dentro do Flatpickr */
.flatpickr-title-custom {
  text-align: center;
  padding: 12px;
  font-weight: 800;
  color: #1976d2;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  border-radius: 12px 12px 0 0;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.flatpickr-footer-custom {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-top: 1px solid #eee;
  background: #fdfdfd;
  border-radius: 0 0 12px 12px;
}

.flatpickr-footer-custom button {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-flatpickr-clear {
  color: #ef4444;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  gap: 5px;
}

.btn-flatpickr-clear:hover {
  background: #fef2f2 !important;
  color: #dc2626;
}

.btn-flatpickr-month {
  color: #c2410c;
  /* Laranja escuro */
  background: #fff7ed !important;
  margin: 0 5px;
  border-radius: 6px;
}

.btn-flatpickr-month:hover {
  background: #ffedd5 !important;
  color: #9a3412;
}

.btn-flatpickr-today {
  color: #2e7d32;
  background: #e8f5e9 !important;
  margin-left: auto;
  border-radius: 6px;
}

.btn-flatpickr-today:hover {
  background: #c8e6c9 !important;
  color: #1b5e20;
}

/* Corrigir cursor nos campos do Flatpickr em todas as variações */
.flatpickr-input,
.flatpickr-input.form-control,
.flatpickr-mobile,
input[readonly].flatpickr-input {
  cursor: pointer !important;
  background-color: white !important;
}

/* Container de Busca com expansão suave */
.search-container-animated {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
  transition: all 0.4s ease-in-out;
  overflow: hidden;
}

h2 {
  text-align: center;
  color: #333;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

h2 i {
  color: #2e7d32;
  /* Verde igual ao login */
}

/* Antiga Header foi preservada para backup invisível caso scripts confiem na classe */
.user-header {
  display: none !important;
}

/* Nova Header Airy SaaS */
.user-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid #eaeaea;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  margin-bottom: 25px;
  transition: all 0.3s ease;
}

.user-header-modern:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0fdf4;
  color: #16a34a;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  border: 1px solid #dcfce7;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 700;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.2;
}

.user-unit {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

.user-unit strong {
  color: #4b5563;
  font-weight: 600;
}

.btn-logout-modern {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: #ef4444;
  border: 1px solid #fee2e2;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn-logout-modern:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
  transform: translateY(-1px);
}

.btn-logout-modern:active {
  transform: translateY(0);
}

.menu-abas {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
  overflow: visible;
}

.btn-aba {
  flex: 1 1 auto;
  padding: 8px 10px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: bold;
  color: #757575;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color 0.3s;
  white-space: nowrap;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.btn-aba:hover {
  color: #2e7d32;
}

.btn-aba.ativa {
  color: #2e7d32;
  border-bottom: 3px solid #2e7d32;
  margin-bottom: -12px;
}

/* Dropdown Admin Menu */
.dropdown-admin {
  position: relative;
  display: none;
}

.dropdown-admin-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
  z-index: 10;
  border-radius: 6px;
  top: 100%;
  left: 0;
  margin-top: 5px;
  overflow: hidden;
  border: 1px solid #eee;
}

.dropdown-admin-content button {
  color: #555;
  padding: 12px 16px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-weight: 500;
}

.dropdown-admin-content button:hover {
  background-color: #f4f7f6;
  color: #d84315;
}

.dropdown-admin.active .dropdown-admin-content {
  display: block;
}

.dropdown-admin .btn-aba.ativa {
  border-bottom: 3px solid #d84315;
  margin-bottom: -12px;
  color: #d84315;
}

.form-group {
  margin-bottom: 15px;
  text-align: left;
}

label {
  display: block;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 5px;
  color: #555;
}

input,
select {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s;
  background-color: white;
}

input[readonly].flatpickr-input,
input[readonly].flatpickr-mobile,
input[readonly]:not(.input-doador):not(.input-marca) {
  cursor: pointer !important;
  background-color: white !important;
}

input[readonly].input-doador,
input[readonly].input-marca,
input[readonly].input-doador-conf,
input[readonly].input-marca-conf {
  background-color: #f1f3f5;
  color: #495057;
  cursor: not-allowed;
  font-weight: bold;
}

button.btn-sucesso {
  width: 100%;
  padding: 12px;
  background-color: #2e7d32;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  margin-top: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

button.btn-sucesso:hover {
  background-color: #1b5e20;
}

button.btn-sucesso:disabled {
  background-color: #9e9e9e;
  cursor: not-allowed;
}

#msgLogin,
#mensagem {
  margin-top: 15px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  min-height: 20px;
}

.loading-db {
  font-size: 12px;
  color: #d84315;
  float: right;
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 4px;
}

.produto-chip {
  display: none;
  justify-content: space-between;
  align-items: center;
  background-color: #e3f2fd;
  color: #1976d2;
  padding: 10px 15px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

.produto-chip-close {
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  color: #64b5f6;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.ui-autocomplete {
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 9999 !important;
}

/* Mantém o padrão das tabelas, mas garante visibilidade na aba de produtos */
.tabela-container {
  width: 100%;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}

#telaAdminProdutos .tabela-container {
  min-height: 300px;
  /* Garante que o espaço da tabela exista */
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
}

/* Ajuste das colunas especificamente para a aba de Produtos */
#telaAdminProdutos td:nth-child(2) {
  min-width: 250px;
}

/* Coluna Descrição */
#telaAdminProdutos td:nth-child(1) {
  min-width: 80px;
}

/* Coluna Referência */

#telaAdmin, #telaAdminProdutos, #telaAdminAuxiliares {
  max-width: 900px;
  margin: 0 auto;
}

#mainContainer.modo-tabela #telaAdmin {
  max-width: 100%;
}

#telaAdmin table th:nth-last-child(2), 
#telaAdmin table td:nth-last-child(2),
#telaAdminProdutos table th:nth-last-child(2), 
#telaAdminProdutos table td:nth-last-child(2),
#telaAdminAuxiliares table th:nth-last-child(2), 
#telaAdminAuxiliares table td:nth-last-child(2) {
  width: 90px;
  
}

#telaAdmin table th.col-acao-fixa,
#telaAdmin table td.col-acao-fixa,
#telaAdminProdutos table th.col-acao-fixa,
#telaAdminProdutos table td.col-acao-fixa,
#telaAdminAuxiliares table th.col-acao-fixa,
#telaAdminAuxiliares table td.col-acao-fixa {
  width: 110px;
  text-align: right;
  white-space: nowrap;
}

.col-acao-fixa {
  position: sticky;
  right: 0;
  background-color: #fff;
  text-align: right;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
}

th.col-acao-fixa {
  background-color: #f5f5f5;
  z-index: 3;
}

tbody tr:nth-child(even) td.col-acao-fixa {
  background-color: #f4f7f6;
}

tbody tr:hover td.col-acao-fixa {
  background-color: #e8f5e9;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

th,
td {
  padding: 6px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
}

th {
  background-color: #f5f5f5;
  color: #333;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

td {
  min-width: 90px;
}

/* Cabeçalho Fixo no Relatório (Tela) - SOLUÇÃO FINAL */
#telaRelatorio #areaPrint {
  overflow: visible !important;
}

/* Novo Menu Orbital Admin */
.scene {
  position: relative;
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 10px;
}

.share-toggle {
  display: none;
}

.share-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  color: #d84315;
}

.share-toggle:checked~.share-btn {
  background: #d84315;
  color: white;
  border-color: #bf360c;
  transform: scale(1.05);
}

.icon-close {
  display: none;
}

.share-toggle:checked~.share-btn .icon-share {
  display: none;
}

.share-toggle:checked~.share-btn .icon-close {
  display: block;
}

.orbit-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.social-node {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: white;
  border: 1px solid #ddd;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  color: #555;
}

.share-toggle:checked~.orbit-ring {
  pointer-events: all;
}

.share-toggle:checked~.orbit-ring .social-node {
  opacity: 1;
}

/* Posições para 5 itens no quadrante Superior Direito (Raio expandido para mais espaço) */
.n1 {
  --tx: -18px;
  --ty: -105px;
}

.n2 {
  --tx: 36px;
  --ty: -95px;
}

.n3 {
  --tx: 80px;
  --ty: -65px;
}

.n4 {
  --tx: 100px;
  --ty: -20px;
}

.n5 {
  --tx: 95px;
  --ty: 30px;
}

/* Direita */

.share-toggle:checked~.orbit-ring .social-node {
  transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1);
}

.social-node:hover {
  background: #d84315;
  color: white;
  transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.1) !important;
}

.social-node::after {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  left: 46px;
  /* Padrão: Direita */
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 800;
  color: #333;
  text-shadow: 0 0 4px white, 0 0 4px white;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Exceção: Usuários (n1) aparece na esquerda */
.n1::after {
  left: auto;
  right: 46px;
}

.social-node:hover::after {
  opacity: 1;
}

.Btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition-duration: .3s;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
  background-color: rgb(255, 65, 65);
}

/* plus sign */
.sign {
  width: 100%;
  transition-duration: .3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sign svg {
  width: 14px;
}

.sign svg path {
  fill: white;
}

/* text */
.text {
  position: absolute;
  right: 0%;
  width: 0%;
  opacity: 0;
  color: white;
  font-size: 0.9em;
  font-weight: 600;
  transition-duration: .3s;
}

/* hover effect on button width */
.Btn:hover {
  width: 100px;
  border-radius: 40px;
  transition-duration: .3s;
}

.Btn:hover .sign {
  width: 30%;
  transition-duration: .3s;
  padding-left: 12px;
}

/* hover effect button's text */
.Btn:hover .text {
  opacity: 1;
  width: 70%;
  transition-duration: .3s;
  padding-right: 5px;
}

/* button click effect*/
.Btn:active {
  transform: translate(2px, 2px);
}

.print-btn {
  width: 130px;
  /* Ajustado levemente para caber o texto 'Imprimir' */
  height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border: 1px solid rgb(213, 213, 213);
  border-radius: 10px;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  overflow: hidden;
  font-weight: 600;
  box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.065);
  transition: all 0.3s;
  color: #333;
  margin-bottom: 1px;
}

/* Novo botão de impressão nos cards (Estilo Premium V2) */
.btn-print-card-admin {
  width: 85px;
  min-height: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  /* Mais arredondado como na imagem */
  gap: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #1e293b;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  margin-top: 2px;
}

.btn-print-card-admin:hover {
  background-color: #ffffff;
  transform: translateY(-3px);
  border-color: #1976d2;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.btn-print-card-admin .printer-wrapper {
  width: 42px;
  height: 42px;
  transition: transform 0.3s;
}

.btn-print-card-admin:hover .printer-wrapper {
  transform: scale(1.1);
}

.btn-print-card-admin .text-print {
  font-size: 10px;
  font-weight: 700;
  color: #1976d2;
  text-transform: none;
  /* Mantendo natural como na imagem */
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.btn-print-card-admin .printer-page {
  border: 1px solid black;
}

.btn-print-card-admin:hover .printer-page {
  height: 16px;
  background-color: #f1f5f9;
}

.printer-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 100%;
}

.printer-container {
  height: 50%;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.printer-container svg {
  width: 100%;
  height: auto;
  transform: translateY(4px);
}

.printer-page-wrapper {
  width: 100%;
  height: 50%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.printer-page {
  width: 70%;
  height: 10px;
  border: 1px solid black;
  background-color: white;
  transform: translateY(0px);
  transition: all 0.3s;
  transform-origin: top;
}

.print-btn:hover .printer-page {
  height: 16px;
  background-color: rgb(239, 239, 239);
}

.print-btn:hover {
  background-color: rgb(239, 239, 239);
  transform: translateY(-2px);
}

#telaRelatorio .tabela-container {
  max-height: 80vh !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative;
  background: white;
  border: 1px solid #e0e0e0;
}

/* Fixar a primeira linha (Título e Info) */
#telaRelatorio thead tr:first-child td {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background: white !important;
  z-index: 100 !important;
  padding: 10px !important;
  border-bottom: 2px solid #333 !important;
}

/* Fixar a segunda linha (Nomes das Colunas) */
#telaRelatorio thead tr:nth-child(2) th {
  position: -webkit-sticky;
  position: sticky;
  top: 150px;
  /* Ajustado para a altura real do cabeçalho acima */
  background: #f5f5f5 !important;
  color: #333 !important;
  z-index: 90 !important;
  border-bottom: 2px solid #ccc !important;
  padding: 12px 10px !important;
}

/* Garantir que a tabela não quebre o sticky */
#telaRelatorio table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100%;
  table-layout: fixed;
  min-width: 1100px;
  /* Previne esmagamento grave em telas pequenas, gerando scroll lateral */
}

#telaRelatorio th,
#telaRelatorio td {
  word-wrap: break-word;
}

/* Ajuste fino para evitar que as bordas da tabela "vazarem" ao rolar */
#telaRelatorio thead th,
#telaRelatorio thead td {
  box-shadow: inset 0 -1px 0 #333;
  /* Mantém a borda visível ao rolar */
}

tbody tr:nth-child(even) {
  background-color: #f4f7f6;
}

/* Zebra striping original */
tbody tr:hover {
  background-color: #e8f5e9;
}

/* Hover verde claro original */

.tag-qtd {
  background-color: #e8f5e9;
  color: #2e7d32;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.loading-tabela {
  text-align: center;
  padding: 30px;
  color: #757575;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ==========================================
   ESTILIZAÇÃO DO RELATÓRIO (TELA)
   ========================================== */
.cabecalho-relatorio {
  background-color: transparent;
  padding: 10px 0;
  margin-bottom: 25px;
}

.cabecalho-relatorio h1 {
  margin: 0 0 15px 0;
  font-size: 22px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #333;
  padding-bottom: 12px;
  color: #333;
}

.info-header-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-top: 5px;
}

.info-header-grid p {
  margin: 0;
  font-size: 15px;
  color: #333;
}

.info-header-grid strong {
  color: #000;
}

/* Esconder assinaturas na tela, só mostrar na impressão */
.assinaturas-container {
  display: none;
}

/* Remover efeito de hover persistente na hora da impressão */
#areaPrint tbody tr:hover,
#areaPrintRomaneio tbody tr:hover {
  background-color: transparent !important;
}

#areaPrint tbody tr:nth-child(even):hover,
#areaPrintRomaneio tbody tr:nth-child(even):hover {
  background-color: #f4f7f6 !important;
}

/* ==========================================
   CSS PARA IMPRESSÃO (RELATÓRIO)
   ========================================== */
@media print {
  @page {
    size: A4 landscape;
    margin: 5mm;
  }

  body {
    background-color: white;
    padding: 0;
    margin: 0;
    overflow: visible !important;
  }

  .container {
    box-shadow: none;
    max-width: 100% !important;
    padding: 0;
    margin: 0;
  }

  /* Ocultar elementos UI */
  .user-header,
  .user-header-modern,
  .menu-abas,
  h2,
  #telaFormulario,
  #telaHistorico,
  #telaAdmin,
  #loginContainer,
  #formRelatorioPrint,
  #btnImprimirContainer {
    display: none !important;
  }

  /* Mostrar apenas a tela de relatório */
  #mainContainer {
    display: block !important;
    overflow: visible !important;
  }

  #telaRelatorio {
    display: block !important;
    overflow: visible !important;
  }

  #telaRelatorio #areaPrint,
  #telaRelatorio #areaPrintRomaneio {
    display: none !important;
  }

  body.printing-report #telaRelatorio #areaPrint {
    display: block !important;
    overflow: visible !important;
  }

  body.printing-romaneio #telaRelatorio #areaPrintRomaneio {
    display: block !important;
    overflow: visible !important;
  }

  /* Resetar a tabela para impressão */
  #telaRelatorio .tabela-container {
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
    position: static !important;
  }

  table {
    width: 100%;
    min-width: auto !important;
    border-collapse: collapse !important;
    margin-top: 20px;
    font-size: 11px;
    table-layout: fixed !important;
  }

  th,
  td {
    border: 1px solid #000 !important;
    padding: 4px 6px;
    color: #000;
    word-wrap: break-word;
  }

  tr.cabecalho-print-row td,
  tfoot td {
    border: none !important;
  }

  /* Remover bordas pretas nos blocos de agrupamento que herdaram do table td */
  th {
    background-color: #f0f0f0 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    font-size: 10px;
  }

  /* Assinaturas */
  .assinaturas-container {
    margin-top: 50px;
    display: flex;
    justify-content: space-around;
    page-break-inside: avoid;
  }

  .linha-assinatura {
    border-top: 1px solid #000;
    width: 250px;
    text-align: center;
    padding-top: 5px;
    font-size: 12px;
  }

  /* Cabeçalho do relatório (Impressão) */
  .cabecalho-relatorio {
    border: none !important;
    padding: 10px 0;
    margin-bottom: 20px;
    border-radius: 0;
    box-shadow: none;
    background-color: white !important;
  }

  .cabecalho-relatorio h1 {
    font-size: 20px;
    border-bottom: 2px solid #000;
    color: #000;
    padding-bottom: 12px;
    margin-bottom: 15px;
  }

  .info-header-grid p {
    color: #000;
    font-size: 14px;
  }

  /* Resetar estilos sticky para impressão */
  #telaRelatorio thead tr:first-child td,
  #telaRelatorio thead tr:nth-child(2) th {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    background: white !important;
    box-shadow: none !important;
  }

  /* Repetir cabeçalho e rodapé da tabela em cada página */
  thead {
    display: table-header-group !important;
  }

  tfoot {
    display: table-footer-group !important;
  }

  tbody tr {
    page-break-inside: avoid !important;
    page-break-after: auto !important;
  }

  /* Rodapé / Numeração de Página na Impressão */
  .print-page-number {
    position: fixed;
    bottom: 5px;
    right: 0;
    text-align: right;
    font-size: 10px;
    color: #666;
  }

  .print-page-number::after {
    counter-increment: page;
    content: "Página " counter(page);
  }
}

/* ==========================================
   MODAL GLOBAL ESTILIZADO (CENTRALIZAÇÃO GARANTIDA)
   ========================================== */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0, 0, 0, 0.6) !important;
  display: none;
  /* JS muda para flex */
  justify-content: center !important;
  align-items: center !important;
  z-index: 999999 !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  margin: 0 !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}

.modal-container {
  background: #ffffff !important;
  width: 100% !important;
  max-width: 450px !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  animation: modalAnimIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  position: relative !important;
}

@keyframes modalAnimIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 15px 20px !important;
  background-color: #f8f9fa !important;
  border-bottom: 1px solid #eee !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.modal-close {
  font-size: 24px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.modal-body {
  padding: 25px 20px;
  text-align: center;
}

.modal-body p {
  margin: 0;
  font-size: 16px;
  color: #555;
  line-height: 1.5;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: center;
}

.modal-footer button {
  padding: 10px 25px;
  font-size: 14px;
  width: auto;
  margin-top: 0;
}

/* Tipos de Modal (Cores dos Ícones) */
.modal-type-error {
  color: #d32f2f;
}

.modal-type-success {
  color: #2e7d32;
}

.modal-type-warning {
  color: #f57c00;
}

.modal-type-info {
  color: #1976d2;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes stretchDown {
  from {
    transform: scaleY(0.4);
    transform-origin: top;
    opacity: 0;
  }

  to {
    transform: scaleY(1);
    transform-origin: top;
    opacity: 1;
  }
}

.anim-slide-down {
  animation: slideDown 0.4s ease-out forwards;
}

.anim-stretch-down {
  animation: stretchDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ==========================================
   LOADING ANIMATION (UIVERSE - TABLE SIZE)
   ========================================== */
.loading-card-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 0;
  width: 100%;
}

.card-loader {
  width: 100%;
  background: #ffff;
  box-shadow: 0 1px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-loader-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  border-bottom: 1px solid #f9f9f9;
}

.card-loader-row:last-child {
  border-bottom: none;
}

.card_load {
  width: 30px;
  height: 30px;
  background: linear-gradient(120deg, #e5e5e5 30%, #f0f0f0 38%, #f0f0f0 40%, #e5e5e5 48%);
  border-radius: 50%;
  background-size: 200% 100%;
  animation: load89234 2s infinite;
  flex-shrink: 0;
}

.card_load_extreme_title {
  height: 20px;
  border-radius: 5px;
  background: linear-gradient(120deg, #e5e5e5 30%, #f0f0f0 38%, #f0f0f0 40%, #e5e5e5 48%);
  background-size: 200% 100%;
  animation: load89234 2s infinite;
  flex: 1;
}

.card_load_extreme_descripion {
  height: 20px;
  border-radius: 5px;
  background: linear-gradient(120deg, #e5e5e5 30%, #f0f0f0 38%, #f0f0f0 40%, #e5e5e5 48%);
  background-size: 200% 100%;
  animation: load89234 2s infinite;
  flex: 2;
}

@keyframes load89234 {
  100% {
    background-position: -100% 0;
  }
}

/* ==========================================
   CARDS DO CONFERENTE
   ========================================== */
.card-conferente {
  background: #ffffff;
  border-left: 4px solid #2e7d32 !important;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.05) !important;
  transition: transform 0.2s;
}

.card-conferente:hover {
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  body {
    background-color: #ffffff !important;
    /* Fundo branco no mobile para sumir com o cinza */
    padding: 0 !important;
  }

  #mainContainer {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 10px !important;
  }

  .card-conferente {
    border-radius: 0 !important;
    margin-left: -10px !important;
    margin-right: -10px !important;
    border-left: 0 !important;
    border-bottom: 2px solid #eee !important;
  }

  .card-conferente>div:not(:first-child) {
    grid-template-columns: 1fr !important;
  }

  .card-conferente .form-group[style*="grid-column: span 2"] {
    grid-column: span 1 !important;
  }
}

/* === CARD CONFERENTE COMPLETO === */
.card-conferente.card-completo {
  background: #f0fdf4 !important;
  border-left-color: #16a34a !important;
  opacity: 0.88;
}

.card-conferente.card-completo input {
  background-color: #f0fdf4 !important;
  color: #166534;
}

.badge-card-completo {
  position: absolute;
  top: 14px;
  right: 40px;
  background: #16a34a;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.3px;
  pointer-events: none;
  animation: badgeFadeIn 0.3s ease;
}

/* Ajuste específico para Romaneio (Revenda) - Lado direito (sem X) */
.card-romaneio .badge-card-completo {
  right: 12px;
  top: 14px;
}

/* Filtros por Balõezinhos (Chips) */
.filter-chips-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  padding: 5px 2px;
  /* Adiciona respiro para o efeito de escala não cortar */
}

.filter-chip {
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  border: 1px solid transparent;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.filter-chip.active {
  transform: scale(1.05);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter-chip-all {
  background: #ffffff;
  color: #333;
  border-color: #ddd;
}

.filter-chip-all.active {
  background: #f5f5f5;
  border-color: #999;
}

.filter-chip-aguardando {
  background: #e3f2fd;
  color: #1976d2;
  border-color: #bbdefb;
}

.filter-chip-aguardando.active {
  background: #1976d2;
  color: #fff;
  border-color: #1565c0;
}

.filter-chip-pendente {
  background: #fff8e1;
  /* Ajustado para Amarelo/Laranja para diferenciar de Falta/Avaria */
  color: #f57c00;
  border-color: #ffecb3;
}

.filter-chip-pendente.active {
  background: #f57c00;
  color: #fff;
  border-color: #e65100;
}

.filter-chip-finalizado {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #c8e6c9;
}

.filter-chip-finalizado.active {
  background: #2e7d32;
  color: #fff;
  border-color: #1b5e20;
}

/* === NOVO LOADER ANIMADO === */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  --color: hsl(0, 0%, 87%);
  --animation: 2s ease-in-out infinite;
}

.loader .circle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 20px;
  height: 20px;
  border: solid 2px var(--color);
  border-radius: 50%;
  margin: 0 10px;
  background-color: transparent;
  animation: circle-keys var(--animation);
}

.loader .circle .dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--color);
  animation: dot-keys var(--animation);
}

.loader .circle .outline {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  animation: outline-keys var(--animation);
}

.circle:nth-child(2) {
  animation-delay: 0.3s;
}

.circle:nth-child(3) {
  animation-delay: 0.6s;
}

.circle:nth-child(4) {
  animation-delay: 0.9s;
}

.circle:nth-child(5) {
  animation-delay: 1.2s;
}

.circle:nth-child(2) .dot {
  animation-delay: 0.3s;
}

.circle:nth-child(3) .dot {
  animation-delay: 0.6s;
}

.circle:nth-child(4) .dot {
  animation-delay: 0.9s;
}

.circle:nth-child(5) .dot {
  animation-delay: 1.2s;
}

.circle:nth-child(1) .outline {
  animation-delay: 0.9s;
}

.circle:nth-child(2) .outline {
  animation-delay: 1.2s;
}

.circle:nth-child(3) .outline {
  animation-delay: 1.5s;
}

.circle:nth-child(4) .outline {
  animation-delay: 1.8s;
}

.circle:nth-child(5) .outline {
  animation-delay: 2.1s;
}

@keyframes circle-keys {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes dot-keys {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes outline-keys {
  0% {
    transform: scale(0);
    outline: solid 20px var(--color);
    outline-offset: 0;
    opacity: 1;
  }

  100% {
    transform: scale(1);
    outline: solid 0 transparent;
    outline-offset: 20px;
    opacity: 0;
  }
}

/* Seletor Customizado (Select com Ícones) */
.custom-select-wrapper {
  position: relative;
  user-select: none;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 700;
  color: #333;
  background: #ffffff;
  border: 2px solid #d84315;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.custom-select-trigger span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-select-trigger:active {
  transform: scale(0.98);
}

.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #d84315;
  border-radius: 8px;
  margin-top: 5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  display: none;
  z-index: 99999;
  /* Valor extremo para sobrepor tudo */
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

/* Garante que o container pai não corte o select */
.custom-select-wrapper {
  position: relative;
  user-select: none;
  z-index: 10000;
}

/* Força o formulário a permitir a exibição de elementos flutuantes */
#formRomaneio {
  overflow: visible !important;
}

.custom-select-wrapper.open .custom-select-options {
  display: block;
}

.custom-select-wrapper.open .custom-select-trigger i.ph-caret-down {
  transform: rotate(180deg);
}

.custom-option {
  padding: 12px 15px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.custom-option:last-child {
  border-bottom: none;
}

.custom-option:hover {
  background: #fff3e0;
}

.custom-option.active {
  background: #fff3e0;
  color: #d84315;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes badgeFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Switch Toggle Style */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked+.slider {
  background-color: #d84315;
}

input:focus+.slider {
  box-shadow: 0 0 1px #d84315;
}

input:checked+.slider:before {
  -webkit-transform: translateX(20px);
  -ms-transform: translateX(20px);
  transform: translateX(20px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ==========================================
   ESTILO DE IMPRESSÃO ROMANEIO (RESTAURADO V12 + MELHORIAS)
   ========================================== */
body.printing-romaneio {
  background: white !important;
  padding: 0 !important;
  margin: 0 !important;
  counter-reset: page 0;
  /* RESETA O CONTADOR GLOBAL */
}

/* Esconde todas as outras telas na tela real enquanto imprime */
body.printing-romaneio #telaFormulario,
body.printing-romaneio #telaHistorico,
body.printing-romaneio #telaAdmin,
body.printing-romaneio #loginContainer,
body.printing-romaneio #formRelatorioPrint,
body.printing-romaneio #areaPrint,
body.printing-romaneio .menu-abas,
body.printing-romaneio .user-header-modern {
  display: none !important;
}

body.printing-romaneio #mainContainer,
body.printing-romaneio #telaRelatorio,
body.printing-romaneio #areaPrintRomaneio {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.romaneio-page {
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

.tabela-impressao-romaneio {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
  background: white !important;
  margin-top: 10px;
}

.tabela-impressao-romaneio thead {
  display: table-header-group !important;
}

.tabela-impressao-romaneio tfoot {
  display: table-footer-group !important;
}

.cabecalho-impressao-container {
  background: white !important;
  padding-bottom: 10px;
}

.titulos-colunas-impressao th {
  background: #f0f0f0 !important;
  border: 1px solid #000 !important;
  padding: 6px 4px !important;
  font-size: 11px !important;
  text-align: center !important;
  text-transform: uppercase;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.tabela-impressao-romaneio tbody td {
  border: 1px solid #000 !important;
  padding: 4px 4px !important;
  font-size: 13px !important;
  word-break: normal !important;
}

/* DESTAQUE DO PRODUTO (PEDIDO DO USUÁRIO) */
.tabela-impressao-romaneio tbody td:first-child {
  font-weight: bold !important;
  font-size: 14px !important;
}

.pagina-footer-contador {
  text-align: right;
  font-size: 11px;
  font-family: sans-serif;
  color: #000;
  padding-top: 10px;
}

.tabela-impressao-romaneio tr {
  page-break-inside: avoid !important;
}

/* =======================================
   SEÇÃO: BANCO CEGA — CHIPS DE FILTRO
   ======================================= */
.chip-filtro-cega {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #90caf9;
  background: #fff;
  color: #1565c0;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}
.chip-filtro-cega:hover {
  background: #e3f2fd;
  transform: scale(1.04);
}
.chip-filtro-cega.chip-ativo {
  background: #1976d2;
  color: #fff;
  border-color: #1565c0;
  box-shadow: 0 2px 6px rgba(25,118,210,0.3);
}

/* Badges de status inline */
.badge-pendente {
  background: #fff8e1;
  color: #f57f17;
  border: 1px solid #ffe082;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-finalizado {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.nota-cega-preview {
  font-weight: bold;
  color: #1565c0;
  font-size: 12px;
}

/* Linhas Expansíveis (Accordion) */
.linha-detalhe-lote {
  display: none;
  background: #fdfdfd;
}
.linha-detalhe-lote.aberta {
  display: table-row;
  animation: slideDown 0.2s ease-out;
}
.container-sub-tabela {
  padding: 10px 15px 15px 50px;
}
.sub-tabela-lotes {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
}
.sub-tabela-lotes th {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  padding: 8px;
  text-align: left;
}
.sub-tabela-lotes td {
  padding: 8px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.btn-expandir {
  display: inline-block; /* Essencial para o transform funcionar */
  cursor: pointer;
  color: #1976d2;
  font-size: 16px;
  transition: transform 0.2s ease;
  vertical-align: middle;
  margin-right: 10px;
  width: 20px;
  text-align: center;
}
.btn-expandir.rodado {
  transform: rotate(90deg);
}
.container-sub-tabela {
  padding: 15px 25px 20px 50px;
  background: #f9fafb;
  border-bottom: 1px solid #edf2f7;
}
.sub-tabela-lotes {
  width: 100%;
  max-width: 600px;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Container para input com botão de colar flutuante */
.input-colar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-colar-input {
  position: absolute;
  right: 5px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1976d2;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 5;
}

.input-colar-wrapper:hover .btn-colar-input {
  opacity: 1;
  visibility: visible;
}

.btn-colar-input:hover {
  background: #f1f5f9;
  transform: scale(1.1);
}

/* Tooltip Customizado Moderno */
[data-tooltip] {
  position: relative;
  cursor: help;
  display: inline-block;
}

/* Elevação da linha para o tooltip flutuar livremente */
tbody tr:hover {
  position: relative;
  z-index: 10000;
}

tbody tr:hover td {
  overflow: visible !important;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  left: 100%; /* Posicionado à direita para evitar corte superior */
  transform: translateY(-50%);
  margin-left: 12px;
  padding: 8px 12px;
  background: rgba(33, 37, 41, 0.98);
  color: #fff;
  font-size: 11px;
  border-radius: 6px;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 1000000;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

[data-tooltip]:hover::after {
  visibility: visible;
  opacity: 1;
  transform: translateY(-50%) translateX(5px);
}

/* Seta lateral esquerda */
[data-tooltip]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  margin-left: 6px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent rgba(33, 37, 41, 0.98) transparent transparent;
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 1000000;
  pointer-events: none;
}

[data-tooltip]:hover::before {
  visibility: visible;
  opacity: 1;
  transform: translateY(-50%) translateX(5px);
}

/* Dica de Cópia Leve */
.copy-hint {
  position: relative;
  cursor: copy !important;
}
.copy-hint::after {
  content: attr(data-hint);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  pointer-events: none;
  z-index: 10000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s ease;
}
.copy-hint:hover::after {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.copy-hint.copied::after {
  content: 'Copiado! ✓' !important;
  background: #22c55e !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}

/* Tooltip Justificativa Adm */
.has-justificativa {
    text-decoration: underline dotted #d32f2f;
    cursor: help;
    position: relative;
    font-weight: bold;
    color: #d32f2f;
}

.has-justificativa:hover::after {
    content: attr(data-justificativa);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.has-justificativa:hover::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
    z-index: 1000;
}