/* ==========================================================================
   DESIGN SYSTEM INSTITUCIONAL MILITAR EXECUTIVO — 63º BI
   Módulo de Projetos Estratégicos Integrado ao Siteadm.
   Paleta: Verde Oliva (#3d5016), Dourado Sóbrio (#c9a227), Glassmorphism com Imagem Aérea
   ========================================================================== */

/* LOADER OVERLAY DE ENTRADA DO 63° BI COM FUNDO CLARO E CONTEÚDO CENTRALIZADO */
#loaderOverlay {
  position: fixed;
  inset: 0;
  background-color: #f5f2e8;
  background-image: linear-gradient(rgba(245, 242, 232, 0.88), rgba(245, 242, 232, 0.88)), url('../assets/imagemaerea63biverdeoliva.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#loaderOverlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0.25em 0;
}

.absolute { position: absolute; }
.inline-block { display: inline-block; }

.dash {
  animation: dashArray 2s ease-in-out infinite, dashOffset 2s linear infinite;
}

.spin {
  animation: spinDashArray 2s ease-in-out infinite, spin 8s ease-in-out infinite, dashOffset 2s linear infinite;
  transform-origin: center;
}

@keyframes dashArray {
  0% { stroke-dasharray: 0 1 359 0; }
  50% { stroke-dasharray: 0 359 1 0; }
  100% { stroke-dasharray: 359 1 0 0; }
}

@keyframes spinDashArray {
  0% { stroke-dasharray: 270 90; }
  50% { stroke-dasharray: 0 360; }
  100% { stroke-dasharray: 250 90; }
}

@keyframes dashOffset {
  0% { stroke-dashoffset: 385; }
  100% { stroke-dashoffset: 5; }
}

@keyframes spin {
  0% { rotate: 0deg; }
  12.5%, 25% { rotate: 270deg; }
  37.5%, 50% { rotate: 540deg; }
  62.5%, 75% { rotate: 810deg; }
  87.5%, 100% { rotate: 1080deg; }
}

