/* ============================================================
   css/gestao_documentos.css
   Estilos específicos do módulo Gestão de Documentos.
   Só existe porque hover, ::after (linha conectora da timeline) e
   @keyframes (pulso da fase ativa) não dá pra fazer em style inline —
   o resto do módulo (badges de status, cores dinâmicas) continua
   inline, igual o padrão do resto do sistema (GUIA_ESTILOS.md).
   Tokens usados: --bg, --panel, --surface-alt, --line, --text, --muted,
   --green, --danger, --warn, --blue, --purple (global.css).
   ============================================================ */

/* ---------- Sidebar de categorias (aba Documentos, desktop) ---------- */
.gd-cat {
  transition: background var(--transition-fast, .15s), color var(--transition-fast, .15s);
}
.gd-cat:hover {
  background: var(--surface-alt);
  color: var(--green);
}

/* ---------- Botão "+ Novo Documento" ---------- */
.gd-btn-novo {
  width: 100%;
}

/* ---------- Item da lista de documentos ---------- */
.gd-doc-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--transition-fast, .15s);
}
.gd-doc-item:hover { background: var(--surface-alt); }
.gd-doc-item.selected { background: var(--surface-alt); border-left: 3px solid var(--green); padding-left: 11px; }

.gd-doc-type-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--panel2, var(--surface-alt));
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
}

/* ---------- Cartão de escolha Externo/Interno (modal Novo Documento) ---------- */
.gd-tipo-card {
  border: 2px solid var(--line);
  border-radius: var(--radius-md, 12px);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast, .15s), background var(--transition-fast, .15s);
}
.gd-tipo-card:hover {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 6%, transparent);
}

/* ---------- KPIs do Dashboard ---------- */
.gd-kpi-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
@media (min-width: 769px) {
  .gd-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }
}
.gd-kpi-card {
  flex: 1;
  min-width: 130px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 12px);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.gd-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

/* ---------- Timeline de fases (painel de detalhe) ---------- */
.gd-timeline-item {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
}
.gd-timeline-item:last-child { margin-bottom: 0; }
.gd-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 12px;
  top: 30px;
  width: 2px;
  height: calc(100% - 14px);
  background: var(--line);
}
.gd-timeline-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 2px solid var(--line);
  background: var(--panel2, var(--surface-alt));
  color: var(--muted);
  z-index: 1;
}
.gd-timeline-item.done .gd-timeline-dot {
  background: var(--green);
  border-color: var(--green);
  color: #04140a;
}
.gd-timeline-item.active .gd-timeline-dot {
  border-color: var(--warn);
  color: var(--warn);
  animation: gd-pulse 1.6s infinite;
}
.gd-timeline-item.recusado .gd-timeline-dot {
  border-color: var(--danger);
  color: var(--danger);
}
@keyframes gd-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 40%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--warn) 0%, transparent); }
}

.gd-sign-btn {
  margin-top: 8px;
  padding: 6px 12px;
  background: var(--warn);
  color: #1a1400;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity var(--transition-fast, .15s);
}
.gd-sign-btn:hover { opacity: .88; }

/* ---------- Wizard (Novo Documento Interno) ---------- */
.gd-wizard-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.gd-wizard-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background var(--transition-base, .2s);
}
.gd-wizard-step.done { background: var(--green); }

/* ---------- Canvas de assinatura ---------- */
.gd-sign-canvas-wrap {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.gd-sign-canvas-wrap canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
}

/* ---------- Ações do painel de detalhe ---------- */
.gd-action-btn {
  transition: background var(--transition-fast, .15s), color var(--transition-fast, .15s);
}
.gd-action-btn:hover {
  background: var(--surface-alt);
  color: var(--green);
}

/* ---------- Calendário do Dashboard ---------- */
.gd-dash-dia {
  transition: background var(--transition-fast, .15s);
}
.gd-dash-dia[data-dia]:hover {
  background: var(--surface-alt);
}