/* Reset e Base */
:root {
  --primary: #1a73e8;
  --primary-light: #e8f0fe;
  --border: #e0e0e0;
  --header-bg: #f1f3f4;
  --row-hover: #f5f5f5;
  --text: #202124;
  --text-light: #5f6368;
  --bg: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

body {
  background-color: #f9f9f9;
  color: var(--text);
}

/* Container Principal */
.container {
  max-width: 98%;
  margin: 10px auto;
  padding: 8px;
}

/* Cabeçalho */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-title h1 {
  font-size: 26px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  border-radius: 2px;
}

.btn-back:hover {
  background: #f1f1f1;
}

/* Botões */
.btn {
  padding: 5px 12px;
  border-radius: 2px;
  border: 1px solid #d9d9d9;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s;
  background-color: white;
  color: var(--text);
  height: 28px;
}

.btn-add {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-add:hover {
  background-color: #1765cc;
}

.btn-export {
  background-color: white;
  color: var(--text);
}

.btn-export:hover {
  background-color: #f1f1f1;
}

.btn-filter {
  background-color: white;
}

.btn-filter:hover {
  background-color: #f1f1f1;
}

.btn-secondary {
  background-color: white;
  color: var(--text);
}

.btn-secondary:hover {
  background-color: #f1f1f1;
}

.btn-action {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 2px;
  color: var(--text-light);
}

.btn-action:hover {
  background-color: #f1f1f1;
  color: var(--primary);
}

.btn-remove-image {
  width: 100%;
  background-color: white;
  border: 1px solid var(--border);
  padding: 4px;
  font-size: 12px;
}

/* Filtros */
.filters {
  background-color: var(--bg);
  border: 1px solid var(--border);
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 2px;
  padding: 4px 8px;
  border: 1px solid #cfe2ff; /* Azul sutil */
  height: 28px;
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 2px 4px;
  outline: none;
}

.filter-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.filter-group select {
  padding: 4px 8px;
  border-radius: 2px;
  border: 1px solid #4990f9; /* Azul sutil */
  background-color: white;
  height: 28px;
  min-width: 120px;
}

/* Tabela - Estilo Excel Otimizado */
.table-container {
  background-color: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 12px;
  overflow-x: auto;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.inventory-table th {
  background-color: var(--header-bg);
  color: var(--text);
  font-weight: 500;
  text-align: left;
  padding: 6px 8px;
  border: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.inventory-table td {
  padding: 4px 8px;
  border: 1px solid var(--border);
  vertical-align: middle;
  height: 28px;
}

.inventory-table tr:hover {
  background-color: var(--row-hover);
}

/* Colunas Específicas Otimizadas */
.img-col {
  width: 50px;
  padding: 4px !important;
  text-align: center;
}

.code-col {
  width: 60px; /* Otimizado para 5 dígitos */
  text-align: center;
  padding: 4px 2px !important;
  font-family: 'Courier New', monospace;
}

.unit-col {
  width: 40px; /* Otimizado para 2 caracteres */
  text-align: center;
  padding: 4px 1px !important;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
}

.action-col {
  width: 90px;
}

.numeric-col {
  text-align: right;
  padding-right: 8px !important;
  font-family: 'Courier New', monospace;
}

/* Imagem do Produto */
.product-img {
  max-width: 100%;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  border: 1px solid #e0e0e0;
  background-color: #f9f9f9;
  display: block;
  margin: 0 auto;
}

.product-img:hover {
  transform: scale(1.8);
  z-index: 10;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
  background-color: white;
}

.product-img[src*="placeholder.com"] {
  opacity: 0.6;
  filter: grayscale(80%);
}

/* Paginação */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.btn-pagination {
  background: white;
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-pagination:hover {
  background-color: #f1f1f1;
}

.page-number {
  font-weight: 400;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg);
  padding: 16px;
  border-radius: 2px;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modal-content h2 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.modal-content label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-light);
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Upload de Imagem */
.image-upload-container {
  margin-bottom: 12px;
}

.image-preview {
  width: 100%;
  height: 120px;
  border: 1px dashed var(--border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 8px;
  background-color: #fafafa;
}

.image-preview .placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-light);
  font-size: 12px;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Ícones */
[data-lucide] {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* Efeito de célula selecionada */
.inventory-table td:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* Responsividade */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .filter-group {
    flex-direction: column;
    width: 100%;
  }
  
  .filter-group select {
    width: 100%;
  }
  
  .modal-content {
    margin: 0 16px;
  }
  
  .inventory-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Ajustes para mobile */
  .code-col, .unit-col {
    width: auto;
    min-width: 40px;
  }
}
/* Adicione ao seu arquivo CSS existente */

/* Estilo para os spinners */
.btn-export .spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Estado de carregamento */
.btn-export.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-export.loading .spinner {
  display: inline-block;
}

.btn-export.loading i {
  display: none;
}
.filtros-container {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 0 20px;
  align-items: center;
}

.filtros-container input,
.filtros-container select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}
/* Estilos Base */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f9fafb;
  color: #1f2937;
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 24px;
}

/* Cabeçalho */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

/* Botão Voltar */
.btn-voltar {
  padding: 8px 16px;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-voltar:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

/* Container de Usuários */
.usuarios-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Cards de Usuário */
.usuario-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e5e7eb;
  transition: box-shadow 0.2s ease;
}

.usuario-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Informações do Usuário */
.usuario-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.usuario-info span {
  font-size: 14px;
  color: #4b5563;
}

/* Tags de Status */
.tag-ativo {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: white;
}

.tag-ativo.true {
  background-color: #10b981;
}

.tag-ativo.false {
  background-color: #ef4444;
}

/* Funções */
.funcoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.funcoes button {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  background-color: #f9fafb;
  transition: all 0.2s ease;
}

.funcoes button:hover {
  background-color: #f3f4f6;
}

.funcoes button.ativa {
  background-color: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Responsivo */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .btn-voltar {
    align-self: flex-end;
  }
}
.btn-novo {
  position: relative;
}

.btn-novo::after {
  content: "Novo";
  position: absolute;
  top: -28px;
  right: -12px;
  background-color: #3b82f6; /* Azul vibrante */
  border-color: white;
  border: 2px solid #3b82f6;
  color: white;
  font-size: 16px;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 50px;
  animation: bounceBadge 1.8s infinite;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

@keyframes bounceBadge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
.estoque-baixo {
  color: #ff0000;
  font-weight: bold;
  background-color: #ffeeee !important; /* Fundo vermelho claro */
}
.spinner-loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #ccc;
  border-top: 2px solid #4CAF50;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 4px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
#editestoqueminimo {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
/* Estilo para a coluna de unidade */
.th-und, .td-und {
  width: 50px; /* ou o tamanho que desejar */
  max-width: 50px;
  min-width: 50px;
  text-align: center;
}
/* Aumenta a largura da coluna de imagem */
.th-img, .td-img {
  width: 100px; /* ou o tamanho que desejar */
  min-width: 100px;
  max-width: 150px;
}

/* Aumenta o tamanho das imagens */
.product-img {
  width: 120px;  /* tamanho da imagem */
  height: 64px; /* mantém proporção quadrada */
  object-fit: fit; /* garante que a imagem preencha o espaço */
  border-radius: 4px; /* opcional - bordas arredondadas */
}
.container, .content, main, .page, .wrap {
  max-width: 100vw !important;
  overflow-x: visible !important;
}
.valor-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.btn-icon {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon i {
  width: 14px;
  height: 14px;
}
/* Spinners para botões de exportação */
.btn-export {
    position: relative;
}

.btn-export .spinner {
    display: none;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos para tabela PDF */
.estoque-baixo {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
}

/* Botões desabilitados */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
/* Container Principal da Barra de Filtros */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background-color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

/* Grupo de Busca (Ícone + Input) */
.search-group {
    position: relative;
    flex-grow: 1; /* Ocupa o espaço restante */
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}

#searchInput {
    width: 100%;
    padding: 10px 10px 10px 38px; /* Espaço para o ícone */
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #334155;
    transition: all 0.2s;
    height: 42px; /* Altura padronizada */
}

#searchInput:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Estilo dos Selects (Obra e Ordenação) */
.form-select {
    padding: 10px 35px 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    color: #334155;
    height: 42px; /* Mesma altura do input */
    cursor: pointer;
    min-width: 180px;
    
    /* Remove seta padrão feia e adiciona customizada (opcional) */
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.form-select:focus {
    border-color: #3b82f6;
    outline: none;
}

/* Grupo de Botões */
.actions-group {
    display: flex;
    gap: 8px;
}

/* Botões Gerais */
button {
    height: 42px;
    padding: 0 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s, opacity 0.2s;
}

button:active {
    transform: scale(0.98);
}

/* Cores Específicas dos Botões */
.btn-filter {
    background-color: #3b82f6; /* Azul */
    color: white;
}
.btn-filter:hover { background-color: #2563eb; }

.btn-export.pdf {
    background-color: #ef4444; /* Vermelho */
    color: white;
}
.btn-export.pdf:hover { background-color: #dc2626; }

.btn-export.excel {
    background-color: #10b981; /* Verde */
    color: white;
}
.btn-export.excel:hover { background-color: #059669; }

/* Responsividade para Mobile */
@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-group, .form-select, .actions-group {
        width: 100%;
        min-width: 100%;
    }
    
    .actions-group {
        margin-top: 10px;
        justify-content: space-between;
    }
    
    button {
        flex: 1;
        justify-content: center;
    }
}

/* Botão de editar preço (lápis) */
.btn-edit-price {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    margin-left: 8px;
    padding: 4px;
    transition: color 0.2s;
}

.btn-edit-price:hover {
    color: #3b82f6; /* Azul ao passar o mouse */
}

/* Ajustes da Modal Pequena */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}

.modal-content.small-modal {
    background: white; padding: 20px; border-radius: 8px;
    width: 300px; /* Bem compacta */
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.close-modal { cursor: pointer; font-size: 20px; font-weight: bold; }
.btn-save { background: #16a34a; color: white; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; }
.btn-cancel { background: #e2e8f0; color: #475569; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; margin-right: 5px; }

/* Ajuste do Rodapé da Modal para alinhar botões */
.modal-footer {
    display: flex;           /* Habilita o modo flexível */
    justify-content: flex-end; /* Alinha tudo à direita (opcional, pode usar space-between se preferir) */
    align-items: center;     /* Centraliza verticalmente */
    gap: 10px;               /* Cria o espaço entre os botões */
    margin-top: 20px;        /* Afasta um pouco do campo de input */
}

/* Garante que os botões não ocupem 100% da largura */
.btn-save, .btn-cancel {
    width: auto;             /* Deixa o botão do tamanho do texto */
    min-width: 100px;        /* Tamanho mínimo para ficarem bonitos */
}