<mxGraphModel>
  <root>
    <mxCell id="0"/>
    <mxCell id="1" parent="0"/>

    <!-- Layer 1: Client Layer -->
    <mxCell id="L1" value="Client Layer" style="swimlane;startSize=28;fillColor=#dae8fc;strokeColor=#6c8ebf;fontStyle=1;fontSize=13;rounded=1;" vertex="1" parent="1">
      <mxGeometry x="40" y="20" width="1060" height="110" as="geometry"/>
    </mxCell>
    <mxCell id="user" value="CRM Users" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;fontStyle=1;fontSize=11;" vertex="1" parent="L1">
      <mxGeometry x="80" y="30" width="36" height="50" as="geometry"/>
    </mxCell>
    <mxCell id="vpnclient" value="VPN Client" style="rounded=1;whiteSpace=wrap;fillColor=#f5f5f5;strokeColor=#666;fontSize=11;" vertex="1" parent="L1">
      <mxGeometry x="250" y="33" width="120" height="42" as="geometry"/>
    </mxCell>
    <mxCell id="vpngw" value="VPN Gateway" style="rounded=1;whiteSpace=wrap;fillColor=#f5f5f5;strokeColor=#666;fontSize=11;" vertex="1" parent="L1">
      <mxGeometry x="500" y="33" width="120" height="42" as="geometry"/>
    </mxCell>
    <mxCell id="e1" style="edgeStyle=orthogonalEdgeStyle;strokeColor=#6c8ebf;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="L1" source="user" target="vpnclient">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="e2" value="IPsec VPN" style="strokeColor=#6c8ebf;strokeWidth=2;endArrow=block;endFill=1;fontSize=10;" edge="1" parent="L1" source="vpnclient" target="vpngw">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>

    <!-- Layer 2: Edge Security -->
    <mxCell id="L2" value="Edge Security Layer" style="swimlane;startSize=28;fillColor=#fff2cc;strokeColor=#d6b656;fontStyle=1;fontSize=13;rounded=1;" vertex="1" parent="1">
      <mxGeometry x="40" y="160" width="1060" height="100" as="geometry"/>
    </mxCell>
    <mxCell id="waf" value="WAF (Firewall)" style="rounded=1;whiteSpace=wrap;fillColor=#f8cecc;strokeColor=#b85450;fontSize=11;fontStyle=1;" vertex="1" parent="L2">
      <mxGeometry x="250" y="35" width="120" height="42" as="geometry"/>
    </mxCell>
    <mxCell id="lb" value="Load Balancer (L7)" style="rounded=1;whiteSpace=wrap;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=11;fontStyle=1;" vertex="1" parent="L2">
      <mxGeometry x="500" y="35" width="140" height="42" as="geometry"/>
    </mxCell>
    <mxCell id="ssl" value="TLS Cert" style="rounded=1;whiteSpace=wrap;fillColor=#f5f5f5;strokeColor=#999;fontSize=10;" vertex="1" parent="L2">
      <mxGeometry x="780" y="38" width="90" height="36" as="geometry"/>
    </mxCell>
    <mxCell id="e3" style="strokeColor=#d6b656;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="L2" source="waf" target="lb">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="e4" style="strokeColor=#999;strokeWidth=1;dashed=1;endArrow=open;endFill=0;" edge="1" parent="L2" source="lb" target="ssl">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>

    <!-- Layer 3: Application Layer (single row) -->
    <mxCell id="L3" value="Application Layer" style="swimlane;startSize=28;fillColor=#d5e8d4;strokeColor=#82b366;fontStyle=1;fontSize=13;rounded=1;" vertex="1" parent="1">
      <mxGeometry x="40" y="290" width="1060" height="120" as="geometry"/>
    </mxCell>
    <mxCell id="app_a" value="App Server&#xa;(AZ-a)" style="shape=component;align=center;spacingLeft=36;fillColor=#d5e8d4;strokeColor=#82b366;fontStyle=1;fontSize=10;" vertex="1" parent="L3">
      <mxGeometry x="20" y="38" width="140" height="55" as="geometry"/>
    </mxCell>
    <mxCell id="app_c" value="App Server&#xa;(AZ-c)" style="shape=component;align=center;spacingLeft=36;fillColor=#d5e8d4;strokeColor=#82b366;fontStyle=1;fontSize=10;" vertex="1" parent="L3">
      <mxGeometry x="185" y="38" width="140" height="55" as="geometry"/>
    </mxCell>
    <mxCell id="batch" value="Batch Server" style="shape=component;align=center;spacingLeft=36;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=10;" vertex="1" parent="L3">
      <mxGeometry x="370" y="38" width="130" height="55" as="geometry"/>
    </mxCell>
    <mxCell id="mail" value="Mail Server&#xa;(SMTP)" style="shape=component;align=center;spacingLeft=36;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=10;" vertex="1" parent="L3">
      <mxGeometry x="535" y="38" width="130" height="55" as="geometry"/>
    </mxCell>
    <mxCell id="msgq" value="Message&#xa;Queue" style="rounded=1;whiteSpace=wrap;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=10;" vertex="1" parent="L3">
      <mxGeometry x="710" y="38" width="100" height="55" as="geometry"/>
    </mxCell>
    <mxCell id="appapi" value="REST API&#xa;(Internal)" style="rounded=1;whiteSpace=wrap;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=10;" vertex="1" parent="L3">
      <mxGeometry x="850" y="38" width="100" height="55" as="geometry"/>
    </mxCell>
    <mxCell id="e5" value="Trigger" style="edgeStyle=orthogonalEdgeStyle;strokeColor=#9673a6;strokeWidth=1;dashed=1;endArrow=open;endFill=0;fontSize=9;exitX=1;exitY=0.3;entryX=0;entryY=0.3;" edge="1" parent="L3" source="app_c" target="batch">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="e6" value="Send" style="edgeStyle=orthogonalEdgeStyle;strokeColor=#b85450;strokeWidth=1;dashed=1;endArrow=open;endFill=0;fontSize=9;exitX=1;exitY=0.7;entryX=0;entryY=0.7;" edge="1" parent="L3" source="batch" target="mail">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="e7" value="Enqueue" style="edgeStyle=orthogonalEdgeStyle;strokeColor=#d6b656;strokeWidth=1;dashed=1;endArrow=open;endFill=0;fontSize=9;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="L3" source="mail" target="msgq">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>

    <!-- Layer 4: Data Layer (aligned with app layer columns) -->
    <mxCell id="L4" value="Data Layer" style="swimlane;startSize=28;fillColor=#f8cecc;strokeColor=#b85450;fontStyle=1;fontSize=13;rounded=1;" vertex="1" parent="1">
      <mxGeometry x="40" y="440" width="1060" height="130" as="geometry"/>
    </mxCell>
    <mxCell id="db_w" value="RDBMS Primary&#xa;(PostgreSQL)" style="shape=cylinder3;size=10;fillColor=#f8cecc;strokeColor=#b85450;fontStyle=1;fontSize=10;whiteSpace=wrap;" vertex="1" parent="L4">
      <mxGeometry x="25" y="38" width="130" height="65" as="geometry"/>
    </mxCell>
    <mxCell id="db_r" value="RDBMS Replica&#xa;(Read Only)" style="shape=cylinder3;size=10;fillColor=#f8cecc;strokeColor=#b85450;fontSize=10;whiteSpace=wrap;" vertex="1" parent="L4">
      <mxGeometry x="195" y="38" width="130" height="65" as="geometry"/>
    </mxCell>
    <mxCell id="filesrv" value="File Server&#xa;(Windows SMB)" style="shape=cylinder3;size=10;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=10;whiteSpace=wrap;" vertex="1" parent="L4">
      <mxGeometry x="380" y="38" width="130" height="65" as="geometry"/>
    </mxCell>
    <mxCell id="objstore" value="Object Storage&#xa;(Backup/Logs)" style="shape=cylinder3;size=10;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=10;whiteSpace=wrap;" vertex="1" parent="L4">
      <mxGeometry x="560" y="38" width="130" height="65" as="geometry"/>
    </mxCell>
    <mxCell id="cache" value="Cache&#xa;(Session)" style="shape=hexagon;size=0.15;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=10;whiteSpace=wrap;" vertex="1" parent="L4">
      <mxGeometry x="740" y="42" width="100" height="55" as="geometry"/>
    </mxCell>
    <mxCell id="e9" value="Replication" style="strokeColor=#b85450;strokeWidth=1;dashed=1;endArrow=open;endFill=0;fontSize=9;" edge="1" parent="L4" source="db_w" target="db_r">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>

    <!-- Layer 5: Operations -->
    <mxCell id="L5" value="Operations Layer" style="swimlane;startSize=28;fillColor=#e1d5e7;strokeColor=#9673a6;fontStyle=1;fontSize=13;rounded=1;" vertex="1" parent="1">
      <mxGeometry x="40" y="600" width="1060" height="100" as="geometry"/>
    </mxCell>
    <mxCell id="monitor" value="Monitoring" style="rounded=1;whiteSpace=wrap;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="L5">
      <mxGeometry x="50" y="35" width="130" height="40" as="geometry"/>
    </mxCell>
    <mxCell id="secretmgr" value="Secret Manager" style="rounded=1;whiteSpace=wrap;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="L5">
      <mxGeometry x="250" y="35" width="130" height="40" as="geometry"/>
    </mxCell>
    <mxCell id="keymgr" value="Key Management" style="rounded=1;whiteSpace=wrap;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="L5">
      <mxGeometry x="460" y="35" width="130" height="40" as="geometry"/>
    </mxCell>
    <mxCell id="audit" value="Audit Log" style="rounded=1;whiteSpace=wrap;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="L5">
      <mxGeometry x="660" y="35" width="130" height="40" as="geometry"/>
    </mxCell>

    <!-- Cross-layer edges: node to node, straight lines -->
    <mxCell id="cx1" value="Filtered" style="strokeColor=#6c8ebf;strokeWidth=2;endArrow=block;endFill=1;fontSize=9;" edge="1" parent="1" source="vpngw" target="waf">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="cx2" value="HTTPS" style="strokeColor=#82b366;strokeWidth=2;endArrow=block;endFill=1;fontSize=9;" edge="1" parent="1" source="lb" target="app_a">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="cx3" value="HTTPS" style="strokeColor=#82b366;strokeWidth=2;endArrow=block;endFill=1;fontSize=9;" edge="1" parent="1" source="lb" target="app_c">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <!-- App -> Data: each app aligns with its data target column -->
    <mxCell id="cx4" value="Write" style="strokeColor=#b85450;strokeWidth=2;endArrow=block;endFill=1;fontSize=9;" edge="1" parent="1" source="app_a" target="db_w">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="cx5" value="Read" style="strokeColor=#b85450;strokeWidth=1;dashed=1;endArrow=open;endFill=0;fontSize=9;" edge="1" parent="1" source="app_c" target="db_r">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="cx6" value="SMB" style="strokeColor=#6c8ebf;strokeWidth=1;endArrow=block;endFill=1;fontSize=9;" edge="1" parent="1" source="batch" target="filesrv">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="cx7" value="Export" style="strokeColor=#82b366;strokeWidth=1;dashed=1;endArrow=open;endFill=0;fontSize=9;" edge="1" parent="1" source="mail" target="objstore">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="cx8" value="Cache" style="strokeColor=#d6b656;strokeWidth=1;dashed=1;endArrow=open;endFill=0;fontSize=9;" edge="1" parent="1" source="msgq" target="cache">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <!-- Data -> Ops: aligned columns -->
    <mxCell id="cx9" style="strokeColor=#9673a6;strokeWidth=1;dashed=1;endArrow=open;endFill=0;" edge="1" parent="1" source="db_w" target="monitor">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="cx10" style="strokeColor=#9673a6;strokeWidth=1;dashed=1;endArrow=open;endFill=0;" edge="1" parent="1" source="db_r" target="secretmgr">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="cx11" style="strokeColor=#9673a6;strokeWidth=1;dashed=1;endArrow=open;endFill=0;" edge="1" parent="1" source="filesrv" target="keymgr">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="cx12" style="strokeColor=#9673a6;strokeWidth=1;dashed=1;endArrow=open;endFill=0;" edge="1" parent="1" source="objstore" target="audit">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>

    <!-- Annotation -->
    <mxCell id="note1" value="Multi-AZ / Cloud-Agnostic&#xa;UML Component Diagram" style="shape=note;size=14;fillColor=#ffffcc;strokeColor=#999;fontStyle=2;fontSize=10;align=left;spacingLeft=8;" vertex="1" parent="1">
      <mxGeometry x="880" y="298" width="200" height="38" as="geometry"/>
    </mxCell>
  </root>
</mxGraphModel>