/* BARRA DE PROGRESSO DO LOADER */
.loader-progress-bg {
  width: 220px;
  height: 4px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
  position: relative;
}
.loader-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #5f7727, #c9a227, #e8bc3a);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(232, 188, 58, 0.7);
  animation: fillProgressMenu 2.2s ease-in-out forwards;
}
@keyframes fillProgressMenu {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

:root {
  --olive-dark: #202b0c;
  --olive: #3d5016;
  --olive-light: #5f7727;
  --gold: #b89320;
  --gold-subtle: #fcf8eb;
  --gold-border: #e6c86e;
  
  --bg-main: #f4f6f1;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-muted: rgba(248, 250, 246, 0.88);
  
  --text-primary: #181d13;
  --text-secondary: #4a5440;
  --text-muted: #6e7765;
  
  --border-default: rgba(0, 0, 0, 0.1);
  --border-dark: #cbd4c2;
  
  --accent-red: #c22525;
  --accent-blue: #1d58d8;
  --accent-green: #15803d;
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.18);
  --shadow-modal: 0 20px 50px rgba(0,0,0,0.35);
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #f5f2e8;
  background-image: linear-gradient(rgba(245, 242, 232, 0.88), rgba(245, 242, 232, 0.88)), url('../assets/imagemaerea63biverdeoliva.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: 60px;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* PRIORITY BADGES - MINIMAL EXECUTIVE RATING */
.priority-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.priority-badge.rank-top {
  background: var(--gold-subtle);
  color: #785102;
  border: 1px solid var(--gold-border);
}

.priority-badge.rank-high {
  background: #f0fdf4;
  color: #14532d;
  border: 1px solid #bbf7d0;
}

.priority-badge.rank-mid {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.priority-badge.rank-standard {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

/* HEADER EXECUTIVO EM VERDE OLIVA MILITAR COM EFEITO DE VIDRO (FROSTED GLASSMORPHISM) */
.header-bar {
  background: rgba(20, 28, 12, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2.5px solid var(--gold);
  color: #ffffff;
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-img {
  height: 72px;
  width: auto;
  object-fit: contain;
}

.header-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.header-subtitle {
  font-size: 0.78rem;
  color: #c2d1b2;
  font-weight: 600;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* BOTÕES PROFISSIONAIS COM SVG */
.btn-primary {
  background-color: var(--olive);
  color: #ffffff;
  border: 1px solid var(--olive-light);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: var(--olive-light);
}

.btn-gold {
  background-color: var(--gold);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-gold:hover {
  background-color: #9e7d17;
}

.btn-danger {
  background-color: #ffffff;
  color: var(--accent-red);
  border: 1px solid #fca5a5;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-danger:hover {
  background-color: #fef2f2;
  border-color: var(--accent-red);
}

.btn-outline {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-outline:hover {
  background: var(--bg-muted);
  border-color: var(--border-dark);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

/* KPIS DASHBOARD EXECUTIVO COM EFEITO VIDRO */
.kpi-container {
  max-width: 1400px;
  margin: 110px auto 0;
  padding: 0 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  position: relative;
  z-index: 2;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--olive-dark);
  margin-top: 4px;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* FILTROS E PESQUISA */
.filter-container {
  max-width: 1400px;
  margin: 20px auto 0;
  padding: 0 40px;
  position: relative;
  z-index: 2;
}

.filter-bar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.search-input-wrap {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 36px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(52, 69, 19, 0.1);
}

.select-filter {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  min-width: 180px;
}

.select-filter:focus {
  border-color: var(--olive);
}

/* CARDS DE PROJETOS */
.grid-container-section {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 40px;
  position: relative;
  z-index: 2;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.project-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  transform: translateZ(0);
  will-change: transform;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.96);
}

.card-img-header {
  position: relative;
  height: 180px;
  background: #202b0c;
  overflow: hidden;
}

.card-img-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .card-img-header img {
  transform: scale(1.03);
}

/* HEADER INSTITUCIONAL QUANDO O PROJETO AINDA NÃO POSSUI FOTO */
.card-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--olive-dark) 0%, var(--olive) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  position: relative;
}

.placeholder-icon {
  margin-bottom: 4px;
}

.placeholder-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

.empty-image-dropzone {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f2f6eb;
  border: 2px dashed #c0ceb1;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  padding: 16px;
  text-align: center;
}

.empty-image-dropzone:hover {
  background: #e6eedb;
  border-color: var(--olive);
}

.empty-image-dropzone.ia-zone {
  background: #fdfbf7;
  border-color: var(--gold-border);
  color: #785102;
}

.empty-image-dropzone.ia-zone:hover {
  background: #fef8e7;
}

.drop-icon-svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  margin-bottom: 6px;
}

.drop-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.drop-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 40%, rgba(0,0,0,0.5) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  pointer-events: none;
}

.card-top-badges {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* BADGE DA DIRETORIA: COM E SEM LOGO */
.badge-pro {
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  backdrop-filter: blur(4px);
}

/* SEM FUNDO ESCURO QUANDO A LOGO ESTÁ ANEXADA */
.badge-pro.has-logo {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* TAMANHO E FORMATO PADRONIZADO DA LOGO */
.badge-logo-img {
  height: 32px;
  width: auto;
  max-width: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.75));
}

.badge-pro-name {
  font-size: 9px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.8);
  line-height: 1.1;
  letter-spacing: 0.5px;
  text-align: center;
}

/* BOTÃO COMPACTO HORIZONTAL PARA ANEXAR LOGO DA DIRETORIA */
.btn-attach-logo-sm {
  height: 34px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--olive-dark);
  background: var(--gold-subtle);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-attach-logo-sm:hover {
  background: #f0f7e6;
  border-color: var(--olive);
  color: var(--olive);
}

.logo-preview-inline {
  height: 34px;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  padding: 0 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.card-financial-box {
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  margin-bottom: 12px;
}

.card-val-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.card-val-amount {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--olive-dark);
}

/* SISTEMA DE PROGRESSO ANIMADO */
.card-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}

.card-progress-percent {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.card-progress-count {
  color: var(--text-muted);
  font-weight: 600;
}

.card-progress-track {
  width: 100%;
  height: 8px;
  background: #e2e7dc;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.card-progress-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
  position: relative;
}

.card-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  animation: shimmerProgress 2.5s infinite;
}

@keyframes shimmerProgress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* MODAIS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 10, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: var(--olive-dark);
  color: #ffffff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-title h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-title p {
  font-size: 11px;
  color: #c2d1b2;
  margin-top: 2px;
}

.close-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}

.close-btn:hover {
  background: var(--accent-red);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* COMPARADOR ANTES DEPOIS E EDIÇÃO DE IMAGEM */
.before-after-box {
  position: relative;
  width: 100%;
  height: 400px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-default);
  user-select: none;
  background: #192110;
}

/* LOADER IDÊNTICO AO DO MÓDULO PARA O CARREGAMENTO DAS IMAGENS */
.ba-loader-overlay {
  position: absolute;
  inset: 0;
  background-color: #f5f2e8;
  background-image: linear-gradient(rgba(245, 242, 232, 0.90), rgba(245, 242, 232, 0.90)), url('../assets/imagemaerea63biverdeoliva.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s ease;
  user-select: none;
}

.ba-loader-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ba-loader-scale {
  transform: scale(0.68);
  transform-origin: center center;
  margin: 0;
}

.ba-loader-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold);
  margin-top: -6px;
  text-transform: uppercase;
}

