/* ========== GANTT CHART ========== */
.gantt-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.gantt-toolbar button { padding: 6px 14px; border: 1px solid #ddd; border-radius: 6px; background: white; cursor: pointer; font-size: 12px; }
.gantt-toolbar button:hover { background: #f0f0f0; }
.gantt-toolbar button.btn-primary { background: #1a3c7d; color: white; border-color: #1a3c7d; }
.gantt-toolbar button.btn-primary:hover { background: #0f2b5e; }
.gantt-toolbar button.active { background: #1a3c7d; color: white; border-color: #1a3c7d; }
.gantt-toolbar .gantt-period { font-weight: 600; font-size: 13px; min-width: 180px; text-align: center; }
.gantt-wrapper { display: flex; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; background: white; }
.gantt-labels { width: 200px; min-width: 120px; border-right: 2px solid #ddd; overflow-y: auto; background: #fafafa; transition: width 0.15s; }
.gantt-labels .gantt-group { border-bottom: 1px solid #e0e0e0; }
.gantt-labels .gantt-group-title {
  height: 28px; padding: 0 10px; font-weight: 700; font-size: 11px; text-transform: uppercase;
  color: white; display: flex; justify-content: space-between; align-items: center; white-space: nowrap; overflow: hidden;
}
.gantt-labels .gantt-equipe-row {
  height: 36px; display: flex; flex-direction: column; justify-content: center; padding: 3px 10px;
  font-size: 11px; color: #666; border-top: 1px solid #f0f0f0; white-space: nowrap; overflow: hidden;
}
.gantt-labels .gantt-equipe-row .equipe-nome { font-weight: 700; color: #444; line-height: 1.1; }
.gantt-labels .gantt-equipe-row .equipe-responsavel { font-size: 10px; color: #888; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.gantt-timeline-wrap { flex: 1; overflow-x: auto; overflow-y: auto; position: relative; }
.gantt-timeline { position: relative; min-width: 100%; }
.gantt-header { position: sticky; top: 0; z-index: 10; background: white; border-bottom: 2px solid #ddd; }
.gantt-header-months { display: flex; }
.gantt-header-month {
  text-align: center; font-size: 11px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
  border-right: 2px solid #fff; padding: 4px 0; background: #1a3c7d; text-transform: uppercase;
}
.gantt-header-days { display: flex; }
.gantt-header-day {
  text-align: center; font-size: 9px; color: #666;
  border-right: 1px solid #f0f0f0; display: flex; flex-direction: column; justify-content: center;
}
.gantt-header-day .day-num { font-weight: 700; font-size: 11px; line-height: 1.2; }
.gantt-header-day .day-name { font-size: 8px; color: #999; line-height: 1.1; text-transform: lowercase; }
.gantt-header-day.weekend {
  background: repeating-linear-gradient(
    45deg,
    #f0f0f0,
    #f0f0f0 4px,
    #d0d0d0 4px,
    #d0d0d0 8px
  );
}
.gantt-header-day.weekend .day-num { color: #bbb; }
.gantt-header-day.weekend .day-name { color: #ccc; }
.gantt-header-day.today { background: #fff3e0; }
.gantt-header-day.today .day-num { font-weight: 700; color: #e65100; }
.gantt-header-day.today .day-name { color: #e65100; }
.gantt-header-day.month-start { border-left: 2px solid #1a3c7d; }
.gantt-body { position: relative; }
.gantt-group-body { border-bottom: 1px solid #e0e0e0; }
.gantt-row {
  height: 36px; position: relative; border-top: 1px solid #f8f8f8;
}
.gantt-row-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; pointer-events: none; }
.gantt-day-col { border-right: 1px solid #f5f5f5; }
.gantt-day-col.weekend {
  background: repeating-linear-gradient(
    45deg,
    #fafafa,
    #fafafa 5px,
    #e8e8e8 5px,
    #e8e8e8 10px
  );
}
.gantt-day-col.today { background: rgba(255,152,0,0.08); }
.gantt-bar {
  position: absolute; height: 26px; top: 5px; border-radius: 5px;
  cursor: grab; user-select: none; display: flex; align-items: center;
  padding: 0 6px; font-size: 10px; font-weight: 600; color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2); z-index: 5; overflow: hidden;
  white-space: nowrap; min-width: 20px; transition: box-shadow 0.15s;
}
.gantt-bar:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.35); z-index: 6; }
.gantt-bar.dragging { opacity: 0.85; cursor: grabbing; box-shadow: 0 4px 12px rgba(0,0,0,0.4); z-index: 20; }
.gantt-bar.conflict { outline: 4px solid #ff9800; outline-offset: 1px; animation: pulse-conflict 1s infinite; }
@keyframes pulse-conflict { 0%,100% { outline-color: #ff9800; } 50% { outline-color: #ffcc80; } }
.gantt-bar.urgente { outline: 3px solid #e74c3c; outline-offset: 1px; animation: pulse-urgente 0.8s infinite; }
.gantt-bar.gantt-finalizado { opacity: 0.22 !important; filter: grayscale(70%) !important; pointer-events: auto; }
.gantt-bar:hover { box-shadow: inset 0 0 0 3px rgba(255,255,255,0.8), 0 0 12px rgba(255,255,255,0.9) !important; filter: brightness(1.15) !important; z-index: 15 !important; }
.gantt-bar.gantt-destaque { box-shadow: inset 0 0 0 3px rgba(255,255,255,1), 0 0 16px rgba(255,255,255,1) !important; filter: brightness(1.25) !important; z-index: 15 !important; }
/* Classes para highlight de sequência (sem mudar barra, só marcar visualmente) */
.gantt-bar.gantt-seq { outline: 2px solid rgba(40,40,40,0.4) !important; outline-offset: 1px !important; }
/* SVG path das setas - vermelho quando ativo */
.gantt-seta path.gantt-seta-ativa { stroke: #e74c3c !important; stroke-width: 2.5 !important; opacity: 1 !important; }
.gantt-row.gantt-row-destaque { background: rgba(26, 60, 125, 0.08) !important; }
.gantt-equipe-row.gantt-equipe-destaque { background: rgba(26, 60, 125, 0.12) !important; font-weight: 600 !important; }
@keyframes pulse-urgente { 0%,100% { outline-color: #e74c3c; outline-width: 3px; box-shadow: 0 0 6px rgba(231,76,60,0.7); } 50% { outline-color: #ff8a80; outline-width: 4px; box-shadow: 0 0 14px rgba(231,76,60,0.95); } }
/* Multa contratual: borda dourada + hachura quando prazo em risco */
.gantt-bar.has-multa { border: 2.5px solid #ffb300; box-sizing: border-box; }
.gantt-bar.has-multa.multa-atencao { border-color: #ef6c00; }
.gantt-bar.has-multa.multa-risco {
  border-color: #c62828;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(255,255,255,0.4) 6px, rgba(255,255,255,0.4) 12px) !important;
  animation: pulse-risco 1.4s infinite;
}
@keyframes pulse-risco { 0%,100% { box-shadow: 0 0 0 0 rgba(198,40,40,0.7); } 50% { box-shadow: 0 0 0 5px rgba(198,40,40,0); } }
/* Linha vertical do prazo contratual */
.gantt-deadline-line {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 2px dashed #c62828; pointer-events: none; z-index: 8;
}
.gantt-deadline-label {
  position: absolute; top: 2px; transform: translateX(-50%);
  background: #c62828; color: white; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px; white-space: nowrap;
  pointer-events: none; z-index: 9;
}
.gantt-bar .resize-handle {
  position: absolute; right: 0; top: 0; bottom: 0; width: 8px;
  cursor: ew-resize; border-radius: 0 5px 5px 0;
}
.gantt-bar .resize-handle:hover { background: rgba(255,255,255,0.3); }
.gantt-bar .bar-label { overflow: hidden; text-overflow: ellipsis; }
.gantt-bar .bar-pct { margin-left: auto; font-size: 9px; opacity: 0.8; padding-left: 4px; }

/* v1.3.0 ETAPA 2: Barra de preview (fantasma) no drawer */
.gantt-bar.gantt-bar-preview {
  background: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.12),
    rgba(0, 0, 0, 0.12) 6px,
    transparent 6px,
    transparent 12px
  ) !important;
  border: 1.5px dashed rgba(0, 0, 0, 0.4) !important;
  opacity: 0.75;
  pointer-events: none;
  cursor: default;
}

.gantt-bar.gantt-bar-preview::after {
  content: "✎";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.7;
  color: rgba(0, 0, 0, 0.5);
}

.gantt-empty { text-align: center; padding: 60px 20px; color: #999; font-size: 14px; }

/* Modal Cronograma */
.crono-modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 3000;
  justify-content: center; align-items: flex-start; padding-top: 60px;
}
.crono-modal-overlay.show { display: flex; }
.crono-modal {
  background: white; border-radius: 12px; width: 95%; max-width: 900px; max-height: 90vh;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3); overflow: hidden; display: flex; flex-direction: column;
}
.crono-modal-header {
  padding: 14px 18px; color: white; display: flex;
  justify-content: space-between; align-items: center;
}
.crono-modal-header h3 { margin: 0; font-size: 15px; }
.crono-modal-body { padding: 18px; flex: 1; overflow-y: auto; max-height: calc(90vh - 100px); }
.crono-modal-body label { display: block; font-size: 11px; color: #666; margin: 8px 0 3px; text-transform: uppercase; }
.crono-modal-body input[type=date], .crono-modal-body input[type=number], .crono-modal-body select {
  width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 13px;
}
.crono-modal-body .crono-info { font-size: 11px; color: #888; margin-top: 3px; }
.crono-modal-body .crono-row { display: flex; gap: 10px; }
.crono-modal-body .crono-row > div { flex: 1; }
.crono-modal-footer { padding: 12px 18px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid #eee; }

/* ===== DRAWER LATERAL (v1.3.0 ETAPA 1) ===== */
.crono-modal-overlay.modo-drawer {
  background: transparent;  /* Sem backdrop escuro */
  justify-content: flex-end;  /* Alinha conteúdo à direita */
  align-items: stretch;  /* Ocupa altura total */
  padding: 0;  /* Remove padding */
  pointer-events: none;  /* Overlay não intercepta cliques — Gantt fica clicável */
}

.crono-modal-overlay.modo-drawer .crono-modal {
  width: 500px;
  min-width: 500px;
  max-width: 40vw;
  max-height: 100vh;
  border-radius: 0;  /* Sem arredondamento em drawer */
  box-shadow: -4px 0 12px rgba(0,0,0,0.08);  /* Sombra só à esquerda */
  transform: translateX(0);
  transition: transform 0.25s ease-out;
  pointer-events: auto;  /* Drawer continua capturando eventos */
}

/* Responsivo: em telas pequenas, drawer ocupa tela cheia */
@media (max-width: 900px) {
  .crono-modal-overlay.modo-drawer .crono-modal {
    width: 100%;
    max-width: 100%;
  }
}

