/* ===== RESET E ESTILOS BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* ===== LAYOUT PRINCIPAL ===== */
.container {
  width: calc(100% - 40px);
  max-width: 1400px;
  margin: 20px auto;
  padding: 0;
}



/* ===== ACORDEÃO DE OBRAS ===== */
#acordeon-container {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.acordeon-title {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.acordeon-title:hover {
  background-color: #f5f7fa;
  border-color: #d0d0d0;
}

.title-text {
  font-size: 16px;
  font-weight: 500;
  color: #2c3e50;
  flex-grow: 1;
}

.material-icons {
  font-size: 20px;
  transition: all 0.3s ease;
}

.expand-icon {
  color: #7f8c8d;
  cursor: pointer;
  margin-left: 15px;
}

.delete-icon {
  color: #e74c3c;
  cursor: pointer;
  margin-left: 15px;
}

.delete-icon:hover {
  color: #c0392b;
}

.acordeon-content {
  display: none;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 20px;
  margin: -10px 0 15px 0;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== DETALHES DA OBRA ===== */
.detail-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.detail-line {
  margin-bottom: 15px;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
}

.detail-line strong {
  display: block;
  font-size: 14px;
  color: #7f8c8d;
  margin-bottom: 5px;
  font-weight: 500;
}

.detail-line span {
  font-size: 15px;
  color: #2c3e50;
  line-height: 1.5;
}

/* ===== BOTÕES DE AÇÃO ===== */
.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-danger {
  background-color: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}



/* ===== PRELOADER ===== */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
}