.ba-loader-sub {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--olive);
}

.ba-progress-scale {
  width: 160px;
  height: 3px;
  margin-top: 4px;
}

.img-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.img-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.before-layer {
  width: 50%;
  z-index: 2;
  border-right: 2px solid var(--gold);
  overflow: hidden;
  background: #192110;
}

.before-layer img {
  height: 100%;
  object-fit: cover;
  max-width: none;
  position: absolute;
  top: 0;
  left: 0;
}

.slider-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--gold);
  z-index: 3;
  cursor: ew-resize;
  transform: translateX(-50%);
}

.slider-handle-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: var(--olive-dark);
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.img-tag {
  position: absolute;
  top: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 4;
}

.tag-before {
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
}

.tag-after {
  right: 10px;
  background: var(--gold);
  color: #ffffff;
}

/* GRUPO DE BOTÕES SOBREPOSTOS NA IMAGEM (EDITAR E EXCLUIR LADO A LADO) */
.img-overlay-controls {
  position: absolute;
  bottom: 12px;
  z-index: 5;
  display: flex;
  gap: 6px;
}

.btn-group-before {
  left: 12px;
}

.btn-group-after {
  right: 12px;
}

.img-change-overlay-btn,
.img-delete-overlay-btn {
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.img-change-overlay-btn:hover {
  background: var(--olive-dark);
  border-color: var(--gold);
  color: var(--gold);
}

.img-delete-overlay-btn:hover {
  background: rgba(194, 37, 37, 0.9);
  border-color: #fca5a5;
  color: #ffffff;
}

/* STEPPER 12 FASES */
.stepper-container {
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
}

.stepper-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.step-item {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.step-item.done {
  background: #f0fdf4;
  border-color: var(--accent-green);
}

.step-item.omitted {
  background: #f3f4f6;
  border-color: #e5e7eb;
  opacity: 0.65;
}

.step-item-idx {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
}

.step-item.done .step-item-idx { color: var(--accent-green); }
.step-item.omitted .step-item-idx { color: #9ca3af; }

.step-item-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.step-item-detail {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* FORMULÁRIOS */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.form-control {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(52, 69, 19, 0.1);
}

.phase-checkbox-box {
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.phase-checkbox-box input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--olive);
}

.conditional-field-wrap {
  display: none;
}

.conditional-field-wrap.active {
  display: flex;
}

/* MODO APRESENTAÇÃO */
.presentation-modal {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.presentation-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.presentation-topbar {
  padding: 12px 32px;
  background: var(--olive-dark);
  border-bottom: 2px solid var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.presentation-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.presentation-main {
  flex: 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.presentation-hero-panel {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.presentation-title-text h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--olive-dark);
  line-height: 1.2;
}

.presentation-title-text p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.pres-metric-grid-dynamic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.pres-metric-card-light {
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.pres-metric-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.pres-metric-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--olive-dark);
  margin-top: 2px;
}

.presentation-panel-light {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.pres-panel-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.pres-pipeline-grid-light {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.pres-step-card-light {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.pres-step-card-light.done {
  background: #f0fdf4;
  border-color: var(--accent-green);
}

.pres-step-card-light.omitted {
  background: #f3f4f6;
  border-color: #e5e7eb;
  opacity: 0.6;
}

.pres-step-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.pres-step-card-sub {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.presentation-sidebar-light {
  width: 300px;
  background: #ffffff;
  border-left: 1px solid var(--border-default);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.pres-thumb-card-light {
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.pres-thumb-card-light:hover {
  background: #eef2e8;
  border-color: var(--olive);
}

.pres-thumb-card-light.active {
  border-color: var(--gold);
  background: var(--gold-subtle);
}

/* TOAST */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-left: 4px solid var(--accent-green);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.25s ease;
  pointer-events: auto;
}

.toast-item.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-item.toast-error {
  border-left-color: var(--accent-red);
}

.toast-item.toast-info {
  border-left-color: var(--accent-blue);
}

/* ==========================================================================
   MELHORIAS V23.0 — ACORDEÃO, TIMELINE VERTICAL & DOCUMENTAÇÃO DRIVE
   ========================================================================== */

/* ACORDEÃO NO MODAL DE EDIÇÃO */
.accordion-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.accordion-item {
  background: #ffffff;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.accordion-item.active {
  border-color: var(--olive);
  box-shadow: var(--shadow-sm);
}

.accordion-header {
  padding: 12px 16px;
  background: #fcfdfa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.accordion-item.active .accordion-header {
  background: #f4f7ee;
  border-bottom-color: var(--border-default);
}

.accordion-header:hover {
  background: #f1f5eb;
}

.accordion-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--gold-subtle);
  color: var(--olive);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border: 1px solid var(--gold-border);
}

.accordion-title-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.accordion-sub-text {
  font-size: 11px;
  color: var(--text-muted);
}

.accordion-chevron {
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.accordion-item.active .accordion-chevron {
  transform: rotate(180deg);
  color: var(--olive);
}

.accordion-content {
  display: none;
  padding: 16px;
  background: #ffffff;
}

.accordion-item.active .accordion-content {
  display: block;
}

/* CARDS DE EDIÇÃO DE FASE NO ACORDEÃO */
.phase-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .phase-edit-grid {
    grid-template-columns: 1fr;
  }
}

.phase-edit-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fafbfa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phase-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phase-edit-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.phase-status-select {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  background: #ffffff;
  color: var(--text-primary);
}

.phase-desc-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 11.5px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  background: #ffffff;
  color: var(--text-primary);
}

.phase-desc-input:focus {
  border-color: var(--olive);
  outline: none;
}

/* GERENCIADOR DE LINHA DO TEMPO NO MODAL DE EDIÇÃO */
.timeline-manager-form {
  background: #f8faf5;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
}

.timeline-items-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.timeline-table-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px;
  background: #fafbfa;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  gap: 12px;
}

.timeline-table-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.timeline-table-main {
  flex: 1;
}

.timeline-table-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.timeline-table-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.timeline-table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* TIMELINE VERTICAL NO MODAL DE DETALHES (COMPACTO — 2 ITENS VISÍVEIS + ROLAGEM) */
.timeline-v-container {
  position: relative;
  padding-left: 18px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #c5cdbc transparent;
}

.timeline-v-container::-webkit-scrollbar {
  width: 4px;
}
.timeline-v-container::-webkit-scrollbar-track {
  background: transparent;
}
.timeline-v-container::-webkit-scrollbar-thumb {
  background: #c5cdbc;
  border-radius: 4px;
}
.timeline-v-container::-webkit-scrollbar-thumb:hover {
  background: var(--olive);
}

.timeline-v-container::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #d8e0ce;
}

.timeline-v-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-v-dot {
  position: absolute;
  left: -18px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--olive);
  box-shadow: 0 0 0 2px rgba(61, 80, 22, 0.12);
  z-index: 1;
}

.timeline-v-item:first-child .timeline-v-dot {
  border-color: var(--gold);
  background: var(--gold-subtle);
}

.timeline-v-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline-v-badge {
  font-size: 9px;
  font-weight: 700;
  color: #ffffff;
  background: var(--olive);
  padding: 1.5px 6px;
  border-radius: 3px;
  letter-spacing: 0.4px;
}

.timeline-v-item:first-child .timeline-v-badge {
  background: var(--gold);
}

.timeline-v-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-v-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
  background: #ffffff;
  padding: 5px 9px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  margin-top: 1px;
  white-space: pre-wrap;
}

/* CARDS DE DOCUMENTOS TÉCNICOS (COMPACTO — 2 ITENS VISÍVEIS + ROLAGEM) */
.doc-card-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 124px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #c5cdbc transparent;
}

.doc-card-grid::-webkit-scrollbar {
  width: 4px;
}
.doc-card-grid::-webkit-scrollbar-track {
  background: transparent;
}
.doc-card-grid::-webkit-scrollbar-thumb {
  background: #c5cdbc;
  border-radius: 4px;
}
.doc-card-grid::-webkit-scrollbar-thumb:hover {
  background: var(--olive);
}

.doc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  gap: 10px;
}

