:root {
  --border-color: #e0e0e0;
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --success-color: #27ae60;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --text-color: #333;
  --light-gray: #f5f5f5;
  --header-bg: #f8f9fa;
}

/* Alert Banner */
.alert-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #fff3cd;
  color: #856404;
  padding: 12px 0;
  border-bottom: 1px solid #ffeeba;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.alert-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
}

.alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: #ffc107;
  color: white;
  border-radius: 50%;
  font-weight: bold;
  margin-right: 12px;
  flex-shrink: 0;
}

.alert-text {
  flex-grow: 1;
  font-size: 0.95rem;
}

.alert-text strong {
  color: #d39e00;
}

.alert-close {
  background: none;
  border: none;
  color: #856404;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding-top: 60px;
  background-color: #f9f9f9;
  color: var(--text-color);
}

.container {
  max-width: 90%;
  padding: 20px;
  margin: 20px auto;
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
}

.req-number {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--secondary-color);
  margin-left: 10px;
}

.header-fields {
  display: flex;
  gap: 15px;
}

.form-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  flex: 1;
}

.form-group.compact {
  flex: 0 1 auto;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.95rem;
  background-color: white;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

/* Tabela de Itens */
#materialTable {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

#materialTable th {
  background-color: var(--header-bg);
  padding: 12px 15px;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
}

#materialTable td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

#materialTable tr:hover td {
  background-color: rgba(0,0,0,0.02);
}

#materialTable input, #materialTable select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  background-color: var(--light-gray);
}

.btn {
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn.outline {
  border: 1px solid var(--secondary-color);
  color: var(--secondary-color);
  background: transparent;
}

.btn.outline:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

.btn.primary {
  background-color: var(--secondary-color);
  color: white;
  border: 1px solid var(--secondary-color);
}

.btn.primary:hover {
  background-color: #2980b9;
}

.btn.success {
  background-color: var(--success-color);
  color: white;
  border: 1px solid var(--success-color);
}

.btn.danger {
  background-color: var(--danger-color);
  color: white;
  border: 1px solid var(--danger-color);
}

.action-buttons {
  display: flex;
  gap: 12px;
  padding: 20px;
}

.file-upload-container {
  margin-bottom: 15px;
}

#fileUpload {
  display: none;
}

#fileList {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px dashed var(--border-color);
  border-radius: 4px;
}

#fileList li {
  padding: 10px 15px;
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  justify-content: space-between;
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
}
/* Estilos específicos para os campos do formulário de solicitação */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: flex-end;
}

.form-group {
  flex: 1;
  min-width: 0; /* Permite que os campos se ajustem corretamente */
}

/* Estilo para os labels */
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
}

/* Estilo base para inputs e selects */
.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95rem;
  background-color: #fff;
  transition: all 0.2s ease;
}

/* Estilo específico para o campo do solicitante */
#requester {
  width: 320px; /* Largura mínima para o campo do nome */
}

/* Estilo específico para o campo do departamento */
#department {
  width: 320px;
}

/* Estilo específico para o dropdown de prioridade */
#priority {
  min-width: 160px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333333'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}

/* Estados de foco */
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Responsividade */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .form-group {
    width: 100%;
  }
  
  #requester,
  #department,
  #priority {
    min-width: 100%;
  }
}
/* Estilos para os botões principais */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: white;
  color: #333;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 8px;
}

.btn:hover {
  background-color: #f5f5f5;
}

/* Botão Salvar Rascunho */
#saveDraftBtn {
  border-color: #b0b0b0;
}

#saveDraftBtn::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23333'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* Botão Enviar para Aprovação */
.btn.primary {
  background-color: #2c3e50;
  border-color: #2c3e50;
  color: white;
}

.btn.primary:hover {
  background-color: #1a252f;
  border-color: #1a252f;
}

.btn.primary::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 19l9 2-9-18-9 18 9-2zm0 0v-8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* Efeito de clique */
.btn:active {
  transform: scale(0.98);
}
/* Cabeçalho Institucional */
.company-header {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.company-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  padding: 8px 12px;
  border-right: 2px solid #e0e0e0;
  min-width: 120px;
}

.company-info {
  flex: 1;
}

.company-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 4px;
}

.company-address {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.4;
}

