/* ============================================================
   operador-ui.css — componentes compartilhados das telas do operador
   (DP, Fiscal, Contábil). Os tokens (--brand-pink, --success, --danger,
   --border, etc.) vêm do cockpit-core.js. Aqui ficam só os blocos extras.
   Um único arquivo para todos os fluxos: mexeu aqui, mudou em todos.
   ============================================================ */

/* ===== Bloco verde: "o que foi feito" ===== */
.done-block { margin-top: 4px; background: var(--success-bg, #f0fdf4); border: 1px solid #bbf7d0; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.done-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.done-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--text-primary); line-height: 1.45; }
.done-row i, .done-row svg { width: 17px; height: 17px; color: var(--success); stroke: var(--success); stroke-width: 2.25; flex-shrink: 0; margin-top: 1px; }

/* ===== Linha do tempo de atuação (robô → operador → robô), dentro do bloco verde ===== */
.timeline-atuacao { display: flex; flex-direction: column; }
.ta-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 14px; }
.ta-group { position: relative; }
.ta-head { display: flex; align-items: center; gap: 10px; }
.ta-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ta-dot svg { width: 15px; height: 15px; stroke-width: 2.25; }
.ta-robo .ta-dot { background: #fff; border: 1px solid #bbf7d0; }
.ta-robo .ta-dot svg { color: var(--text-secondary); stroke: var(--text-secondary); }
.ta-operador .ta-dot { background: #fff; border: 1px solid #bbf7d0; }
.ta-operador .ta-dot svg { color: var(--text-secondary); stroke: var(--text-secondary); }
.ta-actor { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.ta-acoes { margin-left: 13px; padding: 9px 0 14px 24px; border-left: 2px solid #bbf7d0; display: flex; flex-direction: column; gap: 10px; }
/* Linha-guia contínua entre macroetapas: só o último segmento da última macro perde a borda */
.apg-macro:last-child .ta-group:last-child .ta-acoes { border-left-color: transparent; padding-bottom: 0; }
.ta-acao { display: flex; gap: 9px; align-items: flex-start; }
.ta-acao > i, .ta-acao > svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; stroke-width: 2.25; }
.ta-ok > i, .ta-ok > svg { color: var(--success); stroke: var(--success); }
.ta-trava > i, .ta-trava > svg { color: var(--danger); stroke: var(--danger); }
.ta-op > i, .ta-op > svg { color: var(--text-secondary); stroke: var(--text-secondary); }
.ta-text { font-size: 13px; color: var(--text-primary); line-height: 1.5; }
.ta-trava .ta-text { font-weight: 600; }
.ta-obs { margin-top: 7px; font-size: 12.5px; color: var(--text-primary); background: #fff; border-left: 2px solid #bbf7d0; border-radius: 0 6px 6px 0; padding: 7px 11px; font-style: italic; line-height: 1.5; }
.ta-anexos { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== Miolo agrupado por macroetapa (robô/operador intercalados) ===== */
/* Corpo da linha de ação: texto + detalhe fino + hora, ao lado do ícone */
.ta-acao-body { flex: 1; min-width: 0; }
.ta-det { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.45; }
.ta-time { font-size: 11.5px; color: var(--text-tertiary); white-space: nowrap; flex-shrink: 0; margin-top: 1px; }
/* Título da macroetapa organiza por cima; a timeline por ator corre dentro dela */
.apg-macro:not(:first-child) { margin-top: 6px; }
.timeline-atuacao .apg-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #15803d; margin: 12px 0 8px; }
.timeline-atuacao .apg-macro:first-child .apg-group { margin-top: 0; }
/* Etapa que gerou divergência (robô travou): card vermelho embutido na timeline */
.ta-acoes .ta-stopped { margin: 1px 0; padding: 10px 12px; }
.ta-acoes .ta-stopped .problem-head { font-size: 13px; font-weight: 600; gap: 8px; }
.ta-acoes .ta-stopped .problem-head i, .ta-acoes .ta-stopped .problem-head svg { width: 16px; height: 16px; }
.ta-acoes .ta-stopped .problem-text { font-size: 12px; margin-top: 5px; line-height: 1.5; }
.ta-acoes .ta-stopped .ap-crosslink { margin-top: 10px; font-size: 12px; padding: 6px 11px; }
/* Comparativo (valor × referência) compacto, dentro do card de divergência da timeline */
.ta-cmp { margin-top: 10px; gap: 8px; }
.ta-cmp .div-cell { padding: 8px 11px; border-radius: 7px; }
.ta-cmp .div-cell-label { font-size: 11px; margin-bottom: 3px; }
.ta-cmp .div-cell-value { font-size: 14px; }
.ta-cmp .div-sep { font-size: 15px; }
/* Botão de cross-link execução ⇄ pendência (dentro do miolo) */
.ap-crosslink { margin-top: 12px; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--brand-blue, #0171e4); background: var(--brand-blue-soft, #eff6ff); border: 1px solid var(--brand-blue, #0171e4); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.ap-crosslink:hover { background: var(--brand-blue, #0171e4); color: #fff; }
.ap-crosslink svg { width: 15px; height: 15px; stroke: currentColor; }
/* "Próximas etapas" (cinza) — usado na jornada do robô (espiada); nas tarefas HITL fica vazio */
.apf-block { margin-top: 18px; }
.apf-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: 6px; }
.apf-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin: 10px 0 3px; opacity: 0.85; }
.apf-row { display: flex; gap: 9px; align-items: flex-start; padding: 4px 0; opacity: 0.7; }
.apf-check { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border); background: #fff; flex-shrink: 0; margin-top: 1px; }
.apf-name { font-size: 12.5px; color: var(--text-tertiary); line-height: 1.3; }
.apf-andamento { font-size: 10px; font-weight: 700; color: var(--brand-blue, #0171e4); margin-left: 6px; text-transform: uppercase; letter-spacing: 0.03em; }

/* ===== Bloco vermelho: "o que deu erro" + evidência ===== */
.problem-block { margin-top: 20px; }
.stopped-card { background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 14px 16px; }
.problem-head { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.problem-head i, .problem-head svg { width: 19px; height: 19px; color: var(--danger); stroke: var(--danger); stroke-width: 2.25; flex-shrink: 0; }
.problem-text { margin-top: 9px; font-size: 14px; color: var(--text-secondary); line-height: 1.65; }
.evidencia-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin: 16px 0 8px; }
.divergencia-box { margin-top: 16px; }
.div-row { display: flex; align-items: stretch; gap: 10px; }
.div-cell { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; }
.div-cell-label { font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 5px; }
.div-cell-value { font-size: 18px; font-weight: 700; color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }
.div-cell-lines { font-size: 13.5px; color: var(--text-primary); line-height: 1.7; font-family: 'JetBrains Mono', monospace; }
.div-sep { display: flex; align-items: center; font-size: 18px; font-weight: 700; color: var(--text-tertiary); }
.div-diff { margin-top: 10px; display: inline-flex; align-items: center; gap: 7px; background: var(--danger-soft); border: 1px solid #fecaca; border-radius: 8px; padding: 8px 13px; font-size: 13.5px; font-weight: 600; color: var(--danger); }
.div-diff svg { width: 16px; height: 16px; color: var(--danger); stroke: var(--danger); flex-shrink: 0; stroke-width: 2.25; }
.seq-caption { font-size: 11.5px; color: var(--text-tertiary); margin-top: 8px; }

/* ===== "O que precisa ser feito" ===== */
.need-box { margin-top: 18px; background: #fff; border: 1px dashed var(--border-strong); border-left: 3px solid var(--brand-pink); border-radius: 10px; padding: 13px 16px; display: flex; align-items: flex-start; gap: 11px; }
.need-box i, .need-box svg { width: 18px; height: 18px; color: var(--brand-pink); stroke: var(--brand-pink); flex-shrink: 0; margin-top: 1px; }
.need-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-pink); margin-bottom: 3px; }
.need-text { font-size: 14px; color: var(--text-primary); font-weight: 500; line-height: 1.5; }

/* ===== Materiais · no GDocs ===== */
.materiais-accordion { margin-top: 18px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.materiais-head { display: flex; align-items: center; gap: 9px; padding: 12px 14px; cursor: pointer; background: var(--surface-subtle); user-select: none; }
.materiais-head:hover { background: #f4f4f5; }
.materiais-head svg { width: 16px; height: 16px; color: var(--text-secondary); stroke: var(--text-secondary); flex-shrink: 0; }
.materiais-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.materiais-count { font-size: 11px; font-weight: 600; color: var(--text-secondary); background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px; }
.materiais-chevron { margin-left: auto; transition: transform 0.2s; color: var(--text-secondary); }
.materiais-accordion.open .materiais-chevron { transform: rotate(180deg); }
.materiais-body { padding: 12px 14px; display: none; flex-wrap: wrap; gap: 8px; }
.materiais-accordion.open .materiais-body { display: flex; }
.material-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px 4px 10px; background: #fff; border: 1px solid var(--border); border-radius: 8px; max-width: 100%; transition: border-color .15s; }
.material-chip:hover { border-color: var(--border-strong); }
.material-chip > svg { width: 15px; height: 15px; color: var(--text-tertiary); stroke: var(--text-tertiary); flex-shrink: 0; }
.material-chip-name { font-size: 12.5px; color: var(--text-primary); white-space: nowrap; }
.material-chip-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 5px; flex-shrink: 0; white-space: nowrap; }
.material-chip-tag.tag-nf { background: #eff6ff; color: #2563eb; }
.material-chip-tag.tag-rel { background: #f5f3ff; color: #7c3aed; }
.material-chip-tag.tag-doc { background: var(--surface-subtle); color: var(--text-secondary); }
.material-chip-tag.tag-err { background: #fef2f2; color: #dc2626; }
.material-chip-actions { display: inline-flex; align-items: center; gap: 1px; margin-left: 2px; padding-left: 6px; border-left: 1px solid var(--border); flex-shrink: 0; }
.material-chip-btn { width: 24px; height: 24px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text-tertiary); cursor: pointer; transition: all .12s; padding: 0; }
.material-chip-btn:hover { background: var(--surface-muted); color: var(--brand-pink); }
.material-chip-btn svg { width: 14px; height: 14px; stroke: currentColor; }

/* O link "Abrir página do cliente" (.client-link) agora é fonte ÚNICA no
   cockpit-core.js (montarLinkCliente + estilo no <style> injetado), pra valer
   em toda tarefa (Hub e Autopilot). Removido daqui pra não haver duplicata. */

/* ===== Card de Resolução — wizard ===== */
#resolucao-card .section-title { margin-bottom: 16px; }
.resolucao-intro { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 18px; }
.choice-q { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; background: #fff; border: 1.5px solid var(--border-strong); border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-primary); cursor: pointer; transition: all .14s; font-family: inherit; }
.choice-btn:hover { border-color: var(--brand-pink); color: var(--brand-pink); }
.choice-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.25; }
.choice-btn.selected { border-color: var(--brand-pink); background: var(--brand-pink-soft); color: var(--brand-pink); }
.answer-label { font-size: 13.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.answer-hint { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; }
.answer-textarea { width: 100%; min-height: 104px; padding: 13px 14px; border: 1px solid var(--border-strong); border-radius: 10px; font-family: inherit; font-size: 13.5px; resize: vertical; outline: none; color: var(--text-primary); }
.answer-textarea:focus { border-color: var(--brand-pink); box-shadow: 0 0 0 3px var(--brand-pink-soft); }
.btn-attach { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-primary); }
.btn-attach:hover { border-color: var(--brand-pink); color: var(--brand-pink); }

/* ===== Esconde o que é específico de "solicitação do cliente" ===== */
#form-tabs, #form-edit-btn, #form-collab-strip, #task-sla-inline, #task-deadline, #attachments-block { display: none !important; }
.decision-card { display: none !important; }
#exec-solicitante-tags, #exec-sla-inline, #exec-deadline { display: none !important; }

/* ===== Processamento → confirmação "tarefa finalizada" ===== */
.proc-confirm { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 16px 10px; gap: 12px; }
.proc-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-subtle); transition: background .3s; }
.proc-icon svg { width: 30px; height: 30px; color: var(--text-secondary); stroke: var(--text-secondary); }
.proc-icon.done { background: var(--success-soft); }
.proc-icon.done svg { color: var(--success); stroke: var(--success); }
.proc-headline { font-size: 19px; font-weight: 700; color: var(--text-primary); }
.proc-sub { font-size: 13.5px; color: var(--text-secondary); margin-top: -4px; }
#proc-btn { margin-top: 12px; }
#proc-btn:disabled, #btn-reprocessar:disabled { opacity: 0.5; cursor: not-allowed; }
.spin { animation: rbspin 1s linear infinite; }
@keyframes rbspin { to { transform: rotate(360deg); } }