.doc-card:hover {
  border-color: var(--olive);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.doc-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.doc-pdf-icon-box {
  width: 26px;
  height: 28px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 3px;
  color: #dc2626;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-pdf-icon-box svg {
  width: 13px;
  height: 13px;
}

.doc-pdf-icon-text {
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-top: 0px;
}

.doc-card-meta {
  flex: 1;
  min-width: 0;
}

.doc-card-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card-tag-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.doc-category-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  background: #e2e8f0;
  color: #334155;
}

.doc-category-badge.edital { background: #dbeafe; color: #1e40af; }
.doc-category-badge.tr { background: #fef3c7; color: #92400e; }
.doc-category-badge.diex { background: #e0e7ff; color: #3730a3; }
.doc-category-badge.planta { background: #dcfce7; color: #166534; }

.doc-date-text {
  font-size: 9.5px;
  color: var(--text-muted);
}

.btn-doc-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--olive);
  background: var(--gold-subtle);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-doc-open:hover {
  background: var(--gold);
  color: #ffffff;
  border-color: var(--gold);
}

/* RODAPÉ DE ÚLTIMA MOVIMENTAÇÃO NOS CARDS DA TELA INICIAL */
.card-last-action {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-default);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.card-last-action-icon {
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 1px;
}

.card-last-action-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.card-last-action-date {
  font-weight: 700;
  color: var(--olive);
}

/* DIÁLOGO / POPUP MODAL CUSTOMIZADO (SUBSTITUTO DE CONFIRM E ALERTA) */
.app-dialog-overlay {
  z-index: 10050 !important;
  background: rgba(15, 23, 10, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.app-dialog-card {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px -12px rgba(15, 23, 10, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  animation: dialogScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: flex;
  flex-direction: column;
}

@keyframes dialogScaleIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.app-dialog-header {
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-default);
  background: #fafbf8;
}

.app-dialog-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.app-dialog-icon-badge.warning {
  background: #fef3c7;
  color: #b45309;
}

.app-dialog-icon-badge.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.app-dialog-icon-badge.info {
  background: #e0e7ff;
  color: #3730a3;
}

.app-dialog-title-box h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.app-dialog-title-box p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.app-dialog-body {
  padding: 20px 22px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.app-dialog-footer {
  padding: 14px 22px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafbf8;
  border-top: 1px solid var(--border-default);
}

.app-dialog-btn {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
}

