<mxfile host="app.diagrams.net" modified="2026-05-07T00:00:00.000Z" agent="Stoix Cartorio R4 Consolidado" version="22.0.0" type="device">
  <diagram id="01-context-c4" name="01-context-c4">
    <mxGraphModel dx="1800" dy="1300" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1900" pageHeight="1480" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="C4 - Nivel 1 (Contexto) R4: Software Cartorial Stoix" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="1820" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Sistema no centro; pessoas no anel interno (azul-marinho); sistemas externos no anel externo (cinza). R4: KBC fundacional - Tabeliao cura a fonte regulatoria; CGJ-SP/DJE-SP sao referencias consultadas pelo Tabeliao para alimentar a KB." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="1820" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; (1) Software Cartorial Stoix no centro (azul). (2) Pessoas no anel superior (azul-marinho) numeradas 1-4. (3) Sistemas externos no anel inferior (cinza) numerados 5-11. (4) Setas azuis: pessoa usa o sistema; setas cinzas: sistema integra com externo. KBC adiciona fluxo proprio - Tabeliao consulta CGJ-SP/DJE-SP/CNB-SP fora do sistema e sobe documentos para curadoria." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="120" width="1820" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="ring_inner" value="Anel interno - Pessoas que operam o sistema" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F0F4F8;strokeColor=#08427B;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#08427B" vertex="1" parent="1">
          <mxGeometry x="80" y="220" width="1740" height="240" as="geometry"/>
        </mxCell>

        <mxCell id="tabeliao" value="&lt;b&gt;1. Tabeliao&lt;/b&gt;&#10;[Pessoa - Controlador]&#10;&#10;Aprova templates, atos lavrados e versoes da KB Cartorial (KBC). Auth ICP-Brasil A3 via realm dedicado." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#08427B;strokeColor=#073B6F;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="140" y="270" width="380" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="escrevente" value="&lt;b&gt;2. Escrevente&lt;/b&gt;&#10;[Pessoa]&#10;&#10;Executa o ato no dia-a-dia: sobe documentos, valida extracao, gera minuta. Cobranca usa KB vigente." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#08427B;strokeColor=#073B6F;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="570" y="270" width="380" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="adminstoix" value="&lt;b&gt;3. Admin Stoix&lt;/b&gt;&#10;[Pessoa - Operador]&#10;&#10;Onboarding (pulumi up por tenant), support, billing por cartorio, observabilidade. Sem acesso a dados do tenant." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#08427B;strokeColor=#073B6F;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1000" y="270" width="380" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="dpo" value="&lt;b&gt;4. DPO Cartorio&lt;/b&gt;&#10;[Pessoa]&#10;&#10;Encarregado LGPD: exporta dados do tenant (RDS dedicado), atende titulares, recebe alertas de incidente em 48h." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#08427B;strokeColor=#073B6F;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1430" y="270" width="380" height="170" as="geometry"/>
        </mxCell>

        <mxCell id="sistema" value="&lt;b&gt;Software Cartorial Stoix&lt;/b&gt;&#10;[Sistema SaaS web - Single-tenant infra A2]&#10;&#10;Fluxo A (cadastro hermeneutico de templates), Fluxo B (execucao de atos com OCR+LLM), KBC (Knowledge Base Cartorial - Tabeliao cura fonte regulatoria). Por cartorio: 1 RDS PostgreSQL dedicado + 3 buckets S3 dedicados + KMS CMK dedicada + realm Keycloak dedicado. ECS, VPC, ALB, CloudFront, Keycloak compartilhados. KMS exclusivo sa-east-1." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#1168BD;strokeColor=#0E5BA6;fontColor=#ffffff;fontSize=14;align=center;fontStyle=0;arcSize=8;verticalAlign=middle;strokeWidth=3" vertex="1" parent="1">
          <mxGeometry x="450" y="540" width="1000" height="240" as="geometry"/>
        </mxCell>

        <mxCell id="ring_outer" value="Anel externo - Sistemas com os quais o Stoix integra" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F8F8F8;strokeColor=#666;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#444" vertex="1" parent="1">
          <mxGeometry x="40" y="860" width="1820" height="380" as="geometry"/>
        </mxCell>

        <mxCell id="cgjsp" value="&lt;b&gt;5. CGJ-SP / DJE-SP / CNB-SP&lt;/b&gt;&#10;[Fonte regulatoria oficial]&#10;&#10;Tabela emolumentos, NSCGJ-SP, normativos. Tabeliao consulta diretamente e sobe na KBC com vigencia." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;strokeColor=#666;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="60" y="920" width="260" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="textract" value="&lt;b&gt;6. AWS Textract&lt;/b&gt;&#10;[Externo SaaS]&#10;&#10;OCR de documentos das partes (RG, CPF, certidoes) e OCR de PDFs da KBC. sa-east-1." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;strokeColor=#666;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="340" y="920" width="240" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="bedrock" value="&lt;b&gt;7. AWS Bedrock&lt;/b&gt;&#10;[Externo SaaS]&#10;&#10;Sonnet (Fluxo A + extracao KBC), Haiku (Fluxo B + RAG), Titan Embeddings (pgvector). sa-east-1 only. PII-stripping obrigatorio." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;strokeColor=#666;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="600" y="920" width="260" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="email" value="&lt;b&gt;8. AWS SES&lt;/b&gt;&#10;[Externo]&#10;&#10;Notificacoes por tenant, exportacoes LGPD, alertas de incidente em 48h, alertas KBC vigencia." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;strokeColor=#666;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="880" y="920" width="240" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="tsa" value="&lt;b&gt;9. TSA RFC 3161&lt;/b&gt;&#10;[Externo - timestamping]&#10;&#10;Timestamp Authority RFC 3161 (CertiSign/Serasa) carimba Merkle root diario do audit trail por tenant. Tamper evidence fora do AWS." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;strokeColor=#666;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1140" y="920" width="240" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="ots" value="&lt;b&gt;10. OpenTimestamps&lt;/b&gt;&#10;[Externo - timestamping]&#10;&#10;Backup do TSA via Bitcoin blockchain. Confirmacao por hash em cadeia publica." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;strokeColor=#666;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1400" y="920" width="220" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="icpbrasil" value="&lt;b&gt;11. ICP-Brasil PSC&lt;/b&gt;&#10;[Externo]&#10;&#10;Cadeia de confianca de certificados A3. Validado via plugin Keycloak PKCS#11 (compartilhado, ativo em todos realms)." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;strokeColor=#666;fontColor=#ffffff;fontSize=12;align=center;arcSize=10;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1640" y="920" width="200" height="170" as="geometry"/>
        </mxCell>

        <mxCell id="e1" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;entryX=0.15;entryY=0;strokeColor=#08427B;strokeWidth=2.5" edge="1" parent="1" source="tabeliao" target="sistema">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e1_lbl" value="cadastra modelos, aprova KBC, auth ICP-Brasil A3" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="190" y="492" width="320" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="e2" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;entryX=0.4;entryY=0;strokeColor=#08427B;strokeWidth=2.5" edge="1" parent="1" source="escrevente" target="sistema">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e2_lbl" value="executa atos, sobe docs, gera minuta" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="615" y="492" width="320" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="e3" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;entryX=0.6;entryY=0;strokeColor=#08427B;strokeWidth=2.5" edge="1" parent="1" source="adminstoix" target="sistema">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e3_lbl" value="onboarding (pulumi up), billing por tenant, support" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1045" y="492" width="320" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="e4" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;entryX=0.85;entryY=0;strokeColor=#08427B;strokeWidth=2.5" edge="1" parent="1" source="dpo" target="sistema">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e4_lbl" value="exporta dados RDS, recebe alertas 48h" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1480" y="492" width="320" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="e5" style="endArrow=classic;html=1;rounded=0;exitX=0.1;exitY=1;entryX=0.5;entryY=0;strokeColor=#666666;strokeWidth=2;dashed=1" edge="1" parent="1" source="sistema" target="cgjsp">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e5_lbl" value="Tabeliao consulta fora do sistema, sobe na KBC" style="text;html=1;fontSize=11;fontColor=#444444;align=center" vertex="1" parent="1">
          <mxGeometry x="60" y="820" width="280" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="e6" style="endArrow=classic;html=1;rounded=0;exitX=0.25;exitY=1;entryX=0.5;entryY=0;strokeColor=#666666;strokeWidth=2" edge="1" parent="1" source="sistema" target="textract">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e6_lbl" value="OCR docs partes + OCR KBC (OcrClient)" style="text;html=1;fontSize=11;fontColor=#444444;align=center" vertex="1" parent="1">
          <mxGeometry x="335" y="820" width="260" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="e7" style="endArrow=classic;html=1;rounded=0;exitX=0.4;exitY=1;entryX=0.5;entryY=0;strokeColor=#666666;strokeWidth=2" edge="1" parent="1" source="sistema" target="bedrock">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e7_lbl" value="Sonnet/Haiku/Embeddings (LlmClient)" style="text;html=1;fontSize=11;fontColor=#444444;align=center" vertex="1" parent="1">
          <mxGeometry x="595" y="820" width="270" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="e8" style="endArrow=classic;html=1;rounded=0;exitX=0.55;exitY=1;entryX=0.5;entryY=0;strokeColor=#666666;strokeWidth=2" edge="1" parent="1" source="sistema" target="email">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e8_lbl" value="alertas LGPD + alertas KBC vigencia" style="text;html=1;fontSize=11;fontColor=#444444;align=center" vertex="1" parent="1">
          <mxGeometry x="875" y="820" width="250" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="e9" style="endArrow=classic;html=1;rounded=0;exitX=0.7;exitY=1;entryX=0.5;entryY=0;strokeColor=#666666;strokeWidth=2" edge="1" parent="1" source="sistema" target="tsa">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e9_lbl" value="carimba Merkle root por tenant" style="text;html=1;fontSize=11;fontColor=#444444;align=center" vertex="1" parent="1">
          <mxGeometry x="1135" y="820" width="250" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="e10" style="endArrow=classic;html=1;rounded=0;exitX=0.85;exitY=1;entryX=0.5;entryY=0;strokeColor=#666666;strokeWidth=2" edge="1" parent="1" source="sistema" target="ots">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e10_lbl" value="backup hash blockchain" style="text;html=1;fontSize=11;fontColor=#444444;align=center" vertex="1" parent="1">
          <mxGeometry x="1395" y="820" width="230" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="e11" style="endArrow=classic;html=1;rounded=0;exitX=0.95;exitY=1;entryX=0.5;entryY=0;strokeColor=#666666;strokeWidth=2" edge="1" parent="1" source="sistema" target="icpbrasil">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e11_lbl" value="valida cadeia A3 PKCS#11" style="text;html=1;fontSize=11;fontColor=#444444;align=center" vertex="1" parent="1">
          <mxGeometry x="1635" y="820" width="210" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="legBox" value="&lt;b&gt;Legenda R4&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#444;fontSize=12;fontStyle=1;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="40" y="1280" width="1820" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="leg1" value="Pessoa" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#08427B;fontColor=#ffffff;fontSize=11;strokeColor=#073B6F" vertex="1" parent="1">
          <mxGeometry x="100" y="1310" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="leg2" value="Sistema (este)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#1168BD;fontColor=#ffffff;fontSize=11;strokeColor=#0E5BA6" vertex="1" parent="1">
          <mxGeometry x="280" y="1310" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="leg3" value="Sistema externo" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#ffffff;fontSize=11;strokeColor=#666" vertex="1" parent="1">
          <mxGeometry x="460" y="1310" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="leg4" value="Seta azul = pessoa usa o sistema  |  Seta cinza = sistema integra com externo  |  Seta cinza tracejada = consulta humana fora do sistema" style="text;html=1;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="640" y="1310" width="1180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="leg5" value="&lt;b&gt;R4 vs R3:&lt;/b&gt; (1) CGJ-SP/DJE-SP agora sao fonte que o Tabeliao cura via KBC (nao mais sincronizacao automatica). (2) Bedrock adiciona Titan Embeddings para pgvector. (3) Textract usado tambem na ingestao da KBC. (4) TSA RFC 3161 e OpenTimestamps separados (em R3 estavam juntos). (5) Audit por tenant - cada cartorio tem cadeia propria." style="text;html=1;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;fontColor=#444" vertex="1" parent="1">
          <mxGeometry x="100" y="1370" width="1720" height="60" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="02-container-c4" name="02-container-c4">
    <mxGraphModel dx="2200" dy="1500" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="2400" pageHeight="1700" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="C4 - Nivel 2 (Containers) R4: Software Cartorial Stoix" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="2320" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="UI/Edge -&gt; Aplicacao -&gt; Dados (single-tenant infra A2 por cartorio). KBC e novo cidadao de primeira classe; Keycloak compartilhado com 1 realm por tenant; RDS dedicado por tenant substitui Aurora compartilhada." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="2320" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; (1) Usuario entra pelo topo. (2) Camada 1 UI &amp; Edge - CloudFront/WAF/SPA + Keycloak Compartilhado (1 instancia, N realms). (3) Camada 2 Aplicacao - API + Workers + KBC (Upload/Extract/Diff/VectorStore) + abstracoes. (4) Camada 3 Dados - 1 RDS dedicado + 3 buckets dedicados + KMS CMK por tenant. Sistemas externos a direita (cinza). Cores: azul-marinho UI, laranja aplicacao, vermelho dados, cinza externos." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="120" width="2320" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="layer1" value="Camada 1 - UI e Edge (compartilhada entre tenants)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F0F4F8;strokeColor=#08427B;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#08427B" vertex="1" parent="1">
          <mxGeometry x="60" y="220" width="1820" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="&lt;b&gt;Tabeliao / Escrevente / Admin&lt;/b&gt;&lt;br/&gt;[Pessoa]&lt;br/&gt;cartorio.stoix.com.br/{slug}" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#08427B;fontColor=#ffffff;fontSize=12;align=center;verticalAlign=middle;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="100" y="285" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="cdn" value="&lt;b&gt;CloudFront + WAF&lt;/b&gt;&lt;br/&gt;[CDN + Edge - compartilhado]&lt;br/&gt;&lt;br/&gt;TLS 1.3, OWASP Top 10&lt;br/&gt;rate limit, geo-restriction BR" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="430" y="285" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="alb" value="&lt;b&gt;ALB compartilhado&lt;/b&gt;&lt;br/&gt;[Application Load Balancer]&lt;br/&gt;&lt;br/&gt;Roteia por path /{slug} para target group da API; injeta header X-Tenant-Slug." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="760" y="285" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="webapp" value="&lt;b&gt;Web App (SPA)&lt;/b&gt;&lt;br/&gt;[Next.js / React]&lt;br/&gt;&lt;br/&gt;UI dos Fluxos A, B e KBC&lt;br/&gt;painel admin, audit timeline, KBC review/diff" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1090" y="285" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="keycloak" value="&lt;b&gt;Keycloak Compartilhado&lt;/b&gt;&lt;br/&gt;[ECS Fargate, 2 tasks multi-AZ]&lt;br/&gt;&lt;br/&gt;1 instancia, N realms (cartorio-{slug}). Plugin ICP-Brasil A3 PKCS#11 ativo em todos. MFA TOTP. JWT com claims realm + role." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#3334B9;strokeColor=#1F1F8C;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1420" y="285" width="440" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="layer2" value="Camada 2 - Aplicacao (compartilhada entre tenants - selecao por X-Tenant-Slug)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF7E6;strokeColor=#FF9900;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#7A4900" vertex="1" parent="1">
          <mxGeometry x="60" y="470" width="1820" height="540" as="geometry"/>
        </mxCell>

        <mxCell id="api" value="&lt;b&gt;API BFF&lt;/b&gt;&lt;br/&gt;[Node.js Fastify, ECS Fargate]&lt;br/&gt;&lt;br/&gt;Auth via Keycloak JWT (claim realm). TenantResolver mapeia realm-&gt;DB connection pool. OTel SDK." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="100" y="530" width="300" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="absheader" value="Abstracoes (R4)" style="text;html=1;align=center;fontSize=12;fontStyle=1;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="430" y="510" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="ocrclient" value="&lt;b&gt;OcrClient&lt;/b&gt;&lt;br/&gt;[Abstracao TS]&lt;br/&gt;&lt;br/&gt;Provider Textract sa-east-1. Usado por Fluxo B e Extract Worker KBC. CPF DV local Mod 11." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#3C7FC0;fontColor=#000000;fontSize=11;align=center;verticalAlign=middle;dashed=1;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="430" y="535" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="llmclient" value="&lt;b&gt;LlmClient&lt;/b&gt;&lt;br/&gt;[Abstracao TS]&lt;br/&gt;&lt;br/&gt;Provider Bedrock sa-east-1. Sonnet (Fluxo A + KBC extract), Haiku (Fluxo B + RAG), Titan (embeddings). PII-stripping antes." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#3C7FC0;fontColor=#000000;fontSize=11;align=center;verticalAlign=middle;dashed=1;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="430" y="650" width="280" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="workersheader" value="Workers async Fluxos A/B" style="text;html=1;align=center;fontSize=12;fontStyle=1;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="740" y="510" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="workerocr" value="&lt;b&gt;Worker OCR&lt;/b&gt;&lt;br/&gt;[Lambda]&lt;br/&gt;Fluxo B: extrai docs partes via OcrClient." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="740" y="535" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="workerllm" value="&lt;b&gt;Worker LLM&lt;/b&gt;&lt;br/&gt;[Lambda]&lt;br/&gt;Fluxo A (Sonnet sub-agentes), Fluxo B (Haiku + RAG via pgvector)." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="740" y="650" width="280" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="kbcheader" value="KBC - Knowledge Base Cartorial (R4 NOVO)" style="text;html=1;align=center;fontSize=12;fontStyle=1;fontColor=#5C8A3E" vertex="1" parent="1">
          <mxGeometry x="1050" y="510" width="500" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="kbcgroup" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;dashed=1;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1050" y="530" width="500" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="kbcupload" value="&lt;b&gt;KBC Upload Service&lt;/b&gt;&lt;br/&gt;[ECS Fargate / API path]&lt;br/&gt;Tabeliao sobe PDF/DOCX/HTML com vigencia + tipo (emolumento/normativo/modelo). Persiste kb_document." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontColor=#000000;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1060" y="540" width="240" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kbcextract" value="&lt;b&gt;KBC Extract Worker&lt;/b&gt;&lt;br/&gt;[Lambda]&lt;br/&gt;OCR via OcrClient + LLM Sonnet via LlmClient. Estrutura JSON. Gera kb_chunk + embeddings Titan." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontColor=#000000;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1300" y="540" width="240" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kbcdiff" value="&lt;b&gt;KBC Diff Reviewer (UI)&lt;/b&gt;&lt;br/&gt;Tabeliao revisa lado-a-lado PDF original vs JSON extraido. Aprova -&gt; kb_version vigente." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontColor=#000000;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1060" y="650" width="240" height="90" as="geometry"/>
        </mxCell>
        <mxCell id="kbcvector" value="&lt;b&gt;Vector Store&lt;/b&gt;&lt;br/&gt;[pgvector no RDS do tenant]&lt;br/&gt;kb_chunk + embedding (1536d). RAG hibrido: SQL exato + semantico." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontColor=#000000;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1300" y="650" width="240" height="90" as="geometry"/>
        </mxCell>

        <mxCell id="otherwheader" value="Workers periodicos / event-driven" style="text;html=1;align=center;fontSize=12;fontStyle=1;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="100" y="780" width="1450" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="workerbill" value="&lt;b&gt;Worker Billing&lt;/b&gt;&lt;br/&gt;[Lambda + EventBridge]&lt;br/&gt;Apuracao mensal por tenant. Consulta kb_emolumento_estruturado vigente. Snapshot kb_versao_id no billing_event." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="100" y="810" width="320" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="workerts" value="&lt;b&gt;Worker Timestamping&lt;/b&gt;&lt;br/&gt;[Lambda + EventBridge cron]&lt;br/&gt;Por tenant: Merkle root diario do audit_log -&gt; TSA RFC 3161 + OpenTimestamps." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="450" y="810" width="320" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="workerkbcalert" value="&lt;b&gt;Worker KBC Vigencia&lt;/b&gt;&lt;br/&gt;[Lambda + cron diario]&lt;br/&gt;Alerta Tabeliao 30/15/5 dias antes de kb_version vencer. Bloqueia atos economicos se vencido." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontColor=#000000;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="800" y="810" width="320" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="eventbus" value="&lt;b&gt;EventBridge bus&lt;/b&gt;&lt;br/&gt;Eventos de dominio com tag tenant: ato.criado, minuta.gerada, billing.evento, kb_version.aprovada, kb_version.expirando." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F3F8FE;strokeColor=#3C7FC0;fontColor=#1F4E79;fontSize=11;align=center;verticalAlign=middle;dashed=1" vertex="1" parent="1">
          <mxGeometry x="1150" y="810" width="400" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="layer2note" value="Aplicacao stateless: tenant resolvido por X-Tenant-Slug no header (vindo do realm Keycloak no JWT). Connection pool por tenant em memoria do API. Workers recebem tenant_slug em payload de evento." style="text;html=1;fontSize=11;align=center;fontColor=#7A4900;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="100" y="950" width="1700" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="layer3" value="Camada 3 - Dados e seguranca (DEDICADO POR TENANT - silo A2)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFEEEC;strokeColor=#DD344C;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#8B0000" vertex="1" parent="1">
          <mxGeometry x="60" y="1040" width="1820" height="500" as="geometry"/>
        </mxCell>

        <mxCell id="tenantbox" value="Por tenant (1 cartorio = 1 set):" style="text;html=1;align=center;fontSize=12;fontStyle=1;fontColor=#8B0000" vertex="1" parent="1">
          <mxGeometry x="100" y="1080" width="1700" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="rds" value="&lt;b&gt;RDS PostgreSQL&lt;/b&gt;&lt;br/&gt;db.t4g.micro multi-AZ&lt;br/&gt;&lt;br/&gt;1 instancia DEDICADA por tenant. Schema unico app (sem RLS, sem tenant_id). Extensoes: pgvector, pg_audit, pg_stat_statements." style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="100" y="1110" width="320" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="s3uploads" value="&lt;b&gt;S3 cartorio-{slug}-uploads&lt;/b&gt;&lt;br/&gt;[Bucket dedicado]&lt;br/&gt;Documentos das partes (RG, CPF, certidoes). SSE-KMS CMK do tenant." style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="450" y="1110" width="280" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="s3worm" value="&lt;b&gt;S3 cartorio-{slug}-minutas-worm&lt;/b&gt;&lt;br/&gt;[Bucket dedicado + Object Lock]&lt;br/&gt;Matriz por classe: livro_notas perpetuo (Lambda extensao); documento 30y; audit 7y." style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="760" y="1110" width="320" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="s3kb" value="&lt;b&gt;S3 cartorio-{slug}-kb&lt;/b&gt;&lt;br/&gt;[Bucket dedicado - KBC]&lt;br/&gt;Originais subidos pelo Tabeliao (PDF/DOCX/HTML). Versionamento ativado." style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1110" y="1110" width="280" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="kms" value="&lt;b&gt;KMS CMK alias/cartorio-{slug}&lt;/b&gt;&lt;br/&gt;[Customer Master Key - sa-east-1 only]&lt;br/&gt;1 CMK dedicada por tenant. Multi-region keys OFF. Rotacao anual. Cifra RDS, S3 (3 buckets), Secrets do tenant." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DD344C;strokeColor=#B8001F;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1420" y="1110" width="380" height="180" as="geometry"/>
        </mxCell>

        <mxCell id="sharedbox" value="Compartilhado entre tenants:" style="text;html=1;align=center;fontSize=12;fontStyle=1;fontColor=#8B0000" vertex="1" parent="1">
          <mxGeometry x="100" y="1310" width="1700" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="rdsauth" value="&lt;b&gt;RDS Stoix-Auth&lt;/b&gt;&lt;br/&gt;db.t4g.micro multi-AZ&lt;br/&gt;Backing store do Keycloak (compartilhado entre realms - dados de auth sao agnosticos a tenant)." style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#3334B9;strokeColor=#1F1F8C;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="100" y="1340" width="320" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="sqs" value="&lt;b&gt;Filas SQS FIFO&lt;/b&gt;&lt;br/&gt;[Mensageria - compartilhada]&lt;br/&gt;ocr-queue, llm-queue, kbc-extract-queue, billing-queue. tenant_slug no payload. DLQ por etapa." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="450" y="1340" width="320" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="ddb" value="&lt;b&gt;DynamoDB (compartilhado)&lt;/b&gt;&lt;br/&gt;[NoSQL key-value]&lt;br/&gt;audit_log com PK = tenant_slug#timestamp (hash chain por tenant). Idempotency keys. Sessions cache." style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;strokeColor=#3C7FC0;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="800" y="1340" width="320" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="secrets" value="&lt;b&gt;Secrets Manager&lt;/b&gt;&lt;br/&gt;[Cofre - compartilhado]&lt;br/&gt;Credenciais RDS por tenant (rot. 30d), API keys, Keycloak admin. Cifrado por CMK do tenant correspondente." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DD344C;strokeColor=#B8001F;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1150" y="1340" width="320" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="kmsnote" value="Isolamento R4: 1 cartorio = 1 RDS + 3 S3 + 1 CMK + 1 realm Keycloak. Bug em codigo NAO causa vazamento cross-tenant porque infra e fisicamente separada. Compartilhado: ECS, ALB, CloudFront, Keycloak (com realms), DDB (com PK), SQS (com tenant_slug)." style="text;html=1;fontSize=11;align=center;fontColor=#8B0000;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="1500" y="1340" width="380" height="180" as="geometry"/>
        </mxCell>

        <mxCell id="extlayer" value="Sistemas externos" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F8F8F8;strokeColor=#666;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#444" vertex="1" parent="1">
          <mxGeometry x="1900" y="220" width="460" height="1320" as="geometry"/>
        </mxCell>
        <mxCell id="textract" value="&lt;b&gt;AWS Textract (sa-east-1)&lt;/b&gt;&lt;br/&gt;[via OcrClient]&lt;br/&gt;OCR Fluxo B + KBC ingest" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle;strokeColor=#666" vertex="1" parent="1">
          <mxGeometry x="1940" y="290" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="bedrock" value="&lt;b&gt;AWS Bedrock (sa-east-1)&lt;/b&gt;&lt;br/&gt;[via LlmClient]&lt;br/&gt;Sonnet + Haiku + Titan Embeddings" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle;strokeColor=#666" vertex="1" parent="1">
          <mxGeometry x="1940" y="410" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="ses" value="&lt;b&gt;AWS SES&lt;/b&gt;&lt;br/&gt;Notificacoes por tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle;strokeColor=#666" vertex="1" parent="1">
          <mxGeometry x="1940" y="530" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="tsaext" value="&lt;b&gt;TSA RFC 3161 + OpenTimestamps&lt;/b&gt;&lt;br/&gt;Timestamping externo por tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle;strokeColor=#666" vertex="1" parent="1">
          <mxGeometry x="1940" y="650" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="icp" value="&lt;b&gt;ICP-Brasil PSC&lt;/b&gt;&lt;br/&gt;Cadeia A3 - PKCS#11 plugin" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#ffffff;fontSize=11;align=center;verticalAlign=middle;strokeColor=#666" vertex="1" parent="1">
          <mxGeometry x="1940" y="770" width="380" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="a1" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=2;strokeColor=#08427B" edge="1" parent="1" source="user" target="cdn">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a1_lbl" value="1 HTTPS / TLS 1.3" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="385" y="350" width="120" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a2" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=2;strokeColor=#08427B" edge="1" parent="1" source="cdn" target="alb">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a2_lbl" value="2 origin" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="715" y="350" width="80" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a3" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=2;strokeColor=#08427B" edge="1" parent="1" source="alb" target="webapp">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a3_lbl" value="3 path /{slug}" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1045" y="350" width="100" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a4" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=2;strokeColor=#3334B9;dashed=1" edge="1" parent="1" source="webapp" target="keycloak">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a4_lbl" value="4 OIDC realm cartorio-{slug} + ICP-Brasil A3" style="text;html=1;fontSize=11;fontColor=#1F1F8C;align=center" vertex="1" parent="1">
          <mxGeometry x="1375" y="350" width="290" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="a5" style="endArrow=classic;html=1;exitX=0.4;exitY=1;entryX=0.5;entryY=0;strokeWidth=2;strokeColor=#FF9900" edge="1" parent="1" source="webapp" target="api">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a5_lbl" value="5 HTTPS/JSON Bearer JWT" style="text;html=1;fontSize=11;fontColor=#7A4900;align=center" vertex="1" parent="1">
          <mxGeometry x="320" y="490" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="a6" style="endArrow=classic;html=1;exitX=1;exitY=0.3;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#FF9900" edge="1" parent="1" source="api" target="ocrclient">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a6_lbl" value="6 OcrClient" style="text;html=1;fontSize=11;fontColor=#7A4900;align=center" vertex="1" parent="1">
          <mxGeometry x="395" y="566" width="100" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a7" style="endArrow=classic;html=1;exitX=1;exitY=0.7;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#FF9900" edge="1" parent="1" source="api" target="llmclient">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a7_lbl" value="7 LlmClient" style="text;html=1;fontSize=11;fontColor=#7A4900;align=center" vertex="1" parent="1">
          <mxGeometry x="395" y="685" width="100" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="a8" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#3C7FC0" edge="1" parent="1" source="ocrclient" target="workerocr">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a9" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#3C7FC0" edge="1" parent="1" source="llmclient" target="workerllm">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="a10" style="endArrow=classic;html=1;exitX=1;exitY=0.2;entryX=0;entryY=0.4;strokeWidth=1.5;strokeColor=#5C8A3E" edge="1" parent="1" source="api" target="kbcupload">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="900" y="560"/>
              <mxPoint x="900" y="580"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="a10_lbl" value="8 KBC upload Tabeliao" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="800" y="540" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a11" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#5C8A3E" edge="1" parent="1" source="kbcupload" target="kbcextract">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a11_lbl" value="9 enfileira extract" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1295" y="565" width="120" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a12" style="endArrow=classic;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeWidth=1.5;strokeColor=#5C8A3E" edge="1" parent="1" source="kbcextract" target="kbcvector">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a12_lbl" value="10 chunks + embeddings" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1300" y="640" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a13" style="endArrow=classic;html=1;exitX=0;exitY=0.5;entryX=1;entryY=0.5;strokeWidth=1.5;strokeColor=#5C8A3E" edge="1" parent="1" source="kbcdiff" target="kbcextract">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1040" y="580"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="a13_lbl" value="11 Tabeliao aprova versao" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1080" y="630" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="a14" style="endArrow=classic;html=1;exitX=0.3;exitY=1;entryX=0.5;entryY=0;strokeWidth=2;strokeColor=#DD344C" edge="1" parent="1" source="api" target="rds">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a14_lbl" value="12 SQL pool por tenant" style="text;html=1;fontSize=11;fontColor=#8B0000;align=center" vertex="1" parent="1">
          <mxGeometry x="80" y="1010" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a15" style="endArrow=classic;html=1;exitX=0.7;exitY=1;entryX=0.5;entryY=0;strokeWidth=2;strokeColor=#DD344C" edge="1" parent="1" source="api" target="s3uploads">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a15_lbl" value="13 Presigned URL bucket dedicado" style="text;html=1;fontSize=11;fontColor=#8B0000;align=center" vertex="1" parent="1">
          <mxGeometry x="430" y="1010" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a16" style="endArrow=classic;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeWidth=1.5;strokeColor=#DD344C" edge="1" parent="1" source="kbcupload" target="s3kb">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a16_lbl" value="14 grava original KBC" style="text;html=1;fontSize=11;fontColor=#8B0000;align=center" vertex="1" parent="1">
          <mxGeometry x="1080" y="1010" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a17" style="endArrow=classic;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeWidth=1.5;strokeColor=#DD344C;dashed=1" edge="1" parent="1" source="workerllm" target="s3worm">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a17_lbl" value="15 minuta WORM" style="text;html=1;fontSize=11;fontColor=#8B0000;align=center" vertex="1" parent="1">
          <mxGeometry x="800" y="1010" width="160" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="a18" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=2;strokeColor=#FF9900" edge="1" parent="1" source="workerocr" target="textract">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1880" y="585"/>
              <mxPoint x="1880" y="340"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="a18_lbl" value="16 AnalyzeDocument" style="text;html=1;fontSize=11;fontColor=#7A4900;align=center" vertex="1" parent="1">
          <mxGeometry x="1745" y="320" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a19" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=2;strokeColor=#FF9900" edge="1" parent="1" source="workerllm" target="bedrock">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1885" y="700"/>
              <mxPoint x="1885" y="460"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="a19_lbl" value="17 InvokeModel + PII-stripped" style="text;html=1;fontSize=11;fontColor=#7A4900;align=center" vertex="1" parent="1">
          <mxGeometry x="1700" y="440" width="220" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a20" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#666" edge="1" parent="1" source="workerts" target="tsaext">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1890" y="870"/>
              <mxPoint x="1890" y="700"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="a20_lbl" value="18 carimba root por tenant" style="text;html=1;fontSize=11;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="1700" y="680" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a21" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#3334B9;dashed=1" edge="1" parent="1" source="keycloak" target="icp">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="a21_lbl" value="19 valida cadeia A3" style="text;html=1;fontSize=11;fontColor=#1F1F8C;align=center" vertex="1" parent="1">
          <mxGeometry x="1880" y="320" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="a22" style="endArrow=classic;html=1;exitX=0;exitY=1;entryX=0.5;entryY=0;strokeWidth=1.5;strokeColor=#3334B9;dashed=1" edge="1" parent="1" source="keycloak" target="rdsauth">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1420" y="1430"/>
              <mxPoint x="260" y="1430"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="a22_lbl" value="20 RDS Stoix-Auth (compartilhado)" style="text;html=1;fontSize=11;fontColor=#1F1F8C;align=center" vertex="1" parent="1">
          <mxGeometry x="500" y="1410" width="260" height="20" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="03-component-flow-a" name="03-component-flow-a">
    <mxGraphModel dx="1500" dy="1000" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1620" pageHeight="2000" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Fluxo A R4 - Cadastro de Atos com IA Hermeneutica + KBC" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="1540" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Tabeliao escolhe origem (criar do zero ou derivar de modelo na KB) - sub-agentes Sonnet sugerem estrutura - LegalRefAgent consulta pgvector da KBC para citacoes reais - PII-stripping antes de Bedrock - Tabeliao aprova - template fica vigente." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="1540" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; Etapas (1) Origem do template - novo R4: Tabeliao escolhe criar do zero OU derivar de kb_document existente. (2) Captura na API. (3) Sub-agentes Sonnet em paralelo - LegalRefAgent consulta pgvector. (4) PII-stripping antes do LlmClient -&gt; Bedrock. (5) Revisao do Tabeliao &amp; publicacao. Linha tracejada cinza = audit log no DDB do tenant." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="135" width="1540" height="70" as="geometry"/>
        </mxCell>

        <mxCell id="U" value="&lt;b&gt;Tabeliao&lt;/b&gt;&lt;br/&gt;[realm cartorio-{slug}]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#08427B;fontColor=#FFFFFF;strokeColor=#073B6F;fontSize=12;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="80" y="240" width="180" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="ETAOR" value="Etapa 1 (R4) - Origem do template" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#3F5E2A" vertex="1" parent="1">
          <mxGeometry x="320" y="220" width="1240" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="OR1" value="&lt;b&gt;Opcao A: criar do zero&lt;/b&gt;&lt;br/&gt;Tabeliao sobe modelo PDF/DOCX proprio." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;fontColor=#000000;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="350" y="265" width="380" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="OR2" value="&lt;b&gt;Opcao B: derivar da KBC&lt;/b&gt;&lt;br/&gt;Tabeliao escolhe kb_document tipo=modelo_ato vigente. Sistema hidrata draft inicial." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;fontColor=#000000;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="780" y="265" width="380" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="KB" value="&lt;b&gt;KB Cartorial (RDS+pgvector)&lt;/b&gt;&lt;br/&gt;kb_document, kb_version, kb_chunk" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#5C8A3E;fontColor=#FFFFFF;strokeColor=#3F5E2A;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1190" y="265" width="350" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="ETA1" value="Etapa 2 - Captura e parse na API BFF (ECS Fargate)" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#EAF2FB;strokeColor=#5D82A8;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="320" y="370" width="1240" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="UP" value="&lt;b&gt;TemplateUploadController&lt;/b&gt;&lt;br/&gt;valida MIME, gera presigned URL S3 do tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="350" y="420" width="280" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="PA" value="&lt;b&gt;DocumentParserService&lt;/b&gt;&lt;br/&gt;extrai texto PDF/DOCX, normaliza" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="660" y="420" width="280" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="OR" value="&lt;b&gt;HermeneuticOrchestrator&lt;/b&gt;&lt;br/&gt;coordena sub-agentes via SQS (tenant_slug em payload)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="970" y="420" width="280" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="S3T" value="S3 cartorio-{slug}-uploads&lt;br/&gt;(prefix templates/)" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="350" y="510" width="220" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="SQ" value="SQS hermeneutic-queue&lt;br/&gt;(tenant_slug payload)" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1280" y="420" width="240" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="ETA2" value="Etapa 3 - Worker LLM (Lambda) - 5 sub-agentes hermeneuticos em paralelo + cache + RAG KBC" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#FFF8E8;strokeColor=#B68F2C;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#7A5A0E" vertex="1" parent="1">
          <mxGeometry x="320" y="620" width="1240" height="240" as="geometry"/>
        </mxCell>
        <mxCell id="AS" value="&lt;b&gt;StructureAgent&lt;/b&gt;&lt;br/&gt;identifica secoes" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="350" y="670" width="200" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="AC" value="&lt;b&gt;ClauseAgent&lt;/b&gt;&lt;br/&gt;clausulas-tipo" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="670" width="200" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="AP2" value="&lt;b&gt;ParameterAgent&lt;/b&gt;&lt;br/&gt;variaveis e origem" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="810" y="670" width="200" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="AR" value="&lt;b&gt;RuleAgent&lt;/b&gt;&lt;br/&gt;regras de validacao" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1040" y="670" width="200" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="AL" value="&lt;b&gt;LegalRefAgent (R4)&lt;/b&gt;&lt;br/&gt;cita normativos via RAG pgvector da KBC do tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;fontColor=#000000;strokeColor=#5C8A3E;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1270" y="670" width="240" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="PC" value="PromptCache - Anthropic prompt caching (cache reads compartilhado entre sub-agentes)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F3F8FE;fontColor=#000000;strokeColor=#5D82A8;fontSize=11;fontStyle=2;dashed=1" vertex="1" parent="1">
          <mxGeometry x="350" y="760" width="850" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="RAG" value="RAG pgvector - SELECT kb_chunk ORDER BY embedding &amp;lt;-&amp;gt; query LIMIT 8 (KB do tenant)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;fontColor=#3F5E2A;strokeColor=#5C8A3E;fontSize=11;fontStyle=2;dashed=1" vertex="1" parent="1">
          <mxGeometry x="1220" y="760" width="320" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="ETA3" value="Etapa 4 - Sanitizacao obrigatoria + invocacao Bedrock (R4)" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#FCEAEA;strokeColor=#DD344C;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#8B0000" vertex="1" parent="1">
          <mxGeometry x="320" y="900" width="1240" height="200" as="geometry"/>
        </mxCell>
        <mxCell id="PII" value="&lt;b&gt;PII-stripping pre-LLM&lt;/b&gt;&lt;br/&gt;regex CPF/RG/email/telefone -&gt; tokens reversiveis (mapa local em memoria do worker)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;strokeWidth=2;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="360" y="950" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="LLMCLI" value="&lt;b&gt;LlmClient (interface)&lt;/b&gt;&lt;br/&gt;Sonnet preferencial - degrade Haiku 4.5 se Sonnet sa-east-1 indisponivel" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;dashed=1;strokeWidth=2;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="800" y="950" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="BR" value="&lt;b&gt;AWS Bedrock sa-east-1&lt;/b&gt;&lt;br/&gt;Claude Sonnet/Haiku 4.5 + Titan Embeddings" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#FFFFFF;strokeColor=#666666;fontSize=12" vertex="1" parent="1">
          <mxGeometry x="1240" y="950" width="280" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="ETA4" value="Etapa 5 - Revisao do Tabeliao e publicacao do template" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#3F5E2A" vertex="1" parent="1">
          <mxGeometry x="320" y="1160" width="1240" height="280" as="geometry"/>
        </mxCell>
        <mxCell id="RV" value="&lt;b&gt;TemplateReviewService&lt;/b&gt;&lt;br/&gt;lista sugestoes para Tabeliao revisar item-a-item; mostra citacoes da KBC" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="350" y="1210" width="320" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="AP" value="&lt;b&gt;TemplatePublishService&lt;/b&gt;&lt;br/&gt;promove ato_template a vigente" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="730" y="1210" width="320" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="VR" value="&lt;b&gt;TemplateVersionRepo&lt;/b&gt;&lt;br/&gt;versionamento imutavel + FK kb_version_origem" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1110" y="1210" width="320" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="DB" value="RDS PostgreSQL&lt;br/&gt;cartorio-{slug}-prd" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1180" y="1340" width="220" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="AUD" value="DynamoDB audit_log (compartilhado)&lt;br/&gt;PK = tenant_slug#timestamp + hash chain por tenant" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="80" y="1340" width="320" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="e1a" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.3;entryX=0;entryY=0.5" edge="1" parent="1" source="U" target="OR1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e1a_lbl" value="1a opcao A" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="280" y="270" width="80" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e1b" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.7;entryX=0;entryY=0.5" edge="1" parent="1" source="U" target="OR2">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="290" y="305"/>
              <mxPoint x="780" y="295"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e1b_lbl" value="1b opcao B" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="540" y="305" width="80" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="ekb" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;dashed=1;strokeColor=#5C8A3E" edge="1" parent="1" source="OR2" target="KB">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ekb_lbl" value="hidrata draft de kb_version" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1165" y="280" width="240" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e1" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.2;entryY=0" edge="1" parent="1" source="OR1" target="UP">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e1_lbl" value="2 envia modelo PDF/DOCX" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="380" y="380" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e2" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.3;exitY=1;entryX=0.5;entryY=0" edge="1" parent="1" source="UP" target="S3T">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e2_lbl" value="3 grava modelo no bucket do tenant" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="350" y="500" width="240" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e3" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5" edge="1" parent="1" source="UP" target="PA">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e3_lbl" value="4 texto bruto" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="630" y="448" width="80" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e4" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5" edge="1" parent="1" source="PA" target="OR">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e4_lbl" value="5 normalizado" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="940" y="448" width="80" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e5" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5" edge="1" parent="1" source="OR" target="SQ">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e5_lbl" value="6 enfileira jobs" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1250" y="448" width="100" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e6" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#B68F2C" edge="1" parent="1" source="SQ" target="ETA2">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e6_lbl" value="7 entrega aos sub-agentes" style="text;html=1;fontSize=11;fontColor=#7A5A0E;align=center;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1230" y="600" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="eRag" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;dashed=1;strokeColor=#5C8A3E" edge="1" parent="1" source="AL" target="RAG">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="eRag_lbl" value="8 RAG normativos" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1305" y="745" width="160" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e7a" style="endArrow=none;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.2;entryY=0;strokeColor=#5D82A8" edge="1" parent="1" source="AS" target="PII">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e7b" style="endArrow=none;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.4;entryY=0;strokeColor=#5D82A8" edge="1" parent="1" source="AC" target="PII">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e7c" style="endArrow=none;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.6;entryY=0;strokeColor=#5D82A8" edge="1" parent="1" source="AP2" target="PII">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e7d" style="endArrow=none;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.8;entryY=0;strokeColor=#5D82A8" edge="1" parent="1" source="AR" target="PII">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e7e" style="endArrow=classic;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.95;entryY=0;strokeColor=#5D82A8" edge="1" parent="1" source="AL" target="PII">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e7lbl" value="9 sub-agentes -&gt; PII-stripping (sanitizacao obrigatoria)" style="text;html=1;fontSize=11;fontColor=#D79B00;align=center;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="800" y="900" width="380" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e8" style="endArrow=classic;html=1;strokeWidth=2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#D79B00" edge="1" parent="1" source="PII" target="LLMCLI">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e8_lbl" value="10 texto sanitizado" style="text;html=1;fontSize=11;fontColor=#8B0000;align=center" vertex="1" parent="1">
          <mxGeometry x="745" y="990" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e9" style="endArrow=classic;html=1;strokeWidth=2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#666666" edge="1" parent="1" source="LLMCLI" target="BR">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e9_lbl" value="11 InvokeModel" style="text;html=1;fontSize=11;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="1185" y="990" width="120" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="ePc" style="endArrow=classic;html=1;strokeWidth=1.2;dashed=1;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.7;exitY=1;entryX=0.2;entryY=0;strokeColor=#5D82A8" edge="1" parent="1" source="PC" target="LLMCLI">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ePc_lbl" value="cache reads" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="850" y="830" width="100" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e10" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.2;exitY=1;entryX=0.5;entryY=0;strokeColor=#5C8A3E" edge="1" parent="1" source="LLMCLI" target="RV">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="836" y="1130"/>
              <mxPoint x="510" y="1130"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e10_lbl" value="12 persiste sugestoes" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="540" y="1115" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e11" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.1;entryY=0;strokeColor=#5C8A3E" edge="1" parent="1" source="U" target="RV">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="170" y="1180"/>
              <mxPoint x="382" y="1180"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e11_lbl" value="13 revisa item-a-item" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="180" y="1165" width="170" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e12" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#5C8A3E" edge="1" parent="1" source="RV" target="AP">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e12_lbl" value="aprovacao consolidada" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="675" y="1255" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e13" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#5C8A3E" edge="1" parent="1" source="AP" target="VR">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e13_lbl" value="14 versiona &amp; emite evento" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1055" y="1255" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e14" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.6;exitY=1;entryX=0.5;entryY=0;strokeColor=#3C7FC0" edge="1" parent="1" source="VR" target="DB">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e14_lbl" value="persiste no RDS do tenant" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1295" y="1320" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="eaud" style="endArrow=classic;html=1;strokeWidth=1.2;dashed=1;dashPattern=4 4;edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#999999;exitX=0;exitY=1;entryX=0.5;entryY=0" edge="1" parent="1" source="LLMCLI" target="AUD">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="800" y="1120"/>
              <mxPoint x="240" y="1120"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="eaud_lbl" value="audit (tokens, modelo, custo, kb_version_id)" style="text;html=1;fontSize=11;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="80" y="1270" width="320" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="legend" value="&lt;b&gt;Legenda R4&lt;/b&gt;  Azul-marinho: ator humano  Azul claro: API/worker  Verde: KBC  Azul escuro: store/dado  Cinza: servico externo  Amarelo: PII-stripping (R3+)  Tracejado: abstracao ou audit-log/RAG" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#999;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="1500" width="1540" height="40" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="04-component-flow-b" name="04-component-flow-b">
    <mxGraphModel dx="1500" dy="1000" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1700" pageHeight="2200" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Fluxo B R4 - Execucao de Atos com OCR + LLM + KBC vigente" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="1620" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Escrevente sobe documentos das partes - OCR via OcrClient - validacao deterministica - LLM Haiku preenche template + RAG normativo - cobranca consulta kb_emolumento_estruturado vigente - billing_event registra snapshot kb_versao_id+kb_hash." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="1620" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; (1) Escrevente sobe docs partes. (2) OCR via OcrClient (Textract). (3) Validacao deterministica (CPF DV Mod 11, datas, valores). (4) PII-stripping + LLM Haiku via LlmClient com RAG da KBC. (5) Tabeliao revisa minuta. (6) Cobranca - EmolumentoCalcWorker consulta kb_emolumento_estruturado VIGENTE; billing_event grava snapshot kb_versao_id + kb_hash para auditoria. Bloqueio se KBC vencida." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="135" width="1620" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="U" value="&lt;b&gt;Escrevente&lt;/b&gt;&lt;br/&gt;[realm cartorio-{slug}]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#08427B;fontColor=#FFFFFF;strokeColor=#073B6F;fontSize=12;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="80" y="250" width="180" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="T" value="&lt;b&gt;Tabeliao&lt;/b&gt;&lt;br/&gt;[realm cartorio-{slug}]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#08427B;fontColor=#FFFFFF;strokeColor=#073B6F;fontSize=12;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="80" y="350" width="180" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="ETA1" value="Etapa 1 - Captura na API BFF" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#EAF2FB;strokeColor=#5D82A8;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="320" y="240" width="1340" height="200" as="geometry"/>
        </mxCell>
        <mxCell id="ATO" value="&lt;b&gt;AtoInstanceController&lt;/b&gt;&lt;br/&gt;cria ato_instance vinculado a ato_template vigente" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="350" y="290" width="280" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="UPL" value="&lt;b&gt;DocumentUploadService&lt;/b&gt;&lt;br/&gt;presigned URL S3 cartorio-{slug}-uploads" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="660" y="290" width="280" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="OCRQ" value="SQS ocr-queue&lt;br/&gt;(tenant_slug payload)" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="970" y="290" width="220" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="S3UP" value="S3 cartorio-{slug}-uploads" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1230" y="290" width="280" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="ETA2" value="Etapa 2 - Worker OCR (Lambda) + validacao deterministica" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#FFF8E8;strokeColor=#B68F2C;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#7A5A0E" vertex="1" parent="1">
          <mxGeometry x="320" y="470" width="1340" height="200" as="geometry"/>
        </mxCell>
        <mxCell id="OCRC" value="&lt;b&gt;OcrClient (interface)&lt;/b&gt;&lt;br/&gt;Provider Textract sa-east-1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;dashed=1;strokeWidth=2;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="350" y="525" width="260" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="TX" value="&lt;b&gt;AWS Textract sa-east-1&lt;/b&gt;&lt;br/&gt;AnalyzeDocument FORMS+TABLES" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#FFFFFF;strokeColor=#666666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="640" y="525" width="260" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="VAL" value="&lt;b&gt;DeterministicValidator&lt;/b&gt;&lt;br/&gt;CPF DV Mod 11 local, datas (parser BR), valores monetarios, confidence threshold" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="930" y="525" width="320" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="LLMQ" value="SQS llm-queue&lt;br/&gt;(tenant_slug payload)" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1280" y="525" width="240" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="VALnote" value="Confidence baixo - retorna ao escrevente para revisao manual antes de prosseguir" style="text;html=1;fontSize=11;fontColor=#7A5A0E;fontStyle=2;align=center" vertex="1" parent="1">
          <mxGeometry x="930" y="615" width="320" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="ETA3" value="Etapa 3 - Worker LLM Fluxo B (Haiku + RAG KBC) + PII-stripping" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#FCEAEA;strokeColor=#DD344C;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#8B0000" vertex="1" parent="1">
          <mxGeometry x="320" y="700" width="1340" height="240" as="geometry"/>
        </mxCell>
        <mxCell id="PII" value="&lt;b&gt;PII-stripping pre-LLM&lt;/b&gt;&lt;br/&gt;CPF/RG/email/telefone -&gt; tokens reversiveis (mapa local em memoria)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;strokeWidth=2;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="350" y="755" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="LLMCLI" value="&lt;b&gt;LlmClient (interface)&lt;/b&gt;&lt;br/&gt;Haiku 4.5 + RAG via pgvector da KBC do tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;dashed=1;strokeWidth=2;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="660" y="755" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="BR" value="&lt;b&gt;AWS Bedrock sa-east-1&lt;/b&gt;&lt;br/&gt;Haiku 4.5 + Titan Embeddings" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#FFFFFF;strokeColor=#666666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="970" y="755" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="MIN" value="&lt;b&gt;MinutaGenerator&lt;/b&gt;&lt;br/&gt;preenche template com tokens DETOKENIZED + revoga em S3 worm" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1280" y="755" width="320" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="RAGB" value="RAG hibrido pgvector - SELECT kb_chunk para citacoes normativas (CNB-SP, NSCGJ Tomo II)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;fontColor=#3F5E2A;strokeColor=#5C8A3E;fontSize=11;fontStyle=2;dashed=1" vertex="1" parent="1">
          <mxGeometry x="350" y="870" width="900" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="ETA4" value="Etapa 4 - Revisao do Tabeliao e gravacao final" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#3F5E2A" vertex="1" parent="1">
          <mxGeometry x="320" y="970" width="1340" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="REV" value="&lt;b&gt;MinutaReviewService&lt;/b&gt;&lt;br/&gt;Tabeliao revisa diff entre template e minuta preenchida + citacoes" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="350" y="1020" width="320" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="LAV" value="&lt;b&gt;AtoLavraturaService&lt;/b&gt;&lt;br/&gt;Tabeliao assina ICP-Brasil A3 -&gt; ato lavrado, gera evento ato.lavrado" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="1020" width="320" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="WORM" value="S3 cartorio-{slug}-minutas-worm&lt;br/&gt;Object Lock: livro_notas perpetuo (Lambda extensao)" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1050" y="1020" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="DBR" value="RDS PostgreSQL&lt;br/&gt;cartorio-{slug}-prd&lt;br/&gt;ato_instance, documento" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1360" y="1020" width="240" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="ETA5" value="Etapa 5 (R4 critica) - Cobranca consulta KBC vigente + snapshot no billing_event" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#FFF7E6;strokeColor=#FF9900;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#7A4900" vertex="1" parent="1">
          <mxGeometry x="320" y="1220" width="1340" height="280" as="geometry"/>
        </mxCell>
        <mxCell id="EVB" value="&lt;b&gt;EventBridge bus&lt;/b&gt;&lt;br/&gt;ato.lavrado dispara EmolumentoCalcWorker" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F3F8FE;fontColor=#1F4E79;strokeColor=#3C7FC0;fontSize=11;dashed=1" vertex="1" parent="1">
          <mxGeometry x="350" y="1270" width="280" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="CALC" value="&lt;b&gt;EmolumentoCalcWorker (R4)&lt;/b&gt;&lt;br/&gt;[Lambda]&lt;br/&gt;1) busca kb_emolumento_estruturado.versao_vigente_em(data_lavratura). 2) calcula emolumento + ISS + Stoix 3,1%. 3) gera billing_event com snapshot." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;strokeWidth=2;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="660" y="1270" width="380" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="KBE" value="&lt;b&gt;kb_emolumento_estruturado&lt;/b&gt;&lt;br/&gt;[Tabela RDS - vigente aprovada pelo Tabeliao]&lt;br/&gt;FK kb_version_id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;fontColor=#000000;strokeColor=#5C8A3E;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1080" y="1270" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="BLOCK" value="&lt;b&gt;Bloqueio R4&lt;/b&gt;&lt;br/&gt;Se kb_version vencida, bloqueia billing e alerta Tabeliao - ato fica em estado pending_kbc_renovation" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;fontColor=#8B0000;strokeColor=#DD344C;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1400" y="1270" width="240" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="BE" value="&lt;b&gt;billing_event (R4)&lt;/b&gt;&lt;br/&gt;{ ato_id, valor_emolumento, valor_iss, valor_stoix, kb_versao_id, kb_hash, data_lavratura }" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="660" y="1410" width="700" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="AUD" value="DynamoDB audit_log (compartilhado)&lt;br/&gt;PK = tenant_slug#timestamp + hash chain" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="80" y="1410" width="320" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="e1" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5" edge="1" parent="1" source="U" target="ATO">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e1_lbl" value="1 inicia ato" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="265" y="270" width="80" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e2" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5" edge="1" parent="1" source="ATO" target="UPL">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e2_lbl" value="2 sobe docs partes" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="635" y="270" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e3" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0" edge="1" parent="1" source="UPL" target="S3UP">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="800" y="380"/>
              <mxPoint x="1370" y="380"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e3_lbl" value="3 grava no bucket dedicado" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="940" y="395" width="220" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e4" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5" edge="1" parent="1" source="UPL" target="OCRQ">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e4_lbl" value="4 enfileira OCR" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="940" y="270" width="120" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e5" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.3;exitY=1;entryX=0.5;entryY=0;strokeColor=#B68F2C" edge="1" parent="1" source="OCRQ" target="OCRC">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e5_lbl" value="5 worker consome" style="text;html=1;fontSize=11;fontColor=#7A5A0E;align=center" vertex="1" parent="1">
          <mxGeometry x="660" y="490" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e6" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#666" edge="1" parent="1" source="OCRC" target="TX">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e6_lbl" value="6 AnalyzeDocument" style="text;html=1;fontSize=11;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="615" y="555" width="140" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e7" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#D79B00" edge="1" parent="1" source="TX" target="VAL">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e7_lbl" value="7 fields + confidence" style="text;html=1;fontSize=11;fontColor=#7A5A0E;align=center" vertex="1" parent="1">
          <mxGeometry x="900" y="555" width="140" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e8" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#D79B00" edge="1" parent="1" source="VAL" target="LLMQ">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e8_lbl" value="8 valida -&gt; enfileira LLM" style="text;html=1;fontSize=11;fontColor=#7A5A0E;align=center" vertex="1" parent="1">
          <mxGeometry x="1255" y="555" width="180" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e9" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#DD344C" edge="1" parent="1" source="LLMQ" target="PII">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1400" y="650"/>
              <mxPoint x="490" y="700"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e9_lbl" value="9 Worker LLM consome -&gt; PII-stripping" style="text;html=1;fontSize=11;fontColor=#8B0000;align=center;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="690" y="680" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e10" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#D79B00" edge="1" parent="1" source="PII" target="LLMCLI">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e10_lbl" value="10 sanitizado" style="text;html=1;fontSize=11;fontColor=#7A5A0E;align=center" vertex="1" parent="1">
          <mxGeometry x="635" y="785" width="120" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e11" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#666" edge="1" parent="1" source="LLMCLI" target="BR">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e11_lbl" value="11 InvokeModel Haiku + RAG" style="text;html=1;fontSize=11;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="940" y="785" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e12" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#5D82A8" edge="1" parent="1" source="BR" target="MIN">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e12_lbl" value="12 minuta texto" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1245" y="785" width="120" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e13" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#5C8A3E" edge="1" parent="1" source="MIN" target="REV">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1440" y="940"/>
              <mxPoint x="510" y="990"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e13_lbl" value="13 minuta para revisao" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="800" y="950" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e14" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#08427B" edge="1" parent="1" source="T" target="REV">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e14_lbl" value="14 revisa" style="text;html=1;fontSize=11;fontColor=#08427B;align=center" vertex="1" parent="1">
          <mxGeometry x="265" y="370" width="80" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e15" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#5C8A3E" edge="1" parent="1" source="REV" target="LAV">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e15_lbl" value="15 aprova" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="675" y="1055" width="100" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e16" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#5C8A3E" edge="1" parent="1" source="LAV" target="WORM">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e16_lbl" value="16 grava WORM (livro_notas perpetuo)" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1025" y="1055" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e17" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#3C7FC0" edge="1" parent="1" source="WORM" target="DBR">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e17_lbl" value="17 grava metadados" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1335" y="1055" width="160" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e18" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#FF9900" edge="1" parent="1" source="LAV" target="EVB">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="860" y="1180"/>
              <mxPoint x="490" y="1240"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e18_lbl" value="18 emite ato.lavrado" style="text;html=1;fontSize=11;fontColor=#7A4900;align=center" vertex="1" parent="1">
          <mxGeometry x="630" y="1190" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e19" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#FF9900" edge="1" parent="1" source="EVB" target="CALC">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e19_lbl" value="19 dispara worker" style="text;html=1;fontSize=11;fontColor=#7A4900;align=center" vertex="1" parent="1">
          <mxGeometry x="635" y="1300" width="140" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e20" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#5C8A3E" edge="1" parent="1" source="CALC" target="KBE">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e20_lbl" value="20 SELECT vigente" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1045" y="1300" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e21" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#DD344C;dashed=1" edge="1" parent="1" source="KBE" target="BLOCK">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e21_lbl" value="vencida?" style="text;html=1;fontSize=11;fontColor=#8B0000;align=center" vertex="1" parent="1">
          <mxGeometry x="1365" y="1300" width="100" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e22" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#FF9900" edge="1" parent="1" source="CALC" target="BE">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e22_lbl" value="21 grava billing_event com snapshot kb_versao_id + kb_hash" style="text;html=1;fontSize=11;fontColor=#7A4900;align=center;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="700" y="1390" width="380" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="eaud" style="endArrow=classic;html=1;strokeWidth=1.2;dashed=1;dashPattern=4 4;edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#999999;exitX=0;exitY=0.5;entryX=1;entryY=0.5" edge="1" parent="1" source="BE" target="AUD">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="eaud_lbl" value="audit (ato_id, kb_versao_id, valor)" style="text;html=1;fontSize=11;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="410" y="1430" width="240" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="legend" value="&lt;b&gt;Legenda R4&lt;/b&gt;  Azul-marinho: ator humano  Azul claro: API/worker  Verde: KBC  Azul escuro: store/dado  Cinza: servico externo  Amarelo: PII-stripping/validacao deterministica  Laranja: cobranca  Vermelho: bloqueio  Tracejado: abstracao ou audit-log/RAG" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#999;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="1540" width="1620" height="50" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="05-component-kbc" name="05-component-kbc">
    <mxGraphModel dx="1500" dy="1000" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1700" pageHeight="2000" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Fluxo KBC R4 - Knowledge Base Cartorial (NOVO)" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="1620" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Tabeliao (Controlador) cura a fonte regulatoria - Stoix (Operador) prove plataforma + extracao com IA. Sem KBC vigente nao ha cobranca: e o substrato de defesa material em qualquer auditoria." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="1620" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; (1) Tabeliao consulta CGJ-SP/DJE-SP fora do sistema. (2) Sobe PDF/DOCX/HTML com metadados de vigencia. (3) Extract Worker faz OCR + LLM Sonnet estrutura JSON. (4) Diff Reviewer mostra lado-a-lado original vs JSON. (5) Tabeliao APROVA -&gt; kb_version vira vigente. (6) Indexacao em pgvector + tabelas estruturadas. (7) Consumido por Fluxo A (RAG hermeneutico) e Fluxo B (cobranca + RAG). (8) Worker vigencia alerta 30/15/5 dias antes; bloqueia atos economicos se vencido." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="135" width="1620" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="T" value="&lt;b&gt;Tabeliao (Controlador)&lt;/b&gt;&lt;br/&gt;[realm cartorio-{slug}]&lt;br/&gt;auth ICP-Brasil A3" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#08427B;fontColor=#FFFFFF;strokeColor=#073B6F;fontSize=12;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="80" y="270" width="220" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="EXT" value="&lt;b&gt;Fontes externas&lt;/b&gt;&lt;br/&gt;CGJ-SP, DJE-SP, CNB-SP, doutrina, NSCGJ Tomo II" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;strokeColor=#666;fontColor=#FFFFFF;fontSize=11;align=center" vertex="1" parent="1">
          <mxGeometry x="80" y="400" width="220" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="ETA1" value="Etapa 1 - Upload com metadados (Tabeliao cura)" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#3F5E2A" vertex="1" parent="1">
          <mxGeometry x="360" y="260" width="1300" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="UPL" value="&lt;b&gt;KBC Upload Service&lt;/b&gt;&lt;br/&gt;[ECS Fargate / API path]&lt;br/&gt;Recebe PDF/DOCX/HTML + metadados: tipo (emolumento/normativo/modelo_ato/procedimento/referencia_juridica), vigencia (data_inicio + data_fim), origem (oficial_cgj/cnb_sp/doutrina/interno), tags." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;fontColor=#000000;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="390" y="305" width="380" height="160" as="geometry"/>
        </mxCell>
        <mxCell id="S3KB" value="&lt;b&gt;S3 cartorio-{slug}-kb&lt;/b&gt;&lt;br/&gt;[bucket dedicado]&lt;br/&gt;Originais com versionamento" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="820" y="305" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="KBD" value="&lt;b&gt;kb_document&lt;/b&gt;&lt;br/&gt;[Tabela RDS]&lt;br/&gt;PK uuid, s3_key, tipo, origem, data_inicio, data_fim, status (uploaded/extracting/reviewing/vigente/expirada/superseded)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1150" y="305" width="480" height="160" as="geometry"/>
        </mxCell>

        <mxCell id="ETA2" value="Etapa 2 - Extract Worker (OCR + LLM Sonnet) -&gt; JSON estruturado + chunks + embeddings" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#FFF8E8;strokeColor=#B68F2C;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#7A5A0E" vertex="1" parent="1">
          <mxGeometry x="360" y="510" width="1300" height="240" as="geometry"/>
        </mxCell>
        <mxCell id="KBQ" value="SQS kbc-extract-queue&lt;br/&gt;(tenant_slug + kb_document_id)" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="390" y="560" width="240" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="EXW" value="&lt;b&gt;KBC Extract Worker&lt;/b&gt;&lt;br/&gt;[Lambda]&lt;br/&gt;1) baixa do S3 KB. 2) OCR via OcrClient (Textract). 3) LLM Sonnet via LlmClient estrutura em JSON tipado por kb_document.tipo. 4) chunking (~1500 tokens) + Titan Embeddings 1536d. 5) cria kb_version pendente." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;fontColor=#000000;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="660" y="560" width="380" height="160" as="geometry"/>
        </mxCell>
        <mxCell id="OCRC" value="&lt;b&gt;OcrClient&lt;/b&gt;&lt;br/&gt;Textract sa-east-1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;dashed=1;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1080" y="560" width="240" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="LLMC" value="&lt;b&gt;LlmClient&lt;/b&gt;&lt;br/&gt;Bedrock Sonnet + Titan Embeddings" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;dashed=1;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1340" y="560" width="280" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="BR" value="&lt;b&gt;AWS Bedrock + Textract sa-east-1&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#FFFFFF;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1080" y="650" width="540" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="ETA3" value="Etapa 3 - Diff Reviewer (UI Tabeliao) - aprovacao humana obrigatoria" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#EAF2FB;strokeColor=#5D82A8;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="360" y="780" width="1300" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="DIFF" value="&lt;b&gt;KBC Diff Reviewer (UI)&lt;/b&gt;&lt;br/&gt;[Next.js + react-pdf]&lt;br/&gt;Lado-a-lado: PDF original (esquerda) vs JSON extraido editavel (direita). Highlight de campos com baixa confidence. Tabeliao corrige inline e adiciona observacoes." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="390" y="830" width="500" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="APR" value="&lt;b&gt;KBC Approval Service&lt;/b&gt;&lt;br/&gt;Tabeliao assina aprovacao (ICP-Brasil A3 opcional). Promove kb_version para vigente. Marca kb_version anterior do mesmo kb_document como superseded." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="920" y="830" width="320" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="EVKB" value="EventBridge: kb_version.aprovada com tenant + kb_version_id + kb_hash" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F3F8FE;fontColor=#1F4E79;strokeColor=#3C7FC0;fontSize=11;dashed=1" vertex="1" parent="1">
          <mxGeometry x="1270" y="830" width="360" height="140" as="geometry"/>
        </mxCell>

        <mxCell id="ETA4" value="Etapa 4 - Indexacao no RDS do tenant (pgvector + tabelas estruturadas)" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#FFEEEC;strokeColor=#DD344C;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#8B0000" vertex="1" parent="1">
          <mxGeometry x="360" y="1030" width="1300" height="240" as="geometry"/>
        </mxCell>
        <mxCell id="KBV" value="&lt;b&gt;kb_version&lt;/b&gt;&lt;br/&gt;PK uuid, FK kb_document_id, status (vigente/superseded/expirada), data_aprovacao, aprovado_por, kb_hash" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="390" y="1080" width="280" height="160" as="geometry"/>
        </mxCell>
        <mxCell id="KBC" value="&lt;b&gt;kb_chunk + embedding&lt;/b&gt;&lt;br/&gt;[pgvector]&lt;br/&gt;FK kb_version_id, ordem, texto, embedding vector(1536). Index ivfflat para RAG." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="1080" width="320" height="160" as="geometry"/>
        </mxCell>
        <mxCell id="KBE" value="&lt;b&gt;kb_emolumento_estruturado&lt;/b&gt;&lt;br/&gt;FK kb_version_id, codigo_ato, faixa_valor, emolumento_base, fundo_estatal, tarifa_FCDP, ISS_Sao_Paulo. Consulta SQL exata pelo Fluxo B." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;fontColor=#000000;strokeColor=#5C8A3E;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1050" y="1080" width="280" height="160" as="geometry"/>
        </mxCell>
        <mxCell id="RDS" value="RDS PostgreSQL&lt;br/&gt;cartorio-{slug}-prd&lt;br/&gt;extensoes: pgvector, pg_audit" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1370" y="1080" width="260" height="160" as="geometry"/>
        </mxCell>

        <mxCell id="ETA5" value="Etapa 5 - Consumo por Fluxo A (RAG hermeneutico) e Fluxo B (cobranca + RAG)" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#FFF7E6;strokeColor=#FF9900;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#7A4900" vertex="1" parent="1">
          <mxGeometry x="360" y="1300" width="1300" height="200" as="geometry"/>
        </mxCell>
        <mxCell id="FLOWA" value="&lt;b&gt;Fluxo A LegalRefAgent&lt;/b&gt;&lt;br/&gt;RAG via SELECT kb_chunk ORDER BY embedding &amp;lt;-&amp;gt; query LIMIT 8 (KBC tipo=normativo/referencia)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="390" y="1340" width="380" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="FLOWB1" value="&lt;b&gt;Fluxo B EmolumentoCalcWorker&lt;/b&gt;&lt;br/&gt;SELECT kb_emolumento_estruturado WHERE kb_version_id = (SELECT id FROM kb_version WHERE status='vigente' AND data_lavratura BETWEEN data_inicio AND COALESCE(data_fim,now()))" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="800" y="1340" width="440" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="FLOWB2" value="&lt;b&gt;Fluxo B Worker LLM&lt;/b&gt;&lt;br/&gt;RAG via pgvector para citacoes na minuta" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1270" y="1340" width="360" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="ETA6" value="Etapa 6 - Worker KBC Vigencia (cron diario) - alertas + bloqueio" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=#FCEAEA;strokeColor=#DD344C;strokeWidth=2;verticalAlign=top;align=left;fontStyle=1;fontSize=13;spacingLeft=14;spacingTop=10;fontColor=#8B0000" vertex="1" parent="1">
          <mxGeometry x="360" y="1530" width="1300" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="VIG" value="&lt;b&gt;Worker KBC Vigencia&lt;/b&gt;&lt;br/&gt;[Lambda + EventBridge cron 06:00 UTC-3]&lt;br/&gt;Para cada tenant: scan kb_version status=vigente. Se data_fim - now() &amp;lt;= 30/15/5 dias -&gt; SES alerta Tabeliao. Se data_fim &amp;lt; now() -&gt; marca expirada e bloqueia atos economicos." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;strokeColor=#DD344C;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="390" y="1580" width="500" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="SES" value="&lt;b&gt;AWS SES&lt;/b&gt;&lt;br/&gt;email Tabeliao com link para upload da nova versao" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;fontColor=#FFFFFF;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="920" y="1580" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="LOCK" value="&lt;b&gt;Bloqueio nivel app&lt;/b&gt;&lt;br/&gt;ato_template.requires_kbc_vigente=true bloqueia novos atos economicos. Painel mostra aviso vermelho." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;fontColor=#8B0000;strokeColor=#DD344C;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1230" y="1580" width="400" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="AUD" value="DynamoDB audit_log&lt;br/&gt;PK = tenant_slug#timestamp&lt;br/&gt;Cada upload, extract, aprovacao, expiracao gera entry com kb_version_id" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="80" y="1580" width="240" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="e0" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;dashed=1;strokeColor=#666" edge="1" parent="1" source="T" target="EXT">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e0_lbl" value="0 consulta fora do sistema" style="text;html=1;fontSize=11;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="65" y="380" width="240" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e1" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#5C8A3E" edge="1" parent="1" source="T" target="UPL">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e1_lbl" value="1 sobe PDF/DOCX/HTML + metadados" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="305" y="305" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e2" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.3;entryX=0;entryY=0.5;strokeColor=#3C7FC0" edge="1" parent="1" source="UPL" target="S3KB">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e2_lbl" value="2 grava original" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="775" y="335" width="120" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e3" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.7;entryX=0;entryY=0.5;strokeColor=#5D82A8" edge="1" parent="1" source="UPL" target="KBD">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="800" y="420"/>
              <mxPoint x="800" y="385"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e3_lbl" value="3 cria kb_document" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1110" y="370" width="160" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e4" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#B68F2C" edge="1" parent="1" source="UPL" target="KBQ">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e4_lbl" value="4 enfileira extract" style="text;html=1;fontSize=11;fontColor=#7A5A0E;align=center" vertex="1" parent="1">
          <mxGeometry x="430" y="490" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e5" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#5C8A3E" edge="1" parent="1" source="KBQ" target="EXW">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e5_lbl" value="5 worker consome" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="630" y="580" width="140" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e6" style="endArrow=classic;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.4;entryX=0;entryY=0.5;dashed=1;strokeColor=#5D82A8" edge="1" parent="1" source="EXW" target="OCRC">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e6_lbl" value="6a OCR" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1045" y="585" width="60" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e7" style="endArrow=classic;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.6;entryX=0;entryY=0.5;dashed=1;strokeColor=#5D82A8" edge="1" parent="1" source="EXW" target="LLMC">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1325" y="655"/>
              <mxPoint x="1325" y="595"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e7_lbl" value="6b extract + embeddings" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1335" y="615" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e8" style="endArrow=classic;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#666" edge="1" parent="1" source="OCRC" target="BR">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e9" style="endArrow=classic;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#666" edge="1" parent="1" source="LLMC" target="BR">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="e10" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.3;exitY=1;entryX=0.5;entryY=0;strokeColor=#5C8A3E" edge="1" parent="1" source="EXW" target="DIFF">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="775" y="755"/>
              <mxPoint x="640" y="800"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e10_lbl" value="7 kb_version pendente + JSON" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="595" y="755" width="240" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e11" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0;exitY=0.5;entryX=0.2;entryY=0;strokeColor=#08427B" edge="1" parent="1" source="DIFF" target="T">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="200" y="900"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e11_lbl" value="8 Tabeliao revisa diff" style="text;html=1;fontSize=11;fontColor=#08427B;align=center" vertex="1" parent="1">
          <mxGeometry x="60" y="500" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e12" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#5C8A3E" edge="1" parent="1" source="DIFF" target="APR">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e12_lbl" value="9 aprova versao" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="895" y="880" width="140" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e13" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#FF9900" edge="1" parent="1" source="APR" target="EVKB">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e13_lbl" value="10 emite evento" style="text;html=1;fontSize=11;fontColor=#7A4900;align=center" vertex="1" parent="1">
          <mxGeometry x="1245" y="880" width="120" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e14a" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.3;exitY=1;entryX=0.5;entryY=0;strokeColor=#5D82A8" edge="1" parent="1" source="APR" target="KBV">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1015" y="1010"/>
              <mxPoint x="530" y="1050"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e14a_lbl" value="11a marca vigente" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="380" y="1020" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e14b" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#5D82A8" edge="1" parent="1" source="APR" target="KBC">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e14b_lbl" value="11b indexa chunks + embeddings" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="800" y="1020" width="240" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="e14c" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.7;exitY=1;entryX=0.5;entryY=0;strokeColor=#5C8A3E" edge="1" parent="1" source="APR" target="KBE">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e14c_lbl" value="11c upserta emolumentos" style="text;html=1;fontSize=11;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1080" y="1020" width="220" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="e15a" style="endArrow=classic;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#3C7FC0" edge="1" parent="1" source="KBV" target="RDS">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="530" y="1260"/>
              <mxPoint x="1500" y="1260"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e15b" style="endArrow=classic;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#3C7FC0" edge="1" parent="1" source="KBC" target="RDS">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="860" y="1260"/>
              <mxPoint x="1500" y="1260"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e15c" style="endArrow=classic;html=1;strokeWidth=1.2;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeColor=#3C7FC0" edge="1" parent="1" source="KBE" target="RDS">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1190" y="1260"/>
              <mxPoint x="1500" y="1260"/>
            </Array>
          </mxGeometry>
        </mxCell>

        <mxCell id="eFA" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.3;exitY=0;entryX=0.5;entryY=1;strokeColor=#D79B00;dashed=1" edge="1" parent="1" source="FLOWA" target="KBC">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="eFA_lbl" value="12 RAG hermeneutico" style="text;html=1;fontSize=11;fontColor=#7A5A0E;align=center" vertex="1" parent="1">
          <mxGeometry x="380" y="1280" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="eFB1" style="endArrow=classic;html=1;strokeWidth=1.8;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=0;entryX=0.5;entryY=1;strokeColor=#D79B00" edge="1" parent="1" source="FLOWB1" target="KBE">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="eFB1_lbl" value="13 cobranca consulta vigente" style="text;html=1;fontSize=11;fontColor=#7A5A0E;align=center;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="1280" width="240" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="eFB2" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=0;entryX=0.5;entryY=1;strokeColor=#D79B00;dashed=1" edge="1" parent="1" source="FLOWB2" target="KBC">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1450" y="1280"/>
              <mxPoint x="860" y="1280"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="eFB2_lbl" value="14 RAG citacoes minuta" style="text;html=1;fontSize=11;fontColor=#7A5A0E;align=center" vertex="1" parent="1">
          <mxGeometry x="1340" y="1280" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="evig" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=0.5;exitY=0;entryX=0.5;entryY=1;dashed=1;strokeColor=#DD344C" edge="1" parent="1" source="VIG" target="KBV">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="evig_lbl" value="15 cron diario verifica vigencia" style="text;html=1;fontSize=11;fontColor=#8B0000;align=center" vertex="1" parent="1">
          <mxGeometry x="450" y="1520" width="240" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="ev1" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#666" edge="1" parent="1" source="VIG" target="SES">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ev1_lbl" value="16 alerta 30/15/5d" style="text;html=1;fontSize=11;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="895" y="1620" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="ev2" style="endArrow=classic;html=1;strokeWidth=1.5;edgeStyle=orthogonalEdgeStyle;rounded=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeColor=#DD344C" edge="1" parent="1" source="SES" target="LOCK">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ev2_lbl" value="17 expirou -&gt; bloqueia" style="text;html=1;fontSize=11;fontColor=#8B0000;align=center;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1205" y="1620" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="eaud" style="endArrow=classic;html=1;strokeWidth=1.2;dashed=1;dashPattern=4 4;edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#999999;exitX=0;exitY=0.5;entryX=1;entryY=0.5" edge="1" parent="1" source="VIG" target="AUD">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="eaud_lbl" value="audit (kb_version_id, evento)" style="text;html=1;fontSize=11;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="320" y="1660" width="240" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="legend" value="&lt;b&gt;Legenda KBC R4&lt;/b&gt;  Azul-marinho: Tabeliao  Verde: KBC nativo  Azul claro: API/UI/store  Amarelo: validacao/cobranca  Vermelho: bloqueio/audit  Cinza: externo  Tracejado: abstracao/RAG/audit" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#999;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="1750" width="1620" height="40" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="06-deploy-aws" name="06-deploy-aws">
    <mxGraphModel dx="2000" dy="1500" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="2400" pageHeight="2000" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Deploy AWS sa-east-1 R4 - Single-tenant infra A2 + Comandos CLI" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="2320" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="VPC/ALB/CloudFront/Keycloak/ECS service compartilhados; N RDS instances + 3N S3 buckets + N KMS CMK + N realms (1 set por tenant). Setas com comandos CLI inline para reproducao operacional." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="2320" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; (1) Bloco esquerdo - infra COMPARTILHADA Stoix (VPC, ALB, CloudFront, Keycloak ECS, NAT). (2) Bloco direito (repetido por tenant) - RDS dedicado + 3 buckets dedicados + KMS CMK + realm. (3) Setas anotadas com comandos AWS CLI / pulumi reais. (4) Onboarding novo cartorio = pulumi stack init + pulumi up. (5) Operacoes recorrentes (deploy, snapshot, key rotation) tem comando concreto." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="120" width="2320" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="region" value="Regiao AWS sa-east-1 (Sao Paulo) - KMS exclusivo, multi-region keys OFF" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#444;dashed=0;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#444" vertex="1" parent="1">
          <mxGeometry x="40" y="220" width="2320" height="1640" as="geometry"/>
        </mxCell>

        <mxCell id="shared" value="Infra COMPARTILHADA (Stoix base) - Pulumi stack stoix-shared-prd" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#5D82A8;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=14;spacingTop=10;fontSize=13;fontStyle=1;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="80" y="280" width="1100" height="1540" as="geometry"/>
        </mxCell>

        <mxCell id="vpc" value="&lt;b&gt;VPC compartilhada&lt;/b&gt;&lt;br/&gt;10.0.0.0/16, 2 AZ (sa-east-1a / 1b)&lt;br/&gt;Subnets: public, private-app, private-data" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="320" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="vpccmd" value="pulumi up --stack stoix-shared-prd&#10;aws ec2 describe-vpcs --filters Name=tag:stoix,Values=true" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="320" width="640" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="cf" value="&lt;b&gt;CloudFront + WAF&lt;/b&gt;&lt;br/&gt;cartorio.stoix.com.br/{slug}&lt;br/&gt;TLS 1.3, geo-BR" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="450" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="cfcmd" value="aws cloudfront list-distributions&#10;aws cloudfront create-invalidation --distribution-id E1AB --paths /*&#10;aws wafv2 list-web-acls --scope CLOUDFRONT" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="450" width="640" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="alb" value="&lt;b&gt;Application Load Balancer&lt;/b&gt;&lt;br/&gt;Internal HTTPS, target group por servico&lt;br/&gt;Roteia path /{slug} -&gt; API; injeta header X-Tenant-Slug" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="580" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="albcmd" value="aws elbv2 describe-load-balancers --names stoix-shared-alb&#10;aws elbv2 describe-target-health --target-group-arn $TG_ARN" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="580" width="640" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="ecsapi" value="&lt;b&gt;ECS Fargate - API service&lt;/b&gt;&lt;br/&gt;Cluster stoix-shared, service api-bff&lt;br/&gt;2 tasks 0.5 vCPU 1GB, autoscale CPU 70%" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="710" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="ecsapicmd" value="aws ecs update-service --cluster stoix-shared --service api-bff --force-new-deployment&#10;aws ecs describe-services --cluster stoix-shared --services api-bff&#10;aws logs tail /ecs/api-bff --follow" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="710" width="640" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="ecskc" value="&lt;b&gt;ECS Fargate - Keycloak service&lt;/b&gt;&lt;br/&gt;2 tasks 1 vCPU 2GB multi-AZ&lt;br/&gt;1 instancia, N realms cartorio-{slug}&lt;br/&gt;Plugin ICP-Brasil A3 PKCS#11" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#3334B9;strokeColor=#1F1F8C;fontColor=#ffffff;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="840" width="380" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="ecskccmd" value="aws ecs update-service --cluster stoix-shared --service keycloak --force-new-deployment&#10;# criar realm para novo tenant via Keycloak Admin API:&#10;curl -X POST $KC/admin/realms -H Authorization:Bearer-$T &#10;  -d (json com realm cartorio-27sp enabled true)" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F1F8C;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="840" width="640" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="lambdas" value="&lt;b&gt;Lambda workers (compartilhados)&lt;/b&gt;&lt;br/&gt;ocr-worker, llm-worker, billing-worker, kbc-extract-worker, kbc-vigencia-worker, timestamp-worker. Recebem tenant_slug em payload." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="990" width="380" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="lambdacmd" value="aws lambda update-function-code --function-name ocr-worker --image-uri $ECR/ocr-worker:$SHA&#10;aws lambda invoke --function-name kbc-vigencia-worker /tmp/out.json&#10;aws logs tail /aws/lambda/ocr-worker --follow" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="990" width="640" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="rdsauth" value="&lt;b&gt;RDS Stoix-Auth&lt;/b&gt;&lt;br/&gt;db.t4g.micro multi-AZ&lt;br/&gt;Backing store Keycloak (compartilhado entre realms)" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#3334B9;fontColor=#ffffff;strokeColor=#1F1F8C;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="1140" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="rdsauthcmd" value="aws rds describe-db-instances --db-instance-identifier stoix-auth&#10;aws rds create-db-snapshot --db-instance-identifier stoix-auth --db-snapshot-identifier auth-$(date +%F)" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F1F8C;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="1140" width="640" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="ddb" value="&lt;b&gt;DynamoDB audit_log&lt;/b&gt;&lt;br/&gt;PK = tenant_slug#timestamp&lt;br/&gt;Streams ON; TTL 7y" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="1260" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="ddbcmd" value="aws dynamodb describe-table --table-name audit_log&#10;aws dynamodb query --table-name audit_log &#10;  --key-condition-expression pk-eq-cartorio-27sp-2026" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="1260" width="640" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="sqs" value="&lt;b&gt;SQS FIFO + EventBridge&lt;/b&gt;&lt;br/&gt;Filas: ocr-queue, llm-queue, kbc-extract-queue, billing-queue&lt;br/&gt;DLQ por etapa" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="1380" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="sqscmd" value="aws sqs get-queue-attributes --queue-url $Q --attribute-names ApproximateNumberOfMessages&#10;aws events list-rules --name-prefix kbc-vigencia" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="1380" width="640" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="nat" value="&lt;b&gt;NAT Gateway 2 AZ&lt;/b&gt;&lt;br/&gt;Egress private subnet&lt;br/&gt;VPC endpoints: S3, KMS, Secrets, Bedrock" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="1500" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="natcmd" value="aws ec2 describe-nat-gateways&#10;aws ec2 describe-vpc-endpoints --filters Name=service-name,Values=bedrock" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="1500" width="640" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="ecr" value="&lt;b&gt;ECR repos&lt;/b&gt;&lt;br/&gt;api-bff, ocr-worker, llm-worker, kbc-extract-worker, ..." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="1620" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="ecrcmd" value="aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_URI&#10;docker build -t $ECR/api-bff:$SHA . &amp;&amp; docker push $ECR/api-bff:$SHA" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="520" y="1620" width="640" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="tenant" value="Infra DEDICADA por tenant - Pulumi stack cartorio-{slug}-prd" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=14;spacingTop=10;fontSize=13;fontStyle=1;fontColor=#3F5E2A" vertex="1" parent="1">
          <mxGeometry x="1220" y="280" width="1100" height="1540" as="geometry"/>
        </mxCell>

        <mxCell id="onboardnote" value="&lt;b&gt;Onboarding cartorio-27sp&lt;/b&gt;&lt;br/&gt;pulumi stack init cartorio-27sp-prd&lt;br/&gt;pulumi config set tenant:slug 27sp&lt;br/&gt;pulumi up --stack cartorio-27sp-prd&lt;br/&gt;# tempo estimado: ~12 min para criar todos os recursos abaixo" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;fontColor=#000000;strokeColor=#5C8A3E;fontSize=11;strokeWidth=2;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1260" y="320" width="1020" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="rdstenant" value="&lt;b&gt;RDS PostgreSQL cartorio-{slug}-prd&lt;/b&gt;&lt;br/&gt;db.t4g.micro multi-AZ (1 GB RAM, 2 vCPU burst)&lt;br/&gt;Schema unico app, sem RLS, sem tenant_id&lt;br/&gt;Extensoes: pgvector, pg_audit, pg_stat_statements" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1260" y="450" width="500" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="rdstenantcmd" value="aws rds describe-db-instances --db-instance-identifier cartorio-27sp-prd&#10;aws rds create-db-snapshot --db-instance-identifier cartorio-27sp-prd &#10;  --db-snapshot-identifier 27sp-$(date +%F)&#10;aws rds modify-db-instance --db-instance-identifier cartorio-27sp-prd &#10;  --db-instance-class db.t4g.small --apply-immediately" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1780" y="450" width="500" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="s3uploads" value="&lt;b&gt;S3 cartorio-{slug}-uploads&lt;/b&gt;&lt;br/&gt;Documentos das partes&lt;br/&gt;SSE-KMS CMK do tenant" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1260" y="600" width="500" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="s3upcmd" value="aws s3 mb s3://cartorio-27sp-uploads --region sa-east-1&#10;aws s3 cp ./doc.pdf s3://cartorio-27sp-uploads/atos/$ATO/&#10;aws s3api put-bucket-encryption --bucket cartorio-27sp-uploads &#10;  --server-side-encryption-configuration ..." style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1780" y="600" width="500" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="s3worm" value="&lt;b&gt;S3 cartorio-{slug}-minutas-worm&lt;/b&gt;&lt;br/&gt;Object Lock matriz por classe&lt;br/&gt;livro_notas perpetuo (Lambda extensao)&lt;br/&gt;documento 30y; audit 7y" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#438DD5;fontColor=#FFFFFF;strokeColor=#3C7FC0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1260" y="730" width="500" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="s3wormcmd" value="aws s3api create-bucket --bucket cartorio-27sp-minutas-worm &#10;  --object-lock-enabled-for-bucket --create-bucket-configuration LocationConstraint=sa-east-1&#10;aws s3api put-object-retention --bucket cartorio-27sp-minutas-worm &#10;  --key livro_notas/2026/ato-123.pdf --retention Mode=COMPLIANCE,RetainUntilDate=..." style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1780" y="730" width="500" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="s3kb" value="&lt;b&gt;S3 cartorio-{slug}-kb&lt;/b&gt;&lt;br/&gt;Knowledge Base (originais Tabeliao)&lt;br/&gt;Versionamento ativado" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#A4C97A;fontColor=#000000;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1260" y="880" width="500" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="s3kbcmd" value="aws s3api put-bucket-versioning --bucket cartorio-27sp-kb &#10;  --versioning-configuration Status=Enabled&#10;aws s3 cp ./CGJ-SP-emolumentos-2026.pdf s3://cartorio-27sp-kb/emolumento/" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1780" y="880" width="500" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="kms" value="&lt;b&gt;KMS CMK alias/cartorio-{slug}&lt;/b&gt;&lt;br/&gt;Customer Master Key dedicada&lt;br/&gt;Multi-region keys OFF&lt;br/&gt;Rotacao anual automatica&lt;br/&gt;Cifra: RDS, 3 buckets S3, Secrets do tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DD344C;strokeColor=#B8001F;fontColor=#ffffff;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1260" y="1010" width="500" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="kmscmd" value="aws kms create-key --description Cartorio-27sp-CMK --multi-region false&#10;aws kms create-alias --alias-name alias/cartorio-27sp --target-key-id $KEY_ID&#10;aws kms enable-key-rotation --key-id $KEY_ID&#10;aws kms list-grants --key-id $KEY_ID  # auditoria de acessos" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#8B0000;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1780" y="1010" width="500" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="realm" value="&lt;b&gt;Keycloak realm cartorio-{slug}&lt;/b&gt;&lt;br/&gt;Hospedado no Keycloak compartilhado&lt;br/&gt;Plugin ICP-Brasil A3 ativo&lt;br/&gt;Admin do realm = Tabeliao do cartorio" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#3334B9;strokeColor=#1F1F8C;fontColor=#ffffff;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1260" y="1180" width="500" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="realmcmd" value="curl -X POST $KC_URL/admin/realms -H Authorization:Bearer-$TOKEN &#10;  -d (json realm=cartorio-27sp enabled=true sslRequired=all)&#10;curl -X POST $KC_URL/admin/realms/cartorio-27sp/users &#10;  -d (json username=tabeliao.lucas requiredActions=CONFIGURE_TOTP)" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F1F8C;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1780" y="1180" width="500" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="crr" value="&lt;b&gt;S3 Cross-Region Replication&lt;/b&gt;&lt;br/&gt;Cifrado only (us-east-1 destino)&lt;br/&gt;Por tenant: 3 destinos espelhados&lt;br/&gt;KMS sa-east-1 nao acompanha (RTO indeterminado em region failure)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1260" y="1330" width="500" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="crrcmd" value="aws s3api put-bucket-replication --bucket cartorio-27sp-uploads &#10;  --replication-configuration file://replication.json&#10;aws s3api get-bucket-replication --bucket cartorio-27sp-uploads&#10;# replication.json define destino arn:aws:s3:::cartorio-27sp-uploads-dr us-east-1" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A5A0E;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1780" y="1330" width="500" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="secrets" value="&lt;b&gt;Secrets Manager por tenant&lt;/b&gt;&lt;br/&gt;cartorio-{slug}/rds-credentials&lt;br/&gt;cartorio-{slug}/kbc-config&lt;br/&gt;Rotacao 30d via Lambda" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DD344C;strokeColor=#B8001F;fontColor=#ffffff;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1260" y="1480" width="500" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="secretscmd" value="aws secretsmanager create-secret --name cartorio-27sp/rds-credentials &#10;  --kms-key-id alias/cartorio-27sp --secret-string (json user=app password=...)&#10;aws secretsmanager rotate-secret --secret-id cartorio-27sp/rds-credentials &#10;  --rotation-lambda-arn $ROT_LAMBDA --rotation-rules AutomaticallyAfterDays=30" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#8B0000;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1780" y="1480" width="500" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="cw" value="&lt;b&gt;CloudWatch tags por tenant&lt;/b&gt;&lt;br/&gt;Logs /aws/{service}/{tenant}&lt;br/&gt;Metricas custom dim tenant=cartorio-{slug}" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1260" y="1620" width="500" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="cwcmd" value="aws logs filter-log-events --log-group-name /aws/lambda/llm-worker &#10;  --filter-pattern (tenant=cartorio-27sp)&#10;aws cloudwatch get-metric-statistics --namespace Stoix --metric-name AtosLavrados &#10;  --dimensions Name=tenant,Value=cartorio-27sp --start-time ... --period 86400 --statistics Sum" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1780" y="1620" width="500" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="ea" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.3;strokeWidth=2;strokeColor=#5D82A8;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="ecsapi" target="rdstenant">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="800" y="760"/>
              <mxPoint x="800" y="495"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="ea_lbl" value="API conecta no RDS do tenant via TenantResolver" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="780" y="475" width="380" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="eb" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F1F8C;dashed=1;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="ecskc" target="realm">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="800" y="900"/>
              <mxPoint x="800" y="1240"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="eb_lbl" value="serve realm cartorio-{slug}" style="text;html=1;fontSize=11;fontColor=#1F1F8C;align=center" vertex="1" parent="1">
          <mxGeometry x="800" y="1145" width="240" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="ec" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#5D82A8;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="lambdas" target="s3uploads">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="780" y="1050"/>
              <mxPoint x="780" y="650"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="ec_lbl" value="workers acessam buckets do tenant" style="text;html=1;fontSize=11;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="800" y="630" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="ed" style="endArrow=classic;html=1;exitX=1;exitY=0.7;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#B8001F;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="lambdas" target="kms">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="780" y="1080"/>
              <mxPoint x="780" y="1080"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="ed_lbl" value="Decrypt com CMK do tenant (KMS Grant)" style="text;html=1;fontSize=11;fontColor=#8B0000;align=center" vertex="1" parent="1">
          <mxGeometry x="780" y="1090" width="280" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="legend" value="&lt;b&gt;Legenda Deploy R4&lt;/b&gt;  Bloco azul claro: infra compartilhada Stoix  Bloco verde: dedicado por tenant  Bloco vermelho: KMS/Secrets  Caixa Courier: comando AWS CLI / pulumi real  Setas: relacao operacional entre componentes" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#999;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="1880" width="2320" height="40" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="07-data-model" name="07-data-model">
    <mxGraphModel dx="2000" dy="1500" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="2400" pageHeight="1700" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Modelo de Dados R4 - Schema unico app por RDS dedicado por tenant" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="2320" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Sem RLS, sem tenant_id em coluna - isolamento fisico via RDS dedicado por tenant. ER notacional crow's foot. FKs nas extremidades laterais das tabelas. Entidades KBC adicionadas (kb_document, kb_version, kb_chunk, kb_emolumento_estruturado)." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="2320" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; (1) Cabecalho de cada tabela tem nome + tipo de entidade (entidade fundamental, entidade fraca, view). (2) Linhas com FK saem das laterais. (3) Notacao crow's foot: || = um obrigatorio, |o = um opcional, &amp;lt;{ = muitos. (4) Cores por dominio: azul = nucleo, verde = KBC, amarelo = billing, cinza = telemetria. (5) Sem tenant_id em nenhuma tabela porque cada tenant tem RDS dedicado." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="135" width="2320" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="schemabox" value="Schema app no RDS PostgreSQL cartorio-{slug}-prd (db.t4g.micro multi-AZ)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#444;dashed=0;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#444" vertex="1" parent="1">
          <mxGeometry x="40" y="240" width="2320" height="1380" as="geometry"/>
        </mxCell>

        <mxCell id="user" value="&lt;b&gt;user&lt;/b&gt;&lt;br/&gt;[entidade fundamental]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5D82A8;strokeColor=#1F4E79;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="80" y="300" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="user_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;keycloak_subject text UNIQUE&lt;br/&gt;email text UNIQUE&lt;br/&gt;nome text&lt;br/&gt;papel enum (tabeliao, escrevente, admin_stoix, dpo)&lt;br/&gt;icp_brasil_cn text NULL&lt;br/&gt;icp_brasil_serial text NULL&lt;br/&gt;mfa_totp_enabled bool&lt;br/&gt;ativo bool&lt;br/&gt;created_at timestamptz&lt;br/&gt;updated_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="80" y="340" width="320" height="200" as="geometry"/>
        </mxCell>

        <mxCell id="atotpl" value="&lt;b&gt;ato_template&lt;/b&gt;&lt;br/&gt;[entidade fundamental]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5D82A8;strokeColor=#1F4E79;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="500" y="300" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="atotpl_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;codigo text UNIQUE (ex: PROC_GENERICA_2026)&lt;br/&gt;nome text&lt;br/&gt;classe enum (livro_notas, documento, audit)&lt;br/&gt;requires_kbc_vigente bool&lt;br/&gt;tipo_ato text (procuracao, escritura, ata, ...)&lt;br/&gt;status enum (draft, vigente, deprecated)&lt;br/&gt;criado_por uuid&lt;br/&gt;aprovado_por uuid NULL&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="500" y="340" width="320" height="200" as="geometry"/>
        </mxCell>

        <mxCell id="atover" value="&lt;b&gt;ato_template_version&lt;/b&gt;&lt;br/&gt;[entidade fraca]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5D82A8;strokeColor=#1F4E79;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="920" y="300" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="atover_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK ato_template_id uuid&lt;br/&gt;numero_versao int&lt;br/&gt;corpo_template text (handlebars)&lt;br/&gt;clausulas jsonb&lt;br/&gt;parametros jsonb&lt;br/&gt;FK kb_version_origem_id uuid NULL&lt;br/&gt;hash_imutavel text&lt;br/&gt;criado_por uuid&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="920" y="340" width="320" height="200" as="geometry"/>
        </mxCell>

        <mxCell id="atoinst" value="&lt;b&gt;ato_instance&lt;/b&gt;&lt;br/&gt;[entidade fundamental]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5D82A8;strokeColor=#1F4E79;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1340" y="300" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="atoinst_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK ato_template_version_id uuid&lt;br/&gt;numero_protocolo text UNIQUE&lt;br/&gt;status enum (rascunho, processando, em_revisao, lavrado, retificado, cancelado)&lt;br/&gt;valores_preenchidos jsonb&lt;br/&gt;FK criado_por_user_id uuid&lt;br/&gt;FK lavrado_por_user_id uuid NULL&lt;br/&gt;data_lavratura timestamptz NULL&lt;br/&gt;s3_minuta_key text NULL&lt;br/&gt;hash_minuta text NULL&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1340" y="340" width="320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="doc" value="&lt;b&gt;documento&lt;/b&gt;&lt;br/&gt;[entidade fraca]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5D82A8;strokeColor=#1F4E79;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1760" y="300" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="doc_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK ato_instance_id uuid&lt;br/&gt;tipo enum (rg, cpf, certidao_nascimento, certidao_casamento, matricula, procuracao, outro)&lt;br/&gt;s3_key text&lt;br/&gt;ocr_payload jsonb&lt;br/&gt;ocr_confidence numeric(4,3)&lt;br/&gt;validacao_local jsonb (CPF DV, datas, valores)&lt;br/&gt;status enum (uploaded, processing, validated, rejected)&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1760" y="340" width="320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="kbdoc" value="&lt;b&gt;kb_document&lt;/b&gt;&lt;br/&gt;[entidade fundamental KBC]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5C8A3E;strokeColor=#3F5E2A;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="80" y="640" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="kbdoc_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;tipo enum (emolumento, normativo, modelo_ato, procedimento, referencia_juridica)&lt;br/&gt;origem enum (oficial_cgj, cnb_sp, doutrina, interno)&lt;br/&gt;titulo text&lt;br/&gt;s3_key text (cartorio-{slug}-kb)&lt;br/&gt;mime_type text&lt;br/&gt;FK criado_por_user_id uuid (Tabeliao)&lt;br/&gt;tags text[]&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#3F5E2A;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="80" y="680" width="320" height="200" as="geometry"/>
        </mxCell>

        <mxCell id="kbver" value="&lt;b&gt;kb_version&lt;/b&gt;&lt;br/&gt;[entidade fraca KBC]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5C8A3E;strokeColor=#3F5E2A;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="500" y="640" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="kbver_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK kb_document_id uuid&lt;br/&gt;numero_versao int&lt;br/&gt;status enum (uploaded, extracting, reviewing, vigente, expirada, superseded)&lt;br/&gt;data_inicio_vigencia date&lt;br/&gt;data_fim_vigencia date NULL&lt;br/&gt;json_extraido jsonb&lt;br/&gt;kb_hash text (sha256 do json)&lt;br/&gt;FK aprovado_por_user_id uuid NULL&lt;br/&gt;data_aprovacao timestamptz NULL&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#3F5E2A;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="500" y="680" width="320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="kbchunk" value="&lt;b&gt;kb_chunk&lt;/b&gt;&lt;br/&gt;[entidade fraca - pgvector]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5C8A3E;strokeColor=#3F5E2A;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="920" y="640" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="kbchunk_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK kb_version_id uuid&lt;br/&gt;ordem int&lt;br/&gt;texto text&lt;br/&gt;tokens int&lt;br/&gt;embedding vector(1536) -- pgvector&lt;br/&gt;index ivfflat (embedding vector_cosine_ops)&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#3F5E2A;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="920" y="680" width="320" height="170" as="geometry"/>
        </mxCell>

        <mxCell id="kbemol" value="&lt;b&gt;kb_emolumento_estruturado&lt;/b&gt;&lt;br/&gt;[entidade fraca KBC - tabela CGJ-SP normalizada]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5C8A3E;strokeColor=#3F5E2A;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1340" y="640" width="320" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="kbemol_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK kb_version_id uuid (sempre vigente)&lt;br/&gt;codigo_ato text&lt;br/&gt;descricao_ato text&lt;br/&gt;faixa_valor_min numeric(14,2)&lt;br/&gt;faixa_valor_max numeric(14,2) NULL&lt;br/&gt;emolumento_base numeric(10,2)&lt;br/&gt;fundo_estatal numeric(10,2)&lt;br/&gt;tarifa_FCDP numeric(10,2)&lt;br/&gt;ISS_municipio text&lt;br/&gt;ISS_aliquota numeric(5,4)&lt;br/&gt;observacoes text" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#3F5E2A;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1340" y="690" width="320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="bill" value="&lt;b&gt;billing_event&lt;/b&gt;&lt;br/&gt;[entidade fundamental - cobranca]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D79B00;strokeColor=#7A5A0E;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1760" y="640" width="320" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="bill_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK ato_instance_id uuid&lt;br/&gt;tipo enum (lavratura, retificacao, cancelamento)&lt;br/&gt;valor_emolumento numeric(10,2)&lt;br/&gt;valor_iss numeric(10,2)&lt;br/&gt;valor_fundo_estatal numeric(10,2)&lt;br/&gt;valor_stoix numeric(10,2) -- 3,1% ou R$ 7,50&lt;br/&gt;FK kb_version_id uuid -- snapshot R4&lt;br/&gt;kb_hash text -- snapshot imutavel R4&lt;br/&gt;data_lavratura timestamptz&lt;br/&gt;status enum (apurado, faturado, pago, contestado)&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#FFF8E8;strokeColor=#7A5A0E;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1760" y="690" width="320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="llmcall" value="&lt;b&gt;llm_call&lt;/b&gt;&lt;br/&gt;[entidade fraca - telemetria]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;strokeColor=#666;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="80" y="980" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="llmcall_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK ato_instance_id uuid NULL&lt;br/&gt;FK kb_version_id uuid NULL&lt;br/&gt;modelo text (claude-sonnet-4.5, claude-haiku-4.5, titan-embed-v2)&lt;br/&gt;tipo enum (fluxo_a_subagent, fluxo_b_preenchimento, kbc_extract, kbc_embedding, rag_query)&lt;br/&gt;input_tokens int&lt;br/&gt;output_tokens int&lt;br/&gt;cache_read_tokens int&lt;br/&gt;custo_usd numeric(10,6)&lt;br/&gt;latencia_ms int&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#666;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="80" y="1020" width="320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="auditlog" value="&lt;b&gt;audit_log_local&lt;/b&gt;&lt;br/&gt;[view materializada - reflete DDB]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999999;strokeColor=#666;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="500" y="980" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="auditlog_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;ddb_event_id text&lt;br/&gt;timestamp timestamptz&lt;br/&gt;evento text (ato.criado, kb_version.aprovada, ...)&lt;br/&gt;ator_user_id uuid NULL&lt;br/&gt;FK ato_instance_id uuid NULL&lt;br/&gt;FK kb_version_id uuid NULL&lt;br/&gt;hash_anterior text&lt;br/&gt;hash_atual text&lt;br/&gt;merkle_root_diario text NULL&lt;br/&gt;tsa_token bytea NULL&lt;br/&gt;ots_proof bytea NULL" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#666;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="500" y="1020" width="320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="parte" value="&lt;b&gt;parte&lt;/b&gt;&lt;br/&gt;[entidade fraca - LGPD: titular]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5D82A8;strokeColor=#1F4E79;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="920" y="980" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="parte_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK ato_instance_id uuid&lt;br/&gt;papel enum (outorgante, outorgado, comprador, vendedor, parte)&lt;br/&gt;tipo enum (PF, PJ)&lt;br/&gt;cpf_cnpj text (cifrado coluna)&lt;br/&gt;nome_razao text&lt;br/&gt;documento_identidade text NULL&lt;br/&gt;endereco jsonb&lt;br/&gt;representado_por uuid NULL (autoref)&lt;br/&gt;consentimento_lgpd jsonb&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="920" y="1020" width="320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="exportlgpd" value="&lt;b&gt;export_lgpd&lt;/b&gt;&lt;br/&gt;[entidade fraca - DPO]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5D82A8;strokeColor=#1F4E79;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1340" y="980" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="exportlgpd_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK solicitado_por_user_id uuid (DPO)&lt;br/&gt;FK titular_parte_id uuid NULL&lt;br/&gt;tipo enum (acesso, retificacao, exclusao_lgpd, portabilidade, anonimizacao)&lt;br/&gt;status enum (solicitado, aprovado, rejeitado, executado)&lt;br/&gt;motivo_rejeicao text NULL&lt;br/&gt;dados_exportados jsonb NULL&lt;br/&gt;data_solicitacao timestamptz&lt;br/&gt;data_resposta timestamptz NULL&lt;br/&gt;prazo_resposta_dias int default 15" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1340" y="1020" width="320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="kbcalert" value="&lt;b&gt;kbc_alerta&lt;/b&gt;&lt;br/&gt;[entidade fraca KBC]" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5C8A3E;strokeColor=#3F5E2A;fontColor=#FFFFFF;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="1760" y="980" width="320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="kbcalert_attrs" value="&lt;b&gt;PK&lt;/b&gt; id uuid&lt;br/&gt;FK kb_version_id uuid&lt;br/&gt;tipo enum (vigencia_30d, vigencia_15d, vigencia_5d, expirada)&lt;br/&gt;FK enviado_para_user_id uuid (Tabeliao)&lt;br/&gt;canal enum (email, in_app, ambos)&lt;br/&gt;status enum (pendente, enviado, lido)&lt;br/&gt;ses_message_id text NULL&lt;br/&gt;data_envio timestamptz NULL&lt;br/&gt;created_at timestamptz" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#3F5E2A;fontSize=11;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1760" y="1020" width="320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="rUserTpl" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=1;exitY=0.3;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="user_attrs" target="atotpl_attrs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rUserTpl_lbl" value="cria/aprova" style="text;html=1;fontSize=10;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="405" y="385" width="90" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rTplVer" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=1;exitY=0.4;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="atotpl_attrs" target="atover_attrs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rTplVer_lbl" value="versiona" style="text;html=1;fontSize=10;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="825" y="395" width="90" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rVerInst" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=1;exitY=0.4;entryX=0;entryY=0.4;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="atover_attrs" target="atoinst_attrs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rVerInst_lbl" value="instancia" style="text;html=1;fontSize=10;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1245" y="395" width="90" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rInstDoc" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=1;exitY=0.4;entryX=0;entryY=0.4;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="atoinst_attrs" target="doc_attrs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rInstDoc_lbl" value="anexa N docs" style="text;html=1;fontSize=10;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1665" y="395" width="100" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rInstParte" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="atoinst_attrs" target="parte_attrs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rInstParte_lbl" value="tem partes" style="text;html=1;fontSize=10;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1135" y="568" width="120" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rKbDocVer" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.8;strokeColor=#3F5E2A;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="kbdoc_attrs" target="kbver_attrs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rKbDocVer_lbl" value="versiona" style="text;html=1;fontSize=10;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="405" y="775" width="90" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rKbVerChunk" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.8;strokeColor=#3F5E2A;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="kbver_attrs" target="kbchunk_attrs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rKbVerChunk_lbl" value="chunks" style="text;html=1;fontSize=10;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="825" y="775" width="90" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rKbVerEmol" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=1;exitY=0.4;entryX=0;entryY=0.5;strokeWidth=1.8;strokeColor=#3F5E2A;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="kbver_attrs" target="kbemol_attrs">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="860" y="780"/>
              <mxPoint x="1300" y="800"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="rKbVerEmol_lbl" value="estrutura emolumentos" style="text;html=1;fontSize=10;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1115" y="785" width="180" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rTplKbVer" style="endArrow=ERone;startArrow=ERmany;html=1;exitX=0.3;exitY=1;entryX=0.3;entryY=0;strokeWidth=1.2;strokeColor=#5C8A3E;edgeStyle=orthogonalEdgeStyle;dashed=1" edge="1" parent="1" source="atover_attrs" target="kbver_attrs">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1010" y="595"/>
              <mxPoint x="600" y="620"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="rTplKbVer_lbl" value="opc deriva de kb_version (R4)" style="text;html=1;fontSize=10;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="630" y="600" width="240" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rInstBill" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=0.7;exitY=1;entryX=0.5;entryY=0;strokeWidth=1.5;strokeColor=#7A5A0E;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="atoinst_attrs" target="bill_attrs">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1565" y="590"/>
              <mxPoint x="1920" y="620"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="rInstBill_lbl" value="gera billing_event" style="text;html=1;fontSize=10;fontColor=#7A5A0E;align=center" vertex="1" parent="1">
          <mxGeometry x="1645" y="595" width="180" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rBillKbVer" style="endArrow=ERone;startArrow=ERmany;html=1;exitX=0;exitY=0.5;entryX=1;entryY=0.5;strokeWidth=1.8;strokeColor=#7A5A0E;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="bill_attrs" target="kbemol_attrs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rBillKbVer_lbl" value="snapshot kb_versao + kb_hash (R4)" style="text;html=1;fontSize=10;fontColor=#7A5A0E;align=center;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1665" y="775" width="240" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rInstLlm" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=0;exitY=0.7;entryX=1;entryY=0.4;strokeWidth=1.2;strokeColor=#666;edgeStyle=orthogonalEdgeStyle;dashed=1" edge="1" parent="1" source="atoinst_attrs" target="llmcall_attrs">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1320" y="490"/>
              <mxPoint x="420" y="950"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="rInstLlm_lbl" value="telemetria LLM" style="text;html=1;fontSize=10;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="430" y="930" width="160" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rKbVerLlm" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=0;exitY=0.7;entryX=1;entryY=0.6;strokeWidth=1.2;strokeColor=#666;edgeStyle=orthogonalEdgeStyle;dashed=1" edge="1" parent="1" source="kbver_attrs" target="llmcall_attrs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rKbVerLlm_lbl" value="kbc extract telemetria" style="text;html=1;fontSize=10;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="410" y="935" width="180" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rInstAud" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=0;exitY=0.8;entryX=1;entryY=0.4;strokeWidth=1.2;strokeColor=#666;edgeStyle=orthogonalEdgeStyle;dashed=1" edge="1" parent="1" source="atoinst_attrs" target="auditlog_attrs">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1320" y="540"/>
              <mxPoint x="840" y="1100"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="rInstAud_lbl" value="audit eventos" style="text;html=1;fontSize=10;fontColor=#444;align=center" vertex="1" parent="1">
          <mxGeometry x="855" y="945" width="160" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rUserExp" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=0;exitY=0.9;entryX=0;entryY=0.4;strokeWidth=1.2;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="user_attrs" target="exportlgpd_attrs">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="60" y="1080"/>
              <mxPoint x="1320" y="1100"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="rUserExp_lbl" value="DPO solicita" style="text;html=1;fontSize=10;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="60" y="1140" width="120" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rPartExp" style="endArrow=ERone;startArrow=ERone;html=1;exitX=1;exitY=0.6;entryX=0;entryY=0.6;strokeWidth=1.2;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="parte_attrs" target="exportlgpd_attrs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rPartExp_lbl" value="titular = parte" style="text;html=1;fontSize=10;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="1245" y="1145" width="120" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="rKbVerAlert" style="endArrow=ERmany;startArrow=ERone;html=1;exitX=1;exitY=0.9;entryX=0;entryY=0.4;strokeWidth=1.5;strokeColor=#3F5E2A;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="kbver_attrs" target="kbcalert_attrs">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="850" y="1100"/>
              <mxPoint x="1740" y="1100"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="rKbVerAlert_lbl" value="alertas vigencia" style="text;html=1;fontSize=10;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1245" y="1080" width="160" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="notes" value="&lt;b&gt;Notas R4&lt;/b&gt;&lt;br/&gt;1. Sem coluna tenant_id em nenhuma tabela - cada tenant tem RDS dedicado&lt;br/&gt;2. Sem RLS - isolamento e fisico, nao logico&lt;br/&gt;3. billing_event guarda kb_version_id + kb_hash como SNAPSHOT imutavel - garante reprodutibilidade da cobranca em auditoria&lt;br/&gt;4. ato_template_version.kb_version_origem_id e opcional - so preenche se template foi derivado da KBC (Fluxo A opcao B)&lt;br/&gt;5. audit_log_local e view materializada do DDB compartilhado, filtrada por tenant_slug do tenant atual&lt;br/&gt;6. parte.cpf_cnpj cifrado a nivel de coluna com pgcrypto + KMS data key (defesa em profundidade)&lt;br/&gt;7. pgvector index ivfflat em kb_chunk.embedding tunado por kb_version (recreate apos cada aprovacao)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="80" y="1290" width="2240" height="180" as="geometry"/>
        </mxCell>

        <mxCell id="legend" value="&lt;b&gt;Legenda Modelo R4&lt;/b&gt;  Cabecalho azul: nucleo  Cabecalho verde: KBC  Cabecalho laranja: billing  Cabecalho cinza: telemetria/LGPD  Setas crow's foot: |o|--&amp;lt;{ um-para-muitos opcional, ||--&amp;lt;{ obrigatorio  Tracejada: relacao opcional/derivada  FKs nas extremidades laterais (nao no cabecalho)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#999;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="80" y="1490" width="2240" height="60" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="08-network-security" name="08-network-security">
    <mxGraphModel dx="1800" dy="1300" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1900" pageHeight="1500" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Network &amp; Security R4 - Isolamento fisico por tenant" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="1820" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Tenant isolation R4 e FISICO em DB+S3+KMS+realm. Nao ha RLS para explicar. Realm Keycloak + JWT claim sao a barreira. Camadas de defesa decrescem em profundidade fisica e crescem em profundidade aplicacional." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="1820" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; Zonas concentricas - Zona 0 internet (vermelho), Zona 1 edge (azul), Zona 2 app (laranja), Zona 3 dados dedicados por tenant (vermelho intenso). Cada camada de tenant isolation listada na direita; numerada por nivel de defesa. Sem RLS porque nao ha schema compartilhado." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="135" width="1820" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="z0" value="Zona 0 - Internet publica (nao confiavel)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;strokeColor=#DD344C;dashed=0;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#8B0000" vertex="1" parent="1">
          <mxGeometry x="80" y="220" width="1240" height="160" as="geometry"/>
        </mxCell>
        <mxCell id="usuarios" value="&lt;b&gt;Usuarios (Tabeliao, Escrevente, Admin, DPO)&lt;/b&gt;&lt;br/&gt;HTTPS TLS 1.3 + WebSocket WSS + ICP-Brasil A3 (PKCS#11 client)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=12" vertex="1" parent="1">
          <mxGeometry x="120" y="270" width="540" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="ataques" value="&lt;b&gt;Atacantes potenciais&lt;/b&gt;&lt;br/&gt;OWASP Top 10, DDoS, credential stuffing, scraping, fraude documental" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;strokeColor=#DD344C;fontColor=#8B0000;fontSize=12" vertex="1" parent="1">
          <mxGeometry x="700" y="270" width="540" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="z1" value="Zona 1 - Edge AWS (compartilhada Stoix)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="80" y="410" width="1240" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="cf" value="&lt;b&gt;CloudFront + WAF + Shield Standard&lt;/b&gt;&lt;br/&gt;OWASP Top 10 rules, geo-restriction BR, rate limit 100 rps por IP, bot control" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="460" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="alb" value="&lt;b&gt;ALB internal&lt;/b&gt;&lt;br/&gt;HTTPS only, mTLS opcional, target group ECS&lt;br/&gt;injeta header X-Tenant-Slug do path /{slug}" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="520" y="460" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kc" value="&lt;b&gt;Keycloak (compartilhado)&lt;/b&gt;&lt;br/&gt;OIDC issuer cartorio.stoix.com.br/realms/{slug}&lt;br/&gt;Plugin ICP-Brasil A3 PKCS#11 + MFA TOTP" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#3334B9;strokeColor=#1F1F8C;fontColor=#FFFFFF;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="920" y="460" width="380" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="z2" value="Zona 2 - Aplicacao (compartilhada com selecao por X-Tenant-Slug)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF7E6;strokeColor=#FF9900;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#7A4900" vertex="1" parent="1">
          <mxGeometry x="80" y="620" width="1240" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="api" value="&lt;b&gt;API BFF (ECS Fargate)&lt;/b&gt;&lt;br/&gt;valida JWT (issuer+aud+claim realm), TenantResolver mapeia realm -&gt; conn pool RDS do tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="670" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="workers" value="&lt;b&gt;Lambda workers&lt;/b&gt;&lt;br/&gt;tenant_slug em payload, sts:AssumeRole por tenant para acessar S3+KMS dedicados" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="520" y="670" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kbcwk" value="&lt;b&gt;KBC workers&lt;/b&gt;&lt;br/&gt;extract + vigencia + diff. mesmas restricoes IAM por tenant. Sem cross-tenant grants." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="920" y="670" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="vpcendp" value="VPC endpoints: S3 (gateway), KMS, Secrets, Bedrock, Textract - trafego nao sai pra internet" style="text;html=1;fontSize=11;fontColor=#7A4900;align=center" vertex="1" parent="1">
          <mxGeometry x="120" y="770" width="1180" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="z3" value="Zona 3 - Dados DEDICADOS por tenant (silo A2 - blast radius = 1 cartorio)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;strokeColor=#DD344C;dashed=0;strokeWidth=3;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#8B0000" vertex="1" parent="1">
          <mxGeometry x="80" y="870" width="1240" height="380" as="geometry"/>
        </mxCell>
        <mxCell id="rds" value="&lt;b&gt;RDS cartorio-{slug}-prd&lt;/b&gt;&lt;br/&gt;Security Group: ingress so de ECS+Lambda da app&lt;br/&gt;Cifragem at rest com CMK do tenant&lt;br/&gt;Sem coluna tenant_id - schema unico" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="920" width="290" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="s3uploads" value="&lt;b&gt;S3 cartorio-{slug}-uploads&lt;/b&gt;&lt;br/&gt;Bucket Policy nega acesso fora do tenant role&lt;br/&gt;SSE-KMS CMK do tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="430" y="920" width="290" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="s3worm" value="&lt;b&gt;S3 cartorio-{slug}-minutas-worm&lt;/b&gt;&lt;br/&gt;Object Lock COMPLIANCE&lt;br/&gt;Lambda extensao para livro_notas perpetuo" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="740" y="920" width="290" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="s3kb" value="&lt;b&gt;S3 cartorio-{slug}-kb&lt;/b&gt;&lt;br/&gt;Versionamento ON&lt;br/&gt;Acesso so via KBC workers + UI Tabeliao" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="920" width="250" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="kms" value="&lt;b&gt;KMS CMK alias/cartorio-{slug}&lt;/b&gt;&lt;br/&gt;Key policy: principal = roles do tenant&lt;br/&gt;Multi-region keys OFF (sa-east-1 only)&lt;br/&gt;Rotacao anual + audit via CloudTrail" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DD344C;strokeColor=#B8001F;fontColor=#FFFFFF;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="120" y="1080" width="600" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="secrets" value="&lt;b&gt;Secrets cartorio-{slug}/*&lt;/b&gt;&lt;br/&gt;rds-credentials (rot 30d)&lt;br/&gt;kbc-config&lt;br/&gt;Cifrado por CMK do tenant&lt;br/&gt;Acesso so via IAM Role do tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DD344C;strokeColor=#B8001F;fontColor=#FFFFFF;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="740" y="1080" width="560" height="140" as="geometry"/>
        </mxCell>

        <mxCell id="iso" value="Camadas de tenant isolation R4" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F0F4F8;strokeColor=#08427B;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#08427B" vertex="1" parent="1">
          <mxGeometry x="1360" y="220" width="500" height="1030" as="geometry"/>
        </mxCell>
        <mxCell id="iso1" value="&lt;b&gt;Camada 1 - Realm Keycloak&lt;/b&gt;&lt;br/&gt;Usuario so existe em 1 realm (cartorio-{slug}). Login pra realm errado = NotFoundException. Realm e a barreira de auth." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#3334B9;fontColor=#FFFFFF;strokeColor=#1F1F8C;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1380" y="270" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="iso2" value="&lt;b&gt;Camada 2 - JWT claim realm&lt;/b&gt;&lt;br/&gt;API valida claim realm do JWT contra X-Tenant-Slug do path. Mismatch = 403. Tabeliao do 27sp nao ve dados do RJ01." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1380" y="380" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="iso3" value="&lt;b&gt;Camada 3 - TenantResolver + connection pool&lt;/b&gt;&lt;br/&gt;API mapeia tenant_slug -&gt; RDS endpoint do tenant. Bug em rota = no-op (nao acessa RDS de outro). Pool em memoria por tenant." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1380" y="490" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="iso4" value="&lt;b&gt;Camada 4 - IAM Role + sts:AssumeRole&lt;/b&gt;&lt;br/&gt;Workers Lambda assumem role do tenant antes de acessar S3+KMS+Secrets. Cross-tenant tentado = AccessDenied no AWS-side." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;fontColor=#000000;strokeColor=#D79B00;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1380" y="600" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="iso5" value="&lt;b&gt;Camada 5 - KMS Key Policy&lt;/b&gt;&lt;br/&gt;CMK do tenant tem principal explicito (so roles do tenant). Mesmo se IAM permitir, KMS nega Decrypt cross-tenant." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DD344C;fontColor=#FFFFFF;strokeColor=#B8001F;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1380" y="710" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="iso6" value="&lt;b&gt;Camada 6 - Isolamento FISICO de RDS+S3&lt;/b&gt;&lt;br/&gt;Mesmo se TUDO acima falhasse, RDS e S3 buckets sao instancias diferentes. Sem rota de rede que conecte um RDS de tenant A a outro tenant. Sem schema compartilhado.&lt;br/&gt;ESTA E A CAMADA QUE NAO EXISTIA EM R3." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;fontColor=#8B0000;strokeColor=#DD344C;fontSize=11;strokeWidth=3" vertex="1" parent="1">
          <mxGeometry x="1380" y="820" width="460" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="iso7" value="&lt;b&gt;Camada 7 - Audit DDB com PK por tenant&lt;/b&gt;&lt;br/&gt;PK = tenant_slug#timestamp. Hash chain por tenant. Merkle root diario por tenant. Cross-tenant query = no rows." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;fontColor=#000000;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1380" y="970" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="isoNote" value="&lt;b&gt;R4 nao tem RLS&lt;/b&gt;: nao ha schema compartilhado para proteger. R3 tinha 5 camadas (realm, JWT, SET LOCAL, RLS policy, KMS). R4 troca SET LOCAL+RLS por TenantResolver+isolamento fisico - resultado: superficie de bug menor (nao ha policy para errar)." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;fontColor=#7A4900;strokeColor=#D4AC0D;fontSize=11;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="1380" y="1090" width="460" height="140" as="geometry"/>
        </mxCell>

        <mxCell id="ipsec" value="&lt;b&gt;Defesas adicionais R4&lt;/b&gt;&lt;br/&gt;CloudTrail multi-region OFF (so sa-east-1) + GuardDuty + AWS Config + Security Hub + Inspector ECR + IAM Access Analyzer. Logs de auth do Keycloak em CloudWatch + alertas anomalos. Rate limit ICP-Brasil A3 por usuario. Reuso de cert ICP-Brasil = revoga sessoes." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="80" y="1280" width="1240" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="legend" value="&lt;b&gt;Legenda Network&amp;Security R4&lt;/b&gt;  Zona 0: internet (vermelho)  Zona 1: edge (azul)  Zona 2: app (laranja)  Zona 3: dados dedicados (vermelho intenso)  Caixa azul-escuro: identidade  Caixa vermelha: KMS/Secrets  Caixa verde: KBC" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#999;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="80" y="1380" width="1780" height="40" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="09-observability" name="09-observability">
    <mxGraphModel dx="1800" dy="1300" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1900" pageHeight="1400" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Observabilidade R4 - AWS Managed + tags por tenant + sinais KBC" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="1820" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Tres pilares (logs, metricas, traces) + audit + telemetria de negocio. Tags tenant=cartorio-{slug} em TUDO. OpenTelemetry SDK obrigatorio. Sinais novos KBC: extract latency, approval rate, vigencia alertas." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="1820" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; (1) Sources (esquerda) - cada componente emite via OTel SDK. (2) Pipeline AWS Managed (meio). (3) Dashboards Grafana (direita) com filtro por tenant. (4) Alertas em PagerDuty/Slack. Toda metrica/log/trace tem dimensao tenant; queries Grafana usam {tenant=&quot;cartorio-27sp&quot;} para isolar visao por cartorio." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="135" width="1820" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="sources" value="Sources (instrumentacao)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="80" y="220" width="540" height="980" as="geometry"/>
        </mxCell>
        <mxCell id="srcapi" value="&lt;b&gt;API BFF&lt;/b&gt; (ECS Fargate)&lt;br/&gt;OTel SDK + structured JSON logs&lt;br/&gt;Resource attrs: tenant=cartorio-{slug}, service=api-bff, env=prd" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="280" width="460" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="srcwk" value="&lt;b&gt;Lambda workers&lt;/b&gt;&lt;br/&gt;OTel SDK auto-instrumentation + custom spans por etapa (PII-strip, OCR, LLM, persist)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="380" width="460" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="srckbc" value="&lt;b&gt;KBC workers (R4)&lt;/b&gt;&lt;br/&gt;Spans: kbc.upload, kbc.extract, kbc.diff_review, kbc.approval, kbc.indexing&lt;br/&gt;Metrics: kbc_extract_latency_ms, kbc_approval_rate" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="480" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="srckc" value="&lt;b&gt;Keycloak compartilhado&lt;/b&gt;&lt;br/&gt;Auth events com realm como tenant id&lt;br/&gt;Login success/failure, MFA, ICP-Brasil validations por realm" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#3334B9;fontColor=#FFFFFF;strokeColor=#1F1F8C;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="600" width="460" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="srcrds" value="&lt;b&gt;RDS por tenant&lt;/b&gt;&lt;br/&gt;Performance Insights, Slow query log, pg_stat_statements&lt;br/&gt;Tag CloudWatch: tenant=cartorio-{slug}" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="700" width="460" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="srcaws" value="&lt;b&gt;AWS-managed integrations&lt;/b&gt;&lt;br/&gt;ALB access logs, CloudFront real-time logs, WAF logs, VPC Flow Logs, CloudTrail eventos por tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="800" width="460" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="srcsynth" value="&lt;b&gt;Synthetic + RUM&lt;/b&gt;&lt;br/&gt;CloudWatch Synthetics canary por tenant (login + ato simples)&lt;br/&gt;CloudWatch RUM no SPA (UX core web vitals + erros JS)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="900" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="srcaud" value="&lt;b&gt;Audit DDB Streams&lt;/b&gt;&lt;br/&gt;DDB Stream -&gt; Lambda forwarder -&gt; CW Logs ImmutableTrail&lt;br/&gt;Hash chain por tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="1020" width="460" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="srcbiz" value="&lt;b&gt;Telemetria de negocio&lt;/b&gt;&lt;br/&gt;atos_lavrados_total, billing_eventos_total, kbc_versoes_vigentes, kbc_atrasadas, llm_custo_usd_total. Todas com dim tenant." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="1110" width="460" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="pipe" value="Pipeline AWS Managed" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF7E6;strokeColor=#FF9900;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#7A4900" vertex="1" parent="1">
          <mxGeometry x="660" y="220" width="540" height="980" as="geometry"/>
        </mxCell>
        <mxCell id="cwlogs" value="&lt;b&gt;CloudWatch Logs&lt;/b&gt;&lt;br/&gt;Log groups por servico+tenant&lt;br/&gt;Subscription filters -&gt; Lambda forwarders&lt;br/&gt;Retencao 30d hot, archive S3 7y" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="280" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="amp" value="&lt;b&gt;AWS Managed Prometheus (AMP)&lt;/b&gt;&lt;br/&gt;Metricas Prom + dim tenant&lt;br/&gt;Retencao 150d&lt;br/&gt;Recording rules: P95/P99 latency por tenant + por servico" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="400" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="xray" value="&lt;b&gt;AWS X-Ray&lt;/b&gt;&lt;br/&gt;Distributed traces&lt;br/&gt;Service map global + por tenant&lt;br/&gt;Sampling 100% para erros, 5% para success" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="520" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="cwa" value="&lt;b&gt;CloudWatch Alarms + EventBridge&lt;/b&gt;&lt;br/&gt;Alarme por tenant: error rate &amp;gt; 1%, latency P95 &amp;gt; 2s, fila &amp;gt; 100, KBC vencida, custo Bedrock &amp;gt; budget mensal." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="640" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="cwsrec" value="&lt;b&gt;OpenSearch Service&lt;/b&gt;&lt;br/&gt;Logs full-text para investigacao&lt;br/&gt;Indices por tenant + retencao 30d&lt;br/&gt;Acesso so time Stoix support" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="760" width="460" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kbcsig" value="&lt;b&gt;Sinais KBC dedicados (R4)&lt;/b&gt;&lt;br/&gt;Dashboard KBC Health: kb_versoes_vigentes_count, kb_atrasadas_count, extract_latency_p95, approval_rate_24h, vigencia_alerts_pending. Por tenant + global." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="700" y="880" width="460" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="cost" value="&lt;b&gt;Cost Explorer + custom metrics&lt;/b&gt;&lt;br/&gt;Tag baseado: tenant=cartorio-{slug} em RDS, S3, Lambda, KMS, Bedrock, Textract&lt;br/&gt;Permite cobranca por tenant precisa" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="1020" width="460" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="dash" value="Dashboards e Alertas" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#3F5E2A" vertex="1" parent="1">
          <mxGeometry x="1240" y="220" width="620" height="980" as="geometry"/>
        </mxCell>
        <mxCell id="grafana" value="&lt;b&gt;AWS Managed Grafana&lt;/b&gt;&lt;br/&gt;DataSources: AMP, CloudWatch, X-Ray, OpenSearch&lt;br/&gt;Variavel global $tenant - todos os dashboards filtram por tenant=cartorio-{slug}" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1280" y="280" width="540" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="dash1" value="&lt;b&gt;Dashboard 1 - Cartorio Health (por tenant)&lt;/b&gt;&lt;br/&gt;Atos lavrados/dia, fila pendente, tempo medio de OCR, erros 5xx, KBC vigente vs vencida" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1280" y="400" width="540" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="dash2" value="&lt;b&gt;Dashboard 2 - SLO Stoix (multi-tenant)&lt;/b&gt;&lt;br/&gt;SLO 99,5% disponibilidade. Error budget consumido. Tabela top-10 tenants por erro/latencia." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1280" y="500" width="540" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="dash3" value="&lt;b&gt;Dashboard 3 - KBC Health (R4 NOVO)&lt;/b&gt;&lt;br/&gt;Extract latency P95 por tenant, approval rate 24h, n versoes vigentes, vigencia alerts pendentes, kbc_atrasadas global" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1280" y="600" width="540" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="dash4" value="&lt;b&gt;Dashboard 4 - Custo por tenant&lt;/b&gt;&lt;br/&gt;USD/mes Bedrock, Textract, RDS, S3 por tenant. Comparacao vs preco cobrado. Margem operacional." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1280" y="720" width="540" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="dash5" value="&lt;b&gt;Dashboard 5 - Audit imutavel (DPO)&lt;/b&gt;&lt;br/&gt;Eventos do tenant. DPO consulta UI, nao Grafana. Hash chain validation status, tsa/ots tokens" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1280" y="820" width="540" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="alerts" value="&lt;b&gt;Alertas &amp; Roteamento&lt;/b&gt;&lt;br/&gt;CW Alarms -&gt; SNS -&gt; PagerDuty (severidade alta) ou Slack (severidade media).&lt;br/&gt;Tag tenant no alerta direciona pra runbook especifico.&lt;br/&gt;On-call SRE Stoix em rotacao 24x7. Tabeliao recebe email SES para alertas KBC." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;strokeColor=#DD344C;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1280" y="920" width="540" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="slo" value="&lt;b&gt;SLOs R4 (por tenant)&lt;/b&gt;&lt;br/&gt;Disponibilidade API 99,5% mensal&lt;br/&gt;Latencia P95 API &amp;lt; 800ms&lt;br/&gt;Fluxo B end-to-end P95 &amp;lt; 90s&lt;br/&gt;KBC extract P95 &amp;lt; 5min&lt;br/&gt;KBC approval rate 24h &amp;gt; 70%" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1280" y="1060" width="540" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="e1" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="srcapi" target="cwlogs">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e1_lbl" value="OTLP" style="text;html=1;fontSize=10;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="600" y="295" width="60" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="e2" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="srcwk" target="amp">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e2_lbl" value="metrics" style="text;html=1;fontSize=10;fontColor=#1F4E79;align=center" vertex="1" parent="1">
          <mxGeometry x="600" y="408" width="60" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="e3" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#5C8A3E;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="srckbc" target="kbcsig">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="640" y="528"/>
              <mxPoint x="640" y="940"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e3_lbl" value="kbc spans" style="text;html=1;fontSize=10;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="600" y="940" width="80" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="e4" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F1F8C;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="srckc" target="cwlogs">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="640" y="640"/>
              <mxPoint x="640" y="330"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e4_lbl" value="auth events" style="text;html=1;fontSize=10;fontColor=#1F1F8C;align=center" vertex="1" parent="1">
          <mxGeometry x="600" y="335" width="100" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="e5" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="srcrds" target="amp">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e6" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="srcaws" target="cwlogs">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="640" y="840"/>
              <mxPoint x="640" y="350"/>
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e7" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="srcsynth" target="cwa">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e8" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#D79B00;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="srcaud" target="cwsrec">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e9" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#D79B00;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="srcbiz" target="cost">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="ep1" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#5C8A3E;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="cwlogs" target="grafana">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ep1_lbl" value="data source" style="text;html=1;fontSize=10;fontColor=#3F5E2A;align=center" vertex="1" parent="1">
          <mxGeometry x="1180" y="300" width="100" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="ep2" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#5C8A3E;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="amp" target="grafana">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ep3" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#5C8A3E;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="xray" target="grafana">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ep4" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#DD344C;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="cwa" target="alerts">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ep5" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#5C8A3E;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="kbcsig" target="dash3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ep6" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#D79B00;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="cost" target="dash4">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="legend" value="&lt;b&gt;Legenda Obs R4&lt;/b&gt;  Azul: app/infra Stoix  Verde: KBC + dashboards  Laranja: pipeline gerenciado AWS  Amarelo: cost/biz  Vermelho: alertas  Tag tenant=cartorio-{slug} em TUDO permite filtrar Grafana, queries de log, custo, alertas e SLOs por cartorio." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#999;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="80" y="1240" width="1780" height="60" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="10-cicd-pipeline" name="10-cicd-pipeline">
    <mxGraphModel dx="2200" dy="1500" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="2400" pageHeight="1500" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="CI/CD Pipeline R4 - Pulumi stack por tenant + comandos AWS CLI inline" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="2320" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Pipeline tem 3 tracks: app (codigo), infra-shared (1 stack), infra-tenant (N stacks). Onboarding novo cartorio = pulumi stack init + pulumi up + UAT do tabeliao + pulumi up prd. Cada gate tem comando concreto." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="2320" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; (1) Track 1 (App) - codigo branca pra main -&gt; CI -&gt; ECR -&gt; staging deploy. (2) Track 2 (Infra shared) - mudancas em pulumi/shared -&gt; preview -&gt; up. (3) Track 3 (Infra tenant) - onboarding ou upgrade per-tenant. (4) Gate adicional R4: Tabeliao do cartorio aprova UAT em hml antes de prd. (5) Comandos CLI/pulumi inline em cada gate." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="135" width="2320" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="t1" value="Track 1 - App code (api-bff, workers, kbc workers, web app)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="80" y="240" width="2280" height="280" as="geometry"/>
        </mxCell>
        <mxCell id="t1pr" value="&lt;b&gt;PR aberto&lt;/b&gt;&lt;br/&gt;branch -&gt; main" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="300" width="200" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t1prcmd" value="git push origin feat/x&#10;gh pr create" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="120" y="385" width="200" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="t1ci" value="&lt;b&gt;CI Github Actions&lt;/b&gt;&lt;br/&gt;tsc, eslint, vitest, pnpm test, schema Zod check, OWASP audit" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="380" y="300" width="240" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t1cicmd" value="pnpm install --frozen-lockfile&#10;pnpm test --coverage&#10;pnpm dlx audit-ci --high" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="380" y="385" width="240" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t1build" value="&lt;b&gt;Build + Push ECR&lt;/b&gt;&lt;br/&gt;Imagens com tag SHA + cosign signature" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="680" y="300" width="240" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t1buildcmd" value="aws ecr get-login-password | docker login -u AWS --password-stdin $ECR&#10;docker build -t $ECR/api-bff:$SHA .&#10;cosign sign --key awskms:///alias/cosign $ECR/api-bff:$SHA&#10;docker push $ECR/api-bff:$SHA" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="680" y="385" width="240" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="t1stg" value="&lt;b&gt;Deploy staging&lt;/b&gt;&lt;br/&gt;Auto on merge main" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="980" y="300" width="240" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t1stgcmd" value="aws ecs update-service --cluster stoix-shared-stg --service api-bff &#10;  --task-definition api-bff:$REV --force-new-deployment&#10;aws ecs wait services-stable --cluster stoix-shared-stg --services api-bff" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="980" y="385" width="240" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="t1e2e" value="&lt;b&gt;E2E synthetic&lt;/b&gt;&lt;br/&gt;Playwright login + ato simples + KBC upload em staging" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1280" y="300" width="240" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t1e2ecmd" value="pnpm playwright test --reporter=junit&#10;aws synthetics start-canary-run --name stoix-stg-canary&#10;aws synthetics get-canary-runs --name stoix-stg-canary" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1280" y="385" width="240" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="t1prom" value="&lt;b&gt;Promote candidate&lt;/b&gt;&lt;br/&gt;Tag SHA promovido para hml/prd via Pulumi config" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1580" y="300" width="240" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t1promcmd" value="pulumi config set --stack stoix-shared-prd app:imageTag $SHA&#10;# tags imutaveis no ECR; nao re-build, so update da config" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1580" y="385" width="240" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t1deploy" value="&lt;b&gt;Deploy hml + prd compartilhado&lt;/b&gt;&lt;br/&gt;Rolling update ECS&lt;br/&gt;Atualiza Lambdas via update-function-code" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1880" y="300" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t1deploycmd" value="pulumi up --stack stoix-shared-prd --yes&#10;aws ecs update-service ... --force-new-deployment&#10;aws lambda update-function-code --function-name kbc-extract-worker --image-uri $ECR/kbc-extract:$SHA" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1880" y="385" width="380" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="t2" value="Track 2 - Infra compartilhada (pulumi/shared)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF7E6;strokeColor=#FF9900;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#7A4900" vertex="1" parent="1">
          <mxGeometry x="80" y="540" width="2280" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="t2pr" value="&lt;b&gt;PR pulumi/shared&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="600" width="200" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="t2prcmd" value="pulumi preview --stack stoix-shared-prd --diff&#10;pulumi policy run aws-best-practices --stack ..." style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A4900;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="120" y="665" width="200" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t2review" value="&lt;b&gt;Review preview obrigatorio&lt;/b&gt;&lt;br/&gt;Tech Lead + SRE assinam" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="380" y="600" width="240" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="t2revcmd" value="gh pr review --approve --body 'preview validated'&#10;# CODEOWNERS exige 2 approvers para pulumi/" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A4900;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="380" y="665" width="240" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t2hml" value="&lt;b&gt;Apply hml shared&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="680" y="600" width="240" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="t2hmlcmd" value="pulumi up --stack stoix-shared-hml --yes&#10;aws sts get-caller-identity # confirma role correto" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A4900;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="680" y="665" width="240" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t2smoke" value="&lt;b&gt;Smoke test infra hml&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="980" y="600" width="240" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="t2smokecmd" value="aws ecs describe-clusters --clusters stoix-shared-hml&#10;aws elbv2 describe-target-health --target-group-arn $TG&#10;curl -fsS https://hml.stoix.com.br/health" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A4900;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="980" y="665" width="240" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t2gate" value="&lt;b&gt;Gate humano (CTO/CEO)&lt;/b&gt;&lt;br/&gt;Mudanca em compartilhado afeta TODOS os tenants" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1280" y="600" width="240" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="t2gatecmd" value="# Slack approval ou GitHub environment protection&#10;gh deployment create --ref main --environment shared-prd" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A5A0E;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1280" y="665" width="240" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t2prd" value="&lt;b&gt;Apply prd shared&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1580" y="600" width="240" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="t2prdcmd" value="pulumi up --stack stoix-shared-prd --yes&#10;aws cloudwatch describe-alarms --state-value ALARM" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A4900;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1580" y="665" width="240" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t2note" value="&lt;b&gt;Mudancas em shared sao raras e cuidadosas - blast radius = 100% dos tenants&lt;/b&gt;" style="text;html=1;fontSize=11;fontColor=#8B0000;align=left;fontStyle=1;verticalAlign=middle;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="1880" y="600" width="380" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t3" value="Track 3 - Infra por tenant (pulumi/tenant) - onboarding e upgrades" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#3F5E2A" vertex="1" parent="1">
          <mxGeometry x="80" y="780" width="2280" height="320" as="geometry"/>
        </mxCell>

        <mxCell id="t3init" value="&lt;b&gt;Init tenant&lt;/b&gt;&lt;br/&gt;Operacao manual Stoix&lt;br/&gt;cria stack por env" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="840" width="220" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t3initcmd" value="pulumi stack init cartorio-27sp-hml&#10;pulumi stack init cartorio-27sp-prd&#10;pulumi config set tenant:slug 27sp&#10;pulumi config set tenant:tabeliao_email tabeliao@27sp.com.br" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="120" y="925" width="220" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="t3uphml" value="&lt;b&gt;pulumi up hml&lt;/b&gt;&lt;br/&gt;~12 min&lt;br/&gt;Cria RDS+3 buckets+CMK+realm" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="400" y="840" width="240" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t3uphmlcmd" value="pulumi up --stack cartorio-27sp-hml --yes&#10;aws rds wait db-instance-available --db-instance-identifier cartorio-27sp-hml&#10;aws kms describe-key --key-id alias/cartorio-27sp" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="400" y="925" width="240" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="t3seed" value="&lt;b&gt;Seed inicial hml&lt;/b&gt;&lt;br/&gt;Migrations Postgres + criar realm + criar Tabeliao" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="840" width="240" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t3seedcmd" value="pnpm migrate:up --tenant cartorio-27sp-hml&#10;curl -X POST $KC/admin/realms ... # cria realm&#10;curl -X POST $KC/.../users ... # Tabeliao com TOTP+ICP-Brasil" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="700" y="925" width="240" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="t3uat" value="&lt;b&gt;UAT do Tabeliao em hml (R4 NOVO)&lt;/b&gt;&lt;br/&gt;Tabeliao testa fluxos + sobe primeiras KB versions + aprova&lt;br/&gt;Gate obrigatorio antes de prd" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1000" y="840" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="t3uatcmd" value="# Tabeliao acessa hml.cartorio.stoix.com.br/27sp&#10;# UAT checklist:&#10;# - login MFA + ICP-Brasil A3&#10;# - upload KBC: CGJ-SP emolumentos 2026&#10;# - aprovar kb_version&#10;# - executar Fluxo B end-to-end&#10;gh issue close 'UAT cartorio-27sp aprovado' --reason completed" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A5A0E;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1000" y="945" width="280" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="t3dpa" value="&lt;b&gt;DPA + DPIA assinados&lt;/b&gt;&lt;br/&gt;Caroline valida.&lt;br/&gt;Gate juridico" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="1340" y="840" width="220" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t3dpacmd" value="# Anexos no contrato + checklist em ClickUp&#10;# Sem comando AWS - gate humano&#10;# Bloqueio: pulumi.config.set tenant:dpa_signed=true" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A5A0E;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1340" y="925" width="220" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="t3upprd" value="&lt;b&gt;pulumi up prd&lt;/b&gt;&lt;br/&gt;Cria infra dedicada do tenant em prd&lt;br/&gt;~12 min" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1620" y="840" width="240" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t3upprdcmd" value="# Pre-condicao: $UAT_OK == true &amp;&amp; $DPA_SIGNED == true&#10;pulumi up --stack cartorio-27sp-prd --yes&#10;aws rds describe-db-instances --db-instance-identifier cartorio-27sp-prd&#10;aws s3 ls | grep cartorio-27sp" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1620" y="925" width="240" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="t3ga" value="&lt;b&gt;Go-live + observabilidade ativa&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1920" y="840" width="340" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t3gacmd" value="aws cloudwatch put-metric-alarm --alarm-name cartorio-27sp-error-rate ...&#10;aws synthetics create-canary --name cartorio-27sp-canary ...&#10;aws synthetics start-canary --name cartorio-27sp-canary&#10;# Tabeliao recebe email com URL prd e checklist Day-1" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1920" y="925" width="340" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="t3upgrade" value="&lt;b&gt;Upgrade per-tenant&lt;/b&gt;&lt;br/&gt;Ex: subir RDS de db.t4g.micro para small. Ou aplicar nova KBC migration. Sem afetar outros tenants." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;fontSize=11;align=left;spacingLeft=10;spacingTop=8;verticalAlign=top" vertex="1" parent="1">
          <mxGeometry x="120" y="1130" width="600" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t3upgradecmd" value="# upgrade isolado por tenant - bug em um nao afeta outros&#10;pulumi config set --stack cartorio-27sp-prd rds:instanceClass db.t4g.small&#10;pulumi up --stack cartorio-27sp-prd --yes" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="740" y="1130" width="500" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t3rollback" value="&lt;b&gt;Rollback por tenant&lt;/b&gt;&lt;br/&gt;pulumi state contem versao anterior. Restore RDS via snapshot." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;strokeColor=#DD344C;fontSize=11;align=left;spacingLeft=10;spacingTop=8;verticalAlign=top" vertex="1" parent="1">
          <mxGeometry x="1260" y="1130" width="400" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="t3rollbackcmd" value="pulumi stack history --stack cartorio-27sp-prd&#10;pulumi up --stack cartorio-27sp-prd --target-replace ...&#10;aws rds restore-db-instance-from-db-snapshot ..." style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#8B0000;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1680" y="1130" width="580" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="ec1" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t1pr" target="t1ci">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ec2" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t1ci" target="t1build">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ec3" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t1build" target="t1stg">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ec4" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t1stg" target="t1e2e">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ec5" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t1e2e" target="t1prom">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ec6" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#1F4E79;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t1prom" target="t1deploy">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="ed1" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#7A4900;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t2pr" target="t2review">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed2" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#7A4900;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t2review" target="t2hml">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed3" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#7A4900;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t2hml" target="t2smoke">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed4" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#7A4900;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t2smoke" target="t2gate">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed5" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#7A4900;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t2gate" target="t2prd">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="ee1" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#3F5E2A;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t3init" target="t3uphml">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ee2" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#3F5E2A;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t3uphml" target="t3seed">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ee3" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#3F5E2A;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t3seed" target="t3uat">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ee4" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#D79B00;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t3uat" target="t3dpa">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ee4_lbl" value="aprovacao Tabeliao" style="text;html=1;fontSize=10;fontColor=#7A5A0E;align=center;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1280" y="820" width="180" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="ee5" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#3F5E2A;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t3dpa" target="t3upprd">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ee6" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#3F5E2A;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t3upprd" target="t3ga">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="legend" value="&lt;b&gt;Legenda CICD R4&lt;/b&gt;  Track 1 (azul): app code  Track 2 (laranja): infra compartilhada  Track 3 (verde): infra dedicada por tenant  Caixa Courier: comando real  Gate amarelo: aprovacao humana  Gate vermelho: rollback. R4: pulumi stack init e o trigger do onboarding; UAT do Tabeliao e gate obrigatorio." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#999;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="80" y="1240" width="2280" height="60" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="11-disaster-recovery" name="11-disaster-recovery">
    <mxGraphModel dx="1800" dy="1300" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1900" pageHeight="1500" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Disaster Recovery R4 - Arq A pura, recovery por tenant, KMS sa-east-1 ONLY" style="text;html=1;align=center;fontSize=22;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="40" width="1820" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Multi-AZ in-region + S3 CRR cifrado por tenant. Sem failover ativo us-east-1. Cada tenant tem CRR independente; recovery e per-tenant. KMS exclusivo sa-east-1 mantido - cenario region failure = decadal aceito por contrato." style="text;html=1;align=center;fontSize=14;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="80" width="1820" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="howread" value="&lt;b&gt;Como ler:&lt;/b&gt; (1) Lado esquerdo - regiao primaria sa-east-1 com infra completa (compartilhada + dedicada por tenant). (2) Lado direito - regiao secundaria us-east-1 com APENAS S3 CRR cifrado. (3) Cenarios numerados 1-4 com RTO esperado e procedimento. (4) KMS multi-region keys OFF - chaves so existem em sa-east-1; em region failure decadal o cifrotexto fica em us-east-1 mas espera retorno do KMS." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8DC;strokeColor=#D4AC0D;fontSize=12;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="40" y="135" width="1820" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="r1" value="Regiao primaria - sa-east-1 (Sao Paulo) - PRD ATIVO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#1F4E79;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="80" y="240" width="1100" height="500" as="geometry"/>
        </mxCell>

        <mxCell id="azs" value="Multi-AZ (sa-east-1a + sa-east-1b)" style="text;html=1;align=center;fontSize=12;fontStyle=1;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="100" y="290" width="500" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="ecs" value="ECS Fargate compartilhado (2 AZ)&lt;br/&gt;API + Keycloak + workers" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#85BBF0;strokeColor=#5D82A8;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="320" width="280" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="rdsstoix" value="RDS Stoix-Auth multi-AZ&lt;br/&gt;Failover automatico AZ &amp;lt;1min" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#3334B9;fontColor=#FFFFFF;strokeColor=#1F1F8C;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="420" y="320" width="280" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kmsprim" value="KMS sa-east-1 ONLY&lt;br/&gt;Multi-region keys OFF&lt;br/&gt;CMK por tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DD344C;strokeColor=#B8001F;fontColor=#FFFFFF;fontSize=11;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="720" y="320" width="280" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="tenantsbox" value="N tenants - cada um com infra dedicada multi-AZ" style="text;html=1;align=center;fontSize=12;fontStyle=1;fontColor=#3F5E2A" vertex="1" parent="1">
          <mxGeometry x="100" y="420" width="1060" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="tenant27" value="&lt;b&gt;cartorio-27sp-prd&lt;/b&gt;&lt;br/&gt;RDS multi-AZ (failover AZ &amp;lt;1min)&lt;br/&gt;3 buckets S3&lt;br/&gt;CMK alias/cartorio-27sp" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="120" y="450" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="tenantrj" value="&lt;b&gt;cartorio-rj01-prd&lt;/b&gt;&lt;br/&gt;RDS multi-AZ&lt;br/&gt;3 buckets S3&lt;br/&gt;CMK alias/cartorio-rj01" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="420" y="450" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="tenantn" value="&lt;b&gt;cartorio-{slug}-prd&lt;/b&gt;&lt;br/&gt;...&lt;br/&gt;Cada tenant 100% isolado em DR&lt;br/&gt;Backup/restore independente" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#A4C97A;strokeColor=#5C8A3E;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="720" y="450" width="280" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="snap" value="&lt;b&gt;Snapshots automaticos por tenant&lt;/b&gt;&lt;br/&gt;RDS: snapshot diario + transaction log continuo (PITR 7d)&lt;br/&gt;S3 versionamento + Object Lock (livro_notas perpetuo / documento 30y / audit 7y)&lt;br/&gt;DDB PITR 35d + export S3 mensal&lt;br/&gt;Pulumi state em S3 com versionamento + DynamoDB lock" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="120" y="580" width="880" height="140" as="geometry"/>
        </mxCell>

        <mxCell id="r2" value="Regiao secundaria - us-east-1 (N. Virginia) - APENAS S3 CRR CIFRADO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;strokeColor=#DD344C;dashed=1;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#8B0000" vertex="1" parent="1">
          <mxGeometry x="1220" y="240" width="640" height="500" as="geometry"/>
        </mxCell>
        <mxCell id="us27" value="&lt;b&gt;S3 CRR por tenant (us-east-1)&lt;/b&gt;&lt;br/&gt;cartorio-27sp-uploads-dr&lt;br/&gt;cartorio-27sp-minutas-worm-dr&lt;br/&gt;cartorio-27sp-kb-dr&lt;br/&gt;Cifrotexto only - KMS sa-east-1 nao acompanha" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1260" y="290" width="560" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="usrj" value="&lt;b&gt;S3 CRR cartorio-rj01-*-dr&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1260" y="410" width="560" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="usn" value="&lt;b&gt;S3 CRR cartorio-{slug}-*-dr (1 set por tenant)&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE6CC;strokeColor=#D79B00;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1260" y="490" width="560" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="usnotes" value="&lt;b&gt;us-east-1 NAO tem:&lt;/b&gt;&lt;br/&gt;ECS, Aurora, RDS reader, Lambda, Bedrock, Textract, Keycloak, KMS chaves Stoix.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;us-east-1 SO tem:&lt;/b&gt; cifrotexto S3.&lt;br/&gt;Sem KMS local nao da pra decifrar - aguarda sa-east-1 voltar." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;strokeColor=#DD344C;fontColor=#8B0000;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="1260" y="570" width="560" height="160" as="geometry"/>
        </mxCell>

        <mxCell id="cen" value="Cenarios e RTO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#444;dashed=0;strokeWidth=2;verticalAlign=top;align=left;spacingLeft=20;spacingTop=14;fontSize=14;fontStyle=1;fontColor=#444" vertex="1" parent="1">
          <mxGeometry x="80" y="770" width="1780" height="600" as="geometry"/>
        </mxCell>

        <mxCell id="c1" value="&lt;b&gt;Cenario 1 - Falha de AZ (rotineiro - 1-2x/ano)&lt;/b&gt;&lt;br/&gt;Impacto: parcial. Failover automatico.&lt;br/&gt;RTO esperado: &amp;lt; 5 min, RPO ~ 0&lt;br/&gt;Tenants afetados: TODOS, simultaneamente, mas tempo curto." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF7E8;strokeColor=#5C8A3E;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="120" y="820" width="540" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="c1cmd" value="# Acao automatica:&#10;# - RDS multi-AZ failover (~30s)&#10;# - ECS Fargate task replacement (~1-2min)&#10;# - ALB health check remove targets degradados&#10;# Verificacao manual:&#10;aws rds describe-events --duration 60 --source-type db-instance&#10;aws ecs describe-services --cluster stoix-shared --services api-bff" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#3F5E2A;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="120" y="945" width="540" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="c2" value="&lt;b&gt;Cenario 2 - Falha de RDS de UM tenant (corruption, bug query)&lt;/b&gt;&lt;br/&gt;Impacto: 1 cartorio. Outros tenants intactos.&lt;br/&gt;RTO esperado: 30-60 min&lt;br/&gt;RPO: ate 5 min (PITR)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF7E6;strokeColor=#FF9900;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="690" y="820" width="540" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="c2cmd" value="# Restore PITR no proprio tenant:&#10;aws rds restore-db-instance-to-point-in-time &#10;  --source-db-instance-identifier cartorio-27sp-prd &#10;  --target-db-instance-identifier cartorio-27sp-prd-restore &#10;  --restore-time 2026-05-07T14:00:00Z&#10;# Apos validacao, swap via Pulumi config + pulumi up" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A4900;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="690" y="945" width="540" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="c3" value="&lt;b&gt;Cenario 3 - Tenant compromise (KBC errada aprovada / dado vazado)&lt;/b&gt;&lt;br/&gt;Impacto: 1 cartorio.&lt;br/&gt;RTO depende da extensao&lt;br/&gt;Acoes: rollback kb_version, restore S3 versionado, audit forensics no DDB do tenant" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF7E6;strokeColor=#FF9900;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="1260" y="820" width="540" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="c3cmd" value="# Rollback kb_version no DB:&#10;UPDATE kb_version SET status='superseded' WHERE id=$BAD_VERSION;&#10;UPDATE kb_version SET status='vigente' WHERE id=$PREV_VERSION;&#10;# Restore S3 versionado:&#10;aws s3api list-object-versions --bucket cartorio-27sp-kb&#10;aws s3api copy-object --copy-source ...?versionId=$PREV ..." style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#7A4900;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="1260" y="945" width="540" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="c4" value="&lt;b&gt;Cenario 4 - Region failure sa-east-1 (cenario decadal)&lt;/b&gt;&lt;br/&gt;Impacto: TOTAL. Todos tenants offline.&lt;br/&gt;RTO: indeterminado (espera AWS recuperar sa-east-1)&lt;br/&gt;Cifrotexto S3 CRR esta em us-east-1, mas KMS sa-east-1 fora = sem decifragem.&lt;br/&gt;Aceito por contrato (Lei 8.935 nao exige RTO especifico)." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCEAEA;strokeColor=#DD344C;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="120" y="1100" width="840" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="c4cmd" value="# Sem comando de failover - aguardar sa-east-1 voltar.&#10;# Comunicacao:&#10;# 1) Tabeliao notificado por email (SES) ou SMS (canal alternativo)&#10;# 2) Pagina de status: status.stoix.com.br&#10;# 3) Quando sa-east-1 voltar:&#10;aws health describe-events --filter eventTypeCodes=AWS_REGION_DOWN&#10;aws rds describe-db-instances --db-instance-identifier cartorio-27sp-prd&#10;# Validar consistencia + ato_instance.status pendentes -&gt; reprocessar fila SQS" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#8B0000;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="120" y="1245" width="840" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="c5" value="&lt;b&gt;Pratica regular obrigatoria&lt;/b&gt;&lt;br/&gt;1) Restore drill de RDS por tenant a cada 90d (chaos engineering leve)&lt;br/&gt;2) Failover AZ test trimestral em hml&lt;br/&gt;3) S3 versioning recovery test mensal em hml&lt;br/&gt;4) Pulumi state recovery test trimestral&lt;br/&gt;5) DDB PITR test mensal" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EAF2FB;strokeColor=#5D82A8;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="990" y="1100" width="810" height="140" as="geometry"/>
        </mxCell>
        <mxCell id="c5cmd" value="# Restore drill mensal (em hml):&#10;aws rds create-db-snapshot --db-instance-identifier cartorio-27sp-hml --db-snapshot-identifier drill-$(date +%F)&#10;aws rds restore-db-instance-from-db-snapshot --target ... # tempo cronometrado&#10;# Documentar tempo real em runbook + atualizar SLA contratual" style="text;html=1;fontSize=10;fontFamily=Courier New;fontColor=#1F4E79;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
          <mxGeometry x="990" y="1245" width="810" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="er1" style="endArrow=classic;html=1;exitX=1;exitY=0.3;entryX=0;entryY=0.3;strokeWidth=2;strokeColor=#D79B00;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="tenant27" target="us27">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="er1_lbl" value="CRR cifrado - replica continua" style="text;html=1;fontSize=10;fontColor=#7A5A0E;align=center" vertex="1" parent="1">
          <mxGeometry x="1010" y="430" width="240" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="er2" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#D79B00;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="tenantrj" target="usrj">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="er3" style="endArrow=classic;html=1;exitX=1;exitY=0.7;entryX=0;entryY=0.5;strokeWidth=1.5;strokeColor=#D79B00;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="tenantn" target="usn">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="legend" value="&lt;b&gt;Legenda DR R4&lt;/b&gt;  Verde claro: tenant dedicado  Azul: infra primaria  Laranja: backup/replication  Vermelho: KMS/Secrets/region failure  Caixa Courier: comando real. R4 muda vs R3: cada tenant tem CRR independente; recovery e per-tenant; KMS sa-east-1 ONLY mantido (cenario decadal aceito por contrato)." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#999;fontSize=11;align=left;verticalAlign=middle;spacingLeft=14;spacingRight=14" vertex="1" parent="1">
          <mxGeometry x="80" y="1390" width="1780" height="60" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="00-mapa-do-sistema" name="00-mapa-do-sistema">
    <mxGraphModel dx="1600" dy="1000" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1600" pageHeight="1100" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Mapa do Sistema — Software Cartorial Stoix" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=20;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1520" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="subtitle" value="Visão macro de todas as telas e suas conexões — wireframe low-fi" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="55" width="1520" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="login" value="01 Login&#10;(2FA, todos os perfis)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="100" width="200" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="lane-tabeliao" value="TABELIÃO (Lucas)" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#666;fontSize=12;fontStyle=1;startSize=24" vertex="1" parent="1">
          <mxGeometry x="40" y="200" width="500" height="700" as="geometry"/>
        </mxCell>

        <mxCell id="lane-escrevente" value="ESCREVENTE (até 6)" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#666;fontSize=12;fontStyle=1;startSize=24" vertex="1" parent="1">
          <mxGeometry x="560" y="200" width="500" height="700" as="geometry"/>
        </mxCell>

        <mxCell id="lane-dpo-admin" value="DPO / ADMIN" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#666;fontSize=12;fontStyle=1;startSize=24" vertex="1" parent="1">
          <mxGeometry x="1080" y="200" width="480" height="700" as="geometry"/>
        </mxCell>

        <mxCell id="dash-tab" value="02 Dashboard Tabelião&#10;Métricas + atos pendentes&#10;de aprovação + alertas" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="80" y="250" width="180" height="70" as="geometry"/>
        </mxCell>

        <mxCell id="catalogo" value="08 Catálogo de Atos&#10;Lista de tipos cadastrados&#10;(versão, status)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="320" y="250" width="180" height="70" as="geometry"/>
        </mxCell>

        <mxCell id="fa-1" value="04 Fluxo A · 1&#10;Upload modelo&#10;(PDF/DOCX vigente)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="80" y="360" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="fa-2" value="05 Fluxo A · 2&#10;Revisão sugestões IA&#10;(aceitar/editar/rejeitar)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="320" y="360" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="fa-3" value="06 Fluxo A · 3&#10;Parâmetros e regras&#10;(variáveis + validações)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="80" y="450" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="fa-4" value="07 Fluxo A · 4&#10;Aprovação final&#10;e publicação" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="320" y="450" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="rel-billing" value="15 Relatório Billing&#10;Minutas / mês&#10;3,1% ou R$ 7,50" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="80" y="560" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="rel-sla" value="16 Relatório SLA&#10;Disponibilidade,&#10;tickets, severidade" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="320" y="560" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="config-cart" value="18 Configurações Cartório&#10;Dados, ambiente,&#10;integrações" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="80" y="660" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="gest-users" value="17 Gestão Usuários&#10;Papéis, permissões,&#10;reset senha" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="320" y="660" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="dash-escr" value="03 Dashboard Escrevente&#10;Ação primária NOVO ATO&#10;+ fila de revisão" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="600" y="250" width="180" height="70" as="geometry"/>
        </mxCell>

        <mxCell id="fila-rev" value="13 Fila de Revisão&#10;Rascunho / em revisão /&#10;pronto p/ lavratura" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="840" y="250" width="180" height="70" as="geometry"/>
        </mxCell>

        <mxCell id="fb-1" value="09 Fluxo B · 1&#10;Selecionar tipo de ato&#10;do catálogo" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="600" y="360" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="fb-2" value="10 Fluxo B · 2&#10;Upload docs partes + OCR&#10;(RG, CPF, matrícula...)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="840" y="360" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="fb-3" value="11 Fluxo B · 3&#10;Preenchimento LLM&#10;+ revisão campo a campo" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="600" y="450" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="fb-4" value="12 Fluxo B · 4&#10;Alertas e validações&#10;(regras pré-cadastradas)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="840" y="450" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="fb-5" value="14 Fluxo B · 5&#10;Minuta final + emolumento&#10;(GERAR MINUTA)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="720" y="560" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="dpo-area" value="19 Área DPO / LGPD&#10;Logs, incidentes (48h),&#10;exportação dados" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1120" y="250" width="180" height="70" as="geometry"/>
        </mxCell>

        <mxCell id="audit-trail" value="Audit trail&#10;(timeline lateral em&#10;cada minuta — não tela)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;dashed=1" vertex="1" parent="1">
          <mxGeometry x="1340" y="250" width="180" height="70" as="geometry"/>
        </mxCell>

        <mxCell id="admin-stoix" value="Painel Admin Stoix&#10;(multi-tenant, suporte&#10;— FORA do MVP cliente)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;dashed=1" vertex="1" parent="1">
          <mxGeometry x="1120" y="360" width="180" height="70" as="geometry"/>
        </mxCell>

        <mxCell id="legenda-box" value="LEGENDA&#10;Caixa branca = tela wireframada&#10;Caixa pontilhada amarela = futuro / fora do MVP&#10;Seta cheia = navegação direta&#10;Seta tracejada = fluxo condicional / aprovação&#10;Cor de header HOMOLOGAÇÃO ≠ PRODUÇÃO&#10;sempre visível em todas as telas." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1120" y="560" width="400" height="160" as="geometry"/>
        </mxCell>

        <mxCell id="e1" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0" edge="1" parent="1" source="login" target="dash-tab">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e2" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0" edge="1" parent="1" source="login" target="dash-escr">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e3" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0" edge="1" parent="1" source="login" target="dpo-area">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="e4" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="dash-tab" target="catalogo">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e5" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="catalogo" target="fa-1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e6" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="fa-1" target="fa-2">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e7" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="fa-2" target="fa-3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e8" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="fa-3" target="fa-4">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e9" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="fa-4" target="catalogo">
          <mxGeometry relative="1" as="geometry"/>
          <mxCell value="publicar"/>
        </mxCell>

        <mxCell id="e10" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="dash-escr" target="fb-1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e11" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="fb-1" target="fb-2">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e12" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="fb-2" target="fb-3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e13" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="fb-3" target="fb-4">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e14" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="fb-4" target="fb-5">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="e15" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="fb-3" target="fila-rev">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e16" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="fila-rev" target="fb-5">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="e17" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="fb-5" target="rel-billing">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="e18" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="dash-tab" target="rel-billing">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e19" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="dash-tab" target="rel-sla">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e20" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="dash-tab" target="config-cart">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e21" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="dash-tab" target="gest-users">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="01-fluxo-a-cadastro-ato" name="01-fluxo-a-cadastro-ato">
    <mxGraphModel dx="1800" dy="1200" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1700" pageHeight="2400" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Fluxo A — Cadastro Autônomo de Tipo de Ato (Tabelião)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1620" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Swimlanes: Tabelião · Sub-agentes IA · Sistema · Catálogo. Cada item gerado por IA passa por revisão humana." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="55" width="1620" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="lane-tab" value="TABELIÃO" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="100" width="1620" height="320" as="geometry"/>
        </mxCell>
        <mxCell id="lane-ia" value="SUB-AGENTES IA" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="420" width="1620" height="320" as="geometry"/>
        </mxCell>
        <mxCell id="lane-sys" value="SISTEMA" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="740" width="1620" height="280" as="geometry"/>
        </mxCell>
        <mxCell id="lane-cat" value="CATÁLOGO" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="1020" width="1620" height="200" as="geometry"/>
        </mxCell>

        <mxCell id="start" value="Início" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="100" y="200" width="80" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="t1" value="Tabelião abre&#10;Catálogo →&#10;NOVO TIPO DE ATO" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="220" y="190" width="140" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t2" value="Faz upload de&#10;modelo PDF/DOCX&#10;vigente do ato" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="400" y="190" width="140" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t3" value="Revisa item-a-item&#10;sugestões IA&#10;(estrutura, cláusulas)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="800" y="190" width="160" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t-decisao" value="Aceita?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1000" y="190" width="100" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t-edita" value="Edita ou&#10;rejeita item" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1140" y="270" width="120" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="t4" value="Define parâmetros&#10;(variáveis) e regras&#10;de validação" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1140" y="190" width="140" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t5" value="Preview final +&#10;assinatura digital +&#10;PUBLICAR" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1340" y="190" width="160" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="ia1" value="Agente Estrutura&#10;sugere seções&#10;(qualificação, objeto,&#10;cláusulas, fechamento)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;dashed=1" vertex="1" parent="1">
          <mxGeometry x="400" y="500" width="160" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="ia2" value="Agente Cláusulas&#10;extrai cláusulas-tipo&#10;e propõe redação&#10;parametrizada" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;dashed=1" vertex="1" parent="1">
          <mxGeometry x="580" y="500" width="160" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="ia3" value="Agente Parâmetros&#10;identifica variáveis&#10;(ex: nome, CPF,&#10;valor, matrícula)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;dashed=1" vertex="1" parent="1">
          <mxGeometry x="760" y="500" width="160" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="ia4" value="Agente Regras&#10;sugere validações&#10;e alertas&#10;(CPF válido, etc.)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;dashed=1" vertex="1" parent="1">
          <mxGeometry x="940" y="500" width="160" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="ia-note" value="IA gera apenas SUGESTÕES.&#10;Nada é aplicado sem aprovação humana." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="400" y="600" width="700" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="sys1" value="Persiste arquivo&#10;e dispara&#10;sub-agentes IA" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="580" y="800" width="140" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="sys2" value="Persiste decisões&#10;humanas (audit trail&#10;de cada item)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="900" y="800" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="sys3" value="Compila template&#10;parametrizado&#10;(versão N)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1140" y="800" width="140" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="sys4" value="Assina digitalmente&#10;e marca como ATIVO&#10;no catálogo" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1340" y="800" width="160" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="cat1" value="Tipo disponível&#10;para Fluxo B (escreventes)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1340" y="1090" width="180" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="end" value="Fim" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1560" y="1100" width="80" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="ed1" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="start" target="t1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed2" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t1" target="t2">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed3" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t2" target="sys1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed4" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="sys1" target="ia1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed5" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="sys1" target="ia2">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed6" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="sys1" target="ia3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed7" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="sys1" target="ia4">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="ed8" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="ia2" target="t3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="ed9" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t3" target="t-decisao">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="ed10" value="Sim" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t-decisao" target="t4">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed11" value="Não" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t-decisao" target="t-edita">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed12" value="loop" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="t-edita" target="t3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <mxCell id="ed13" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t3" target="sys2">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed14" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t4" target="t5">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed15" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t4" target="sys3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed16" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t5" target="sys4">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed17" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="sys4" target="cat1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ed18" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="cat1" target="end">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="02-fluxo-b-execucao-ato" name="02-fluxo-b-execucao-ato">
    <mxGraphModel dx="1800" dy="1400" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="1400" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Fluxo B — Execução de Ato (Escrevente, com OCR + LLM)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1720" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Swimlanes: Escrevente · OCR · LLM · Sistema · Tabelião (auditoria post-fact). Geração da minuta = evento de billing." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="55" width="1720" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="lane-esc" value="ESCREVENTE" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="100" width="1720" height="240" as="geometry"/>
        </mxCell>
        <mxCell id="lane-ocr" value="OCR" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="340" width="1720" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="lane-llm" value="LLM" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="520" width="1720" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="lane-sys" value="SISTEMA (regras, audit, billing)" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="700" width="1720" height="240" as="geometry"/>
        </mxCell>
        <mxCell id="lane-tab" value="TABELIÃO (auditoria)" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="940" width="1720" height="160" as="geometry"/>
        </mxCell>

        <mxCell id="start" value="Início" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="100" y="200" width="80" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="e1" value="Dashboard&#10;NOVO ATO" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="220" y="200" width="120" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="e2" value="Seleciona tipo&#10;de ato (catálogo)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="380" y="200" width="120" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="e3" value="Upload docs&#10;das partes&#10;(RG, CPF, matrícula)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="540" y="195" width="140" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="e4" value="Revisa dados&#10;extraídos pela IA&#10;campo a campo" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="900" y="195" width="140" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="e-decisao" value="Alertas?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1080" y="200" width="100" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="e5" value="Corrige campos&#10;ou complementa" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1080" y="270" width="120" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="e6" value="Marca como&#10;PRONTO P/&#10;REVISÃO" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1240" y="200" width="120" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="e7" value="Par revisa&#10;na fila" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1400" y="200" width="100" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="e8" value="GERAR&#10;MINUTA FINAL" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1540" y="200" width="120" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="ocr1" value="OCR processa&#10;arquivos enviados" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;dashed=1" vertex="1" parent="1">
          <mxGeometry x="540" y="395" width="140" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="ocr2" value="Extrai texto&#10;estruturado&#10;por documento" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;dashed=1" vertex="1" parent="1">
          <mxGeometry x="700" y="395" width="140" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="llm1" value="LLM lê texto OCR&#10;+ template do ato" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;dashed=1" vertex="1" parent="1">
          <mxGeometry x="700" y="575" width="140" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="llm2" value="Popula variáveis&#10;do template&#10;com dados extraídos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;dashed=1" vertex="1" parent="1">
          <mxGeometry x="860" y="575" width="160" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="llm-note" value="LLM faz proposta. Cada campo mostrado com badge 'sugestão IA' e nível de confiança." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="700" y="650" width="500" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="s1" value="Cria rascunho&#10;(audit: criado por X)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="380" y="780" width="140" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="s2" value="Aplica regras&#10;pré-cadastradas&#10;(CPF, matrícula, etc.)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="900" y="780" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="s3" value="Move na fila:&#10;rascunho → revisão" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1240" y="780" width="140" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="s4" value="Calcula emolumento&#10;(tabela CGJ-SP) +&#10;billing (3,1% ou R$7,50)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1540" y="780" width="180" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="s5" value="Audit: minuta gerada,&#10;quem assinou,&#10;timestamp imutável" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1540" y="870" width="180" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="t1" value="Vê painel de&#10;atos do dia&#10;(post-fact)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1540" y="990" width="160" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="end" value="Fim&#10;(minuta pronta&#10;para lavratura)" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1540" y="280" width="120" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="ed1" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="start" target="e1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed2" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e1" target="e2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed3" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e2" target="e3"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed4" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e2" target="s1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed5" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="e3" target="ocr1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed6" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="ocr1" target="ocr2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed7" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="ocr2" target="llm1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed8" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="llm1" target="llm2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed9" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="llm2" target="e4"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed10" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e4" target="s2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed11" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e4" target="e-decisao"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed12" value="Sim" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e-decisao" target="e5"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed13" value="loop" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="e5" target="e4"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed14" value="Não" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e-decisao" target="e6"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed15" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e6" target="s3"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed16" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e6" target="e7"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed17" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e7" target="e8"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed18" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e8" target="s4"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed19" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="s4" target="s5"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed20" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="s5" target="t1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed21" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e8" target="end"><mxGeometry relative="1" as="geometry"/></mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="03-fluxo-onboarding" name="03-fluxo-onboarding">
    <mxGraphModel dx="1400" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1400" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Fluxo Onboarding — Primeiro Acesso e Setup do Cartório" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Setup inicial conduzido pelo Admin Stoix junto com o Tabelião. Cartório começa em HOMOLOGAÇÃO." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="55" width="1320" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="lane-stoix" value="ADMIN STOIX" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="100" width="1320" height="200" as="geometry"/>
        </mxCell>
        <mxCell id="lane-tab" value="TABELIÃO" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="300" width="1320" height="240" as="geometry"/>
        </mxCell>
        <mxCell id="lane-esc" value="ESCREVENTES" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="540" width="1320" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="lane-sys" value="SISTEMA" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="720" width="1320" height="160" as="geometry"/>
        </mxCell>

        <mxCell id="start" value="Início" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="100" y="180" width="80" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="a1" value="Provisiona tenant&#10;do cartório&#10;(modo HOMOLOGAÇÃO)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="220" y="170" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="a2" value="Cria conta inicial&#10;do Tabelião&#10;(envio convite e-mail)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="420" y="170" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="a3" value="Importa tabela&#10;CGJ-SP de&#10;emolumentos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="620" y="170" width="160" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t1" value="Aceita convite,&#10;define senha,&#10;ativa 2FA" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="220" y="380" width="140" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="t2" value="Completa dados&#10;do cartório&#10;(CNPJ, endereço, DPO)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="400" y="380" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="t3" value="Cria contas dos&#10;escreventes (até 6)&#10;e atribui papel" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="600" y="380" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="t4" value="Cadastra 1º tipo&#10;de ato (Fluxo A)&#10;ainda em homologação" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="800" y="380" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="t5" value="Após validação,&#10;solicita migração&#10;HOMOL → PROD" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1000" y="380" width="160" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="e1" value="Aceitam convites&#10;ativam 2FA" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="600" y="600" width="160" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="e2" value="Tutorial guiado&#10;Fluxo B&#10;(ato simulado)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="800" y="600" width="160" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="s1" value="Migra ambiente&#10;para PRODUÇÃO,&#10;ativa billing" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1180" y="780" width="160" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="end" value="Cartório operando&#10;em PRODUÇÃO" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1200" y="380" width="120" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="ed1" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="start" target="a1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed2" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="a1" target="a2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed3" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="a2" target="a3"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed4" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="a2" target="t1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed5" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t1" target="t2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed6" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t2" target="t3"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed7" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t3" target="t4"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed8" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t3" target="e1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed9" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="e1" target="e2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed10" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t4" target="t5"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed11" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t5" target="s1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed12" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="s1" target="end"><mxGeometry relative="1" as="geometry"/></mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="04-fluxo-billing-mensal" name="04-fluxo-billing-mensal">
    <mxGraphModel dx="1400" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1400" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Fluxo Billing Mensal — Apuração e Fechamento" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Apuração: somar minutas geradas em PRODUÇÃO no mês × max(3,1% do emolumento, R$ 7,50). Cálculo derivado do audit trail." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="55" width="1320" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="lane-sys" value="SISTEMA" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="100" width="1320" height="280" as="geometry"/>
        </mxCell>
        <mxCell id="lane-tab" value="TABELIÃO" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="380" width="1320" height="200" as="geometry"/>
        </mxCell>
        <mxCell id="lane-stoix" value="ADMIN STOIX / FINANCEIRO" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="580" width="1320" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="start" value="Início&#10;(dia 1 do mês)" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="100" y="200" width="100" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="s1" value="Coleta minutas&#10;PRODUÇÃO no mês&#10;via audit trail" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="240" y="200" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="s2" value="Para cada minuta:&#10;calcula max(3,1% × emol., R$ 7,50)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="440" y="200" width="200" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="s3" value="Soma total&#10;e gera prévia&#10;de fatura" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="680" y="200" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="s4" value="Notifica Tabelião&#10;(dashboard +&#10;e-mail)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="880" y="200" width="160" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t1" value="Abre Relatório&#10;Billing&#10;e revisa" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="880" y="450" width="160" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="t-decisao" value="Concorda?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1080" y="450" width="100" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="t-contesta" value="Contesta&#10;(ticket suporte)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1080" y="520" width="140" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="adm1" value="Stoix analisa&#10;contestação&#10;c/ audit trail" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1080" y="640" width="140" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="adm2" value="Emite NF&#10;e envia boleto&#10;ao cartório" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="880" y="640" width="160" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="adm3" value="Concilia pagamento&#10;e fecha mês" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="680" y="640" width="160" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="end" value="Fim&#10;(mês fechado)" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="500" y="640" width="120" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="ed1" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="start" target="s1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed2" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="s1" target="s2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed3" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="s2" target="s3"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed4" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="s3" target="s4"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed5" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="s4" target="t1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed6" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t1" target="t-decisao"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed7" value="Sim" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t-decisao" target="adm2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed8" value="Não" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t-decisao" target="t-contesta"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed9" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t-contesta" target="adm1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed10" value="ajusta" style="endArrow=classic;html=1;rounded=0;dashed=1" edge="1" parent="1" source="adm1" target="adm2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed11" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="adm2" target="adm3"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed12" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="adm3" target="end"><mxGeometry relative="1" as="geometry"/></mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="05-fluxo-incidente-lgpd" name="05-fluxo-incidente-lgpd">
    <mxGraphModel dx="1400" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1400" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="Fluxo Incidente LGPD — Detecção e Notificação em 48h" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1320" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Detecção (auto ou denúncia) → triagem → notificação DPO → comunicação ANPD/titulares dentro de 48h." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="55" width="1320" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="lane-sys" value="SISTEMA / DETECÇÃO" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="100" width="1320" height="200" as="geometry"/>
        </mxCell>
        <mxCell id="lane-dpo" value="DPO" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="300" width="1320" height="240" as="geometry"/>
        </mxCell>
        <mxCell id="lane-tab" value="TABELIÃO" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="540" width="1320" height="160" as="geometry"/>
        </mxCell>
        <mxCell id="lane-anpd" value="ANPD / TITULARES (externo)" style="swimlane;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333;fontSize=12;fontStyle=1;startSize=24;horizontal=0" vertex="1" parent="1">
          <mxGeometry x="40" y="700" width="1320" height="160" as="geometry"/>
        </mxCell>

        <mxCell id="start" value="Evento&#10;detectado" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="100" y="180" width="100" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="s1" value="Trigger automático&#10;(acesso anômalo,&#10;export massivo, etc.)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="240" y="180" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="s2" value="Cria incidente&#10;com timestamp,&#10;notifica DPO" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="440" y="180" width="160" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="d1" value="DPO recebe alerta&#10;e abre painel LGPD" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="440" y="370" width="160" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="d2" value="Triagem:&#10;classifica severidade&#10;(baixa/média/alta)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="640" y="370" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="d-decisao" value="Risco a&#10;titulares?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="840" y="370" width="120" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="d3" value="Documenta no log&#10;(sem notificação)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="840" y="450" width="160" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="d4" value="Prepara minuta&#10;de comunicação ANPD&#10;e aos titulares" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1000" y="370" width="160" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="t1" value="Tabelião revisa&#10;e aprova&#10;(co-controlador)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1000" y="580" width="160" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="d5" value="Envia em até 48h&#10;da ciência" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1180" y="370" width="140" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="anpd" value="ANPD / titulares&#10;recebem comunicação" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1180" y="760" width="140" height="50" as="geometry"/>
        </mxCell>

        <mxCell id="end1" value="Fim" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="900" y="510" width="60" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="end2" value="Fim" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1340" y="770" width="40" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="ed1" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="start" target="s1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed2" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="s1" target="s2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed3" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="s2" target="d1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed4" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="d1" target="d2"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed5" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="d2" target="d-decisao"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed6" value="Não" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="d-decisao" target="d3"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed7" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="d3" target="end1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed8" value="Sim" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="d-decisao" target="d4"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed9" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="d4" target="t1"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed10" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="t1" target="d5"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed11" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="d5" target="anpd"><mxGeometry relative="1" as="geometry"/></mxCell>
        <mxCell id="ed12" style="endArrow=classic;html=1;rounded=0" edge="1" parent="1" source="anpd" target="end2"><mxGeometry relative="1" as="geometry"/></mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="01-login" name="01-login">
    <mxGraphModel dx="1400" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1300" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="01 — Tela de Login" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="800" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="env-bar" value="HOMOLOGAÇÃO  |  produção tem header neutro" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#333;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="logo" value="[ Logo Stoix Cartorial ]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#999;fontSize=12" vertex="1" parent="1">
          <mxGeometry x="540" y="160" width="200" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="cartorio-name" value="27º Tabelionato de Notas — São Paulo / SP" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="440" y="230" width="400" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="form-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="440" y="280" width="400" height="380" as="geometry"/>
        </mxCell>

        <mxCell id="form-title" value="Acessar a plataforma" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="460" y="295" width="360" height="25" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-email" value="E-mail funcional" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="460" y="335" width="360" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-email" value="seu.nome@27notas.com.br" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="460" y="357" width="360" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-senha" value="Senha" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="460" y="405" width="360" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-senha" value="••••••••••" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="460" y="427" width="320" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="show-pwd" value="ver" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="780" y="427" width="40" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-2fa" value="Código 2FA (6 dígitos)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="460" y="475" width="360" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-2fa" value="000 000" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="460" y="497" width="360" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="btn-login" value="Entrar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="460" y="555" width="360" height="42" as="geometry"/>
        </mxCell>

        <mxCell id="forgot" value="Esqueci minha senha" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=4" vertex="1" parent="1">
          <mxGeometry x="460" y="610" width="360" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="footer" value="Stoix Cartorial · v1.0 · suporte@stoix.dev · LGPD: dpo@stoix.dev" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="820" width="1200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="ann-1" value="ANOTAÇÕES UX&#10;1. Banner de ambiente sempre visível (laranja em homol., neutro em produção).&#10;2. 2FA é obrigatório para todos os perfis (Tabelião, Escrevente, DPO). Sistema cartorial = dados sensíveis LGPD.&#10;3. Sem 'lembrar de mim' — sessão sensível. Sessão expira em 30min de inatividade (suposição UX — validar).&#10;4. Microcopy: 'E-mail funcional' deixa claro que não é login pessoal — é vínculo com o cartório.&#10;5. 1 único formulário, sem etapas. Tabelião, Escrevente e DPO usam mesma tela; sistema redireciona ao dashboard correto." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="900" y="280" width="320" height="380" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="02-dashboard-tabeliao" name="02-dashboard-tabeliao">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="02 — Dashboard do Tabelião" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="800" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="search" value="[buscar] buscar ato, parte, nº protocolo..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;spacingLeft=8;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="400" y="76" width="380" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas C. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1060" y="78" width="170" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="sidebar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="744" as="geometry"/>
        </mxCell>
        <mxCell id="nav1" value="▣  Dashboard" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="130" width="200" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="nav2" value="[catalogo]  Catálogo de atos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="170" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav3" value="[lista]  Atos em execução" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="206" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav4" value="[graph]  Relatórios" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="242" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav5" value="[users]  Usuários" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="278" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav6" value="⚙  Configurações" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="314" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav7" value="[shield]  LGPD / DPO" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="350" width="200" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="welcome" value="Bom dia, Lucas. Hoje é 06/05/2026." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="130" width="500" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="kpi1" value="MINUTAS NO MÊS&#10;47" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="260" y="180" width="220" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kpi1-sub" value="produção · ↑ 12 vs mês anterior" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="272" y="250" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="kpi2" value="EMOLUMENTO ACUMULADO&#10;R$ 142.380,00" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="500" y="180" width="220" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kpi2-sub" value="estimativa billing Stoix: R$ 4.413,78" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="512" y="250" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="kpi3" value="FILA DE REVISÃO&#10;6" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="740" y="180" width="220" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kpi3-sub" value="3 prontos p/ lavratura" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="752" y="250" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="kpi4" value="ALERTAS&#10;2" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="980" y="180" width="220" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kpi4-sub" value="1 LGPD · 1 SLA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="992" y="250" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="sec1-title" value="Tipos de ato pendentes da sua aprovação (Fluxo A)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="310" width="600" height="25" as="geometry"/>
        </mxCell>

        <mxCell id="card1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="345" width="940" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="card1-name" value="Escritura de Venda e Compra com Cláusula Resolutiva — v2 (rascunho)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="276" y="356" width="700" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="card1-meta" value="38 sugestões IA · 12 cláusulas · 24 parâmetros · iniciado 04/05" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="276" y="378" width="700" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="card1-cta" value="Continuar revisão →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1050" y="370" width="140" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="card2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="435" width="940" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="card2-name" value="Procuração para Adquirir Imóvel — v1 (pronto p/ aprovação)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="276" y="446" width="700" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="card2-meta" value="14 cláusulas aceitas · 11 parâmetros · pronto há 2 dias" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="276" y="468" width="700" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="card2-cta" value="Aprovar e publicar →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1050" y="460" width="140" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="sec2-title" value="Atividade recente do cartório" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="540" width="600" height="25" as="geometry"/>
        </mxCell>

        <mxCell id="act-list" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="575" width="940" height="240" as="geometry"/>
        </mxCell>

        <mxCell id="act-1" value="14h32 · Maria S. (escrevente) gerou minuta — Escritura de V&amp;C — protocolo #2026-0473" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="276" y="585" width="900" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="act-2" value="14h08 · João P. (escrevente) marcou pronto p/ revisão — Procuração Geral — protocolo #2026-0472" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="276" y="613" width="900" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="act-3" value="13h47 · OCR processou 4 documentos — protocolo #2026-0473" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="276" y="641" width="900" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="act-4" value="11h12 · Você publicou Doação c/ Reserva de Usufruto v1 no catálogo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="276" y="669" width="900" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="act-5" value="09h54 · DPO marcou incidente #003 como concluído (sem risco a titulares)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="276" y="697" width="900" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Squint test: KPIs no topo (4 cards horizontais) — Tabelião vê em 2s o estado do mês.&#10;2. Ações pendentes do Tabelião com CTA forte — não é só relatório.&#10;3. Atividade recente substitui notificações intrusivas — feed cronológico, sem badges piscantes.&#10;4. Sidebar é a mesma para Tabelião e Escrevente, mas com itens condicionais por papel.&#10;5. Pílula HOMOLOGAÇÃO no header é o lembrete persistente." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1260" y="120" width="220" height="320" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="03-dashboard-escrevente" name="03-dashboard-escrevente">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>
        <mxCell id="c2" value="03 - Dashboard do Escrevente" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="800" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="c3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>
        <mxCell id="c4" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="c5" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="c6" value="PRODUCAO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="c7" value="buscar protocolo, parte, CPF... (atalho /)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999999;fontSize=10;align=left;spacingLeft=8;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="380" y="76" width="400" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="c8" value="Maria S. (Escrevente) v" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="c9" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333333" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="744" as="geometry"/>
        </mxCell>
        <mxCell id="c10" value="Dashboard" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="130" width="200" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="c11" value="Fila de revisao" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="170" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c12" value="Catalogo" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="206" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c13" value="Meus atos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="242" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c14" value="+ NOVO ATO (atalho N)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333333;fontColor=#ffffff;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="140" width="280" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="c15" value="Atalho: tecle N em qualquer tela" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="260" y="220" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="c16" value="MEUS ATOS DE HOJE: 5" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="560" y="140" width="200" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="c17" value="A REVISAR (parceiros): 3" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="780" y="140" width="200" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="c18" value="COM ALERTA: 1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="1000" y="140" width="200" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="c19" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999999" vertex="1" parent="1">
          <mxGeometry x="260" y="260" width="940" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="c20" value="MEUS ATOS (5)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999999;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="260" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="c21" value="A REVISAR (3)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="420" y="260" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="c22" value="TODOS DO CARTORIO (12)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="260" width="200" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="c23" value="filtrar v" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999999;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1120" y="270" width="70" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="c24" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999999" vertex="1" parent="1">
          <mxGeometry x="260" y="300" width="940" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c25" value="PROTOCOLO" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="260" y="300" width="120" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c26" value="TIPO DE ATO" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="380" y="300" width="280" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c27" value="STATUS" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="660" y="300" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c28" value="ATUALIZADO" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="820" y="300" width="120" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c29" value="ACOES" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="940" y="300" width="240" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c30" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999999" vertex="1" parent="1">
          <mxGeometry x="260" y="332" width="940" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c31" value="#2026-0473" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="260" y="332" width="120" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c32" value="Escritura de Venda e Compra c/ Clausula Resolutiva" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="380" y="332" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c33" value="EM REVISAO (par)" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="660" y="332" width="160" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c34" value="ha 12 min" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="332" width="120" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c35" value="Abrir" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#666666;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="940" y="338" width="80" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c36" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999999" vertex="1" parent="1">
          <mxGeometry x="260" y="376" width="940" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c37" value="#2026-0470" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="260" y="376" width="120" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c38" value="Procuracao para Adquirir Imovel" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="380" y="376" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c39" value="RASCUNHO" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="660" y="376" width="160" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c40" value="ha 1h" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="376" width="120" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c41" value="Continuar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#666666;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="940" y="382" width="100" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c42" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600" vertex="1" parent="1">
          <mxGeometry x="260" y="420" width="940" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c43" value="#2026-0468" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="420" width="120" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c44" value="Doacao c/ Reserva de Usufruto" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="380" y="420" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c45" value="2 ALERTAS" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1;fontColor=#cc6600" vertex="1" parent="1">
          <mxGeometry x="660" y="420" width="160" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c46" value="ha 3h" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="420" width="120" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c47" value="Resolver" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#cc6600;strokeColor=#cc6600;fontColor=#ffffff;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="940" y="426" width="100" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c48" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999999" vertex="1" parent="1">
          <mxGeometry x="260" y="464" width="940" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c49" value="#2026-0461" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="260" y="464" width="120" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c50" value="Hipoteca em garantia de emprestimo" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="380" y="464" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c51" value="PRONTO P/ LAVRATURA" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="660" y="464" width="160" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c52" value="ontem" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="464" width="120" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="c53" value="Ver minuta" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#666666;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="940" y="470" width="110" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="c54" value="ANOTACOES UX&#10;1. CTA NOVO ATO e a acao primaria - botao grande e atalho N. Escrevente faz 5-15x por dia.&#10;2. Tabs MEUS / A REVISAR / TODOS. Default: MEUS.&#10;3. Linha com alerta destacada em laranja.&#10;4. Status: rascunho / em revisao / pronto - acessivel.&#10;5. Pilula PRODUCAO neutra. Em homol. seria laranja.&#10;6. Sem modal de boas-vindas - vai direto a fila.&#10;7. Sem sidebar de Configuracoes/LGPD - escrevente nao tem acesso." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1260" y="120" width="220" height="420" as="geometry"/>
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="04-fluxo-a-01-novo-ato-upload-modelo" name="04-fluxo-a-01-novo-ato-upload-modelo">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="04 — Fluxo A · Passo 1 · Novo tipo de ato — Upload do modelo vigente" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1200" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="breadcrumb" value="Catálogo / Novo tipo de ato" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="300" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas T. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="sidebar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="744" as="geometry"/>
        </mxCell>
        <mxCell id="nav1" value="▣  Dashboard" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="130" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav2" value="[catalogo]  Catálogo de atos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="166" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav3" value="[lista]  Fila do cartório" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="202" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav4" value="[graph]  Relatórios" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="238" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav5" value="[users]  Usuários" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="274" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav6" value="⚙  Configurações" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="310" width="200" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="140" width="940" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="● 1. Upload modelo" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="140" width="200" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="○ 2. Revisar sugestões IA" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="460" y="140" width="220" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="○ 3. Parâmetros e regras" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="680" y="140" width="220" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="○ 4. Aprovar e publicar" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="900" y="140" width="220" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="form-title" value="Identificação do tipo de ato" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="280" y="220" width="400" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-nome" value="Nome do tipo de ato *" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="280" y="252" width="300" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-nome" value="ex: Escritura de Venda e Compra c/ Cláusula Resolutiva" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="280" y="272" width="600" height="34" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-fam" value="Família" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="280" y="316" width="300" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-fam" value="Escrituras imobiliárias  ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="280" y="336" width="290" height="34" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-onda" value="Onda do MVP" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="590" y="316" width="300" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-onda" value="Onda 1  ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="590" y="336" width="290" height="34" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-desc" value="Descrição interna (uso dos escreventes)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="280" y="380" width="500" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-desc" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10;verticalAlign=top;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="280" y="400" width="600" height="64" as="geometry"/>
        </mxCell>

        <mxCell id="upload-title" value="Modelo vigente" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="280" y="490" width="400" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="btn-import-kbc" value="[catalogo]  Importar modelo do KBC →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;fontColor=#1F4E79;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="620" y="488" width="260" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="upload-help" value="Faça upload do modelo PDF/DOCX que o cartório usa hoje, OU importe um modelo já aprovado na sua Knowledge Base Cartorial. Os sub-agentes de IA hermenêuticos analisarão a estrutura, cláusulas-tipo e variáveis e proporão sugestões — você revisa item-a-item no próximo passo." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="280" y="525" width="600" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="dropzone" value="[ Arraste arquivos aqui ou clique para selecionar ]&#10;PDF ou DOCX · até 20 MB cada · até 5 arquivos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=12;dashed=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="280" y="566" width="600" height="140" as="geometry"/>
        </mxCell>

        <mxCell id="file1" value="[doc] escritura_venda_compra_v2024.docx · 84 KB · ✓ enviado" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="280" y="716" width="600" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="btn-cancel" value="Cancelar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="780" y="780" width="100" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-rascunho" value="Salvar como rascunho" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="890" y="780" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-next" value="Analisar com IA →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="780" width="140" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Stepper de 4 passos no topo, sempre visível. Permite voltar mas não pular.&#10;2. Pílula HOMOLOGAÇÃO em laranja — Tabelião está montando catálogo, ainda não publicado em produção.&#10;3. Botão primário escuro &quot;Analisar com IA&quot; deixa explícito que IA será acionada após este passo (gera expectativa correta).&#10;4. &quot;Salvar como rascunho&quot; sempre disponível — cadastrar ato é trabalho longo, persistência é crucial.&#10;5. Drop-zone com instruções claras de formato e tamanho — evita erros de upload.&#10;6. Família e Onda permitem agrupamento posterior no catálogo.&#10;7. Microcopy: &quot;modelo vigente&quot; (linguagem cartorial) em vez de &quot;template&quot;." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1260" y="120" width="220" height="440" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="05-fluxo-a-02-revisao-sugestoes-ia" name="05-fluxo-a-02-revisao-sugestoes-ia">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="05 — Fluxo A · Passo 2 · Revisão das sugestões dos sub-agentes IA (item-a-item)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1200" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="breadcrumb" value="Catálogo / Escritura V&amp;C c/ Cláusula Resolutiva / Revisão IA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="500" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas T. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="1200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="✓ 1. Upload" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="● 2. Revisar sugestões IA" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="116" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="○ 3. Parâmetros e regras" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="600" y="116" width="320" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="○ 4. Aprovar e publicar" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="920" y="116" width="320" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="left-col" value="Estrutura proposta&#10;[Painel hierárquico das seções do ato]&#10;✓ Cabeçalho&#10;✓ Qualificação das partes&#10;◐ Objeto (em revisão)&#10;○ Preço e forma de pagamento&#10;○ Cláusula resolutiva&#10;○ Declarações fiscais&#10;○ Outorga e aceitação&#10;○ Encerramento&#10;[Subagentes processaram 8 seções]&#10;[3 cláusulas-tipo identificadas]&#10;[12 variáveis sugeridas]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="240" height="660" as="geometry"/>
        </mxCell>

        <mxCell id="counter" value="Sugestão 3 de 27" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="180" width="200" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="badge-ia" value="◆ SUGESTÃO IA · agente Estrutural" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8eaf6;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="212" width="240" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="badge-confiance" value="confiança: alta · 93%" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#666;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="570" y="212" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="badge-fonte" value="extraído do modelo · pág. 2" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#666;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="740" y="212" width="200" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="card-title" value="Cláusula-tipo: Objeto da escritura" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="244" width="600" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="card-body" value="Por meio do presente instrumento, o(a) VENDEDOR(A) {{nome_vendedor}}, já qualificado(a), TRANSFERE e CEDE ao(à) COMPRADOR(A) {{nome_comprador}}, já qualificado(a), o imóvel matriculado sob nº {{matricula_imovel}} no {{cartorio_registro_imoveis}}, com a área de {{area_m2}} m², situado em {{endereco_imovel}}, livre e desembaraçado de quaisquer ônus, exceto os declarados a seguir.&#10;[6 variáveis identificadas — verificar no Passo 3]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=12;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="320" y="276" width="900" height="180" as="geometry"/>
        </mxCell>

        <mxCell id="diff-title" value="Diff vs. modelo enviado" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="466" width="300" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="diff-body" value="• Removido &quot;sito à&quot; (português arcaico) → &quot;situado em&quot; (sugestão de modernização)&#10;• Adicionada variável {{cartorio_registro_imoveis}} antes ausente&#10;• Removida menção fixa &quot;19º RI&quot; — substituída por variável" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="320" y="490" width="900" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="action-bar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="320" y="586" width="900" height="64" as="geometry"/>
        </mxCell>
        <mxCell id="btn-aceitar" value="✓ Aceitar  (A)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="340" y="600" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-editar" value="✎ Editar  (E)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="510" y="600" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-rejeitar" value="✗ Rejeitar  (R)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="680" y="600" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-coment" value="[chat] Comentar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="850" y="600" width="120" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-pular" value="Pular  (→)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1080" y="600" width="120" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="progress-title" value="Progresso da revisão" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="666" width="300" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="progress-bar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="320" y="688" width="900" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="progress-fill" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#666666;strokeColor=#666" vertex="1" parent="1">
          <mxGeometry x="320" y="688" width="80" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="progress-lbl" value="2 aceitas  ·  0 editadas  ·  0 rejeitadas  ·  25 pendentes" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="320" y="712" width="600" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="btn-back" value="← Voltar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="320" y="780" width="100" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-rascunho" value="Salvar rascunho" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="900" y="780" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-next" value="Próximo passo →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#cccccc;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1080" y="780" width="140" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-next-help" value="(habilitado quando todas as sugestões forem revisadas)" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="800" y="820" width="420" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. UX item-a-item (não &quot;aceitar tudo&quot;) é exigência contratual: revisão humana de cada sugestão.&#10;2. Atalhos A/E/R no teclado — Tabelião revisa 27 itens, velocidade conta.&#10;3. Badge ◆ SUGESTÃO IA + nome do agente que sugeriu (Estrutural / Cláusulas / Variáveis / Validação) — transparência.&#10;4. Confiança e fonte (página do PDF) reduzem opacidade.&#10;5. Diff vs modelo original mostra exatamente o que mudou — Tabelião não fica desconfiado de mudanças invisíveis.&#10;6. Editar abre o card em modo texto livre — Tabelião pode reescrever.&#10;7. Coluna esquerda mostra árvore — permite navegação não-linear.&#10;8. Botão &quot;Próximo passo&quot; só habilita após 100% das sugestões revisadas — força fechamento." style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=9;align=left;verticalAlign=top" vertex="1" parent="1">
          <mxGeometry x="40" y="820" width="280" height="20" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="06-fluxo-a-03-parametros-regras" name="06-fluxo-a-03-parametros-regras">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="06 — Fluxo A · Passo 3 · Parâmetros (variáveis) e regras de validação" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1200" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas T. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="1200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="✓ 1. Upload" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="✓ 2. Revisar sugestões IA" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="320" y="116" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="● 3. Parâmetros e regras" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="600" y="116" width="320" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="○ 4. Aprovar e publicar" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="920" y="116" width="320" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="tabs" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="1180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="tab1" value="Parâmetros (12)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="tab2" value="Regras de validação (8)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="240" y="180" width="220" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="tab3" value="Alertas (5)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="460" y="180" width="160" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="thead" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="220" width="1160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th1" value="VARIÁVEL" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="220" width="240" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th2" value="LABEL VISÍVEL AO ESCREVENTE" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="300" y="220" width="280" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th3" value="TIPO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="580" y="220" width="140" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th4" value="FONTE / OCR" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="720" y="220" width="180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th5" value="OBRIG." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="220" width="80" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th6" value="AÇÕES" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="980" y="220" width="160" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="r1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="252" width="1160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1c1" value="{{nome_vendedor}}" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontFamily=Courier New" vertex="1" parent="1">
          <mxGeometry x="60" y="252" width="240" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1c2" value="Nome do vendedor" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="300" y="252" width="280" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1c3" value="Texto" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="252" width="140" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1c4" value="OCR · RG/CNH" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="720" y="252" width="180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1c5" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="252" width="80" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1c6" value="Editar  ·  Remover" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="980" y="252" width="160" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="r2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="292" width="1160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2c1" value="{{cpf_vendedor}}" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontFamily=Courier New" vertex="1" parent="1">
          <mxGeometry x="60" y="292" width="240" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2c2" value="CPF do vendedor" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="300" y="292" width="280" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2c3" value="CPF (validado)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="292" width="140" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2c4" value="OCR · RG/CPF" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="720" y="292" width="180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2c5" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="292" width="80" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2c6" value="Editar  ·  Remover" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="980" y="292" width="160" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="r3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="332" width="1160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3c1" value="{{matricula_imovel}}" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontFamily=Courier New" vertex="1" parent="1">
          <mxGeometry x="60" y="332" width="240" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3c2" value="Matrícula do imóvel" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="300" y="332" width="280" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3c3" value="Texto + nº cartório RI" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="332" width="140" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3c4" value="OCR · matrícula" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="720" y="332" width="180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3c5" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="332" width="80" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3c6" value="Editar  ·  Remover" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="980" y="332" width="160" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="r4" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="372" width="1160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r4c1" value="{{valor_imovel}}" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontFamily=Courier New" vertex="1" parent="1">
          <mxGeometry x="60" y="372" width="240" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r4c2" value="Valor da venda (R$)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="300" y="372" width="280" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r4c3" value="Moeda BRL" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="372" width="140" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r4c4" value="manual (escrevente)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="720" y="372" width="180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r4c5" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="372" width="80" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r4c6" value="Editar  ·  Remover" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="980" y="372" width="160" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="r-more" value="[ + 8 variáveis... ]" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="412" width="240" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="btn-add-var" value="+ Adicionar variável" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="452" width="180" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="rules-title" value="Regras de validação atuais (preview)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="510" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="rule-card1" value="◆ Sugerida pela IA · Validação CPF&#10;SE {{cpf_vendedor}} inválido → bloquear avanço&#10;Mensagem: &quot;CPF do vendedor é inválido. Confira o documento.&quot;&#10;[Aceitar] [Editar] [Rejeitar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="60" y="540" width="380" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="rule-card2" value="◆ Sugerida pela IA · Conferência matrícula&#10;SE {{matricula_imovel}} não existe no RI integrado → ALERTA (não bloqueia)&#10;Mensagem: &quot;Matrícula não localizada — confira manualmente.&quot;&#10;[Aceitar] [Editar] [Rejeitar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="460" y="540" width="380" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="rule-card3" value="◆ Sugerida pela IA · Coerência partes&#10;SE {{cpf_vendedor}} == {{cpf_comprador}} → BLOQUEIO&#10;Mensagem: &quot;Vendedor e comprador não podem ser a mesma pessoa.&quot;&#10;[Aceitar] [Editar] [Rejeitar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="860" y="540" width="380" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="btn-add-rule" value="+ Adicionar regra manualmente" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="676" width="240" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="btn-back" value="← Voltar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="800" width="100" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-rascunho" value="Salvar rascunho" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="900" y="800" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-next" value="Aprovação final →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1080" y="800" width="160" height="36" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="07-fluxo-a-04-aprovacao-final-publicacao" name="07-fluxo-a-04-aprovacao-final-publicacao">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="07 — Fluxo A · Passo 4 · Aprovação final e publicação no catálogo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1200" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas T. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="1200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="✓ 1. Upload" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="✓ 2. Revisar sugestões IA" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="320" y="116" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="✓ 3. Parâmetros e regras" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="600" y="116" width="320" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="● 4. Aprovar e publicar" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="920" y="116" width="320" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="preview-title" value="Pré-visualização do template" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="400" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="preview-body" value="ESCRITURA PÚBLICA DE VENDA E COMPRA COM CLÁUSULA RESOLUTIVA&#10;Aos {{data_lavratura}}, perante mim, Tabelião do 27º Tabelionato de Notas da Capital de São Paulo, compareceram:&#10;OUTORGANTE VENDEDOR: {{nome_vendedor}}, brasileiro(a), portador(a) do RG nº {{rg_vendedor}} e inscrito(a) no CPF sob nº {{cpf_vendedor}}, residente em {{endereco_vendedor}}.&#10;OUTORGADO COMPRADOR: {{nome_comprador}}, brasileiro(a), portador(a) do RG nº {{rg_comprador}} e inscrito(a) no CPF sob nº {{cpf_comprador}}, residente em {{endereco_comprador}}.&#10;Por este instrumento e na forma da lei, declaram, livres e conscientes, o que segue:&#10;CLÁUSULA 1ª — OBJETO&#10;Por meio do presente instrumento, o(a) VENDEDOR(A), já qualificado(a), TRANSFERE e CEDE ao(à) COMPRADOR(A), o imóvel matriculado sob nº {{matricula_imovel}} no {{cartorio_registro_imoveis}}, com a área de {{area_m2}} m², situado em {{endereco_imovel}}, livre e desembaraçado de quaisquer ônus.&#10;CLÁUSULA 2ª — PREÇO&#10;O valor da presente venda é de R$ {{valor_imovel}} ({{valor_imovel_extenso}}), pago [...]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="60" y="210" width="700" height="500" as="geometry"/>
        </mxCell>

        <mxCell id="preview-paginate" value="página 1 de 4  ·  ← anterior  ·  próxima →" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="60" y="714" width="700" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="resumo-title" value="Resumo do tipo de ato" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="800" y="180" width="400" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="resumo-card" value="Nome:&#10;Escritura de Venda e Compra c/ Cláusula Resolutiva&#10;Família: Escrituras imobiliárias&#10;Onda: 1&#10;Versão: v1 (será publicada)&#10;Sugestões IA revisadas: 27 / 27&#10;  · 22 aceitas&#10;  · 4 editadas&#10;  · 1 rejeitada&#10;Variáveis: 12&#10;Regras de validação: 8&#10;Alertas configurados: 5&#10;Última edição: hoje 14h32&#10;por Lucas T. (Tabelião)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="800" y="210" width="400" height="280" as="geometry"/>
        </mxCell>

        <mxCell id="approve-title" value="Aprovação e publicação" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="800" y="510" width="400" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="check1" value="☐  Declaro que revisei integralmente o texto, parâmetros e regras." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="800" y="540" width="400" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="check2" value="☐  Autorizo o uso pelos escreventes em ambiente de PRODUÇÃO." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="800" y="586" width="400" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="ambiente-title" value="Publicar em" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="800" y="640" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="radio1" value="◉  Homologação (não fatura — testes internos)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=middle;spacingLeft=12" vertex="1" parent="1">
          <mxGeometry x="800" y="664" width="400" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="radio2" value="○  Produção (escreventes podem usar — gera billing)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=middle;spacingLeft=12" vertex="1" parent="1">
          <mxGeometry x="800" y="700" width="400" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="btn-back" value="← Voltar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="800" width="100" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-publish" value="Publicar tipo de ato no catálogo" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="800" width="300" height="36" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="08-catalogo-atos" name="08-catalogo-atos">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="08 — Catálogo de tipos de ato (versão e status)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="800" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas T. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="sidebar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="744" as="geometry"/>
        </mxCell>
        <mxCell id="nav1" value="▣  Dashboard" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="130" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav2" value="[catalogo]  Catálogo de atos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="166" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav3" value="[lista]  Fila do cartório" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="202" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav4" value="[graph]  Relatórios" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="238" width="200" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="page-title" value="Catálogo de atos do cartório" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="130" width="500" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="cta-novo" value="+ Novo tipo de ato" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="130" width="180" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="filtros" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="180" width="980" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="search" value="[buscar] buscar por nome ou família..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;spacingLeft=8;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="276" y="190" width="280" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="f1" value="Família: Todas ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="568" y="190" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="f2" value="Status: Todos ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="740" y="190" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="f3" value="Ambiente: Todos ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="912" y="190" width="160" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="thead" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="240" width="980" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th1" value="TIPO DE ATO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="260" y="240" width="320" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th2" value="FAMÍLIA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="580" y="240" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th3" value="VERSÃO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="740" y="240" width="80" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th4" value="STATUS / AMBIENTE" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="820" y="240" width="180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th5" value="USO (30d)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1000" y="240" width="100" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th6" value="AÇÕES" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1100" y="240" width="140" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="r1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="272" width="980" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r1c1" value="Escritura de Venda e Compra" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="272" width="320" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r1c2" value="Escrituras imobiliárias" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="272" width="160" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r1c3" value="v3" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="740" y="272" width="80" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r1c4" value="● Publicado · PRODUÇÃO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="272" width="180" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r1c5" value="42" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1000" y="272" width="100" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r1c6" value="Ver  ·  Nova versão" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1100" y="272" width="140" height="42" as="geometry"/>
        </mxCell>

        <mxCell id="r2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="314" width="980" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r2c1" value="Escritura de V&amp;C c/ Cláusula Resolutiva" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="314" width="320" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r2c2" value="Escrituras imobiliárias" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="314" width="160" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r2c3" value="v1" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="740" y="314" width="80" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r2c4" value="◐ Em homologação" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="314" width="180" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r2c5" value="3" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1000" y="314" width="100" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r2c6" value="Ver  ·  Promover" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1100" y="314" width="140" height="42" as="geometry"/>
        </mxCell>

        <mxCell id="r3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="356" width="980" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r3c1" value="Escritura de V&amp;C — Imóvel Rural" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="356" width="320" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r3c2" value="Escrituras imobiliárias" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="356" width="160" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r3c3" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="740" y="356" width="80" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r3c4" value="○ Rascunho" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="356" width="180" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r3c5" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1000" y="356" width="100" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r3c6" value="Continuar" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1100" y="356" width="140" height="42" as="geometry"/>
        </mxCell>

        <mxCell id="r4" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="398" width="980" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r4c1" value="Hipoteca em garantia de empréstimo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="398" width="320" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r4c2" value="Garantias reais" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="398" width="160" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r4c3" value="v2" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="740" y="398" width="80" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r4c4" value="● Publicado · PRODUÇÃO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="398" width="180" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r4c5" value="14" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1000" y="398" width="100" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r4c6" value="Ver  ·  Nova versão" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1100" y="398" width="140" height="42" as="geometry"/>
        </mxCell>

        <mxCell id="r5" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="440" width="980" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r5c1" value="Doação c/ Reserva de Usufruto" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="440" width="320" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r5c2" value="Doação / Usufruto" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="440" width="160" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r5c3" value="v1" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="740" y="440" width="80" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r5c4" value="● Publicado · PRODUÇÃO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="440" width="180" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r5c5" value="6" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1000" y="440" width="100" height="42" as="geometry"/>
        </mxCell>
        <mxCell id="r5c6" value="Ver  ·  Nova versão" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1100" y="440" width="140" height="42" as="geometry"/>
        </mxCell>

        <mxCell id="r-more" value="[ + 9 outros tipos do MVP — Procurações, Testamento, Divórcio, etc. ]" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="260" y="490" width="600" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="legend" value="LEGENDA STATUS&#10;● Publicado em PRODUÇÃO — escreventes podem usar, gera billing&#10;◐ Em homologação — escreventes podem testar, NÃO gera billing&#10;○ Rascunho — apenas Tabelião pode editar, ainda não disponível" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="260" y="540" width="700" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Coluna USO (30d) ajuda Tabelião a priorizar quais atos manter atualizados.&#10;2. Versão visível na lista — &quot;v3&quot; deixa claro que houve evolução.&#10;3. Ação contextual: rascunho mostra Continuar; publicado mostra Nova versão; homologação mostra Promover.&#10;4. Escrevente vê catálogo só com publicados em produção (ou homologação se em testes), nunca rascunho.&#10;5. Filtro por ambiente importante: Tabelião pode querer ver só homologação para revisar antes de promover." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="260" y="660" width="700" height="180" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="09-fluxo-b-01-novo-documento-selecao-ato" name="09-fluxo-b-01-novo-documento-selecao-ato">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="09 — Fluxo B · Passo 1 · Novo documento — selecionar tipo de ato" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1200" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="search" value="[buscar] buscar protocolo, parte, CPF... (atalho /)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;spacingLeft=8;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="380" y="76" width="400" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Maria S. (Escrevente) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="1200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="● 1. Tipo de ato" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="○ 2. Documentos das partes (OCR)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="280" y="116" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="○ 3. Preencher e revisar" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="560" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="○ 4. Validar alertas" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="800" y="116" width="220" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step5" value="○ 5. Gerar minuta" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1020" y="116" width="220" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="page-q" value="Que tipo de ato você quer iniciar?" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="600" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="search-cat" value="[buscar] começar a digitar &quot;venda&quot;, &quot;hipoteca&quot;, &quot;procuração&quot;..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="60" y="216" width="600" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="search-help" value="Você pode também tocar &quot;/&quot; em qualquer tela para abrir busca rápida." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="60" y="260" width="600" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="recent-title" value="Mais usados nos últimos 30 dias" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="300" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="card1" value="Escritura de Venda e Compra&#10;Escrituras imobiliárias · v3&#10;42 atos no mês&#10;[Selecionar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="334" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="card2" value="Hipoteca em garantia de empréstimo&#10;Garantias reais · v2&#10;14 atos no mês&#10;[Selecionar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="360" y="334" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="card3" value="Procuração para Adquirir Imóvel&#10;Procurações · v1&#10;9 atos no mês&#10;[Selecionar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="660" y="334" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="card4" value="Doação c/ Reserva de Usufruto&#10;Doação / Usufruto · v1&#10;6 atos no mês&#10;[Selecionar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="960" y="334" width="280" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="all-title" value="Todos os tipos de ato disponíveis" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="490" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="fam1" value="Escrituras imobiliárias (4)&#10;  · Escritura de Venda e Compra&#10;  · Escritura de V&amp;C c/ Cláusula Resolutiva (homologação)&#10;  · Escritura de V&amp;C c/ Hipoteca&#10;  · Escritura de V&amp;C — Imóvel Rural" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="60" y="520" width="380" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="fam2" value="Garantias reais (1)&#10;  · Hipoteca em garantia de empréstimo&#10;Sucessão (1)&#10;  · Testamento" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="460" y="520" width="380" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="fam3" value="Procurações imobiliárias (4)&#10;  · Adquirir / Alienar / Doar&#10;  · Anuir&#10;  · Geral" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="860" y="520" width="380" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="fam4" value="Doação / Usufruto (3)&#10;  · Doação c/ Reserva de Usufruto&#10;  · Instituição de Usufruto&#10;  · Renúncia de Usufruto" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="60" y="660" width="380" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="fam5" value="Família (2)&#10;  · Divórcio&#10;  · Separação c/ Partilha" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="460" y="660" width="380" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="btn-cancel" value="Cancelar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="800" width="100" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX: 1) Cards &quot;Mais usados&quot; aceleram 70%+ dos casos. 2) Busca por digitação como primary path. 3) Versão visível mantém transparência. 4) Não há &quot;Próximo&quot; — clique no card já avança." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="200" y="800" width="900" height="40" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="10-fluxo-b-02-upload-docs-ocr" name="10-fluxo-b-02-upload-docs-ocr">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="10 — Fluxo B · Passo 2 · Upload de documentos das partes (com OCR)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1200" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="proto" value="Protocolo #2026-0473  ·  Escritura de V&amp;C c/ Cláusula Resolutiva  ·  auto-save ativo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="600" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Maria S. ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1100" y="78" width="140" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="1200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="✓ 1. Tipo de ato" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="● 2. Documentos das partes (OCR)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="280" y="116" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="○ 3. Preencher e revisar" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="560" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="○ 4. Validar alertas" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="800" y="116" width="220" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step5" value="○ 5. Gerar minuta" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1020" y="116" width="220" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="parts-title" value="Partes do ato" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="part1" value="VENDEDOR(A)&#10;[ Arraste docs aqui ou clique ]&#10;RG, CPF, comprovante de residência&#10;[doc] rg_jose.pdf · ✓ OCR concluído (3s)&#10;[doc] comprovante.pdf · ✓ OCR concluído&#10;[+ Adicionar documento]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="60" y="216" width="380" height="200" as="geometry"/>
        </mxCell>

        <mxCell id="part2" value="COMPRADOR(A)&#10;[ Arraste docs aqui ou clique ]&#10;RG, CPF, comprovante de residência&#10;[doc] cnh_ana.pdf · ◐ processando OCR... 60%&#10;[doc] comp_resid_ana.jpg · ✓ OCR concluído&#10;[+ Adicionar documento]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="460" y="216" width="380" height="200" as="geometry"/>
        </mxCell>

        <mxCell id="part3" value="IMÓVEL&#10;[ Arraste docs aqui ou clique ]&#10;Matrícula atualizada (CRI), IPTU, certidão neg. ônus&#10;[doc] matricula_atualizada.pdf · ! OCR baixa qualidade — revisar&#10;[+ Adicionar documento]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="860" y="216" width="380" height="200" as="geometry"/>
        </mxCell>

        <mxCell id="extracted-title" value="Dados extraídos pelo OCR (preview)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="436" width="500" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="extracted-help" value="Os dados abaixo serão usados como base para o preenchimento automático no próximo passo. Você poderá editar tudo." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="60" y="462" width="800" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="ext-card1" value="Vendedor (do RG + comp. resid.)&#10;Nome: JOSÉ DA SILVA SANTOS&#10;RG: 12.345.678-9 SSP/SP&#10;CPF: 123.456.789-00 (✓ válido)&#10;Endereço: Rua das Flores, 100 — São Paulo/SP&#10;[Editar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10;fontFamily=Courier New" vertex="1" parent="1">
          <mxGeometry x="60" y="492" width="380" height="160" as="geometry"/>
        </mxCell>

        <mxCell id="ext-card2" value="Comprador (da CNH + comp. resid.)&#10;Nome: ANA PAULA MOREIRA&#10;CNH: 01234567890&#10;CPF: 987.654.321-00 (✓ válido)&#10;Endereço: Av. Brasil, 500 — São Paulo/SP&#10;[Editar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10;fontFamily=Courier New" vertex="1" parent="1">
          <mxGeometry x="460" y="492" width="380" height="160" as="geometry"/>
        </mxCell>

        <mxCell id="ext-card3" value="Imóvel (da matrícula — confiança baixa)&#10;Matrícula: 1??.??? (parcial)&#10;Cartório RI: 9º RI da Capital&#10;Área: 84,30 m²&#10;Endereço: Rua das Flores, ?? — SP&#10;! Reler manualmente&#10;[Editar]  [Reenviar PDF]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10;fontFamily=Courier New" vertex="1" parent="1">
          <mxGeometry x="860" y="492" width="380" height="160" as="geometry"/>
        </mxCell>

        <mxCell id="manual-fallback" value="Não tem os documentos digitalizados? [Pular OCR e digitar manualmente]" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="60" y="680" width="600" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="btn-back" value="← Voltar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="800" width="100" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="autosave" value="✓ salvo às 14h32 · auto-save ativo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="180" y="800" width="300" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-next" value="Preencher template →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="800" width="180" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Drop zones por papel da parte (Vendedor / Comprador / Imóvel) — escrevente sabe onde colocar cada doc.&#10;2. Estados explícitos por arquivo: ✓ concluído, ◐ processando %, ! baixa qualidade.&#10;3. Card laranja onde OCR teve baixa confiança — atrai a atenção sem bloquear.&#10;4. Preview dos dados extraídos JÁ na tela de upload — escrevente confere antes de avançar.&#10;5. Auto-save indicator no rodapé — tranquiliza durante uploads longos.&#10;6. Fallback &quot;digitar manualmente&quot; sempre acessível — para casos de doc físico/ausente." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="40" y="848" width="900" height="20" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="11-fluxo-b-03-preenchimento-llm-revisao" name="11-fluxo-b-03-preenchimento-llm-revisao">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="11 — Fluxo B · Passo 3 · Preenchimento por LLM + revisão campo a campo (split view)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1300" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1400" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1400" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="proto" value="#2026-0473  ·  Escritura de V&amp;C c/ Cláusula Resolutiva" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="500" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Maria S. ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1300" y="78" width="140" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="1400" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="✓ 1. Tipo" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="✓ 2. Documentos (OCR)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="280" y="116" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="● 3. Preencher e revisar" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="560" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="○ 4. Validar alertas" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="800" y="116" width="220" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step5" value="○ 5. Gerar minuta" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1020" y="116" width="420" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="left-col-title" value="Variáveis do template (12)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="500" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="ia-status" value="◆ LLM preencheu 9 de 12 variáveis (3 precisam de atenção)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8eaf6;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="208" width="500" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="f1-grp" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="240" width="700" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="f1-title" value="Vendedor" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="74" y="248" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="f1-1" value="Nome do vendedor *" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="74" y="272" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="f1-1v" value="JOSÉ DA SILVA SANTOS  ◆ IA · OCR" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="74" y="292" width="400" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="f1-1conf" value="confiança alta · pág. 1 do RG" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="490" y="296" width="200" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="f1-2" value="CPF do vendedor *" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="74" y="328" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="f1-2v" value="123.456.789-00  ◆ IA · OCR  ✓ válido" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="74" y="348" width="400" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="f1-2conf" value="confiança alta · pág. 1 do RG" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="490" y="352" width="200" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="f2-grp" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="424" width="700" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="f2-title" value="Comprador" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="74" y="432" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="f2-1" value="Nome do comprador *" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="74" y="456" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="f2-1v" value="ANA PAULA MOREIRA  ◆ IA · OCR" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="74" y="476" width="400" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="f3-grp" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600" vertex="1" parent="1">
          <mxGeometry x="60" y="608" width="700" height="170" as="geometry"/>
        </mxCell>
        <mxCell id="f3-title" value="Imóvel  ! requer atenção" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="74" y="616" width="400" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="f3-1" value="Matrícula do imóvel *" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="74" y="640" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="f3-1v" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cc6600;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="74" y="660" width="400" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="f3-1msg" value="! Não foi possível extrair com confiança suficiente — preencha manualmente. Sugestão LLM: &quot;1??.???&quot;" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="74" y="694" width="600" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="f3-2" value="Valor da venda (R$) *" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="74" y="720" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="f3-2v" value="R$ 850.000,00" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="74" y="740" width="400" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="f3-2conf" value="manual (sem OCR para este campo)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="490" y="744" width="200" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="right-col-title" value="Pré-visualização da minuta" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="800" y="180" width="500" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="preview-toggle" value="atualiza ao vivo  ·  ☐ destacar variáveis" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="1100" y="180" width="320" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="preview-body" value="ESCRITURA PÚBLICA DE VENDA E COMPRA COM CLÁUSULA RESOLUTIVA&#10;Aos {{data_lavratura}}, perante mim, Tabelião do 27º Tabelionato de Notas da Capital de São Paulo, compareceram:&#10;OUTORGANTE VENDEDOR: [JOSÉ DA SILVA SANTOS], brasileiro, portador do RG nº [12.345.678-9 SSP/SP] e inscrito no CPF sob nº [123.456.789-00], residente em [Rua das Flores, 100 — São Paulo/SP].&#10;OUTORGADA COMPRADORA: [ANA PAULA MOREIRA], brasileira, portadora da CNH nº [01234567890] e inscrita no CPF sob nº [987.654.321-00], residente em [Av. Brasil, 500 — São Paulo/SP].&#10;CLÁUSULA 1ª — OBJETO&#10;Por meio do presente instrumento, o VENDEDOR, já qualificado, TRANSFERE e CEDE à COMPRADORA o imóvel matriculado sob nº [______] no [9º RI da Capital], com a área de [84,30] m², situado em [Rua das Flores, 100 — São Paulo/SP].&#10;CLÁUSULA 2ª — PREÇO&#10;O valor da presente venda é de R$ [850.000,00] (oitocentos e cinquenta mil reais), pago à vista por...&#10;CLÁUSULA 3ª — CLÁUSULA RESOLUTIVA&#10;Caso..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="800" y="208" width="620" height="540" as="geometry"/>
        </mxCell>

        <mxCell id="preview-paginate" value="página 1 de 4  ·  ← anterior  ·  próxima →" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="800" y="754" width="620" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="btn-back" value="← Voltar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="800" width="100" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="autosave" value="✓ salvo às 14h36" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="180" y="800" width="200" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-fila" value="Enviar para revisão (par)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1020" y="800" width="200" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-next" value="Validar alertas →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1240" y="800" width="180" height="36" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="12-fluxo-b-04-alertas-validacoes" name="12-fluxo-b-04-alertas-validacoes">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="12 — Fluxo B · Passo 4 · Alertas e validações (regras pré-cadastradas)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1200" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="proto" value="#2026-0473  ·  Escritura de V&amp;C c/ Cláusula Resolutiva" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="500" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Maria S. ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1100" y="78" width="140" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="1200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="✓ 1. Tipo" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="✓ 2. Documentos" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="240" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="✓ 3. Preencher" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="480" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="● 4. Validar alertas" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="720" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step5" value="○ 5. Gerar minuta" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="960" y="116" width="280" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="summary" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="1160" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="sum1" value="✓ 5 regras OK" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1;spacingLeft=20" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="220" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="sum2" value="! 2 alertas" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="280" y="180" width="220" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="sum3" value="✗ 1 bloqueio" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="500" y="180" width="220" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="sum-help" value="Bloqueios impedem o avanço para a geração da minuta. Alertas são informativos." style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="720" y="180" width="500" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="block-title" value="Bloqueios" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="284" width="200" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="block-card" value="✗ BLOQUEIO · Matrícula do imóvel não preenchida&#10;A regra &quot;Conferência matrícula&quot; exige um número de matrícula válido. Este campo está vazio.&#10;Ação sugerida: volte ao Passo 3 e digite manualmente o número da matrícula a partir do PDF da matrícula atualizada (CRI).&#10;[Ir ao campo no Passo 3]   [Ver regra]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fde7e9;strokeColor=#cc0000;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="60" y="316" width="1160" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="warn-title" value="Alertas (não bloqueiam)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="460" width="300" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="warn-card1" value="! ALERTA · Matrícula não localizada no RI integrado&#10;Não foi possível confirmar automaticamente a matrícula. Confira manualmente com o cartório de registro de imóveis antes de lavrar.&#10;[Marcar como verificado]   [Ver regra]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="60" y="492" width="570" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="warn-card2" value="! ALERTA · Endereço do imóvel difere do endereço do vendedor&#10;Os dados extraídos indicam que o vendedor reside no mesmo imóvel — confirme se há cláusula de desocupação ou se vendedor permanece.&#10;[Marcar como verificado]   [Ver regra]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="650" y="492" width="570" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="ok-title" value="Regras passando" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="636" width="200" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="ok-list" value="✓ CPF do vendedor é válido&#10;✓ CPF do comprador é válido&#10;✓ Vendedor ≠ Comprador (CPFs distintos)&#10;✓ Valor da venda preenchido e &gt; R$ 0,00&#10;✓ Cláusula resolutiva está presente no template" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="60" y="668" width="1160" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="btn-back" value="← Voltar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="800" width="100" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-rev" value="Enviar para revisão (par)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="800" width="200" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-next" value="Gerar minuta final →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#cccccc;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1040" y="800" width="180" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-next-help" value="(habilitado quando o bloqueio for resolvido)" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="800" y="838" width="420" height="20" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="13-fluxo-b-05-fila-revisao" name="13-fluxo-b-05-fila-revisao">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="13 — Fila de revisão compartilhada (rascunho · em revisão · pronto p/ lavratura)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1300" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1400" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1400" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Maria S. ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1300" y="78" width="140" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="sidebar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="744" as="geometry"/>
        </mxCell>
        <mxCell id="nav1" value="▣  Dashboard" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="130" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav2" value="[lista]  Fila de revisão" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="166" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav3" value="[catalogo]  Catálogo" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="202" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav4" value="[pasta]  Meus atos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="238" width="200" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="page-title" value="Fila de revisão" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="130" width="500" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="filters-bar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="170" width="1170" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="f1" value="◉ Todos do cartório" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="280" y="170" width="180" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="f2" value="○ Apenas meus" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="460" y="170" width="180" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="f3" value="○ Atribuídos a mim" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="640" y="170" width="180" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="f-search" value="[buscar] buscar..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;spacingLeft=8;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="900" y="180" width="240" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="f-tipo" value="Tipo: Todos ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1160" y="180" width="180" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="kanban-h1" value="○ RASCUNHO (5)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=12;fontStyle=1;align=left;spacingLeft=12" vertex="1" parent="1">
          <mxGeometry x="260" y="232" width="380" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="kanban-h2" value="◐ EM REVISÃO (3)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=12;fontStyle=1;align=left;spacingLeft=12" vertex="1" parent="1">
          <mxGeometry x="650" y="232" width="380" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="kanban-h3" value="● PRONTO P/ LAVRATURA (4)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=12;fontStyle=1;align=left;spacingLeft=12" vertex="1" parent="1">
          <mxGeometry x="1040" y="232" width="390" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="kc1-1" value="#2026-0473&#10;Esc. V&amp;C c/ Cláusula Resolutiva&#10;Maria S. · há 12min&#10;! 2 alertas" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="260" y="280" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kc1-2" value="#2026-0470&#10;Procuração para Adquirir Imóvel&#10;Maria S. · há 1h" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="260" y="370" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kc1-3" value="#2026-0468&#10;Doação c/ Reserva de Usufruto&#10;Carlos M. · há 3h&#10;! 2 alertas · ✗ 1 bloqueio" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="260" y="460" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kc1-4" value="#2026-0466&#10;Hipoteca em garantia de empréstimo&#10;Júlia P. · ontem" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="260" y="550" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kc1-5" value="#2026-0464&#10;Testamento&#10;Pedro R. · ontem" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="260" y="640" width="380" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="kc2-1" value="#2026-0463&#10;Esc. V&amp;C — Imóvel Rural&#10;Autor: Júlia P. · Revisor: Pedro R. · há 30min" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="650" y="280" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kc2-2" value="#2026-0462&#10;Procuração Geral&#10;Autor: Maria S. · Revisor: SEM ATRIBUIÇÃO&#10;[Atribuir-me]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="650" y="370" width="380" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kc2-3" value="#2026-0460&#10;Divórcio Consensual&#10;Autor: Carlos M. · Revisor: Maria S. · há 2h" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="650" y="460" width="380" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="kc3-1" value="#2026-0461&#10;Hipoteca em garantia de empréstimo&#10;Autor: Maria S. · Aprov: Pedro R. · ontem&#10;[Ver minuta] [Marcar lavrado]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1040" y="280" width="390" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kc3-2" value="#2026-0459&#10;Esc. V&amp;C&#10;Autor: Carlos M. · ontem&#10;[Ver minuta] [Marcar lavrado]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1040" y="370" width="390" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kc3-3" value="#2026-0457&#10;Procuração para Doar&#10;Autor: Júlia P. · 2 dias&#10;[Ver minuta] [Marcar lavrado]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1040" y="460" width="390" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kc3-4" value="#2026-0455&#10;Renúncia de Usufruto&#10;Autor: Pedro R. · 3 dias&#10;[Ver minuta] [Marcar lavrado]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=10;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1040" y="550" width="390" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Kanban 3-colunas é padrão mental para fila de trabalho — todo escrevente entende sem treino.&#10;2. Drag-and-drop entre colunas (não detalhado no wireframe) — clicar no card abre o detalhe; arrastar muda status quando há permissão.&#10;3. Card laranja para atos com bloqueio chama a atenção — princípio: nada que precise de ação fica escondido.&#10;4. Filtro de visão (Todos / Meus / Atribuídos) atende suposição UX-4 (validar com cliente).&#10;5. &quot;PRONTO P/ LAVRATURA&quot; já gerou minuta — billing está disparado. Lavratura é externa: botão [Marcar lavrado] fecha o ciclo." style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=9;align=left;verticalAlign=top" vertex="1" parent="1">
          <mxGeometry x="260" y="740" width="1170" height="120" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="14-fluxo-b-06-minuta-final-emolumento" name="14-fluxo-b-06-minuta-final-emolumento">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="14 — Fluxo B · Passo 5 · Minuta final + cálculo do emolumento (porta única do billing)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1300" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1400" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1400" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="proto" value="#2026-0473  ·  Escritura de V&amp;C c/ Cláusula Resolutiva" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="500" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Maria S. ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1300" y="78" width="140" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="1400" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="✓ 1. Tipo" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="✓ 2. Documentos" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="280" y="116" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="✓ 3. Preencher" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="560" y="116" width="240" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="✓ 4. Validar alertas" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="800" y="116" width="220" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step5" value="● 5. Gerar minuta" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1020" y="116" width="420" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="preview-title" value="Pré-visualização da minuta final" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="preview-body" value="ESCRITURA PÚBLICA DE VENDA E COMPRA COM CLÁUSULA RESOLUTIVA&#10;Aos seis dias do mês de maio do ano de dois mil e vinte e seis, perante mim, Tabelião do 27º Tabelionato de Notas da Capital de São Paulo, compareceram:&#10;OUTORGANTE VENDEDOR: JOSÉ DA SILVA SANTOS, brasileiro, portador do RG nº 12.345.678-9 SSP/SP e inscrito no CPF sob nº 123.456.789-00, residente em Rua das Flores, 100 — São Paulo/SP.&#10;OUTORGADA COMPRADORA: ANA PAULA MOREIRA, brasileira, portadora da CNH nº 01234567890 e inscrita no CPF sob nº 987.654.321-00, residente em Av. Brasil, 500 — São Paulo/SP.&#10;Por este instrumento e na forma da lei, declaram, livres e conscientes, o que segue:&#10;CLÁUSULA 1ª — OBJETO&#10;Por meio do presente instrumento, o VENDEDOR, já qualificado, TRANSFERE e CEDE à COMPRADORA o imóvel matriculado sob nº 145.382 no 9º RI da Capital, com a área de 84,30 m², situado em Rua das Flores, 100 — São Paulo/SP.&#10;CLÁUSULA 2ª — PREÇO&#10;O valor da presente venda é de R$ 850.000,00 (oitocentos e cinquenta mil reais), pago à vista por TED bancário em data anterior...&#10;CLÁUSULA 3ª — CLÁUSULA RESOLUTIVA&#10;Caso a comprovação do pagamento integral não ocorra até..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="60" y="208" width="800" height="540" as="geometry"/>
        </mxCell>

        <mxCell id="preview-paginate" value="página 1 de 4  ·  ← anterior  ·  próxima →  ·  Baixar PDF de revisão" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="60" y="752" width="800" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="emol-title" value="Cálculo do emolumento" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="180" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="emol-card" value="Tabela CGJ-SP · vigente 2026&#10;Tipo: Escritura de Venda e Compra&#10;Faixa: Acima de R$ 750.000 e até R$ 1.500.000&#10;Valor da venda: R$ 850.000,00&#10;Emolumento (cartório): R$ 4.831,20&#10;ISS, taxas e contribuições: R$ 1.207,80&#10;TOTAL EMOLUMENTOS: R$ 6.039,00&#10;[Detalhar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="900" y="208" width="500" height="200" as="geometry"/>
        </mxCell>

        <mxCell id="kb-source-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;strokeWidth=1" vertex="1" parent="1">
          <mxGeometry x="900" y="408" width="500" height="14" as="geometry"/>
        </mxCell>
        <mxCell id="kb-source" value="[lock]  Fonte: Tabela CGJ-SP 2026 · vigente desde 01/01/2026 · aprovada por Tabelião Lucas C. · hash a3f9...c12" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontColor=#1F4E79;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="900" y="408" width="500" height="14" as="geometry"/>
        </mxCell>

        <mxCell id="billing-title" value="Apuração Stoix (informativo)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="426" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="billing-card" value="Modelo: 3,1% do emolumento OU R$ 7,50&#10;(o que for maior)&#10;3,1% × R$ 6.039,00 = R$ 187,21&#10;Mínimo R$ 7,50&#10;Cobrança Stoix: R$ 187,21&#10;Cobrança ocorre apenas em PRODUÇÃO,&#10;ao gerar a minuta final.&#10;Apuração mensal — fatura emitida no dia 5 do mês seguinte." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="900" y="454" width="500" height="220" as="geometry"/>
        </mxCell>

        <mxCell id="warn-final" value="! Atenção: ao gerar a minuta final em PRODUÇÃO, esta operação será computada para fins de billing e ficará registrada no audit trail. Esta ação não pode ser desfeita — apenas anulada com justificativa registrada." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="900" y="688" width="500" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="btn-back" value="← Voltar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="800" width="100" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-baixar" value="Baixar como rascunho (PDF)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="180" y="800" width="220" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-gerar" value="GERAR MINUTA FINAL  (R$ 187,21)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1080" y="800" width="320" height="36" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="15-relatorios-billing" name="15-relatorios-billing">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="15 — Relatório de billing mensal (base 3,1% / R$ 7,50)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="800" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas T. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="page-title" value="Relatório de billing — Abril/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="130" width="500" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="filters" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="170" width="1180" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="f-mes" value="Mês: Abril/2026 ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="76" y="180" width="200" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="f-tipo" value="Tipo: Todos ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="290" y="180" width="200" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="f-amb" value="Ambiente: Produção ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="504" y="180" width="200" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="btn-csv" value="Exportar CSV" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="940" y="180" width="140" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="btn-pdf" value="Exportar PDF" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1090" y="180" width="140" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="kpi1" value="MINUTAS GERADAS&#10;(Produção · Abril)&#10;87" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=12;fontStyle=1;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="60" y="240" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kpi2" value="EMOLUMENTOS TOTAIS&#10;(base de cálculo)&#10;R$ 412.380,00" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=12;fontStyle=1;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="360" y="240" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kpi3" value="COBRANÇA STOIX&#10;(3,1% ou R$ 7,50)&#10;R$ 12.783,78" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=12;fontStyle=1;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="660" y="240" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kpi4" value="MINUTAS HOMOLOGAÇÃO&#10;(não fatura)&#10;5" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#999;fontSize=12;fontStyle=1;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="960" y="240" width="280" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="chart-title" value="Minutas geradas por dia" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="360" width="400" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="chart-area" value="[ Bar chart — 30 dias × nº minutas ]&#10;Picos visuais nos dias 5, 12, 19, 26 (segundas-feiras).&#10;Eixo Y: 0-12 minutas/dia. Média: 2,9/dia." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=center;verticalAlign=middle;dashed=1" vertex="1" parent="1">
          <mxGeometry x="60" y="390" width="800" height="180" as="geometry"/>
        </mxCell>

        <mxCell id="topact-title" value="Top tipos de ato" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="880" y="360" width="300" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="topact-list" value="1. Esc. Venda e Compra — 42&#10;2. Hipoteca — 14&#10;3. Procuração Adquirir Imóvel — 9&#10;4. Doação c/ Reserva Usufruto — 6&#10;5. Procuração Geral — 5&#10;6. Outros — 11" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="880" y="390" width="360" height="180" as="geometry"/>
        </mxCell>

        <mxCell id="detail-title" value="Detalhamento das minutas (auditoria)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="590" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="thead" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="618" width="1180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th1" value="DATA/HORA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="618" width="140" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th2" value="PROTOCOLO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="200" y="618" width="120" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th3" value="TIPO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="618" width="280" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th4" value="ESCREVENTE" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="600" y="618" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th5" value="EMOLUMENTO" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="760" y="618" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th6" value="STOIX (R$)" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="920" y="618" width="140" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th7" value="AUDIT" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="618" width="180" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="r1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="650" width="1180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r1-1" value="30/04 17:42" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="650" width="140" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r1-2" value="#2026-0473" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="200" y="650" width="120" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r1-3" value="Esc. V&amp;C c/ Cláusula Resolutiva" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="320" y="650" width="280" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r1-4" value="Maria S." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="600" y="650" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r1-5" value="R$ 6.039,00" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="760" y="650" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r1-6" value="187,21" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="920" y="650" width="140" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r1-7" value="Ver timeline" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1060" y="650" width="180" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="r2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="682" width="1180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r2-1" value="30/04 15:18" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="682" width="140" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r2-2" value="#2026-0461" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="200" y="682" width="120" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r2-3" value="Hipoteca" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="320" y="682" width="280" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r2-4" value="Pedro R." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="600" y="682" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r2-5" value="R$ 2.130,00" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="760" y="682" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r2-6" value="66,03" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="920" y="682" width="140" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="r2-7" value="Ver timeline" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1060" y="682" width="180" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="r-more" value="[ + 85 outras minutas... ]" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="720" width="600" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="footer-tot" value="Total mês: 87 minutas  ·  R$ 412.380,00 emolumentos  ·  R$ 12.783,78 cobrança Stoix" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="600" y="800" width="640" height="32" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="16-relatorios-sla" name="16-relatorios-sla">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="16 — Relatório de SLA (disponibilidade, tickets, severidade)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="800" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas T. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="page-title" value="Relatório de SLA — Abril/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="130" width="500" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="period" value="Período: 01/04/2026 a 30/04/2026  ·  Mês de competência abril" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="60" y="160" width="600" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="kpi1" value="DISPONIBILIDADE&#10;(meta 99,5%)&#10;99,87%&#10;✓ acima da meta" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="200" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="kpi2" value="TEMPO INDISPONÍVEL&#10;(janelas planejadas excluídas)&#10;56 minutos&#10;em 4 incidentes" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="360" y="200" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="kpi3" value="TICKETS ABERTOS&#10;(no mês)&#10;12 abertos&#10;11 resolvidos · 1 em andamento" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="660" y="200" width="280" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="kpi4" value="SLA RESPOSTA&#10;(severidade crítica: 1h útil)&#10;100%&#10;0 violações" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="960" y="200" width="280" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="chart-title" value="Disponibilidade diária (30 dias)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="340" width="500" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="chart-area" value="[ Heatmap ou linha — 30 dias × disponibilidade % ]&#10;Linha de meta 99,5% sempre visível.&#10;Picos de queda destacados em 12/04 e 23/04 (incidentes).&#10;Y: 99,0% a 100,0%" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=center;verticalAlign=middle;dashed=1" vertex="1" parent="1">
          <mxGeometry x="60" y="370" width="800" height="180" as="geometry"/>
        </mxCell>

        <mxCell id="sev-title" value="Distribuição por severidade" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="880" y="340" width="300" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="sev-list" value="Crítica (resp. ≤ 1h):  1 ticket&#10;  └ resp. média: 18 min&#10;Alta (resp. ≤ 4h):  3 tickets&#10;  └ resp. média: 47 min&#10;Média (resp. ≤ 1 dia útil):  5 tickets&#10;  └ resp. média: 3h12&#10;Baixa (resp. ≤ 3 dias úteis):  3 tickets&#10;  └ resp. média: 6h40" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="880" y="370" width="360" height="180" as="geometry"/>
        </mxCell>

        <mxCell id="inc-title" value="Incidentes do mês" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="570" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="thead" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="598" width="1180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th1" value="DATA/HORA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="598" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th2" value="SEVERIDADE" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="220" y="598" width="120" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th3" value="DESCRIÇÃO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="340" y="598" width="440" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th4" value="DURAÇÃO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="780" y="598" width="120" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th5" value="STATUS" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="598" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th6" value="POST-MORTEM" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="598" width="180" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="r1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="630" width="1180" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r1-1" value="23/04 14:32" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="630" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r1-2" value="Crítica" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="220" y="630" width="120" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r1-3" value="Indisponibilidade do OCR (timeout fornecedor)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="340" y="630" width="440" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r1-4" value="22 min" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="780" y="630" width="120" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r1-5" value="✓ Resolvido" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="900" y="630" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r1-6" value="Ver post-mortem" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1060" y="630" width="180" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="r2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="666" width="1180" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r2-1" value="12/04 09:15" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="666" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r2-2" value="Alta" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="220" y="666" width="120" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r2-3" value="Lentidão na geração de minuta (DB CPU alto)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="340" y="666" width="440" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r2-4" value="14 min" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="780" y="666" width="120" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r2-5" value="✓ Resolvido" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="900" y="666" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="r2-6" value="Ver post-mortem" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1060" y="666" width="180" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="r-more" value="[ + 2 incidentes... ]" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="710" width="600" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="export" value="Exportar PDF mensal · Exportar CSV técnico · Compartilhar com auditoria" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="60" y="760" width="1180" height="32" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="17-gestao-usuarios" name="17-gestao-usuarios">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="17 — Gestão de usuários e papéis" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="800" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas T. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="page-title" value="Usuários do cartório" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="130" width="500" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="cta-novo" value="+ Convidar usuário" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="130" width="180" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="kpis" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="1180" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kpi1" value="1 Tabelião  ·  6 Escreventes  ·  1 DPO  ·  8 ativos / 0 inativos" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1;spacingLeft=20" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="800" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="kpi2" value="Limite do plano: até 8 usuários · ✓ ok" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;spacingRight=20" vertex="1" parent="1">
          <mxGeometry x="900" y="180" width="320" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="filter-bar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="60" y="280" width="1180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="search" value="[buscar] buscar por nome ou e-mail..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;spacingLeft=8;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="60" y="284" width="320" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="f-papel" value="Papel: Todos ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="400" y="284" width="180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="f-status" value="Status: Todos ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="600" y="284" width="180" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="thead" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="336" width="1180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th1" value="NOME" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="336" width="240" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th2" value="E-MAIL" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="300" y="336" width="280" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th3" value="PAPEL" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="580" y="336" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th4" value="STATUS" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="740" y="336" width="120" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th5" value="ÚLTIMO ACESSO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="860" y="336" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th6" value="AÇÕES" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1020" y="336" width="220" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="r1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="368" width="1180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-1" value="Lucas Tarrega" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="368" width="240" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-2" value="lucas@27notas.sp.br" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="300" y="368" width="280" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-3" value="Tabelião" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="368" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-4" value="● Ativo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="740" y="368" width="120" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-5" value="agora" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="860" y="368" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-6" value="Editar  (não pode desativar)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="1020" y="368" width="220" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="r2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="408" width="1180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2-1" value="Maria Silva" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="408" width="240" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2-2" value="maria.s@27notas.sp.br" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="300" y="408" width="280" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2-3" value="Escrevente" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="408" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2-4" value="● Ativo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="740" y="408" width="120" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2-5" value="há 2 min" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="860" y="408" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r2-6" value="Editar · Reset senha · Desativar" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1020" y="408" width="220" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="r3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="448" width="1180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3-1" value="Carlos Mendonça" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="448" width="240" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3-2" value="carlos.m@27notas.sp.br" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="300" y="448" width="280" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3-3" value="Escrevente" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="580" y="448" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3-4" value="● Ativo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="740" y="448" width="120" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3-5" value="há 1h" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="860" y="448" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r3-6" value="Editar · Reset senha · Desativar" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1020" y="448" width="220" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="r-more" value="[ + 4 escreventes... + DPO Renata B. ]" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="488" width="600" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="papeis-title" value="Permissões por papel (matriz)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="540" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="matrix-h" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="572" width="1180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="m-h1" value="AÇÃO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="572" width="500" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="m-h2" value="TABELIÃO" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="560" y="572" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="m-h3" value="ESCREVENTE" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="720" y="572" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="m-h4" value="DPO" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="880" y="572" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="m-h5" value="ADMIN STOIX" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1040" y="572" width="200" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="mr1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="604" width="1180" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr1-1" value="Cadastrar tipo de ato (Fluxo A)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="604" width="500" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr1-2" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="560" y="604" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr1-3" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="720" y="604" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr1-4" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="880" y="604" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr1-5" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1040" y="604" width="200" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="mr2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="632" width="1180" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr2-1" value="Executar ato (Fluxo B)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="632" width="500" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr2-2" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="560" y="632" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr2-3" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="720" y="632" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr2-4" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="880" y="632" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr2-5" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1040" y="632" width="200" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="mr3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="660" width="1180" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr3-1" value="Ver relatórios de billing e SLA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="660" width="500" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr3-2" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="560" y="660" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr3-3" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="720" y="660" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr3-4" value="parcial (LGPD)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="880" y="660" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr3-5" value="✓ (todos)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1040" y="660" width="200" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="mr4" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="688" width="1180" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr4-1" value="Gerenciar usuários" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="688" width="500" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr4-2" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="560" y="688" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr4-3" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="720" y="688" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr4-4" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="880" y="688" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr4-5" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1040" y="688" width="200" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="mr5" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="716" width="1180" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr5-1" value="Acessar logs LGPD e exportar dados" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="716" width="500" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr5-2" value="ler" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="560" y="716" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr5-3" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="720" y="716" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr5-4" value="✓ (gerencia)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="880" y="716" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="mr5-5" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1040" y="716" width="200" height="28" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="18-configuracoes-cartorio" name="18-configuracoes-cartorio">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="18 — Configurações do cartório (dados, ambiente, integrações)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="800" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas T. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="left-tabs" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="140" width="240" height="700" as="geometry"/>
        </mxCell>
        <mxCell id="t1" value="▣  Dados do cartório" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="150" width="240" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="t2" value="[refresh]  Ambiente" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="60" y="186" width="240" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="t3" value="[link]  Integrações" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="60" y="222" width="240" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="t4" value="[$]  Tabela de emolumentos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="60" y="258" width="240" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="t5" value="[bell]  Notificações" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="60" y="294" width="240" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="t6" value="[lock]  Segurança e 2FA" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="60" y="330" width="240" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="t7" value="[lista]  Plano e billing" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="60" y="366" width="240" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="content-title" value="Dados do cartório" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="140" width="400" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-nome" value="Nome do cartório *" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="320" y="180" width="400" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-nome" value="27º Tabelionato de Notas da Capital de São Paulo" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="320" y="200" width="600" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-cnpj" value="CNPJ" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="320" y="244" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-cnpj" value="00.000.000/0001-00" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="320" y="264" width="280" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-cnj" value="CNS / CNJ" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="640" y="244" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-cnj" value="06.0000-0" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="640" y="264" width="280" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-end" value="Endereço" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="320" y="306" width="400" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-end" value="Rua XV de Novembro, 100 — Centro — São Paulo/SP — 01000-000" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="320" y="326" width="600" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-tab" value="Tabelião titular" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="320" y="370" width="400" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-tab" value="Lucas Tarrega  (lucas@27notas.sp.br)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="320" y="390" width="600" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-dpo" value="DPO designado" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="320" y="434" width="400" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="inp-dpo" value="Renata Bizarria  (dpo@27notas.sp.br)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="320" y="454" width="600" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="amb-title" value="Ambiente atual" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="520" width="400" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="amb-card" value="◉  PRODUÇÃO  (em uso pelos escreventes — gera billing)&#10;○  HOMOLOGAÇÃO  (testes — não gera billing)&#10;! Mudança de ambiente afeta TODO o cartório.&#10;Ação restrita ao Tabelião e exige confirmação 2FA." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12" vertex="1" parent="1">
          <mxGeometry x="320" y="554" width="600" height="120" as="geometry"/>
        </mxCell>

        <mxCell id="cgj-title" value="Tabela CGJ-SP" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="690" width="300" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="cgj-card" value="Versão vigente: CGJ-SP 2026 (atualizada em 02/01/2026 pela Stoix)&#10;Esta tabela é mantida e atualizada pela Stoix conforme provimento da CGJ-SP.&#10;O cartório não pode editá-la diretamente. Em caso de divergência, abrir ticket." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="320" y="716" width="600" height="80" as="geometry"/>
        </mxCell>

        <mxCell id="btn-save" value="Salvar alterações" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="780" y="810" width="160" height="36" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="19-area-dpo-lgpd" name="19-area-dpo-lgpd">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="19 — Área DPO / LGPD (logs, incidentes 48h, exportação de dados)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1000" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#666;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Renata B. (DPO) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1050" y="78" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="page-title" value="Painel LGPD" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="130" width="500" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="kpi1" value="ACESSOS A DADOS&#10;PESSOAIS (30d)&#10;1.247" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="170" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kpi2" value="INCIDENTES ATIVOS&#10;(notificação 48h pendente)&#10;0" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="360" y="170" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kpi3" value="SOLICITAÇÕES TITULARES&#10;(direitos LGPD)&#10;2 abertas / 8 atendidas" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="660" y="170" width="280" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="kpi4" value="POLÍTICAS&#10;✓ Privacidade: v3 vigente&#10;✓ Retenção: 5 anos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=14;spacingTop=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="960" y="170" width="280" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="inc-title" value="Incidentes recentes" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="290" width="500" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="cta-novo" value="+ Registrar incidente" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#333333;strokeColor=#333;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="284" width="180" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="thead" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="328" width="1180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th1" value="DETECTADO EM" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="328" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th2" value="TIPO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="220" y="328" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th3" value="DESCRIÇÃO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="380" y="328" width="380" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th4" value="JANELA 48h" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="760" y="328" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th5" value="STATUS" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="920" y="328" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="th6" value="AÇÕES" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1080" y="328" width="160" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="r1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="360" width="1180" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-1" value="14/03 09:42" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="360" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-2" value="Acesso indevido" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="220" y="360" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-3" value="Tentativa de login forçada (bloqueada após 5 tentativas)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="380" y="360" width="380" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-4" value="encerrada (47h)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="760" y="360" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-5" value="✓ Notificado ANPD" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="920" y="360" width="160" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="r1-6" value="Ver detalhes" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1080" y="360" width="160" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="r-empty" value="Nenhum incidente ativo no momento — bom trabalho!" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="400" width="600" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="logs-title" value="Logs de acesso a dados pessoais (auditoria LGPD)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="450" width="600" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="logs-filter" value="Período: últimos 7 dias ▾  ·  Usuário: todos ▾  ·  Tipo de dado: todos ▾  ·  [buscar] buscar..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=10;align=left;verticalAlign=middle;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="60" y="478" width="1180" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="log-thead" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="522" width="1180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lh1" value="DATA/HORA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="522" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lh2" value="USUÁRIO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="220" y="522" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lh3" value="AÇÃO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="380" y="522" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lh4" value="DADO ACESSADO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="580" y="522" width="280" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lh5" value="PROTOCOLO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="860" y="522" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lh6" value="IP / FINALIDADE" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1020" y="522" width="220" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="lr1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="554" width="1180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr1-1" value="06/05 14:32" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="554" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr1-2" value="Maria S." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="220" y="554" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr1-3" value="OCR · leitura RG" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="380" y="554" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr1-4" value="José da Silva Santos · CPF ***.***.789-00" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="580" y="554" width="280" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr1-5" value="#2026-0473" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="860" y="554" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr1-6" value="200.x.x.x · execução ato" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1020" y="554" width="220" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="lr2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="60" y="586" width="1180" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr2-1" value="06/05 14:33" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="586" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr2-2" value="Maria S." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="220" y="586" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr2-3" value="LLM · preenchimento" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="380" y="586" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr2-4" value="Ana Paula Moreira · CPF ***.***.321-00" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="580" y="586" width="280" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr2-5" value="#2026-0473" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="860" y="586" width="160" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="lr2-6" value="200.x.x.x · execução ato" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1020" y="586" width="220" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="lr-more" value="[ + 1.245 outros eventos no período... ]  ·  [Exportar CSV completo]" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="60" y="624" width="800" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="rights-title" value="Solicitações de titulares (direitos LGPD)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="676" width="500" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="rt1" value="Solicitação #2026-RT-007&#10;Maria do Carmo Souza · CPF ***.***.111-00&#10;Tipo: Acesso aos próprios dados&#10;Recebida em: 02/05/2026 · prazo: 17/05/2026&#10;[Atender]  [Detalhar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="60" y="704" width="580" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="rt2" value="Solicitação #2026-RT-008&#10;João Pedro Lima · CPF ***.***.222-00&#10;Tipo: Anonimização de dados&#10;Recebida em: 04/05/2026 · prazo: 19/05/2026&#10;[Atender]  [Detalhar]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=14;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="660" y="704" width="580" height="120" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="01-kbc-dashboard" name="01-kbc-dashboard">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="KBC 01 — Dashboard da Knowledge Base Cartorial" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="900" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="breadcrumb" value="Knowledge Base Cartorial" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="300" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas C. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1060" y="78" width="170" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="sidebar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="744" as="geometry"/>
        </mxCell>
        <mxCell id="nav1" value="▣  Dashboard" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="130" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav2" value="[catalogo]  Catálogo de atos" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="166" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav3" value="[folder]  Knowledge Base" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="202" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav4" value="[lista]  Atos em execução" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="238" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav5" value="[graph]  Relatórios" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="274" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav6" value="[users]  Usuários" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="310" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="nav7" value="⚙  Configurações" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11;align=left;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="40" y="346" width="200" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="kbc-sidebar-sub" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="60" y="234" width="180" height="180" as="geometry"/>
        </mxCell>
        <mxCell id="sub1" value="•  Visão geral" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="76" y="240" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="sub2" value="•  Subir documento" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="76" y="262" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="sub3" value="•  Versões aprovadas" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="76" y="284" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="sub4" value="•  Pendentes" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="76" y="306" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="sub5" value="•  Auditoria de uso" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="76" y="328" width="160" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="welcome" value="Knowledge Base do 27º Tabelionato" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="130" width="600" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="welcome-sub" value="Você é o Controlador. A Stoix processa, você aprova. Tudo que está aqui foi homologado por você ou um Tabelião substituto." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=2;fontColor=#555" vertex="1" parent="1">
          <mxGeometry x="260" y="156" width="800" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="cta-upload" value="+  Subir novo documento" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1040" y="130" width="180" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="kpi1" value="EMOLUMENTOS&#10;1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="260" y="190" width="180" height="92" as="geometry"/>
        </mxCell>
        <mxCell id="kpi1-sub" value="Tabela CGJ-SP 2026 vigente" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="272" y="252" width="160" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="kpi2" value="NORMATIVOS&#10;14" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="460" y="190" width="180" height="92" as="geometry"/>
        </mxCell>
        <mxCell id="kpi2-sub" value="NSCGJ-SP, provimentos CNJ, etc" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="472" y="252" width="160" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="kpi3" value="MODELOS DE ATO&#10;42" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="660" y="190" width="180" height="92" as="geometry"/>
        </mxCell>
        <mxCell id="kpi3-sub" value="alimenta o Catálogo (Fluxo A)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="672" y="252" width="160" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="kpi4" value="PROCEDIMENTOS&#10;9" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="860" y="190" width="180" height="92" as="geometry"/>
        </mxCell>
        <mxCell id="kpi4-sub" value="checklists, fluxos internos" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="872" y="252" width="160" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="kpi5" value="REFERÊNCIAS&#10;7" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=11;fontStyle=1;align=left;verticalAlign=top;spacingLeft=12;spacingTop=10" vertex="1" parent="1">
          <mxGeometry x="1060" y="190" width="160" height="92" as="geometry"/>
        </mxCell>
        <mxCell id="kpi5-sub" value="doutrina, jurisprudência" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="1072" y="252" width="160" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="alerts-title" value="Atenção — itens que exigem ação" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="306" width="600" height="25" as="geometry"/>
        </mxCell>

        <mxCell id="alert1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="260" y="338" width="940" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="alert1-icon" value="!" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=20;fontColor=#cc6600" vertex="1" parent="1">
          <mxGeometry x="272" y="348" width="40" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="alert1-txt" value="Tabela de Emolumentos CGJ-SP 2026 expira em 23 dias (31/12/2026). Subir tabela 2027 antes do vencimento para não bloquear cobrança." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="348" width="700" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="alert1-cta" value="Atualizar agora →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#cc6600;strokeColor=#cc6600;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="350" width="130" height="34" as="geometry"/>
        </mxCell>

        <mxCell id="alert2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="408" width="940" height="46" as="geometry"/>
        </mxCell>
        <mxCell id="alert2-icon" value="ⓘ" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="272" y="416" width="40" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="alert2-txt" value="3 documentos sem vigência cadastrada — sistema não saberá quando expiram. Edite metadados antes de aprovar." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="320" y="416" width="700" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="alert2-cta" value="Ver pendências" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontColor=#333;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1080" y="416" width="110" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="recent-title" value="Últimas 5 versões aprovadas" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="476" width="600" height="25" as="geometry"/>
        </mxCell>
        <mxCell id="recent-link" value="Ver tudo →" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="1100" y="476" width="100" height="25" as="geometry"/>
        </mxCell>

        <mxCell id="recent-list" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="510" width="940" height="320" as="geometry"/>
        </mxCell>

        <mxCell id="rh1" value="DOCUMENTO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=1;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="276" y="520" width="380" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="rh2" value="TIPO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=1;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="660" y="520" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="rh3" value="VIGÊNCIA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=1;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="790" y="520" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="rh4" value="APROVADA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=1;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="960" y="520" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="rh5" value="" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9" vertex="1" parent="1">
          <mxGeometry x="1090" y="520" width="100" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="row1-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="546" width="908" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="row1-c1" value="Tabela de Emolumentos CGJ-SP 2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="284" y="550" width="370" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row1-c1b" value="hash a3f9...c12 · 84 KB · PDF original" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="284" y="572" width="370" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="row1-c2" value="Emolumento" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;fontSize=9;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="660" y="558" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row1-c3" value="01/01/2026 — 31/12/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="790" y="558" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row1-c4" value="Lucas C. · 02/01/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="960" y="558" width="180" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row1-pill" value="VIGENTE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=9;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1100" y="558" width="76" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="row2-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="598" width="908" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="row2-c1" value="NSCGJ-SP Tomo II — Cap. XIV (Notas)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="284" y="602" width="370" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row2-c1b" value="hash 7e2a...8ff · 312 KB · PDF original" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="284" y="624" width="370" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="row2-c2" value="Normativo" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5e8f8;strokeColor=#7b1fa2;fontSize=9;fontColor=#6a1b9a" vertex="1" parent="1">
          <mxGeometry x="660" y="610" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row2-c3" value="20/03/2026 — perpétuo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="790" y="610" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row2-c4" value="Lucas C. · 21/03/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="960" y="610" width="180" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row2-pill" value="VIGENTE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=9;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1100" y="610" width="76" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="row3-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="650" width="908" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="row3-c1" value="Modelo — Procuração para adquirir imóvel" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="284" y="654" width="370" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row3-c1b" value="hash bc41...d09 · 14 KB · DOCX original · usado em 11 atos" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="284" y="676" width="370" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="row3-c2" value="Modelo de ato" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=9;fontColor=#995200" vertex="1" parent="1">
          <mxGeometry x="660" y="662" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row3-c3" value="15/04/2026 — perpétuo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="790" y="662" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row3-c4" value="Lucas C. · 15/04/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="960" y="662" width="180" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row3-pill" value="VIGENTE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=9;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1100" y="662" width="76" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="row4-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="702" width="908" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="row4-c1" value="Provimento CNJ 149/2023 (regularizado interno)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="284" y="706" width="370" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row4-c1b" value="hash 4d8f...112 · 96 KB · PDF original" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="284" y="728" width="370" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="row4-c2" value="Normativo" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5e8f8;strokeColor=#7b1fa2;fontSize=9;fontColor=#6a1b9a" vertex="1" parent="1">
          <mxGeometry x="660" y="714" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row4-c3" value="01/03/2026 — perpétuo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="790" y="714" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row4-c4" value="Lucas C. · 04/03/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="960" y="714" width="180" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row4-pill" value="VIGENTE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=9;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1100" y="714" width="76" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="row5-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="754" width="908" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="row5-c1" value="Checklist — Doação com Reserva de Usufruto" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="284" y="758" width="370" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row5-c1b" value="hash 9a18...77c · 8 KB · MD original · interno" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="284" y="780" width="370" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="row5-c2" value="Procedimento" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=9;fontColor=#3a6027" vertex="1" parent="1">
          <mxGeometry x="660" y="766" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row5-c3" value="20/04/2026 — perpétuo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="790" y="766" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row5-c4" value="Lucas C. · 20/04/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="960" y="766" width="180" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="row5-pill" value="VIGENTE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=9;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1100" y="766" width="76" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Hierarquia: alerta vermelho/laranja &gt; CTA &quot;Subir&quot; &gt; KPIs por tipo &gt; lista recente. Tabelião que abre vê em 2s o que precisa.&#10;2. Pílulas de tipo (cor por categoria) repetem a mesma paleta usada em todo o sistema (azul=emolumento, roxo=normativo, laranja=modelo, verde=procedimento, cinza=referência).&#10;3. Hash visível por linha — auditoria material. Sem hash, KB perde valor probatório.&#10;4. CTA &quot;Atualizar agora&quot; no alerta de vencimento leva direto pro fluxo de upload com tipo=emolumento pré-selecionado.&#10;5. Sub-navegação à esquerda quando KBC está ativa — &quot;Pendentes&quot; permite chegar nos docs sem vigência.&#10;6. Estado vazio NÃO desenhado aqui (este é o estado povoado); ver wireframe 02 com primeira-experiência sem docs.&#10;7. Decisão: mantemos o bucket cartorio-{slug}-kb visível só por hash, não path — o Tabelião não precisa pensar em S3." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1260" y="120" width="220" height="540" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="02-kbc-upload-passo-1-metadados" name="02-kbc-upload-passo-1-metadados">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="KBC 02 — Upload · Passo 1 · Drop file e metadados" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="900" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="breadcrumb" value="Knowledge Base / Subir documento" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="350" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas C. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1060" y="78" width="170" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="sidebar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="744" as="geometry"/>
        </mxCell>
        <mxCell id="nav3" value="[folder]  Knowledge Base" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="130" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="sub2" value="•  Subir documento" style="text;html=1;strokeColor=none;fillColor=#f0f0f0;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="170" width="180" height="26" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="140" width="940" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="● 1. Drop file e metadados" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="140" width="240" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="○ 2. Processando" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="500" y="140" width="200" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="○ 3. Diff e edição" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="140" width="240" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="○ 4. Aprovar versão" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="940" y="140" width="220" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="responsabilidade" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#cc6600;strokeWidth=1.5" vertex="1" parent="1">
          <mxGeometry x="260" y="216" width="940" height="58" as="geometry"/>
        </mxCell>
        <mxCell id="responsabilidade-icon" value="ⓘ" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontColor=#cc6600;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="272" y="226" width="34" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="responsabilidade-txt" value="Responsabilidade do Controlador. Você é responsável pela conformidade da fonte que está subindo. A Stoix processa o documento (OCR + IA), você revisa, aprova e atesta a vigência. A versão aprovada por você é a fonte oficial — todo ato lavrado registra qual versão da KB foi consultada (snapshot por hash)." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="312" y="222" width="870" height="48" as="geometry"/>
        </mxCell>

        <mxCell id="leftcol-title" value="Arquivo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="290" width="400" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="dropzone" value="[ Arraste o arquivo aqui ou clique para selecionar ]&#10;PDF · DOCX · HTML · até 50 MB&#10;Para fontes oficiais (CGJ-SP, CNB-SP), prefira o PDF original assinado." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999;fontSize=12;dashed=1;align=center;verticalAlign=middle" vertex="1" parent="1">
          <mxGeometry x="260" y="330" width="540" height="200" as="geometry"/>
        </mxCell>

        <mxCell id="file-uploaded" value="[doc]  cgj-sp-tabela-emolumentos-2026.pdf · 84 KB · ✓ enviado" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=11;align=left;spacingLeft=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="540" width="540" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="rightcol-title" value="Metadados" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="820" y="290" width="400" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-tipo" value="Tipo *" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="820" y="326" width="200" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="radio1" value="◉  Emolumento (tabela CGJ-SP)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="350" width="380" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="radio2" value="○  Normativo (NSCGJ-SP, provimento CNJ, etc)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="372" width="380" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="radio3" value="○  Modelo de ato (alimenta Catálogo / Fluxo A)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="394" width="380" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="radio4" value="○  Procedimento interno (checklist, fluxo)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="416" width="380" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="radio5" value="○  Referência jurídica (doutrina, jurisprudência)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="820" y="438" width="380" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-vigencia" value="Vigência *" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="820" y="476" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="vig-from-lbl" value="Início" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="820" y="498" width="100" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="vig-from" value="01/01/2026  [date]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="820" y="518" width="170" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="vig-to-lbl" value="Fim" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="1010" y="498" width="100" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="vig-to" value="31/12/2026  [date]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="1010" y="518" width="170" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="vig-perp" value="☐  Perpétuo (sem prazo de fim — normativo permanente)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="820" y="556" width="380" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-origem" value="Origem *" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="820" y="592" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="origem-dd" value="Oficial CGJ-SP  ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="820" y="614" width="360" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="origem-help" value="opções: oficial CGJ-SP · CNB-SP · doutrina · interno do cartório" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="820" y="650" width="360" height="14" as="geometry"/>
        </mxCell>

        <mxCell id="lbl-tags" value="Tags" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="610" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="tags-input" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=11;align=left;verticalAlign=top;spacingLeft=8;spacingTop=6" vertex="1" parent="1">
          <mxGeometry x="260" y="630" width="540" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="chip1" value="emolumento" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="270" y="640" width="90" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="chip2" value="cgj-sp" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="368" y="640" width="62" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="chip3" value="2026" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="438" y="640" width="50" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="tags-input-cursor" value="adicionar tag…" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;fontColor=#999" vertex="1" parent="1">
          <mxGeometry x="500" y="640" width="180" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="btn-cancel" value="Cancelar" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="260" y="780" width="100" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-rascunho" value="Salvar como rascunho" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="370" y="780" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-next" value="Processar com IA →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1040" y="780" width="160" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Layout 2 colunas: arquivo à esquerda, metadados à direita. Lê de cima pra baixo, esquerda pra direita.&#10;2. Banner amarelo de Responsabilidade NÃO é fechável — Tabelião precisa ler em todo upload (decisão jurídica do Leonardo: defesa material).&#10;3. Tipo como radio (5 opções), não dropdown — campo determina o downstream completo (extração, schema, chunking RAG); precisa visibilidade total.&#10;4. Vigência: 2 datas + toggle &quot;perpétuo&quot;. Se &quot;perpétuo&quot; checado, campo &quot;Fim&quot; vira disabled e cinza.&#10;5. Tags livres mas auto-sugeridas com base no tipo (em &quot;emolumento&quot; já vem &quot;emolumento, cgj-sp, 2026&quot; pré-povoado).&#10;6. CTA principal escuro destaca acionamento da IA. &quot;Salvar rascunho&quot; sempre disponível porque metadados podem demorar de ser preenchidos.&#10;7. Microcopy do dropzone diz &quot;PDF original assinado&quot; — induz Tabelião a NÃO subir cópia ruim.&#10;8. Estado de erro (arquivo &gt;50MB, formato errado): mensagem inline vermelha abaixo do dropzone, não modal.&#10;9. Acessibilidade: radio buttons navegáveis por seta; campos de data aceitam digitação além do picker." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1260" y="120" width="220" height="600" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="03-kbc-upload-passo-2-processando" name="03-kbc-upload-passo-2-processando">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="KBC 03 — Upload · Passo 2 · Processando (OCR + IA + estruturação)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1100" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="breadcrumb" value="Knowledge Base / Subir documento / Processando" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="400" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas C. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1060" y="78" width="170" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="sidebar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="744" as="geometry"/>
        </mxCell>
        <mxCell id="nav3" value="[folder]  Knowledge Base" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="130" width="200" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="140" width="940" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="✓ 1. Drop file e metadados" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#3a6027" vertex="1" parent="1">
          <mxGeometry x="260" y="140" width="240" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="● 2. Processando" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="500" y="140" width="200" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="○ 3. Diff e edição" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="700" y="140" width="240" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="○ 4. Aprovar versão" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="940" y="140" width="220" height="60" as="geometry"/>
        </mxCell>

        <mxCell id="status-title" value="cgj-sp-tabela-emolumentos-2026.pdf" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="232" width="940" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="status-sub" value="Processando · você pode fechar esta tela e voltar quando estiver pronto · enviaremos notificação" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="260" y="262" width="940" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="step-card1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="320" y="320" width="820" height="64" as="geometry"/>
        </mxCell>
        <mxCell id="step-card1-icon" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=22;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="332" y="332" width="40" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="step-card1-name" value="Upload concluído" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="380" y="328" width="400" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="step-card1-desc" value="84 KB recebidos · armazenado em bucket cartorio-27sp-kb · KMS criptografado" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#555" vertex="1" parent="1">
          <mxGeometry x="380" y="350" width="600" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="step-card1-time" value="2s" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="340" width="60" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="step-card2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="320" y="396" width="820" height="64" as="geometry"/>
        </mxCell>
        <mxCell id="step-card2-icon" value="✓" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=22;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="332" y="408" width="40" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="step-card2-name" value="OCR concluído" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="380" y="404" width="400" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="step-card2-desc" value="Textract sa-east-1 · 14 páginas · 98% confiança média · 312 valores numéricos detectados" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#555" vertex="1" parent="1">
          <mxGeometry x="380" y="426" width="600" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="step-card2-time" value="38s" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="416" width="60" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="step-card3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="320" y="472" width="820" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="step-card3-icon" value="[aguarda]" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=22" vertex="1" parent="1">
          <mxGeometry x="332" y="492" width="40" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="step-card3-name" value="Extração com IA — em andamento" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="380" y="484" width="400" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="step-card3-desc" value="Bedrock Sonnet sa-east-1 · identificando faixas de valor, condições e tipos de ato" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#555" vertex="1" parent="1">
          <mxGeometry x="380" y="506" width="600" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="progressbar-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="380" y="534" width="600" height="10" as="geometry"/>
        </mxCell>
        <mxCell id="progressbar-fg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="380" y="534" width="380" height="10" as="geometry"/>
        </mxCell>
        <mxCell id="progressbar-pct" value="63%" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="990" y="528" width="40" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="step-card3-time" value="~ 50s restantes" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="990" y="548" width="120" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="step-card4" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="320" y="584" width="820" height="64" as="geometry"/>
        </mxCell>
        <mxCell id="step-card4-icon" value="○" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=22;fontColor=#999" vertex="1" parent="1">
          <mxGeometry x="332" y="596" width="40" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="step-card4-name" value="Estruturação e indexação" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="380" y="592" width="400" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="step-card4-desc" value="Geração de embeddings (Titan) · gravação na tabela kb_emolumento_estruturado · pgvector index" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#999" vertex="1" parent="1">
          <mxGeometry x="380" y="614" width="600" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="step-card4-time" value="~ 30s" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#999;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="1060" y="604" width="60" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="cancel-area" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="320" y="688" width="820" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="cancel-info" value="ⓘ  Você pode cancelar agora — nada cobrado. Após estruturação, descarte ainda é possível na tela seguinte." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="320" y="688" width="640" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="btn-cancel" value="Cancelar processamento" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cc0000;fontSize=11;fontColor=#cc0000" vertex="1" parent="1">
          <mxGeometry x="980" y="690" width="160" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="aside-title" value="Estimativa de custo desta extração" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="744" width="400" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="aside-row" value="OCR Textract · 14 páginas · ≈ R$ 0,21       Bedrock Sonnet · ≈ R$ 0,38       Embeddings · ≈ R$ 0,02       Total estimado: R$ 0,61" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="320" y="766" width="820" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. 4 cards verticais empilhados — feedback de progresso linear, sem acordeon.&#10;2. Estado de cada card é visível pelo cor da borda + ícone:&#10;   verde + ✓ = concluído&#10;   azul + [aguarda] = em andamento (com progress bar e ETA)&#10;   cinza + ○ = pendente&#10;3. ETA em cima e tempo decorrido na lateral direita — Tabelião sabe quanto falta sem precisar fazer conta.&#10;4. Microcopy explícita: pode fechar tela sem perder progresso, notificação avisa quando pronto. Reduz ansiedade.&#10;5. Cancelamento sempre disponível durante OCR/Extração com aviso de gratuidade. Após estruturação, custo já foi gasto — descarte é diferente de cancelar.&#10;6. Estimativa de custo aparece desde o início — transparência radical (Stoix usa contrato pay-as-you-process, isso evita reclamação na fatura).&#10;7. Estado de erro: card 3 muda pra fillColor vermelho claro, ícone ✕, mensagem (&quot;OCR falhou — provavelmente PDF protegido. Tentar novamente ou subir PDF desbloqueado&quot;) e CTA &quot;Tentar de novo&quot;." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1260" y="120" width="220" height="540" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="04-kbc-diff-extracao" name="04-kbc-diff-extracao">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="KBC 04 — Diff visual de extração · revisão e edição da fonte estruturada" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1200" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="breadcrumb" value="KB / Subir / Diff de extração — Tabela CGJ-SP 2026 (rascunho)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="500" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas C. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1060" y="78" width="170" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="stepper" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="124" width="1200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step1" value="✓ 1. Drop file" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#3a6027" vertex="1" parent="1">
          <mxGeometry x="40" y="124" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step2" value="✓ 2. Processado" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#3a6027" vertex="1" parent="1">
          <mxGeometry x="320" y="124" width="280" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step3" value="● 3. Diff e edição" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="600" y="124" width="320" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="step4" value="○ 4. Aprovar versão" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="920" y="124" width="320" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="lefthead" value="DOCUMENTO ORIGINAL — cgj-sp-tabela-emolumentos-2026.pdf · pág 4/14" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=11;fontStyle=1;align=left;spacingLeft=12" vertex="1" parent="1">
          <mxGeometry x="40" y="180" width="500" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="righthead" value="EXTRAÇÃO ESTRUTURADA — editável" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=11;fontStyle=1;align=left;spacingLeft=12" vertex="1" parent="1">
          <mxGeometry x="540" y="180" width="500" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="confhead" value="CONFIANÇA POR CAMPO" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=11;fontStyle=1;align=left;spacingLeft=12" vertex="1" parent="1">
          <mxGeometry x="1040" y="180" width="200" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="leftpane" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="212" width="500" height="560" as="geometry"/>
        </mxCell>

        <mxCell id="pdf-line1" value="TÍTULO V — DOS EMOLUMENTOS NOTARIAIS" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="56" y="226" width="470" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="pdf-line2" value="Capítulo II — Tabela de Atos com Conteúdo Econômico" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="56" y="248" width="470" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="pdf-row-h" value="Faixa | Valor do bem (R$) | Emolumento (R$)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="56" y="282" width="470" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="pdf-hl1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8c4;strokeColor=#cc6600;strokeWidth=1;dashed=1" vertex="1" parent="1">
          <mxGeometry x="50" y="306" width="480" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="pdf-row1" value="1 — até 49.025,89 — 110,30" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="56" y="306" width="470" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="pdf-hl2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8c4;strokeColor=#cc6600;strokeWidth=1;dashed=1" vertex="1" parent="1">
          <mxGeometry x="50" y="330" width="480" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="pdf-row2" value="2 — de 49.025,90 até 98.051,77 — 220,60" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="56" y="330" width="470" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="pdf-hl3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8c4;strokeColor=#cc6600;strokeWidth=1;dashed=1" vertex="1" parent="1">
          <mxGeometry x="50" y="354" width="480" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="pdf-row3" value="3 — de 98.051,78 até 196.103,55 — 367,67" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="56" y="354" width="470" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="pdf-hl4" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8c4;strokeColor=#cc6600;strokeWidth=1;dashed=1" vertex="1" parent="1">
          <mxGeometry x="50" y="378" width="480" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="pdf-row4" value="4 — de 196.103,56 até 392.207,12 — 514,73" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="56" y="378" width="470" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="pdf-hl5" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fde8e8;strokeColor=#cc0000;strokeWidth=1;dashed=1" vertex="1" parent="1">
          <mxGeometry x="50" y="402" width="480" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="pdf-row5" value="5 — de 392.207,13 até 784.414,21 — 661,80" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="56" y="402" width="470" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="pdf-row6" value="6 — acima de 784.414,21 — 808,87 (acrescido de 0,02% sobre o excedente)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="56" y="426" width="470" height="42" as="geometry"/>
        </mxCell>

        <mxCell id="pdf-note" value="§1º — Os valores serão atualizados anualmente conforme provimento do CSM." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="56" y="478" width="470" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="pdf-pagination" value="◀ pág 4 de 14 ▶" style="text;html=1;strokeColor=none;fillColor=#f0f0f0;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="200" y="740" width="180" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="rightpane" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="540" y="212" width="500" height="560" as="geometry"/>
        </mxCell>

        <mxCell id="ext-table-title" value="kb_emolumento_estruturado · 6 faixas detectadas" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="556" y="226" width="470" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="ext-h" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="550" y="252" width="480" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="ext-h1" value="Faixa" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="556" y="254" width="50" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="ext-h2" value="Valor mín (R$)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="610" y="254" width="120" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="ext-h3" value="Valor máx (R$)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="734" y="254" width="120" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="ext-h4" value="Emolumento" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="858" y="254" width="120" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="ext-r1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="550" y="282" width="480" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r1-1" value="1" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="556" y="284" width="50" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r1-2" value="0,00" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="610" y="284" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r1-3" value="49.025,89" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="734" y="284" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r1-4" value="110,30" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="858" y="284" width="120" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="ext-r2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="550" y="308" width="480" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r2-1" value="2" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="556" y="310" width="50" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r2-2" value="49.025,90" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="610" y="310" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r2-3" value="98.051,77" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="734" y="310" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r2-4" value="220,60" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="858" y="310" width="120" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="ext-r3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="550" y="334" width="480" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r3-1" value="3" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="556" y="336" width="50" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r3-2" value="98.051,78" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="610" y="336" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r3-3" value="196.103,55" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="734" y="336" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r3-4" value="367,67" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="858" y="336" width="120" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="ext-r4" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="550" y="360" width="480" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r4-1" value="4" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="556" y="362" width="50" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r4-2" value="196.103,56" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="610" y="362" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r4-3" value="392.207,12" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="734" y="362" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r4-4" value="514,73" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="858" y="362" width="120" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="ext-r5" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fde8e8;strokeColor=#cc0000;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="550" y="386" width="480" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r5-1" value="5" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="556" y="388" width="50" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r5-2" value="392.207,13" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="610" y="388" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r5-3" value="784.414,21" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="734" y="388" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r5-4" value="| 661,80" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;fontColor=#cc0000" vertex="1" parent="1">
          <mxGeometry x="858" y="388" width="120" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="ext-r6" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="550" y="412" width="480" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r6-1" value="6" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="556" y="414" width="50" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r6-2" value="784.414,22" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="610" y="414" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r6-3" value="(sem máx)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="734" y="414" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r6-4" value="808,87 + 0,02% exc." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="858" y="414" width="170" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="ext-r6-cond" value="condição: valor &gt; 784.414,21 — fórmula: 808,87 + (valor − 784.414,21) × 0,0002" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="556" y="436" width="460" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="ext-add" value="+ adicionar faixa" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="556" y="468" width="200" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="conf-pane" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="1040" y="212" width="200" height="560" as="geometry"/>
        </mxCell>

        <mxCell id="conf-overall" value="confiança média" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontColor=#666;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1052" y="222" width="160" height="14" as="geometry"/>
        </mxCell>
        <mxCell id="conf-overall-val" value="92%" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=20;fontStyle=1;fontColor=#3a6027" vertex="1" parent="1">
          <mxGeometry x="1052" y="236" width="160" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="conf-divider" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#999;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="1052" y="270" width="176" height="1" as="geometry"/>
        </mxCell>

        <mxCell id="conf-h" value="campo · confiança" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontColor=#666;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1052" y="278" width="160" height="14" as="geometry"/>
        </mxCell>

        <mxCell id="conf-1" value="Faixa 1 → 99%" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#3a6027" vertex="1" parent="1">
          <mxGeometry x="1052" y="296" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="conf-2" value="Faixa 2 → 98%" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#3a6027" vertex="1" parent="1">
          <mxGeometry x="1052" y="316" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="conf-3" value="Faixa 3 → 96%" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#3a6027" vertex="1" parent="1">
          <mxGeometry x="1052" y="336" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="conf-4" value="Faixa 4 → 91%" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#cc6600" vertex="1" parent="1">
          <mxGeometry x="1052" y="356" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="conf-5" value="Faixa 5 → 72% !" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;fontColor=#cc0000" vertex="1" parent="1">
          <mxGeometry x="1052" y="376" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="conf-6" value="Faixa 6 (excedente) → 88%" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#cc6600" vertex="1" parent="1">
          <mxGeometry x="1052" y="396" width="160" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="conf-low-warn" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fde8e8;strokeColor=#cc0000;strokeWidth=1" vertex="1" parent="1">
          <mxGeometry x="1052" y="430" width="176" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="conf-low-txt" value="Atenção: Faixa 5 com confiança baixa.&#10;Possível causa: caractere &quot;|&quot; antes de 661,80 no PDF.&#10;Verifique no original e edite o valor no painel central se necessário." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=9;fontColor=#cc0000;spacingLeft=8;spacingTop=6" vertex="1" parent="1">
          <mxGeometry x="1052" y="430" width="176" height="100" as="geometry"/>
        </mxCell>

        <mxCell id="conf-divider2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#999;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="1052" y="546" width="176" height="1" as="geometry"/>
        </mxCell>

        <mxCell id="conf-meta-h" value="metadados" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontColor=#666;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1052" y="554" width="160" height="14" as="geometry"/>
        </mxCell>
        <mxCell id="conf-meta-1" value="modelo: Sonnet" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1052" y="570" width="160" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="conf-meta-2" value="região: sa-east-1" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1052" y="588" width="160" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="conf-meta-3" value="hash extr: a3f9...c12" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1052" y="606" width="160" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="conf-meta-4" value="duração: 1m 18s" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="1052" y="624" width="160" height="18" as="geometry"/>
        </mxCell>

        <mxCell id="actions" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="40" y="784" width="1200" height="56" as="geometry"/>
        </mxCell>

        <mxCell id="btn-reject" value="Rejeitar versão" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#cc0000;fontSize=11;fontColor=#cc0000" vertex="1" parent="1">
          <mxGeometry x="56" y="794" width="140" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-rextract" value="Solicitar reextração" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#1F4E79;fontSize=11;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="206" y="794" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-save-draft" value="Salvar edições (rascunho)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="376" y="794" width="200" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-approve" value="Aprovar versão · publicar como vigente →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#5c8a3e;strokeColor=#3a6027;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="794" width="320" height="36" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="05-kbc-lista-versoes" name="05-kbc-lista-versoes">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="KBC 05 — Lista de versões aprovadas (histórico KB)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="900" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="breadcrumb" value="Knowledge Base / Versões aprovadas" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="350" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas C. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1060" y="78" width="170" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="sidebar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="744" as="geometry"/>
        </mxCell>
        <mxCell id="nav3" value="[folder]  Knowledge Base" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="130" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="sub3" value="•  Versões aprovadas" style="text;html=1;strokeColor=none;fillColor=#f0f0f0;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="60" y="170" width="180" height="26" as="geometry"/>
        </mxCell>

        <mxCell id="page-title" value="Versões aprovadas" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="260" y="130" width="600" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="page-sub" value="73 versões · todas com hash registrado · armazenadas com Object Lock" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="260" y="156" width="600" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="cta-upload" value="+  Subir novo documento" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1040" y="130" width="180" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="filters-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="190" width="940" height="58" as="geometry"/>
        </mxCell>

        <mxCell id="f-label" value="Filtrar por:" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="276" y="200" width="80" height="38" as="geometry"/>
        </mxCell>
        <mxCell id="f-tipo" value="Tipo: todos  ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="356" y="206" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="f-vig" value="Vigência: vigente  ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;fontSize=10;align=left;spacingLeft=10;fontColor=#1F4E79;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="526" y="206" width="180" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="f-origem" value="Origem: todas  ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;spacingLeft=10" vertex="1" parent="1">
          <mxGeometry x="716" y="206" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="f-search" value="[buscar]  buscar nome, hash, tag..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999;fontSize=10;align=left;spacingLeft=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="886" y="206" width="300" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="active-filters" value="↳  Vigente · 47 resultados encontrados" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="276" y="258" width="600" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="tbl-h" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="260" y="288" width="940" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="tbl-h1" value="DOCUMENTO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;fontColor=#ffffff" vertex="1" parent="1">
          <mxGeometry x="276" y="290" width="280" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="tbl-h2" value="TIPO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;fontColor=#ffffff" vertex="1" parent="1">
          <mxGeometry x="556" y="290" width="100" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="tbl-h3" value="VIGÊNCIA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;fontColor=#ffffff" vertex="1" parent="1">
          <mxGeometry x="656" y="290" width="160" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="tbl-h4" value="APROVADOR · DATA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;fontColor=#ffffff" vertex="1" parent="1">
          <mxGeometry x="816" y="290" width="180" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="tbl-h5" value="STATUS" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;fontColor=#ffffff" vertex="1" parent="1">
          <mxGeometry x="996" y="290" width="80" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="tbl-h6" value="AÇÕES" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1;fontColor=#ffffff" vertex="1" parent="1">
          <mxGeometry x="1076" y="290" width="120" height="28" as="geometry"/>
        </mxCell>

        <mxCell id="r1-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="260" y="320" width="940" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="r1-mark" value="VIGENTE AGORA" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=8;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="266" y="326" width="100" height="18" as="geometry"/>
        </mxCell>
        <mxCell id="r1-c1" value="Tabela de Emolumentos CGJ-SP 2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="276" y="346" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r1-c1b" value="hash a3f9...c12" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="276" y="364" width="280" height="14" as="geometry"/>
        </mxCell>
        <mxCell id="r1-c2" value="Emolumento" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;fontSize=9;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="556" y="340" width="86" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r1-c3" value="01/01/2026 — 31/12/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="656" y="340" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r1-c3b" value="vence em 23 dias !" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontColor=#cc6600;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="656" y="358" width="160" height="14" as="geometry"/>
        </mxCell>
        <mxCell id="r1-c4" value="Lucas C. · 02/01/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="816" y="340" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r1-c5" value="Vigente" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=9;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="996" y="340" width="76" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r1-c6" value="ver · baixar PDF · estrut" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="1076" y="340" width="120" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="r2-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="260" y="380" width="940" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="r2-c1" value="NSCGJ-SP Tomo II — Cap. XIV (Notas) v.2026-03" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="276" y="384" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r2-c1b" value="hash 7e2a...8ff" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="276" y="404" width="280" height="14" as="geometry"/>
        </mxCell>
        <mxCell id="r2-c2" value="Normativo" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5e8f8;strokeColor=#7b1fa2;fontSize=9;fontColor=#6a1b9a" vertex="1" parent="1">
          <mxGeometry x="556" y="394" width="86" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r2-c3" value="20/03/2026 — perpétuo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="656" y="394" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r2-c4" value="Lucas C. · 21/03/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="816" y="394" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r2-c5" value="Vigente" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=9;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="996" y="394" width="76" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r2-c6" value="ver · baixar PDF · estrut" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="1076" y="394" width="120" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="r3-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="260" y="430" width="940" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="r3-c1" value="Modelo — Procuração para adquirir imóvel v3" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="276" y="434" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r3-c1b" value="hash bc41...d09 · usado em 11 atos" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="276" y="454" width="280" height="14" as="geometry"/>
        </mxCell>
        <mxCell id="r3-c2" value="Modelo" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=9;fontColor=#995200" vertex="1" parent="1">
          <mxGeometry x="556" y="444" width="86" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r3-c3" value="15/04/2026 — perpétuo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="656" y="444" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r3-c4" value="Lucas C. · 15/04/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="816" y="444" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r3-c5" value="Vigente" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=9;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="996" y="444" width="76" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r3-c6" value="ver · baixar PDF · estrut" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="1076" y="444" width="120" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="r4-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="260" y="480" width="940" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="r4-c1" value="Tabela de Emolumentos CGJ-SP 2025 (versão substituída)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="276" y="484" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r4-c1b" value="hash 22ca...903" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="276" y="504" width="280" height="14" as="geometry"/>
        </mxCell>
        <mxCell id="r4-c2" value="Emolumento" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;fontSize=9;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="556" y="494" width="86" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r4-c3" value="01/01/2025 — 31/12/2025" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="656" y="494" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r4-c4" value="Lucas C. · 28/12/2024" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="816" y="494" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r4-c5" value="Expirada" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=9;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="996" y="494" width="76" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r4-c6" value="ver · auditar uso (37)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="1076" y="494" width="120" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="r5-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="260" y="530" width="940" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="r5-c1" value="Tabela de Emolumentos CGJ-SP 2027 (rascunho)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="276" y="534" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r5-c1b" value="aguardando aprovação · iniciado 04/05" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#cc6600" vertex="1" parent="1">
          <mxGeometry x="276" y="554" width="280" height="14" as="geometry"/>
        </mxCell>
        <mxCell id="r5-c2" value="Emolumento" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;fontSize=9;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="556" y="544" width="86" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r5-c3" value="01/01/2027 — 31/12/2027" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="656" y="544" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r5-c4" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="816" y="544" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r5-c5" value="Rascunho" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=9;fontColor=#995200;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="996" y="544" width="76" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r5-c6" value="continuar revisão →" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1076" y="544" width="120" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="r6-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="260" y="580" width="940" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="r6-c1" value="Provimento CNJ 149/2023 (regularizado interno)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="276" y="584" width="280" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r6-c1b" value="hash 4d8f...112" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="276" y="604" width="280" height="14" as="geometry"/>
        </mxCell>
        <mxCell id="r6-c2" value="Normativo" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5e8f8;strokeColor=#7b1fa2;fontSize=9;fontColor=#6a1b9a" vertex="1" parent="1">
          <mxGeometry x="556" y="594" width="86" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r6-c3" value="01/03/2026 — perpétuo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="656" y="594" width="160" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r6-c4" value="Lucas C. · 04/03/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="816" y="594" width="180" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r6-c5" value="Vigente" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f5e9;strokeColor=#5c8a3e;fontSize=9;fontColor=#3a6027;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="996" y="594" width="76" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="r6-c6" value="ver · baixar PDF · estrut" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="1076" y="594" width="120" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="empty-state" value="ⓘ  Use os filtros para encontrar versões específicas. Versões expiradas continuam consultáveis para fins de auditoria — atos lavrados durante a vigência delas continuam válidos." style="text;html=1;strokeColor=none;fillColor=#fff8e1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;spacingLeft=12" vertex="1" parent="1">
          <mxGeometry x="260" y="650" width="940" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="pagination" value="Mostrando 6 de 47 vigentes · 26 expiradas · 0 futuras" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="260" y="700" width="500" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="pages" value="◀  1 · 2 · 3 · ... · 8  ▶" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="900" y="700" width="300" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Versão vigente em destaque (azul borda 2px + pílula &quot;VIGENTE AGORA&quot;) — Tabelião identifica em 1s qual versão está produzindo efeitos no Fluxo B.&#10;2. Filtro Vigência default = &quot;vigente&quot; — caso de uso primário; expiradas e futuras só com 1 clique adicional.&#10;3. Status diferentes:&#10;   verde = Vigente   cinza = Expirada   laranja = Rascunho   azul = Futura&#10;4. Hash visível em pequeno mas presente em todas as linhas — material para auditoria. Click no hash = copia.&#10;5. Ações (ver/baixar/estrut) como links inline em vez de menu kebab — economiza 1 click.&#10;6. Rascunho aparece NA MESMA lista, não em página separada — Tabelião não esquece de continuar.&#10;7. Linha de doc expirada com texto em cinza médio (não regular) — deemphasize visual sem ocultar.&#10;8. Auditar uso (37) na linha expirada → leva pra wireframe 06 aba &quot;Histórico de uso&quot;. Importante: doc expirado mostra quantos atos consultaram ele." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1260" y="120" width="220" height="600" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="06-kbc-detalhe-versao-aprovada" name="06-kbc-detalhe-versao-aprovada">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="KBC 06 — Detalhe de versão aprovada (com tabs)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="900" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="breadcrumb" value="KB / Versões / Tabela de Emolumentos CGJ-SP 2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="288" y="76" width="500" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas C. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1060" y="78" width="170" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="sidebar" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="200" height="744" as="geometry"/>
        </mxCell>
        <mxCell id="nav3" value="[folder]  Knowledge Base" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none;fontSize=11;align=left;spacingLeft=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="130" width="200" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="docheader" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="130" width="940" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="doc-name" value="Tabela de Emolumentos CGJ-SP 2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="276" y="140" width="700" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="doc-pill-vigente" value="VIGENTE AGORA" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#5c8a3e;strokeColor=#3a6027;fontColor=#ffffff;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1060" y="142" width="130" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="doc-meta-row" value="Tipo: Emolumento  ·  Vigência: 01/01/2026 — 31/12/2026 (vence em 23 dias)  ·  Origem: oficial CGJ-SP" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="276" y="170" width="900" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="doc-meta-row2" value="Aprovado por: Lucas C. (Tabelião) em 02/01/2026 às 09h14" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="276" y="192" width="900" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="doc-hash-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="276" y="218" width="600" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="doc-hash" value="hash sha-256: a3f9b4c1d8e2f7090b6e... (click p/ copiar)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666;spacingLeft=8" vertex="1" parent="1">
          <mxGeometry x="276" y="218" width="600" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="doc-pdf-link" value="[doc]  baixar PDF original (Object Lock 30 anos)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="900" y="218" width="280" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="tabs-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="266" width="940" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="tab1-active" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="260" y="266" width="200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="tab1" value="Visão estruturada" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1;fontColor=#ffffff" vertex="1" parent="1">
          <mxGeometry x="260" y="266" width="200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="tab2" value="Documento original" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="460" y="266" width="200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="tab3" value="Histórico de uso (47)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="660" y="266" width="200" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="tab4" value="Auditoria" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="860" y="266" width="200" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="tab-content-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="260" y="310" width="940" height="478" as="geometry"/>
        </mxCell>

        <mxCell id="cont-title" value="6 faixas estruturadas · consumidas pelo Fluxo B (cobrança)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="276" y="324" width="700" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="cont-edit" value="✎  editar (cria nova versão)" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="980" y="324" width="200" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="ttbl-h-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="276" y="358" width="908" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="ttbl-h1" value="FAIXA" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="290" y="360" width="60" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="ttbl-h2" value="VALOR DO BEM (R$)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="350" y="360" width="280" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="ttbl-h3" value="EMOLUMENTO (R$)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="640" y="360" width="200" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="ttbl-h4" value="CONDIÇÃO" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="850" y="360" width="320" height="26" as="geometry"/>
        </mxCell>

        <mxCell id="tt1-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="388" width="908" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="tt1-1" value="1" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="290" y="390" width="60" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt1-2" value="0,00 — 49.025,89" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="350" y="390" width="280" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt1-3" value="110,30" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="640" y="390" width="200" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt1-4" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="850" y="390" width="320" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="tt2-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="416" width="908" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="tt2-1" value="2" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="290" y="418" width="60" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt2-2" value="49.025,90 — 98.051,77" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="350" y="418" width="280" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt2-3" value="220,60" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="640" y="418" width="200" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt2-4" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="850" y="418" width="320" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="tt3-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="444" width="908" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="tt3-1" value="3" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="290" y="446" width="60" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt3-2" value="98.051,78 — 196.103,55" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="350" y="446" width="280" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt3-3" value="367,67" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="640" y="446" width="200" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt3-4" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="850" y="446" width="320" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="tt4-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="472" width="908" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="tt4-1" value="4" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="290" y="474" width="60" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt4-2" value="196.103,56 — 392.207,12" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="350" y="474" width="280" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt4-3" value="514,73" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="640" y="474" width="200" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt4-4" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="850" y="474" width="320" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="tt5-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="500" width="908" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="tt5-1" value="5" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="290" y="502" width="60" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt5-2" value="392.207,13 — 784.414,21" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="350" y="502" width="280" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt5-3" value="661,80" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="640" y="502" width="200" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="tt5-4" value="—" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="850" y="502" width="320" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="tt6-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#e0e0e0" vertex="1" parent="1">
          <mxGeometry x="276" y="528" width="908" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="tt6-1" value="6" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="290" y="532" width="60" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="tt6-2" value="784.414,22 — sem máx" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="350" y="532" width="280" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="tt6-3" value="808,87 + variável" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="640" y="532" width="200" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="tt6-4" value="0,02% sobre o excedente de 784.414,21" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="850" y="532" width="320" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="usage-summary-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;strokeWidth=1" vertex="1" parent="1">
          <mxGeometry x="276" y="600" width="908" height="74" as="geometry"/>
        </mxCell>
        <mxCell id="usage-icon" value="[graph]" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=22" vertex="1" parent="1">
          <mxGeometry x="288" y="612" width="40" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="usage-title" value="Esta versão alimentou 47 atos no Fluxo B até agora" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="340" y="608" width="600" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="usage-sub" value="R$ 142.380,00 em emolumentos cobrados · R$ 4.413,78 em billing Stoix · ver detalhamento por ato →" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#1F4E79" vertex="1" parent="1">
          <mxGeometry x="340" y="630" width="700" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="usage-cta" value="Ver detalhamento →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="1040" y="618" width="130" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="actions-row-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="276" y="694" width="908" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="btn-archive" value="Arquivar versão" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#cc0000;fontSize=11;fontColor=#cc0000" vertex="1" parent="1">
          <mxGeometry x="290" y="704" width="140" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-archive-help" value="(arquiva apenas; não altera atos já lavrados — auditoria preservada)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="436" y="704" width="380" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-edit" value="Criar nova versão (substitui esta)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="940" y="704" width="240" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Header da página com nome + pílula vigente + metadata em 3 linhas. Tabelião confirma identidade da versão antes de qualquer ação.&#10;2. Hash em fonte mono, click pra copiar — instrumento de auditoria. NÃO está escondido.&#10;3. Tabs pra separar 4 visões (estrut / original / uso / auditoria) — cada uma é uma viewport própria. Tab default = &quot;Visão estruturada&quot; pq é a que afeta operação.&#10;4. Tab &quot;Histórico de uso (47)&quot; com badge de contagem — Tabelião antecipa quanto material vai aparecer (importante pra DPO).&#10;5. Card destacado azul mostrando uso em produção — transparência total. Mesma versão da KB pode ter consumido R$ 142k em emolumentos. Stoix mostra isso porque é base do billing.&#10;6. Botão &quot;Arquivar&quot; vermelho fantasma — ação destrutiva mas reversível, microcopy explica que atos lavrados não são afetados.&#10;7. Edição NÃO altera in-place — sempre cria nova versão (immutability obrigatória pra audit). Microcopy do CTA é clara.&#10;8. Estado expirado: pílula muda pra cinza &quot;EXPIRADA&quot;, banner amarelo no topo &quot;Esta versão expirou em DD/MM. Atos lavrados durante a vigência continuam válidos.&quot;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1260" y="120" width="220" height="600" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="07-kbc-modal-vigencia-expirando" name="07-kbc-modal-vigencia-expirando">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="KBC 07 — Modal de vigência expirando (no login do Tabelião)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="900" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="HOMOLOGAÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="120" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Lucas C. (Tabelião) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1060" y="78" width="170" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="bg-overlay" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#000000;strokeColor=none;opacity=50" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="1200" height="744" as="geometry"/>
        </mxCell>

        <mxCell id="bg-blurry-dash" value="(dashboard borrado por trás)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=2;fontColor=#cccccc" vertex="1" parent="1">
          <mxGeometry x="40" y="200" width="1200" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="modal-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333;strokeWidth=2;shadow=1" vertex="1" parent="1">
          <mxGeometry x="320" y="200" width="640" height="540" as="geometry"/>
        </mxCell>

        <mxCell id="modal-header-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#cc6600;strokeWidth=2" vertex="1" parent="1">
          <mxGeometry x="320" y="200" width="640" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="modal-icon" value="!" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=32;fontColor=#cc6600" vertex="1" parent="1">
          <mxGeometry x="332" y="216" width="60" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="modal-title" value="Atenção, Tabelião — sua KB tem documentos vencendo" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1;fontColor=#995200" vertex="1" parent="1">
          <mxGeometry x="400" y="212" width="540" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="modal-sub" value="Mantenha sua KB atualizada para evitar bloqueio de cobrança no Fluxo B." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#995200" vertex="1" parent="1">
          <mxGeometry x="400" y="238" width="540" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="content-title" value="Próximos a vencer (30 dias)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="340" y="296" width="600" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="item1-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fde8e8;strokeColor=#cc0000;strokeWidth=1.5" vertex="1" parent="1">
          <mxGeometry x="340" y="324" width="600" height="74" as="geometry"/>
        </mxCell>
        <mxCell id="item1-name" value="Tabela de Emolumentos CGJ-SP 2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="354" y="332" width="400" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="item1-vig" value="vence em 23 dias · 31/12/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#cc0000;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="354" y="354" width="400" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="item1-impact" value="impacto: bloqueia cobrança de atos econômicos no Fluxo B se vencer" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="354" y="372" width="500" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="item1-cta" value="Atualizar →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#cc6600;strokeColor=#cc6600;fontColor=#ffffff;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="836" y="346" width="100" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="item2-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#cc6600" vertex="1" parent="1">
          <mxGeometry x="340" y="408" width="600" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="item2-name" value="Modelo — Escritura de Doação v2" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="354" y="416" width="400" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="item2-vig" value="vence em 18 dias · 26/12/2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#995200" vertex="1" parent="1">
          <mxGeometry x="354" y="438" width="400" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="item2-cta" value="Atualizar →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cc6600;fontColor=#cc6600;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="836" y="422" width="100" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="item3-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#cc6600" vertex="1" parent="1">
          <mxGeometry x="340" y="478" width="600" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="item3-name" value="Provimento CSM 1.234/2025 — vigência limitada" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="354" y="486" width="400" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="item3-vig" value="vence em 27 dias · 04/01/2027" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#995200" vertex="1" parent="1">
          <mxGeometry x="354" y="508" width="400" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="item3-cta" value="Atualizar →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cc6600;fontColor=#cc6600;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="836" y="492" width="100" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="snooze-area" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="340" y="560" width="600" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="snooze-label" value="Adiar lembrete por:" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="356" y="578" width="160" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="snooze-1" value="○ 1 dia" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="510" y="578" width="80" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="snooze-7" value="○ 7 dias" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="590" y="578" width="80" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="snooze-help" value="(adiamento &gt; 7 dias bloqueado para emolumento)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="676" y="578" width="260" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="modal-actions-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="320" y="676" width="640" height="64" as="geometry"/>
        </mxCell>
        <mxCell id="btn-later" value="Lembrar amanhã" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="340" y="690" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-list" value="Ver lista completa" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#1F4E79;fontColor=#1F4E79;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="510" y="690" width="160" height="36" as="geometry"/>
        </mxCell>
        <mxCell id="btn-now" value="Atualizar agora →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#cc6600;strokeColor=#cc6600;fontColor=#ffffff;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="780" y="690" width="160" height="36" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Modal centralizado, fundo escuro 50% — bloqueio funcional. Tabelião precisa decidir antes de continuar.&#10;2. Hierarquia em 3 níveis de urgência:&#10;   vermelho = vence em ≤ 25 dias (bloqueio iminente)&#10;   laranja = vence em 26-30 dias (atenção)&#10;   amarelo = vence em &gt; 30 dias (não aparece neste modal — só dashboard)&#10;3. Cada item mostra impacto em texto explícito — Tabelião entende consequência.&#10;4. Adiamento permitido mas com limite duro: emolumento NÃO pode ser adiado &gt; 7 dias. Decisão jurídica: defesa material exige tabelião agir.&#10;5. CTA primário laranja (não verde) — laranja é cor de atenção, não de sucesso. Visualmente urgente.&#10;6. &quot;Lembrar amanhã&quot; permite Tabelião sair e continuar trabalho — não tira agência dele.&#10;7. ESC fecha o modal MAS reabre no próximo login até item ser atualizado ou snoozado válido.&#10;8. Acessibilidade: foco vai pro botão primário ao abrir, navegação Tab cíclica dentro do modal." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="980" y="200" width="240" height="540" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
  <diagram id="08-kbc-bloqueio-fluxob-vencida" name="08-kbc-bloqueio-fluxob-vencida">
    <mxGraphModel dx="1500" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="900" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="KBC 08 — Bloqueio em Fluxo B (escrevente) por tabela vencida na KB" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1100" height="30" as="geometry"/>
        </mxCell>

        <mxCell id="frame" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="800" as="geometry"/>
        </mxCell>

        <mxCell id="header" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#333" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="1200" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="logo" value="[Stoix]" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f0f0f0;strokeColor=#999;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="56" y="76" width="80" height="24" as="geometry"/>
        </mxCell>
        <mxCell id="env-pill" value="PRODUÇÃO" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fde8e8;strokeColor=#cc0000;fontSize=10;fontStyle=1;fontColor=#cc0000" vertex="1" parent="1">
          <mxGeometry x="148" y="78" width="100" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="breadcrumb" value="Fluxo B / Ato em execução / Etapa 6 — Minuta final e emolumento" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2" vertex="1" parent="1">
          <mxGeometry x="268" y="76" width="500" height="26" as="geometry"/>
        </mxCell>
        <mxCell id="user" value="Maria S. (Escrevente) ▾" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="1060" y="78" width="170" height="22" as="geometry"/>
        </mxCell>

        <mxCell id="bg-overlay" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#000000;strokeColor=none;opacity=70" vertex="1" parent="1">
          <mxGeometry x="40" y="116" width="1200" height="744" as="geometry"/>
        </mxCell>

        <mxCell id="bg-fading" value="(tela do Fluxo B Etapa 6 borrada por trás — protocolo #2026-0473, escritura V&amp;C)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=2;fontColor=#cccccc" vertex="1" parent="1">
          <mxGeometry x="40" y="140" width="1200" height="40" as="geometry"/>
        </mxCell>

        <mxCell id="modal-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cc0000;strokeWidth=3;shadow=1" vertex="1" parent="1">
          <mxGeometry x="280" y="200" width="720" height="580" as="geometry"/>
        </mxCell>

        <mxCell id="modal-header-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fde8e8;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="280" y="200" width="720" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="modal-icon" value="[stop]" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=42" vertex="1" parent="1">
          <mxGeometry x="304" y="220" width="60" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="modal-title" value="Cobrança bloqueada — KB de emolumento expirada" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1;fontColor=#cc0000" vertex="1" parent="1">
          <mxGeometry x="380" y="220" width="600" height="28" as="geometry"/>
        </mxCell>
        <mxCell id="modal-sub" value="Por exigência regulatória, este sistema não aplica tabela de emolumentos sem versão vigente aprovada pelo Tabelião." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#995200" vertex="1" parent="1">
          <mxGeometry x="380" y="252" width="600" height="38" as="geometry"/>
        </mxCell>

        <mxCell id="explain-title" value="O que aconteceu" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="304" y="316" width="400" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="status-card" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="304" y="346" width="672" height="120" as="geometry"/>
        </mxCell>
        <mxCell id="status-row1" value="Documento na KB" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="356" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="status-row1-val" value="Tabela de Emolumentos CGJ-SP 2026" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="520" y="356" width="440" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="status-row2" value="Vigência" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="380" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="status-row2-val" value="01/01/2026 — 31/12/2026 (expirou há 4 dias)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#cc0000;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="520" y="380" width="440" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="status-row3" value="Data de lavratura proposta" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="404" width="200" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="status-row3-val" value="04/01/2027 — fora da vigência" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#cc0000;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="520" y="404" width="440" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="status-row4" value="Atualização pendente do Tabelião" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="320" y="428" width="220" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="status-row4-val" value="Tabela CGJ-SP 2027 ainda não foi aprovada por Lucas C." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="540" y="428" width="440" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="next-title" value="O que fazer agora" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="304" y="486" width="400" height="24" as="geometry"/>
        </mxCell>

        <mxCell id="opt1-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e8f0f8;strokeColor=#1F4E79;strokeWidth=1.5" vertex="1" parent="1">
          <mxGeometry x="304" y="516" width="672" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="opt1-num" value="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="316" y="528" width="32" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="opt1-name" value="Notificar o Tabelião agora" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="360" y="522" width="500" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="opt1-sub" value="Envia push e e-mail pra Lucas C. com link direto pra subir a tabela 2027." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="360" y="544" width="500" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="opt1-cta" value="Notificar →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#1F4E79;strokeColor=#1F4E79;fontColor=#ffffff;fontSize=10;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="876" y="528" width="92" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="opt2-bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#999" vertex="1" parent="1">
          <mxGeometry x="304" y="582" width="672" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="opt2-num" value="2" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#999;strokeColor=#999;fontColor=#ffffff;fontSize=14;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="316" y="594" width="32" height="32" as="geometry"/>
        </mxCell>
        <mxCell id="opt2-name" value="Salvar minuta e adiar lavratura" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="360" y="588" width="500" height="22" as="geometry"/>
        </mxCell>
        <mxCell id="opt2-sub" value="Volta à fila com flag &quot;aguardando KB&quot;. Continua quando tabela for aprovada — sem perda de trabalho." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="360" y="610" width="500" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="opt2-cta" value="Salvar →" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666;fontSize=10" vertex="1" parent="1">
          <mxGeometry x="876" y="594" width="92" height="32" as="geometry"/>
        </mxCell>

        <mxCell id="opt3-link" value="3.  Falar diretamente com Lucas: telefone 11 9 8765-4321 · WhatsApp" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontStyle=2;fontColor=#666" vertex="1" parent="1">
          <mxGeometry x="316" y="654" width="660" height="20" as="geometry"/>
        </mxCell>

        <mxCell id="footer-help" value="Por que existe esse bloqueio? Lei 8.935/94 e Provimentos CGJ-SP exigem que cobrança siga tabela vigente. Sistema garante isso por design." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontStyle=2;fontColor=#666;spacingLeft=14" vertex="1" parent="1">
          <mxGeometry x="304" y="694" width="672" height="44" as="geometry"/>
        </mxCell>

        <mxCell id="footer-divider" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e0e0e0;strokeColor=none" vertex="1" parent="1">
          <mxGeometry x="304" y="694" width="672" height="1" as="geometry"/>
        </mxCell>

        <mxCell id="ann" value="ANOTAÇÕES UX&#10;1. Modal full-screen com overlay 70% — bloqueio total, escrevente NÃO pode prosseguir. Decisão jurídica do Leonardo: defesa material por design.&#10;2. Borda vermelha 3px + ícone [stop] + título vermelho — tom severo MAS:&#10;   - mensagem é técnica e factual (não acusatória)&#10;   - não culpa o escrevente&#10;   - dá 2 caminhos práticos&#10;3. Card de status mostra 4 fatos objetivos lado a lado — escrevente entende exatamente o que está fora do lugar.&#10;4. Opção 1 (Notificar) destacada — caminho ativo. Opção 2 (Salvar e adiar) é o caminho passivo legítimo (preserva trabalho do escrevente).&#10;5. Microcopy do footer educa sobre a base legal — escrevente entende que é regulatório, não capricho do sistema. Reduz fricção emocional.&#10;6. Telefone do Tabelião como opção 3 — última instância, mostra que o sistema sabe que negócio precisa continuar.&#10;7. Pílula PRODUÇÃO em vermelho no header indica ambiente real — diferente da homologação. Escrevente sabe que é sério.&#10;8. NÃO há CTA &quot;ignorar&quot;, &quot;cobrar com tabela antiga&quot; ou &quot;continuar mesmo assim&quot;. Por design.&#10;9. Acessibilidade: foco vai pro botão Notificar; ESC não fecha (intencional)." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff8e1;strokeColor=#999;fontSize=10;align=left;verticalAlign=top;spacingLeft=8;spacingTop=8" vertex="1" parent="1">
          <mxGeometry x="1020" y="200" width="220" height="580" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
</mxfile>