.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== SITUAÇÃO DA OBRA ===== */
.situacao {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.situacao.em-andamento {
  background-color: #e3f2fd;
  color: #1976d2;
}

.situacao.concluída {
  background-color: #e8f5e9;
  color: #388e3c;
}

.situacao.paralisada {
  background-color: #fff3e0;
  color: #f57c00;
}

.situacao.em-planejamento {
  background-color: #f3e5f5;
  color: #8e24aa;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .container {
    width: calc(100% - 20px);
    margin: 10px;
  }
  
  .detail-section {
    grid-template-columns: 1fr;
  }
  
  .acordeon-title {
    padding: 12px 15px;
  }
  
  .add-button {
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* ===== ESTADOS ATIVOS ===== */
.acordeon-title.active {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
}

.acordeon-title.active .title-text,
.acordeon-title.active .material-icons {
  color: white;
}

.acordeon-title.active .expand-icon {
  transform: rotate(180deg);
}
.sucesso-icone {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #10b981; /* Verde de sucesso */
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 9999;
  animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 20px 30px;
  border-radius: 8px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.modal-actions button {
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

#btnConfirmar {
  background-color: #ef4444;
  color: white;
}

#btnCancelar {
  background-color: #e5e7eb;
  color: #111827;
}


/* ===== CABEÇALHO ===== */


.header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.btn-voltar {
  padding: 12px 18px;
  font-size: 22px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-voltar:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: f5f7fa;
  border-bottom: 1px solid f5f7fa;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-voltar {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #2563eb;
}

.add-button {
  background-color: #2563eb;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.add-button:hover {
  background-color: #1e40af;
}
#acordeon-container {
  margin-top: 24px;
}
/* ===========================
   CAMPO: DATA PRORROGADA
   =========================== */

/* Linha do campo - layout independente e tamanho fixo */
.detail-line.prorrogada-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: auto !important;       /* Não herda largura do acordeon */
  max-width: none !important;
  flex: none !important;
  margin-top: 8px;
}

/* Rótulo do campo */
.detail-line.prorrogada-line > strong {
  font-weight: 600;
  color: #1f2937;
  min-width: 140px;
}

/* Input de data fixo */
.detail-line.prorrogada-line input[id^="inp-prorrogada-"] {
  appearance: none;
  -webkit-appearance: none;
  width: 160px !important;       /* 🔒 largura fixa */
  min-width: 160px !important;
  max-width: 160px !important;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-size: 14px;
  line-height: 1;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  flex: none !important;         /* impede expansão dentro do flex */
}

/* Ícone do calendário */
.detail-line.prorrogada-line input[id^="inp-prorrogada-"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.detail-line.prorrogada-line input[id^="inp-prorrogada-"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Efeitos de interação */
.detail-line.prorrogada-line input[id^="inp-prorrogada-"]:hover {
  border-color: #b0b0b0;
}
.detail-line.prorrogada-line input[id^="inp-prorrogada-"]:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17,24,39,0.12);
}

/* Container dos botões */
.detail-line.prorrogada-line .detail-actions {
  display: inline-flex;
  gap: 6px;
  flex: none;
}

/* Botões de ação */
.detail-line.prorrogada-line .detail-actions button {
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #f9fafb;
  color: #111827;
  transition: background .2s, border-color .2s;
}

/* Hover e foco dos botões */
.detail-line.prorrogada-line .detail-actions button:hover {
  background: #f3f4f6;
  border-color: #c9c9c9;
}

/* Botão "Salvar" destacado */
.detail-line.prorrogada-line .detail-actions button:first-child {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.detail-line.prorrogada-line .detail-actions button:first-child:hover {
  background: #000;
}

/* Responsividade - empilha no mobile */
@media (max-width: 640px) {
  .detail-line.prorrogada-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .detail-line.prorrogada-line .detail-actions {
    width: 100%;
  }
}
/* ===========================
   CAMPO: DATA PRORROGADA
   =========================== */

.detail-line.prorrogada-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  margin-top: 10px;
  background: #fafafa;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

/* Rótulo */
.detail-line.prorrogada-line > strong {
  font-weight: 600;
  color: #1f2937;
  min-width: 140px;
  font-size: 14px;
}

/* ===== Input estilizado ===== */
.detail-line.prorrogada-line input[id^="inp-prorrogada-"] {
  appearance: none;
  -webkit-appearance: none;
  width: 180px !important;       /* Tamanho fixo */
  min-width: 180px !important;
  max-width: 180px !important;
  height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: linear-gradient(to right, #ffffff, #f9fafb);
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  outline: none;
  flex: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

/* Ícone do calendário - sutil e moderno */
.detail-line.prorrogada-line input[id^="inp-prorrogada-"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  filter: invert(40%) sepia(8%) saturate(300%) hue-rotate(180deg);
  transition: opacity 0.3s ease, filter 0.3s ease;
  margin-left: 4px;
}
.detail-line.prorrogada-line input[id^="inp-prorrogada-"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  filter: invert(10%) sepia(10%) saturate(800%) hue-rotate(190deg);
}

/* Hover */
.detail-line.prorrogada-line input[id^="inp-prorrogada-"]:hover {
  border-color: #b0b0b0;
  background: linear-gradient(to right, #fefefe, #f6f6f6);
}

/* Foco */
.detail-line.prorrogada-line input[id^="inp-prorrogada-"]:focus {
  border-color: #2563eb; /* azul moderno */
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  background: #fff;
}

/* Placeholder */
.detail-line.prorrogada-line input[id^="inp-prorrogada-"]::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

/* ===== Botões ===== */
.detail-line.prorrogada-line .detail-actions {
  display: inline-flex;
  gap: 8px;
  flex: none;
}

/* Botão padrão */
.detail-line.prorrogada-line .detail-actions button {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #f9fafb;
  color: #111827;
  transition: all 0.25s ease-in-out;
}

/* Hover dos botões */
.detail-line.prorrogada-line .detail-actions button:hover {
  background: #f3f4f6;
  border-color: #c9c9c9;
  transform: translateY(-1px);
}

/* Botão "Salvar" (primário) */
.detail-line.prorrogada-line .detail-actions button:first-child {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}
.detail-line.prorrogada-line .detail-actions button:first-child:hover {
  background: #1e40af;
  border-color: #1e40af;
  box-shadow: 0 3px 6px rgba(30, 64, 175, 0.3);
}

/* ===== Responsividade ===== */
@media (max-width: 640px) {
  .detail-line.prorrogada-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .detail-line.prorrogada-line .detail-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
/* ===========================
   IMAGEM NO ACORDEON
   =========================== */

/* Contêiner da imagem no topo do acordeon */
.obra-imagem-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 16px;
}

/* Imagem da obra */
.obra-imagem-container img {
  width: 100%;              /* ocupa 75% do card */
  border-radius: 12px;     /* arredondamento suave */
  object-fit: cover;       /* mantém proporção e cobre bem o espaço */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}



/* Responsivo */
@media (max-width: 768px) {
  .obra-imagem-container img {
    width: 90%; /* em telas menores, ocupa mais do card */
  }
}
/* ===========================
   IMAGEM NO ACORDEON (CARD)
   =========================== */

.obra-imagem-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  /* menos alto */
  margin: 10px 0 14px;
}

/* Quando houver imagem: card mais baixo, com recorte */
.obra-imagem-card {
  width: 75%;
  max-width: 980px;
  border-radius: 22px;
  overflow: hidden;                 /* recorta a imagem */
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* Controla a altura “menos alta” do card de imagem */
.obra-imagem-card img {
  display: block;
  width: 100%;
  height: 220px;                    /* << ajuste de altura do card */
  object-fit: cover;                /* cobre sem distorcer */
  transition: transform .25s ease, box-shadow .25s ease;
}
.obra-imagem-card img:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* Placeholder quando NÃO houver imagem */
.obra-imagem-placeholder {
  width: 75%;
  max-width: 980px;
  min-height: 160px;                /* menos alto */
  border-radius: 22px;
  border: 2px dashed rgba(37,99,235,.5);   /* azul suave tracejado */
  background: #f8fafc;                     /* leve contraste */
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .02s;
}
.obra-imagem-placeholder:hover {
  background: #f1f5f9;
  border-color: rgba(37,99,235,.65);
}
.obra-imagem-placeholder:active {
  transform: translateY(1px);
}

/* Texto do placeholder */
.obra-imagem-placeholder .placeholder-text {
  font-size: 14px;
  font-weight: 600;
  opacity: .85;
}
/* ===========================
   IMAGEM NO ACORDEON (CARD)
   =========================== */

/* Contêiner da imagem */
.obra-imagem-container {
  display: flex;
  justify-content: flex-start;   /* 👈 agora alinhado à esquerda */
  align-items: flex-start;
  width: 100%;
  margin: 10px 0 14px;
}

/* Card com imagem */
.obra-imagem-card {
  width: 100%;
  max-width: 980px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* Imagem dentro do card */
.obra-imagem-card img {
  display: block;
  width: 100%;
  height: 420px;           /* altura reduzida */
  object-fit: cover;
  transition: transform .25s ease, box-shadow .25s ease;
}
.obra-imagem-card img:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* Placeholder quando não há imagem */
.obra-imagem-placeholder {
  width: 100%;
  max-width: 100%;
  min-height: 160px;
  border-radius: 22px;
  border: 2px dashed rgba(37,99,235,.5);
  background: #f8fafc;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .02s;
}
.obra-imagem-placeholder:hover {
  background: #f1f5f9;
  border-color: rgba(37,99,235,.65);
}
.obra-imagem-placeholder:active {
  transform: translateY(1px);
}

/* Texto dentro do placeholder */
.obra-imagem-placeholder .placeholder-text {
  font-size: 14px;
  font-weight: 600;
  opacity: .85;
}

/* Responsivo */
@media (max-width: 768px) {
  .obra-imagem-card,
  .obra-imagem-placeholder {
    width: 90%;
  }
}
/* Garante que o card da imagem permita posicionamento interno */
.obra-imagem-card {
  position: relative;
}

/* Coloca o botão dentro do card, canto superior direito */
.btn-excluir-imagem {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-excluir-imagem:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
/* --- ESTILOS DO MODAL DE EDIÇÃO --- */

/* Fundo do Modal (Overlay) */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5); /* Escurece o fundo */
    backdrop-filter: blur(4px);    /* Efeito de desfoque */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

/* Container do Modal */
.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #111827;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 15px;
}

/* Grid e Labels */
#editForm label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

#editForm input, 
#editForm textarea {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #1f2937;
    transition: all 0.2s;
    outline: none;
    margin-bottom: 15px;
}

#editForm input:focus, 
#editForm textarea:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Botões do Modal */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

#btnSalvarEdicao {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#btnSalvarEdicao:hover {
    background: #2563eb;
}

.modal-actions button[type="button"] {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.modal-actions button[type="button"]:hover {
    background: #e5e7eb;
}

/* Scrollbar Customizada para o Modal */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 10px;
}

/* Responsividade para o Grid de 2 colunas */
@media (min-width: 480px) {
    .grid-2-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 15px;
    }
    .span-2 {
        grid-column: span 2;
    }
}