/* Ajuste para o container principal */
.container {
  border-top: none; /* Remove borda duplicada */
}
/* Versão Minimalista */
.company-header {
  background-color: #f8f9fa;
  padding: 12px 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.company-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 2px;
}

.company-address {
  font-size: 0.75rem;
  color: #666;
}
/* Cabeçalho Institucional Alinhado */
.company-header {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 15px 20px 15px 40px; /* 40px left para alinhar com o container */
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: -20px; /* Compensa o padding do container */
  margin-right: -20px;
  margin-top: -20px; /* Alinha ao topo do container */
}

.company-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  padding: 8px 12px;
  border-right: 2px solid #e0e0e0;
  min-width: 120px;
}

.company-info {
  flex: 1;
}

.company-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 4px;
}

.company-address {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.4;
}

/* Garante que o container não tenha espaçamento extra */
.container {
  padding-top: 0;
  border-top: none;
}
/* Estilos do Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: black;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  color: #888;
  cursor: pointer;
}

.close-btn:hover {
  color: #000;
}
.btn-voltar {
  position: absolute;
  top: 20px;
  left: 20px;
  background-color: transparent;
  border: 1px solid #ccc;
  color: #333;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  z-index: 1000;
}

.btn-voltar:hover {
  background-color: #f2f2f2;
}
.back-icon {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%231a73e8"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>') no-repeat center;
  background-size: contain;
}

.back-icon:hover {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%230d5bbc"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>');
}
/* Estilo do seletor de obras */
.obra-selection {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.obra-selection label {
  font-weight: bold;
  color: #333;
  font-size: 15px;
}

.obra-selection select {
  padding: 10px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  width: 100%;
  max-width: 400px;
  cursor: pointer;
}

/* Cabeçalho com informações da obra */
.obra-info {
  margin-top: 15px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f9f9f9;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.obra-info h2 {
  font-size: 18px;
  color: #007bff;
  margin-bottom: 8px;
}

.obra-info p {
  margin: 4px 0;
  font-size: 14px;
  color: #444;
}

.obra-info strong {
  color: #222;
}
/* Container geral da obra */
.obra-info {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  margin-top: 15px;
  padding: 28px;
  width: 60%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f9f9f9;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Logo da construtora */
.obra-info .obra-logo {
  width: 120px;
  margin-top: 18px;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: white;
  padding: 8px;
  border: 1px solid #ddd;
}

/* Detalhes da obra */
.obra-info .obra-details {
  flex: 1;
}

.obra-info h2 {
  font-size: 18px;
  color: #007bff;
  margin-bottom: 8px;
}

.obra-info p {
  margin: 4px 0;
  font-size: 14px;
  color: #444;
}

.obra-info strong {
  color: #222;
}
/* Modal de produtos */
#produtoModal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000;
}

#produtoModal.hidden { display: none; }

#produtoModal .modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  max-height: 80%;
  overflow-y: auto;
}

#produtoModal h2 {
  margin-bottom: 15px;
  font-size: 20px;
  text-align: center;
}

.produto-search {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.produto-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

.produto-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.produto-card:hover {
  background: #f0f8ff;
  border-color: #007bff;
}

.produto-card img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}
/* Lista de produtos em linha única */
#produtoList {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px; /* rolagem se muitos itens */
  overflow-y: auto;
  padding-right: 5px;
}

.produto-linha {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  transition: background 0.2s ease;
}

.produto-linha:hover {
  background: #f8f8f8;
}

.produto-linha-img {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #ddd;
}

.produto-linha-info {
  display: flex;
  flex-direction: column;
}

.produto-linha-nome {
  font-weight: 600;
  font-size: 15px;
  color: #333;
}

.produto-linha-codigo {
  font-size: 12px;
  color: #777;
  margin-top: 2px;
}
.ui-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
/* Layout da linha de produto na modal */
.produto-linha {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.produto-linha:hover { background-color: #f8fafc; }

.prod-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.prod-info {
    display: flex;
    flex-direction: column;
}

.prod-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.prod-code {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}
/* Botões de paginação na modal */
.btn-pag {
    background-color: white;
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-pag:hover:not(:disabled) {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

/* Ajuste na linha para ficar mais limpa */
.produto-linha:hover {
    background-color: #f1f7ff;
}