/* ========================================
   PAINEL DE OBRAS - DASHBOARD
======================================== */

/* Hero Section */
.obras-hero {
  background: linear-gradient(135deg, #004a7c 0%, #003459 50%, #00263d 100%);
  position: relative;
  overflow: hidden;
}

.obras-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Filter Section */
.filter-section {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-top: -3rem;
  position: relative;
  z-index: 10;
}

.filter-section .form-label {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.85rem;
}

.filter-section .form-control,
.filter-section .form-select {
  height: 46px;
  border-radius: 8px;
  border-color: #dee2e6;
}

.filter-section .form-control:focus,
.filter-section .form-select:focus {
  border-color: #004a7c;
  box-shadow: 0 0 0 0.2rem rgba(0, 74, 124, 0.15);
}

.filter-section .btn-primary {
  height: 46px;
  border-radius: 8px;
  background: #004a7c;
  border-color: #004a7c;
}

.filter-section .btn-primary:hover {
  background: #003459;
  border-color: #003459;
}

.filter-section .btn-outline-secondary {
  height: 46px;
  border-radius: 8px;
}

/* Stats Cards */
.obras-page .stats-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.obras-page .stats-card:hover {
  transform: translateY(-3px);
  border-color: #004a7c;
}

.obras-page .stats-card.active {
  border-color: #004a7c;
  box-shadow: 0 4px 20px rgba(0, 74, 124, 0.15);
}

.obras-page .stats-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.25rem;
  color: #fff;
}

.obras-page .stats-icon.primary { background: linear-gradient(135deg, #004a7c 0%, #003459 100%); }
.obras-page .stats-icon.success { background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%); }
.obras-page .stats-icon.info { background: linear-gradient(135deg, #17a2b8 0%, #138496 100%); }
.obras-page .stats-icon.warning { background: linear-gradient(135deg, #ffc107 0%, #d39e00 100%); }
.obras-page .stats-icon.danger { background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%); }

.obras-page .stats-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
}

.obras-page .stats-label {
  color: #6c757d;
  font-size: 0.85rem;
}

/* Dashboard Layout */
.dashboard-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.dashboard-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.dashboard-card-header h6 {
  margin: 0;
  font-weight: 700;
  color: #2c3e50;
}

.dashboard-card-body {
  padding: 0;
}

/* Lista de Obras */
.obras-list {
  max-height: 400px;
  overflow-y: auto;
}

.obra-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  cursor: pointer;
  transition: all 0.2s ease;
}

.obra-item:hover {
  background-color: #f8f9fa;
}

.obra-item.active {
  background-color: #e3f2fd;
  border-left: 4px solid #004a7c;
}

.obra-title {
  font-size: 0.9rem;
  color: #2c3e50;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.obra-status-indicator {
  width: 10px;
  min-width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 12px;
  margin-top: 4px;
}

/* Status Colors */
.status-waiting { background-color: #6c757d; }
.status-in_progress { background-color: #28a745; }
.status-stopped { background-color: #dc3545; }
.status-completed { background-color: #17a2b8; }

.obra-status-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.obra-status-badge.status-waiting { background-color: #6c757d; color: white; }
.obra-status-badge.status-in_progress { background-color: #28a745; color: white; }
.obra-status-badge.status-stopped { background-color: #dc3545; color: white; }
.obra-status-badge.status-completed { background-color: #17a2b8; color: white; }

/* Mapa */
#obrasMap {
  height: 400px;
}

.custom-marker .marker-pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.custom-marker .marker-pin i {
  transform: rotate(45deg);
  color: white;
  font-size: 12px;
}

/* Detalhes da Obra */
.obra-detail-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, #004a7c 0%, #003459 100%);
  color: white;
}

.obra-progress-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: bold;
  color: #333;
  background: conic-gradient(#e9ecef 0deg, #e9ecef 360deg);
  position: relative;
}

.obra-progress-circle::before {
  content: '';
  position: absolute;
  width: 70px;
  height: 70px;
  background: white;
  border-radius: 50%;
}

.obra-progress-circle span {
  position: relative;
  z-index: 1;
}

.info-box {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 10px;
  height: 100%;
}

.info-box label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.info-box p {
  font-size: 0.95rem;
}

/* Chart Container */
.chart-container {
  position: relative;
  width: 100%;
}

/* No Results */
.obras-page .no-results {
  text-align: center;
  padding: 3rem 2rem;
}

.obras-page .no-results i {
  font-size: 3rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

/* Scrollbar */
.obras-list::-webkit-scrollbar {
  width: 6px;
}

.obras-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.obras-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

/* Mensagem de paralisação da obra */
.obras-page .obra-stopped-alert {
  background: linear-gradient(135deg, #fff5f5 0%, #ffeaea 100%);
  border-left: 5px solid #dc3545 !important;
  color: #842029;
}

.obras-page .obra-stopped-alert i.fa-2x {
  color: #dc3545;
}

.obras-page .obra-stopped-message {
  background: rgba(220, 53, 69, 0.06);
  border: 1px dashed rgba(220, 53, 69, 0.35);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: #5b1118;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Anexos / Documentos */
.obras-page .obra-detail-medias .obra-media-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.obras-page .obra-detail-medias .obra-media-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #b6d4fe !important;
}

.obras-page .obra-detail-medias .obra-media-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Responsivo */
@media (max-width: 991px) {
  .obras-list { max-height: 350px; }
  #obrasMap { height: 250px; }
  .obra-progress-circle { width: 70px; height: 70px; font-size: 1rem; }
  .obra-progress-circle::before { width: 55px; height: 55px; }
}
